(()=>{var e,t,n={540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Breakpoints=t.BreakpointConstraint=void 0;var r,i=n(9161);function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],s=!0,o=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(l){o=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(o)throw i}}return a}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=i._breakpoints[t]&&e=i._breakpoints[t]}))})),d(this,"valuesWithBreakpointProps",(function(e){var t,n=e.length,r=[];return i._sortedBreakpoints.forEach((function(i,a){var s=e[a];a0&&void 0!==arguments[0]?arguments[0]:e.validKeys()).reduce((function(e,n){return e[n]=t._mediaQueries[n],e}),{});return Object.entries(n).reduce((function(e,t){var n=s(t,2),r=n[0];return n[1].forEach((function(t,n){e.push((0,i.createRuleSet)((0,i.createClassName)(r,n),"not all and ".concat(t)))})),e}),[])}},{key:"shouldRenderMediaQuery",value:function(e,t){var n=this;if((e=this._normalizeProps(e)).lessThan){var r=this._breakpoints[e.lessThan];return Math.min.apply(Math,a(t.map((function(e){return n._breakpoints[e]}))))=i}if(e.greaterThanOrEqual){var s=this._breakpoints[e.greaterThanOrEqual];return Math.max.apply(Math,a(t.map((function(e){return n._breakpoints[e]}))))>=s}if(e.between){var o=this._breakpoints[e.between[0]],l=this._breakpoints[e.between[1]],u=t.map((function(e){return n._breakpoints[e]}));return!(Math.max.apply(Math,a(u))=l)}return!1}},{key:"_normalizeProps",value:function(e){if(e.at){var t=this._sortedBreakpoints.indexOf(e.at),n=this._sortedBreakpoints[t+1];return n?{between:[e.at,n]}:{greaterThanOrEqual:e.at}}return e}},{key:"_createBreakpointQuery",value:function(e){if((e=this._normalizeProps(e)).lessThan){var t=this._breakpoints[e.lessThan];return"(max-width:".concat(t-.02,"px)")}if(e.greaterThan){var n=this._breakpoints[this._findNextBreakpoint(e.greaterThan)];return"(min-width:".concat(n,"px)")}if(e.greaterThanOrEqual){var r=this._breakpoints[e.greaterThanOrEqual];return"(min-width:".concat(r,"px)")}if(e.between){var i=this._breakpoints[e.between[0]],a=this._breakpoints[e.between[1]];return"(min-width:".concat(i,"px) and (max-width:").concat(a-.02,"px)")}throw new Error("Unexpected breakpoint props: ".concat(JSON.stringify(e)))}},{key:"_createBreakpointQueries",value:function(e,t){var n=this;return t.reduce((function(t,r){return t.set(function(e){return Array.isArray(e)?e.join("-"):e}(r),n._createBreakpointQuery(d({},e,r))),t}),new Map)}},{key:"_findNextBreakpoint",value:function(e){var t=this._sortedBreakpoints[this._sortedBreakpoints.indexOf(e)+1];if(!t)throw new Error("There is no breakpoint larger than ".concat(e));return t}},{key:"sortedBreakpoints",get:function(){return this._sortedBreakpoints}},{key:"dynamicResponsiveMediaQueries",get:function(){return Array.from(this._mediaQueries[r.at].entries()).reduce((function(e,t){var n=s(t,2);return function(e){for(var t=1;t{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createResponsiveComponents=function(){var e=a.default.createContext({});return e.displayName="Media.DynamicContext",{Consumer:e.Consumer,Provider:function(t){function n(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}(this,l(n).call(this,e)),d(c(c(t)),"isSupportedEnvironment",(function(){return"undefined"!=typeof window&&void 0!==window.matchMedia})),d(c(c(t)),"setupMatchers",(function(e){return Object.keys(e).reduce((function(t,n){return s({},t,d({},n,window.matchMedia(e[n])))}),{})})),d(c(c(t)),"checkMatchers",(function(e){return Object.keys(e).reduce((function(t,n){return s({},t,d({},n,e[n].matches))}),{})})),d(c(c(t)),"mediaQueryStatusChangedCallback",(function(){var e=t.checkMatchers(t.state.mediaQueryMatchers);t.setState({mediaQueryMatches:e})}));var i,a=void 0;return t.isSupportedEnvironment()?(a=t.setupMatchers(e.mediaQueries),i=t.checkMatchers(a)):i=Object.keys(e.mediaQueries).reduce((function(t,n){return s({},t,d({},n,!!e.initialMatchingMediaQueries&&e.initialMatchingMediaQueries.includes(n)))}),{}),t.state={mediaQueryMatchers:a,mediaQueryMatches:i},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,t),function(e,t,n){t&&o(e.prototype,t);n&&o(e,n)}(n,[{key:"componentDidMount",value:function(){if(this.state.mediaQueryMatchers){var e=this.mediaQueryStatusChangedCallback;Object.values(this.state.mediaQueryMatchers).forEach((function(t){t.addListener(e)}))}}},{key:"componentWillUnmount",value:function(){if(this.state.mediaQueryMatchers){var e=this.mediaQueryStatusChangedCallback;Object.values(this.state.mediaQueryMatchers).forEach((function(t){return t.removeListener(e)}))}}},{key:"shouldComponentUpdate",value:function(e,t){return!!this.state.mediaQueryMatchers&&(e.children!==this.props.children||!h(this.state.mediaQueryMatches,t.mediaQueryMatches))}},{key:"render",value:function(){return a.default.createElement(e.Provider,{value:this.state.mediaQueryMatches},this.props.children)}}]),n}(a.default.Component)}};var i,a=(i=n(4041))&&i.__esModule?i:{default:i};function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Interactions=t.InteractionKey=void 0;var r,i=n(9161);function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,a=[],s=!0,o=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(l){o=!0,i=l}finally{try{s||null==n.return||n.return()}finally{if(o)throw i}}return a}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMedia=function(e){var t,n,i=(0,l.castBreakpointsToIntegers)(e.breakpoints),f=new o.MediaQueries(i,e.interactions||{}),w=(0,s.createResponsiveComponents)(),_=a.default.createContext({});_.displayName="Media.Context";var E=a.default.createContext({hasParentMedia:!1,breakpointProps:{}});_.displayName="MediaParent.Context";var T=(0,l.memoize)((function(e){return{onlyMatch:e}}));return{Media:(n=t=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}(this,g(t).call(this,e)),y(v(v(n)),"getMediaParentContextValue",(0,l.memoize)((function(e){return{hasParentMedia:!0,breakpointProps:e}}))),function(e){var t=Object.keys(e).filter((function(e){return b.includes(e)}));if(t.length<1)throw new Error("1 of ".concat(b.join(", ")," is required."));if(t.length>1)throw new Error("Only 1 of ".concat(t.join(", ")," is allowed at a time."))}(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),function(e,t,n){t&&p(e.prototype,t);n&&p(e,n)}(t,[{key:"render",value:function(){var e=this,t=this.props,n=(t.children,t.className),r=t.style,i=t.interaction,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,["children","className","style","interaction"]),o=this.getMediaParentContextValue(s);return a.default.createElement(E.Consumer,null,(function(u){return a.default.createElement(E.Provider,{value:o},a.default.createElement(_.Consumer,null,(function(){var o,c=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).onlyMatch;if(t.interaction)o=(0,l.createClassName)("interaction",t.interaction);else{if(t.at){var d=f.breakpoints.largestBreakpoint;if(t.at===d){var h=null;try{var p=e._reactInternalFiber._debugOwner.type;h=p.displayName||p.name}catch(b){}console.warn("[@artsy/fresnel] `at` is being used with the largest breakpoint. Consider using `` to account for future ')+"breakpoint definitions outside of this range.".concat(h?" It is being used in the ".concat(h," component."):""))}}var g=(0,l.propKey)(s),m=s[g];o=(0,l.createClassName)(g,m)}var v=(!u.hasParentMedia||(0,l.intersection)(f.breakpoints.toVisibleAtBreakpointSet(u.breakpointProps),f.breakpoints.toVisibleAtBreakpointSet(s)).length>0)&&(void 0===c||f.shouldRenderMediaQuery(function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaQueries=void 0;var r=n(540),i=n(9431),a=n(9161);function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0})):r(e)},t.createRuleSet=function(e,t){return"@media ".concat(t,"{.").concat(e,"{display:none!important;}}")},t.createClassName=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";Object.defineProperty(t,"H",{enumerable:!0,get:function(){return r.createMedia}});var r=n(9240),i=n(540)},8311:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{A:()=>i})},3033:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},4086:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},8324:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(4041),i=n(1085);const a=e=>(0,i.jsx)(r.Suspense,{fallback:(0,i.jsx)("div",{}),children:e.children})},5040:(e,t,n)=>{"use strict";n.d(t,{ZY:()=>v,Xu:()=>y,Ay:()=>b});var r=n(4041),i=n(6253),a=n(1085);const s=()=>{var e;const t="Suche in MDRJUMP.DE",n=(0,r.useRef)(null),s=(0,r.useRef)(null),[o,l]=(0,r.useState)(!1),[u,c]=(0,r.useState)(""),d={transition:"width 180ms",width:0,overflow:"hidden",height:"100%",display:"flex",alignItems:"center",justifyContent:"flex-end",padding:0},h={entering:{width:"75%"},entered:{width:"75%"},exiting:{width:0},exited:{width:0}},f=()=>u.length>1,p=e=>{var t;""===u?l(!1):(c(""),null==(t=s.current)||t.focus())},g=e=>c(e.target.value);(0,r.useEffect)((()=>f()?n.current.classList.add("valid"):n.current.classList.remove("valid")),[u]);const m=e=>{"Escape"===e.key&&p()};return(0,r.useEffect)((()=>document.addEventListener("keydown",m,!1)),[]),null==(e=document.getElementById("detailSearchInput"))||e.setAttribute("placeholder",t),[(0,a.jsxs)("form",{ref:n,className:"form searchForm",action:"/suche/index.html",method:"get",children:[(0,a.jsx)(i.Ay,{nodeRef:n,in:o,timeout:180,addEndListener:(e,t)=>{var n;return null==(n=s.current)?void 0:n.focus()},mountOnEnter:!0,unmountOnExit:!0,children:e=>(0,a.jsxs)("div",{className:"formElement",style:Object.assign({},d,h[e]),children:[(0,a.jsx)("input",{type:"text",name:"q",className:"textInput",ref:s,onChange:g,value:u,placeholder:t}),(0,a.jsx)("button",{type:"reset",className:"clear",onClick:p})]})}),(0,a.jsx)("button",{type:"submit",className:"jmpSearchToggle"+(o?" searchOpen":""),title:t,onClick:e=>{var t;e.preventDefault(),o&&f()?null==(t=n.current)||t.submit():l(!o)},children:(0,a.jsx)("span",{className:"text",children:"Suche"})})]},"formJmpHdgSearch")]};function o({toggleMainMenu:e,toggleSearch:t}){const n=(0,r.useContext)(v);return(0,a.jsxs)("div",{className:"jmpHdgTop wrapper",children:[(0,a.jsx)("a",{className:"jmpLogo",href:"/",title:"MDR JUMP Startseite",children:(0,a.jsx)("svg",{viewBox:"0 0 88 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M34.31 27.9315H28.6906C28.4939 27.9315 28.3342 28.0842 28.3182 28.2805C28.1409 30.4584 26.3168 32.1709 24.093 32.1709C21.7517 32.1709 19.8536 30.2728 19.8536 27.9316V21.953C19.8536 21.7467 19.6863 21.5792 19.4798 21.5792H13.8684C13.6619 21.5792 13.4945 21.7467 13.4945 21.953V27.9383H13.4947C13.4984 33.7885 18.2419 38.53 24.093 38.53C29.8157 38.53 34.479 33.9944 34.6844 28.3219C34.6922 28.1091 34.5228 27.9316 34.31 27.9316L34.31 27.9315ZM53.7602 10.1679C50.8709 10.1679 48.2531 11.3255 46.3413 13.2003C44.4294 11.3255 41.8116 10.1679 38.9223 10.1679C33.069 10.1679 28.3239 14.9131 28.3239 20.7664V25.525C28.3239 25.7315 28.4912 25.899 28.6977 25.899H34.3091C34.5155 25.899 34.6829 25.7315 34.6829 25.525V20.7664C34.6829 18.4251 36.581 16.5271 38.9223 16.5271C41.2636 16.5271 43.1617 18.4251 43.1617 20.7664H43.1623V25.52C43.1623 25.7266 43.3298 25.8941 43.5362 25.8941H49.1475C49.3541 25.8941 49.5214 25.7266 49.5214 25.52L49.5159 20.7664C49.5159 20.7664 49.5264 20.5225 49.5349 20.4173C49.7124 18.2393 51.5363 16.5271 53.7601 16.5271C56.1014 16.5271 57.9995 18.4251 57.9995 20.7664V25.525C57.9995 25.7315 58.167 25.899 58.3735 25.899H63.9847C64.1912 25.899 64.3586 25.7315 64.3586 25.525V20.7664C64.3586 14.9131 59.6135 10.1679 53.7601 10.1679H53.7602ZM87.997 15.2308C87.8645 9.60858 83.2793 5.02328 77.657 4.89094C71.6869 4.7505 66.8031 9.54797 66.803 15.4864V32.2455C66.803 32.452 66.9704 32.6194 67.1769 32.6194H72.7882C72.9947 32.6194 73.1621 32.452 73.1621 32.2455V15.5747C73.1621 13.2646 74.9733 11.3119 77.2825 11.2486C79.6782 11.183 81.6408 13.1055 81.6408 15.4864C81.6408 17.8277 79.7429 19.7257 77.4016 19.7257C77.3985 19.7257 76.4643 19.7653 75.8681 19.7469C75.6319 19.7396 75.4492 19.953 75.4902 20.1858L76.4773 25.7839C76.5094 25.9659 76.6696 26.0973 76.8543 26.0929C77.0291 26.0888 77.2061 26.0848 77.4016 26.0848C83.3398 26.0848 88.1374 21.201 87.997 15.2308ZM5.05815 25.4855C7.51293 25.4855 9.65232 23.4955 9.65232 21.0408C9.65232 18.5862 7.66251 16.5962 5.20769 16.5962C2.75287 16.5962 0.763052 18.586 0.763052 21.0408C0.763052 23.4956 2.60345 25.4855 5.05814 25.4855H5.05815ZM10.9341 27.9383H5.32282C5.11643 27.9383 4.94896 28.1056 4.94896 28.3121V40.6563H4.94909C4.94909 42.8043 3.35153 44.5788 1.27994 44.8573C1.00158 44.8696 0.732976 44.9015 0.383715 44.8907C0.14747 44.8834 -0.0352426 45.0968 0.00577964 45.3296L0.992187 50.8468C1.02426 51.0288 1.18439 51.1602 1.36912 51.1559C1.71439 51.1488 2.81532 51.003 3.08201 50.9304C7.87586 49.9676 11.3081 45.7836 11.3081 40.6563V28.3121C11.3081 28.1056 11.1407 27.9383 10.9342 27.9383L10.9341 27.9383ZM48.2934 4.04796C48.4621 4.05277 48.5736 4.15107 48.6084 4.31586C48.6199 4.3698 48.6232 4.42631 48.6233 4.48165C48.625 5.22399 48.6256 5.96634 48.6262 6.70868C48.6262 6.74562 48.6219 6.78575 48.6655 6.80168C48.7096 6.81778 48.7479 6.80566 48.7784 6.768C48.7978 6.74419 48.8207 6.72329 48.842 6.70101C49.4211 6.09411 49.9955 5.4826 50.6057 4.90616C50.8101 4.71306 51.0215 4.52862 51.2611 4.37919C51.5375 4.20683 51.8326 4.10749 52.1637 4.15094C52.4656 4.19061 52.6865 4.33772 52.7825 4.63588C52.8126 4.72968 52.8314 4.8308 52.8339 4.92912C52.8412 5.21933 52.8376 5.50983 52.8386 5.80024C52.8389 5.90409 52.8375 6.0081 52.8434 6.11164C52.8448 6.13649 52.8677 6.17321 52.8889 6.18038C52.9136 6.18875 52.9482 6.17319 52.9767 6.16302C52.9896 6.15842 52.9981 6.14168 53.0088 6.13063C53.3402 5.7874 53.6685 5.44116 54.0041 5.10204C54.2503 4.85316 54.5052 4.61243 54.8005 4.42014C55.0995 4.2255 55.4192 4.10416 55.7845 4.15121C55.936 4.17068 56.0763 4.21666 56.192 4.32234C56.3636 4.47902 56.4213 4.68511 56.4268 4.90434C56.4366 5.30224 56.4334 5.7004 56.4357 6.09844C56.4358 6.12256 56.4357 6.14667 56.4357 6.17121H57.6394C57.6402 6.158 57.6413 6.1487 57.6413 6.13939C57.641 5.70282 57.6464 5.26617 57.6383 4.82975C57.6323 4.5068 57.5533 4.19869 57.3876 3.91819C57.0773 3.39308 56.6153 3.10458 56.0088 3.04298C55.7674 3.01848 55.5286 3.03698 55.2909 3.07852C54.7577 3.1717 54.2863 3.39632 53.8788 3.75149C53.7855 3.83287 53.7049 3.92887 53.6225 4.01389C53.6068 4.00744 53.6042 4.00719 53.6037 4.00597C53.594 3.98511 53.5844 3.96429 53.5754 3.94319C53.3877 3.50472 53.0637 3.22175 52.6027 3.0989C52.1626 2.9816 51.7304 3.02104 51.307 3.17876C50.7664 3.38013 50.3063 3.70584 49.8904 4.09921C49.8748 4.11397 49.8588 4.12834 49.8316 4.15344C49.8316 3.95532 49.8337 3.77476 49.8311 3.59425C49.8273 3.32382 49.6417 3.13766 49.3715 3.13671C48.7343 3.13448 48.097 3.13508 47.4598 3.13478C47.447 3.13477 47.4342 3.13725 47.4201 3.13872V4.0419C47.4782 4.0419 47.5336 4.0416 47.5889 4.04194C47.8237 4.04341 48.0587 4.04129 48.2934 4.04795L48.2934 4.04796ZM64.2042 0.00652849C63.5997 0.0140348 62.995 0.00865225 62.3905 0.00860926H62.3246V0.919197C62.3624 0.919197 62.3966 0.91918 62.4308 0.919197C62.6714 0.919395 62.9121 0.917056 63.1527 0.920694C63.325 0.92329 63.4449 1.01984 63.4832 1.1803C63.4937 1.22468 63.4985 1.27153 63.4985 1.31724C63.4993 2.15007 63.499 2.9829 63.4987 3.81573C63.4987 3.83157 63.4965 3.84741 63.4949 3.86802C62.3826 2.71582 60.5345 2.83763 59.5487 3.73089C58.4503 4.72609 58.2552 6.25631 58.97 7.44086H60.3217C60.3002 7.40691 60.2792 7.37266 60.2572 7.33903C60.0453 7.01512 59.8776 6.67238 59.8067 6.28804C59.7421 5.93854 59.7451 5.59459 59.8682 5.25496C60.1503 4.47631 60.9604 4.01548 61.775 4.17073C62.1031 4.23328 62.4 4.36843 62.6594 4.57096C63.1855 4.98162 63.7016 5.40513 64.2203 5.82518C64.3488 5.92929 64.4701 6.04243 64.5985 6.14667C64.6222 6.16591 64.6667 6.17241 64.6973 6.16548C64.7148 6.16152 64.7345 6.11871 64.7345 6.09334C64.7365 5.33746 64.736 4.58157 64.7361 3.82568C64.7361 2.73127 64.7322 1.63683 64.7387 0.542466C64.7409 0.171959 64.5206 0.00259049 64.2042 0.00653709V0.00652849ZM66.8753 6.79414C66.8916 6.78869 66.903 6.76844 66.9164 6.75463C67.346 6.31096 67.7709 5.86249 68.2068 5.42504C68.5728 5.0577 68.9701 4.72633 69.4236 4.4688C69.7252 4.29747 70.0433 4.17311 70.3936 4.14612C70.4369 4.14278 70.4799 4.13458 70.523 4.12865V3.04381C70.5028 3.04018 70.4824 3.03303 70.4623 3.03348C70.343 3.03623 70.2236 3.0372 70.1046 3.04538C69.8545 3.06258 69.6095 3.10466 69.375 3.19872C68.87 3.4013 68.4319 3.70504 68.0371 4.07514C68.0139 4.09678 67.9905 4.11804 67.9571 4.14872C67.9571 4.12193 67.9572 4.10925 67.9571 4.09661C67.9569 3.94083 67.9586 3.78499 67.956 3.62925C67.9509 3.31829 67.7716 3.13726 67.4625 3.13626C66.8367 3.13422 66.211 3.13552 65.5853 3.13557C65.5723 3.13557 65.5593 3.13715 65.5445 3.13812V4.0419C65.5737 4.0419 65.5984 4.04177 65.6232 4.0419C65.8869 4.04354 66.1507 4.04142 66.4144 4.04826C66.578 4.05253 66.6937 4.1541 66.7286 4.31162C66.7397 4.36183 66.7438 4.41451 66.7438 4.46606C66.7447 5.22193 66.744 5.97778 66.7461 6.73362C66.7462 6.7586 66.7656 6.79682 66.7858 6.80506C66.8104 6.81508 66.8466 6.80372 66.8753 6.79413L66.8753 6.79414Z",fill:"currentColor"})})}),(0,a.jsx)("div",{className:"gap"}),(0,a.jsx)(s,{}),(0,a.jsx)("a",{onClick:e,className:"jmpNavToggle"+(n.navigationExpanded?" navigationExpanded":""),href:"/service/navigation-102.html",title:"Navigation",children:(0,a.jsx)("span",{className:"text",children:"Navigation"})})]})}var l=n(3520),u=n(5250);const c=()=>{const e={XS:{full:l.w4.hdg.heights.xs},S:{full:l.w4.hdg.heights.s},M:{full:l.w4.hdg.heights.m},L:{full:l.w4.hdg.heights.l},XL:{full:l.w4.hdg.heights.xl}},t={XS:{full:l.w4.mpl.heights.xs},S:{full:l.w4.mpl.heights.s},M:{full:l.w4.mpl.heights.m},L:{full:l.w4.mpl.heights.l},XL:{full:l.w4.mpl.heights.xl}},n=()=>{const n=(()=>{const e=window.innerWidth;return e<480?"XS":e<768?"S":e<1008?"M":e<1480?"L":"XL"})(),r=e[n].full,i=Math.round(Math.max(50,.38*r)),a=r-i,s=t[n].full;return{clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,fullWidth:document.documentElement.clientWidth,hdgFullHeight:r,hdgTopHeight:a,hdgBottomHeight:i,mplHeight:s,view:n}},[i,a]=(0,r.useState)(n()),s=(0,r.useCallback)((0,u.debounce)((()=>{a((e=>Object.assign({},e,n())))}),50,{leading:!1,trailing:!0}),[]);return(0,r.useEffect)((()=>(window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}))),i};var d=n(8521);function h({domNavigation:e}){const t=(0,r.useContext)(v),n=(0,r.useContext)(y),s=(0,r.useRef)(null),o=(0,r.useRef)(),{height:u}=(0,d.c)(o);(0,r.useEffect)((()=>{const e=document.querySelectorAll("ul.level1 > li.hasChilds");[].forEach.call(e,(function(e){e.querySelector("span").innerHTML+=''+l.FI.arrowDown+"",e.addEventListener("click",(function(e){this.classList.toggle("open")}))}))}),[]);const c={transition:"height 300ms ease-in-out",height:0,overflow:"hidden"},h={entering:{height:Math.max(n.clientHeight,u)},entered:{height:Math.max(n.clientHeight,u)},exiting:{height:0},exited:{height:0}};return(0,a.jsx)(i.Ay,{nodeRef:s,in:t.navigationExpanded,timeout:{appear:0,exit:300,enter:0},unmountOnExit:!1,mountOnEnter:!1,children:t=>(0,a.jsx)("div",{ref:s,style:Object.assign({},c,h[t]),children:(0,a.jsx)("div",{ref:o,className:"jmpNavigation",dangerouslySetInnerHTML:{__html:null==e?void 0:e.innerHTML}})})})}const f=r.lazy((()=>Promise.all([n.e(619),n.e(322)]).then(n.bind(n,3322))));function p({domNavigation:e,mplVisible:t,mplExpanded:n}){return(0,a.jsxs)("div",{className:"jmpHdgBottom wrapper",children:[(0,a.jsx)(h,{domNavigation:e}),t&&(0,a.jsx)(f,{mplExpanded:n})]})}var g=n(5383),m=n(8324);const v=r.createContext(null),y=r.createContext(null);function b({domNavigation:e}){var t,n;const i=(0,r.useContext)(g.Pd),s=null==i||null==(t=i.appState)?void 0:t.liveboxVisible,l=null==i||null==(n=i.appState)?void 0:n.liveboxExpanded,[u,d]=(0,r.useState)({navigationExpanded:!1}),h=c();return(0,a.jsx)(m.A,{children:(0,a.jsx)(v.Provider,{value:u,children:(0,a.jsx)(y.Provider,{value:h,children:(0,a.jsxs)("div",{className:"jmpHdg",children:[(0,a.jsx)(o,{toggleMainMenu:e=>{e.preventDefault(),d((e=>Object.assign({},e,{navigationExpanded:!u.navigationExpanded})))}}),(0,a.jsx)(p,{domNavigation:e,mplVisible:s,mplExpanded:l})]})})})})}},8521:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(4041),i=n(5250);const a=e=>{const[t,n]=(0,r.useState)({width:0,height:0}),a=()=>({width:e.current.offsetWidth,height:e.current.offsetHeight});return(0,r.useEffect)((()=>{const t=(0,i.debounce)((function(){n(a())}),300);return e.current&&n(a()),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e.current]),t}},7071:(e,t,n)=>{"use strict";n.d(t,{Jo:()=>f,KV:()=>h,Z5:()=>m,iN:()=>p,zm:()=>g});var r=n(4022),i=(n(133),n(6225)),a=n(2307),s=(n(4041),n(4947)),o=n.n(s),l=n(8324),u=n(6206),c=n(5873),d=n(1085);r.A.mdrReact=r.A.mdrReact||{},r.A.mdrReact.components=r.A.mdrReact.components||{};const h=()=>({generic:{isAutoplay:!0,isDvrEnabled:!0},web:{baseUrl:"/resources/global/ardplayer/release-6.9.1/",isForcedAutoplay:!0,isAudioSticky:!1,enablePostMessage:!1},pluginData:{}}),f={ardPlayerJS:"/resources/global/ardplayer/release-6.9.1/ardplayer-mdr-6.9.1.b0d0c607.js",ardPlayerCSS:"/resources/global/ardplayer/release-6.9.1/ardplayer-mdr-6.9.1.26a59c08.css"},p=({type:e,props:t,playerState:n,playerApi:r})=>{var i,s;const o=(null==(i=t.avDocument)?void 0:i.pianoAnalyticsProps)||(null==(s=t.avDocument.measure)?void 0:s.pianoAnalyticsProps),l=String(n.currentTime),u={playerApi:r,data:{avDocument:t.adAvDocument,dgsAvDocument:t.dgsAvDocument}};switch(e){default:break;case"metaUpdate":(0,a.XJ)("richMedia",{name:"metaUpdate",action:l},o,u);break;case"start":(0,a.XJ)("richMedia",{name:"buffer.start",action:l},o,u);break;case"waiting":(0,a.XJ)("richMedia",{name:"rebuffer.start",action:l},o,u);break;case"pause":(0,a.XJ)("richMedia",{name:"pause",action:l},o,u);break;case"ended":case"abort":case"error":(0,a.XJ)("richMedia",{name:"stop",action:l},o,u);break;case"play":(0,a.XJ)("richMedia",{name:"start",action:l},o,u)}},g=async(e,t,n)=>{var a;const s=e.view[0]||e.view,o=s.querySelector(".ardplayer-external-wrapper");o&&o.remove();const g=document.createElement("div");g.className="ardplayer-external-wrapper";const m=s.querySelector(".media")||s;m.classList.remove("av-playerContainer");const v=Object.assign({},e.rootConfig,f,{isLightbox:!!s.closest(".hasPortraitVideo")}),y=h();if("avplus"===(null==e?void 0:e.nodeType))m.appendChild(g);else{const e=m.querySelector(".imageWrapper"),t=m.querySelector(".imageWrapper img");!0===n?null==t||t.after(g):e.append(g)}v.jumpmarks&&(y.pluginData["jumpmarks@web"]={refreshSeconds:0,chapterArray:v.jumpmarks}),v.ratio=e.ratio,v.preview=n,r.A.mdrReact.theme&&!r.A.mdrReact.theme.global&&(r.A.mdrReact.theme.global=i.A.global);const b=Object.assign({},r.A.mdrReact.theme);b.player=r.A.mdrReact.theme.player||{mainColor:"#fff",playerBgColor:"#0062ae",hoverColor:"#0062ae",bgColor:"rgba(0,0,0,.5)"},r.A.mdrReact.components[v.id]||(r.A.mdrReact.components[v.id]=(0,c.createRoot)(g));const w=null==e||null==(a=e.view)?void 0:a.closest(".box").find(".linkAll").attr("href");r.A.mdrReact.components[v.id].render((0,d.jsx)(l.A,{children:(0,d.jsx)(u.g,{onPlayerStateHandler:p,theme:b,id:v.id,config:v,client:"mdr",ardPlayerConfig:y,detailPageUrl:w})}))},m=async()=>{if(!0!==r.A.ardPlayerLoaded){try{await Promise.all([o().css("/resources/global/ardplayer/release-6.7.0/ardplayer-mdr-6.7.0.b73fa0fd.css"),o().js("/resources/global/ardplayer/release-6.7.0/ardplayer-mdr-6.7.0.4e09ba3c.js")]),r.A.ardPlayerLoaded=!0}catch(e){console.error("#Player load Error",e)}try{await Promise.all([o().js("https://de-config.sensic.net/sui-connector.js")])}catch(e){console.error("#gfk load Error",e)}}}},6190:(e,t,n)=>{"use strict";n.d(t,{Ri:()=>s,YZ:()=>o,eq:()=>a,wV:()=>l,XN:()=>c,gq:()=>u});var r=n(4022);n(6660);n(4947);var i=n(2307);function a(e){const t=[];if(e&&"object"==typeof e){const n=Object.keys(e);for(let r=0;r"_v-**imageVariant**")),t=t.replace(/_w-[0-9]+/,(e=>"_w-**width**")),t}function o(e){if(!e||"object"!=typeof e)return null;let t=null;if(null!=e&&e.artist_image_id){var n,r;const i=null==e||null==(n=e.artist_image_id.imageVariant)?void 0:n.find((e=>"variantSmall1x1"===e["@attributes"].name?e:null));i&&null!=(r=i["@attributes"])&&r.url&&(t=i["@attributes"].url)}return t}function l(e,t,n){e&&t&&n&&window.open(e,"MDR JUMP Livestreamplayer","height=800,width=480")}function u(e){var t;if("object"==typeof(null==r.A||null==(t=r.A.pianoAnalyticsProps)?void 0:t.pageProperties)){var n;const t={content_namepath:"",content_tool:"",content_tool_details:""};t.content_namepath=null==(n=r.A.pianoAnalyticsProps.pageProperties)?void 0:n.content_namepath,"string"==typeof(null==e?void 0:e.content_tool)&&(t.content_tool=e.content_tool),"string"==typeof(null==e?void 0:e.content_tool_details)&&(t.content_tool_details=e.content_tool_details),t.content_namepath+=null!=e&&e.content_tool?"."+e.content_tool:"",t.content_namepath+=null!=e&&e.content_tool_details?"."+e.content_tool_details:"",(0,i.XJ)("view",null,Object.assign({},r.A.pianoAnalyticsProps,{pageProperties:Object.assign({},r.A.pianoAnalyticsProps.pageProperties,t)}))}}function c(e){return-1===e.indexOf("http")?"https://www.mdrjump.de"+e:e}},3520:(e,t,n)=>{"use strict";n.d(t,{FI:()=>i,w4:()=>r});n(2968);const r={jmpToggleNowOnAirInterval:12e3,jmpTransitionTimeGeneral:"320ms",jumpTransitionTimeButtonHover:"160ms",colors:{offBlack950:"#0e101d",offBlack900:"#1b1e30",offBlack850:"#22263d",greenLight100:"#00ff8e",greenDark400:"#00a8a8",red450:"#fe114d",violet600:"#8130ab",yellow050:"#faff66",yellow300:"#ff8000",orange300:"#ff9966",orange500:"#ff0000",blue150:"#00ece8",blue650:"#5b22d6",primary:"#0e101d",secondary:"#00ff8e"},hdg:{heights:{xs:108,s:130,m:161,l:192,xl:192}},mpl:{heights:{xs:357,s:357,m:377,l:400,xl:400}}},i={pinFilled:"",video:"",internalLink:"",audio:"",share:"",popout:"",info:"",menu:"",close:"",play:"",home:"",pause:"",image:"",skipRew:"",skipFwd:"",playlist:"",arrowLeft:"",arrowRight:"",arrowRightFull:"➔",arrowUp:"",arrowDown:"",subscribe:"",search:"",minus:"",plus:"",burger:"",refresh:"",volume:"",volumeMuted:"",locationGps:"",speechBubbles:"",facebook:"",twitter:"",pinterest:"",instagram:"",google:"",mail:"",whatsapp:"",youtube:"",mdr:"",podcast:{rss:"",apple:"",audiothek:"",google:"",overCast:"",pocketCast:"",antennaPod:"",spotify:""}}},5383:(e,t,n)=>{"use strict";n.d(t,{Pd:()=>a,tv:()=>s});var r=n(4041),i=n(1085);const a=(0,r.createContext)(),s=e=>(0,i.jsx)(a.Provider,{value:e.store,children:e.children})},7323:(e,t,n)=>{"use strict";n.d(t,{az:()=>r.az});var r=n(8090);n(8649),n(4041),n(1085)},8649:(e,t,n)=>{"use strict";n.d(t,{S:()=>y,$:()=>g});var r=n(4041),i=n(8014),a=n(8400),s=n(1238),o=n(2968),l=n(5655);const u=s.Ay.button.withConfig({displayName:"ButtonStyled__StandardButton",componentId:"sc-1d1718z-0"})(["width:",";height:",";top:",";left:",";right:",";bottom:",";box-shadow:",";border-radius:",";white-space:",";overflow:hidden;max-width:",";min-width:",";flex-direction:",";font-family:",";text-overflow:",";display:",";justify-content:center;align-items:center;color:",";cursor:pointer;padding:",";background-color:",";border:",";font-weight:",";position:",";margin:",";font-size:",";"," &:focus{outline-color:",";outline-offset:1px;color:",";}"," ",""],(e=>e.width?e.width:null),(e=>e.height?e.height:null),(e=>e.top?e.top:null),(e=>e.top?e.left:null),(e=>e.right?e.right:null),(e=>e.bottom?e.bottom:null),(e=>e.boxShadow?e.boxShadow:null),(e=>e.borderRadius?e.borderRadius:"4px"),(e=>e.whiteSpace?e.whiteSpace:"nowrap"),(({maxWidth:e})=>e||null),(({minWidth:e})=>e||null),(({flexDirection:e})=>e||null),(({theme:e})=>e.textFont?e.textFont:null),(e=>e.textOverflow?e.textOverflow:null),(e=>e.display?e.display:"flex"),(({color:e})=>e||"#313131"),(e=>e.padding?e.padding:"0.5rem 1rem"),(e=>e.bgColor?e.bgColor:"#ebebeb"),(e=>e.border?e.border:"1px solid #dcdcdc"),(e=>e.fontWeight?e.fontWeight:"bold"),(e=>e.position?e.position:"relative"),(e=>e.margin?e.margin:"1rem 0"),(({fontSize:e})=>e||"1rem"),(e=>e.hidden&&(0,s.AH)(["opacity:0;pointer-events:none;"])),(e=>e.bgColor?e.bgColor:o.Jy.blue),(e=>e.activeColor?e.activeColor:null),!(0,l.CN)()&&(0,s.AH)(["&:hover{background-color:",";color:",";}"],(({activeBgColor:e})=>e||null),(({activeColor:e})=>e||null)),(e=>e.disabled&&(0,s.AH)(["cursor:default;"]))),c=(0,s.Ay)(u).withConfig({displayName:"ButtonStyled__SubmitButton",componentId:"sc-1d1718z-1"})(["transition:color 0.3s ease-out;float:none;padding:0.5rem;border-radius:1px;background:",";color:",";font-weight:bold;overflow:hidden;display:flex;align-items:center;justify-content:center;margin:0.25rem;width:7.75rem;"],(e=>e.bgColor?e.bgColor:"transparent"),(e=>e.color?e.color:o.Jy.blue)),d=(0,s.Ay)(u).withConfig({displayName:"ButtonStyled__LightButton",componentId:"sc-1d1718z-2"})(["border:0.0625rem solid;border-radius:0.125rem;background:none;padding:0.25rem 1rem;color:",";font-weight:bold;overflow:hidden;display:flex;align-items:center;transition:all 0.3s ease-out;justify-content:",";width:",";height:",";background-color:",";"],(e=>e.color?e.color:"#fff"),(e=>e.justifyContent?e.justifyContent:"space-between"),(e=>e.width?e.width:"auto"),(e=>e.height?e.height:"auto"),(e=>e.isLoading?e.activeBgColor:"transparent")),h=(0,s.Ay)(u).withConfig({displayName:"ButtonStyled__PlayerStandardButton",componentId:"sc-1d1718z-3"})(["width:",";min-width:",";white-space:nowrap;overflow:hidden;display:",";justify-content:center;align-items:center;color:",";margin-left:0;cursor:pointer;padding:",";background-color:",";border-radius:4px;font-weight:bold;font-size:",";letter-spacing:0.4px;text-transform:uppercase;"],(({width:e})=>e||"auto"),(({minWidth:e})=>e||"auto"),(e=>e.display?e.display:"flex"),(e=>e.color?e.color:"#313131"),(({padding:e})=>e||"0.5rem"),(({bgColor:e})=>e||"#ebebeb"),(({fontSize:e})=>e||"0.75rem")),f=s.Ay.button.withConfig({displayName:"ButtonStyled__IconButton",componentId:"sc-1d1718z-4"})(["background:none;border:0;background-color:",";border-radius:",";display:flex;align-items:center;justify-content:center;align-content:center;text-align:center;margin:",";opacity:",";width:",";height:",";font-size:",";",";top:50%;cursor:pointer;"],(({bgColor:e})=>e||null),(({borderRadius:e})=>e||"50%"),(({margin:e})=>e||null),(({opacity:e})=>e||null),(({width:e})=>e||"1rem"),(({height:e})=>e||"1rem"),(({fontSize:e})=>e||"1rem"),(({transform:e})=>e&&(0,s.AH)(["transform:",";"],e)));var p=n(1085);const g=e=>{const t=()=>e.isLoading?(0,p.jsx)(a.ps,{width:"2rem",height:"2rem",bgColor:"light"===e.variant?"#fff":null,state:"isLoading"}):e.children;return"submit"===e.variant?(0,p.jsx)(c,Object.assign({},e,{children:t()})):"light"===e.variant?(0,p.jsx)(d,Object.assign({},e,{width:e.isLoading?"64px":e.width,children:t()})):"icon"===e.variant?(0,p.jsx)(f,Object.assign({},e,{tabIndex:0,children:(0,p.jsx)(i.I,{code:e.icon,color:e.color})})):"standard"===e.variant||"standardWithIcon"===e.variant?(0,p.jsx)(u,Object.assign({},e,{width:e.isLoading?"64px":e.width,children:t()})):"playerStandard"===e.variant?(0,p.jsx)(h,Object.assign({},e,{width:e.isLoading?"64px":e.width,children:t()})):(0,p.jsxs)(u,Object.assign({},e,{onClick:()=>{e.onClick(e)},children:[e.icon?(0,p.jsx)(i.I,{code:e.icon}):null,t()]}))};var m=n(8090);const v=(e,t)=>(0,p.jsx)(m.az,Object.assign({ref:t,cursor:"pointer",as:e.isLinkButton?"a":"button",border:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},e,{children:e.children})),y=r.forwardRef(v)},4912:(e,t,n)=>{"use strict";n.d(t,{a:()=>o});var r=n(1238),i=n(5655);const a=(0,r.i7)(["0%{background-color:hsl(200,20%,70%);}100%{background-color:hsl(200,20%,95%);}"]),s=["backgroundColor","display","fontSize","order","width","height","color","fontWeight"],o=r.Ay.div.withConfig({shouldForwardProp:(e,t)=>!s.includes(e)&&t(e)}).withConfig({displayName:"Box",componentId:"sc-1xje3pj-0"})(["",";display:",";position:",";top:",";bottom:",";left:",";right:",";margin:",";margin-top:",";margin-bottom:",";margin-left:",";margin-right:",";padding:",";padding-top:",";padding-bottom:",";padding-left:",";padding-right:",";color:",";opacity:",";order:",";background-color:",";background:",";background-size:",";background-image:",";width:",";height:",";max-width:",";min-width:",";max-height:",";min-height:",";z-index:",";outline:",";outline-offset:",";box-shadow:",";text-shadow:",";border:",";border-top:",";border-radius:",";cursor:",";pointer-events:",";justify-content:",";align-items:",";align-self:",";flex-basis:",";flex:",";flex-wrap:",";flex-grow:",";flex-direction:",";flex-shrink:",";grid-area:",";grid-column:",";grid-row:",";grid-row-start:",";grid-row-end:",";grid-template-columns:",";grid-template-rows:",";grid-auto-rows:",";grid-auto-columns:",";grid-auto-flow:",";grid-template-areas:",";align-content:",";text-align:",";white-space:",";gap:",";column-gap:",";row-gap:",";transform:",";transform-origin:",";transition:",";animation:",";font-family:",";font-weight:",";font-size:",";line-height:",";text-align:",";text-transform:",";word-break:",";word-wrap:",";hyphens:",";letter-spacing:",";overflow:",";overflow-x:",";overflow-y:",";object-fit:",";object-position:",";filter:",";resize:",";&.skeleton{opacity:0.7;animation:"," 1s linear infinite alternate;}",";",";",";",";",";",";",";",";",";",";",";",";",";",";",";",";",";",";&.inactive{opacity:0.25;pointer-events:none;}"],(({debug:e})=>e&&["background: rgba(0, 255, 255, 0.1) !important;","border: 1px dashed rgba(255, 0, 255, 1) !important;"]),(({display:e})=>e),(({position:e})=>e),(({top:e})=>e),(({bottom:e})=>e),(({left:e})=>e),(({right:e})=>e),(({margin:e})=>e),(({marginTop:e})=>e),(({marginBottom:e})=>e),(({marginLeft:e})=>e),(({marginRight:e})=>e),(({padding:e})=>e),(({paddingTop:e})=>e),(({paddingBottom:e})=>e),(({paddingLeft:e})=>e),(({paddingRight:e})=>e),(({color:e})=>e),(({opacity:e})=>e),(({order:e})=>e),(({backgroundColor:e})=>e),(({background:e})=>e),(({backgroundSize:e})=>e),(({backgroundImage:e})=>e),(({width:e})=>e),(({height:e})=>e),(({maxWidth:e})=>e),(({minWidth:e})=>e),(({maxHeight:e})=>e),(({minHeight:e})=>e),(({zIndex:e})=>e),(({outline:e})=>e),(({outlineOffset:e})=>e),(({boxShadow:e})=>e),(({textShadow:e})=>e),(({border:e})=>e),(({borderTop:e})=>e),(({borderRadius:e})=>e),(({cursor:e})=>e),(({pointerEvents:e})=>e),(({justifyContent:e})=>e),(({alignItems:e})=>e),(({alignSelf:e})=>e),(({flexBasis:e})=>e),(({flex:e})=>e),(({flexWrap:e})=>e),(({flexGrow:e})=>e),(({flexDirection:e})=>e),(({flexShrink:e})=>e),(({gridArea:e})=>e),(({gridColumn:e})=>e),(({gridRow:e})=>e),(({gridRowStart:e})=>e),(({gridRowEnd:e})=>e),(({gridTemplateColumns:e})=>e),(({gridTemplateRows:e})=>e),(({gridAutoRows:e})=>e),(({gridAutoColumns:e})=>e),(({gridAutoFlow:e})=>e),(({gridTemplateAreas:e})=>e),(({alignContent:e})=>e),(({textAlign:e})=>e),(({whiteSpace:e})=>e),(({gap:e})=>e),(({columnGap:e})=>e),(({rowGap:e})=>e),(({transform:e})=>e),(({transformOrigin:e})=>e),(({transition:e})=>e),(({animation:e})=>e),(({fontFamily:e})=>e),(({fontWeight:e})=>e),(({fontSize:e})=>e),(({lineHeight:e})=>e),(({textAlign:e})=>e),(({textTransform:e})=>e),(({wordBreak:e})=>e),(({wordWrap:e})=>e),(({hyphens:e})=>e),(({letterSpacing:e})=>e),(({overflow:e})=>e),(({overflowX:e})=>e),(({overflowY:e})=>e),(({objectFit:e})=>e),(({objectPosition:e})=>e),(({filter:e})=>e),(({resize:e})=>e),a,(({beforeStyle:e})=>e&&(0,r.AH)(["&:before{content:'';pointer-events:none;","}"],e)),(({afterStyle:e})=>e&&(0,r.AH)(["&:after{content:'';pointer-events:none;","}"],e)),(({customCss:e})=>e&&(0,r.AH)(["",""],e)),(({xsStyle:e})=>e&&(0,r.AH)(["@media (min-width:0){","}"],e)),(({sStyle:e,theme:t})=>e&&(0,r.AH)(["@media (min-width:","){","}"],`${null==t?void 0:t.breakpoints.s}px`||"480px",e)),(({mStyle:e,theme:t})=>e&&(0,r.AH)(["@media (min-width:","){","}"],`${null==t?void 0:t.breakpoints.m}px`||"768px",e)),(({lStyle:e,theme:t})=>e&&(0,r.AH)(["@media (min-width:","){","}"],`${null==t?void 0:t.breakpoints.l}px`||"1008px",e)),(({xlStyle:e,theme:t})=>e&&(0,r.AH)(["@media (min-width:","){","}"],`${null==t?void 0:t.breakpoints.xl}px`||"1480px",e)),(({desktop:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.desktop,e)}),(({tv:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.tv,e)}),(({tablet:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.tablet,e)}),(({smartPhone:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.smartPhone,e)}),(({smartPhoneBig:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.smartPhoneBig,e)}),(({smartPhoneSmall:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.smartPhoneSmall,e)}),(({smartPhoneToTablet:e,theme:t})=>{var n;return e&&(0,r.AH)(["@media ","{","}"],null==t||null==(n=t.viewports)?void 0:n.smartPhoneToTablet,e)}),(({hover:e})=>e&&!(0,i.CN)()&&(0,r.AH)(["&:hover{","}"],e)),(({focus:e})=>e&&(0,r.AH)(["&:focus{","}"],e)),(({activeStyle:e})=>e&&(0,r.AH)(["&:focus:not(:active){","}"],e)))},8090:(e,t,n)=>{"use strict";n.d(t,{az:()=>r.a});n(4041),n(1085);var r=n(4912)},5424:(e,t,n)=>{"use strict";n.d(t,{G:()=>h,$:()=>u});var r=n(1238),i=n(1085);const a=r.Ay.h1.withConfig({displayName:"Headline__BigHeadline",componentId:"sc-155ccom-0"})(["width:",";height:",";color:",";font-size:",";margin:",";font-weight:",";text-transform:",";text-align:",";letter-spacing:",";"],(e=>e.width?e.width:"100%"),(e=>e.height?e.height:"auto"),(e=>e.color?e.color:"#313131"),(e=>e.fontSize?e.fontSize:"1.5rem"),(e=>e.margin?e.margin:"1rem 0"),(e=>e.fontWeight?e.fontWeight:"bold"),(e=>e.textTransform?e.textTransform:null),(e=>e.textAlign?e.textAlign:null),(e=>e.letterSpacing?e.letterSpacing:null)),s=r.Ay.h2.withConfig({displayName:"Headline__MediumHeadline",componentId:"sc-155ccom-1"})(["width:",";height:",";color:",";font-size:",";margin:",";font-weight:",";text-transform:",";text-align:",";letter-spacing:",";display:",";align-items:",";"],(e=>e.width?e.width:"auto"),(e=>e.height?e.height:"auto"),(e=>e.color?e.color:"#313131"),(e=>e.fontSize?e.fontSize:"1.25rem"),(e=>e.margin?e.margin:"0 0 1rem 0"),(e=>e.fontWeight?e.fontWeight:"bold"),(e=>e.textTransform?e.textTransform:null),(e=>e.textAlign?e.textAlign:null),(e=>e.letterSpacing?e.letterSpacing:null),(e=>e.display?e.display:null),(e=>e.alignItems?e.alignItems:null)),o=r.Ay.h3.withConfig({displayName:"Headline__SmallHeadline",componentId:"sc-155ccom-2"})(["width:",";height:",";color:",";font-size:",";margin:",";font-weight:",";text-transform:",";text-align:",";letter-spacing:",";"],(e=>e.width?e.width:"auto"),(e=>e.height?e.height:"auto"),(e=>e.color?e.color:"#313131"),(e=>e.fontSize?e.fontSize:"0.75rem"),(e=>e.margin?e.margin:"0 0 1rem 0"),(e=>e.fontWeight?e.fontWeight:"bold"),(e=>e.textTransform?e.textTransform:"uppercase"),(e=>e.textAlign?e.textAlign:"left"),(e=>e.letterSpacing?e.letterSpacing:"2px")),l=r.Ay.h4.withConfig({displayName:"Headline__TeaserHeadline",componentId:"sc-155ccom-3"})(["width:",";height:",";color:",";font-size:",";margin:",";font-weight:",";text-transform:",";text-align:",";letter-spacing:",";white-space:",";"],(e=>e.width?e.width:"100%"),(e=>e.height?e.height:"auto"),(e=>e.color?e.color:"#313131"),(e=>e.fontSize?e.fontSize:"1rem"),(e=>e.margin?e.margin:"0 0 0 0"),(e=>e.fontWeight?e.fontWeight:"normal"),(e=>e.textTransform?e.textTransform:null),(e=>e.textAlign?e.textAlign:null),(e=>e.letterSpacing?e.letterSpacing:null),(e=>e.whiteSpace?e.whiteSpace:null)),u=e=>"big"===e.type?(0,i.jsx)(a,Object.assign({},e,{children:e.children})):"medium"===e.type?(0,i.jsx)(s,Object.assign({},e,{children:e.children})):"small"===e.type?(0,i.jsx)(o,Object.assign({},e,{children:e.children})):"teaser"===e.type?(0,i.jsx)(l,Object.assign({},e,{children:e.children})):(0,i.jsx)(o,Object.assign({},e,{children:e.children}));n(4041);var c=n(7323);const d=(0,r.Ay)(c.az).withConfig({displayName:"BaseHeadlinestyled__BaseHeadlineStyled",componentId:"sc-1o3r6zz-0"})(["position:",";"],(({position:e})=>e||"relative")),h=e=>(0,i.jsx)(d,Object.assign({as:e.as||"h4"},e,{children:e.children}))},8383:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,N:()=>l});var r=n(7323),i=n(1238),a=n(1085);const s=(0,i.Ay)(r.az).withConfig({displayName:"Icon__Wrapper",componentId:"sc-11y7yd8-0"})(["display:flex;height:",";width:",";font-weight:200;font-family:",";text-decoration:none !important;align-items:center;justify-content:center;pointer-events:none;"],(({height:e})=>e||"100%"),(({width:e})=>e||"auto"),(({theme:e})=>{var t,n;return null!=e&&null!=(t=e.global)&&t.iconFont?null==e||null==(n=e.global)?void 0:n.iconFont:"mdricons"})),o=(0,i.Ay)(r.az).withConfig({displayName:"Icon__WrapperArd",componentId:"sc-11y7yd8-1"})(["display:flex;height:",";width:",";font-weight:200;font-size:",";color:",";font-family:'ardplayer !important';text-decoration:none !important;align-items:center;justify-content:center;pointer-events:none;"],(({height:e})=>e||"100%"),(({width:e})=>e||"auto"),(({width:e})=>e||"auto"),(({color:e})=>e||"#fff")),l=e=>(0,a.jsx)(o,Object.assign({},e,{style:{fontFamily:"ardplayer !important"},dangerouslySetInnerHTML:{__html:`${e.code}`}})),u=e=>(0,a.jsx)(s,Object.assign({},e,{dangerouslySetInnerHTML:{__html:e.code}}))},8014:(e,t,n)=>{"use strict";n.d(t,{I:()=>r.A});var r=n(8383)},2586:(e,t,n)=>{"use strict";n.d(t,{h:()=>v});var r=n(4041),i=n(5655),a=n(5143),s=n(1238),o=n(4375),l=n.n(o),u=n(8400),c=n(4912);const d=s.Ay.img.withConfig({displayName:"ImageStyled__ImgTag",componentId:"sc-7kil2l-0"})(["width:",";height:",";object-fit:cover;"],(e=>e.width?e.width:"100%"),(e=>e.height?e.height:"auto")),h=(0,s.Ay)(c.a).withConfig({displayName:"ImageStyled__Wrapper",componentId:"sc-7kil2l-1"})(["border:0;width:",";height:",";min-width:",";max-width:",";margin:",";position:",";overflow:hidden;display:block;background-color:",";border-radius:",";img{position:static;aspect-ratio:",";opacity:0;width:100%;&.loaded{transition:opacity 0.3s ease-out;opacity:1;}}"],(e=>e.width?e.width:"100%"),(e=>e.height?e.height:"auto"),(e=>e.minWidth?e.minWidth:null),(e=>e.maxWidth?e.maxWidth:"128px"),(({margin:e})=>e||"0"),(e=>e.position?e.position:"relative"),(e=>e.bgColor?e.bgColor:"transparent"),(e=>e.borderRadius?e.borderRadius:"0"),(e=>e.ratio?e.ratio:"16 / 9")),f=s.Ay.img.withConfig({displayName:"ImageStyled__PosterImage",componentId:"sc-7kil2l-2"})(["position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;&.loaded{transition:opacity 0.3s ease-out;opacity:1;}object-fit:contain;"]);var p=n(4022),g=n(1085);const m=e=>{switch(e){case"1x1":return"1 / 1";case"24x9":return"24 / 9";default:return"16 / 9"}},v=e=>{var t;const n=(0,r.useContext)(s.Dx),o=(0,r.useRef)(null),[c,v]=(0,r.useState)(null),[y,b]=(0,r.useState)(!1),[w,_]=(0,r.useState)(e.noPreload?"loaded":""),[E,T]=(0,r.useState)(!1),[S,C]=(0,r.useState)(null),[x,A]=(0,r.useState)(!1),[k,D]=(0,r.useState)(),[L,R]=(0,r.useState)(null!=(t=null==e?void 0:e.ratio)?t:m(e.imageVariant)),P=t=>{let r=0;const a=t;let s="",l="variantSmall",u="**imageVariant**";o&&o.current&&o.current.getBoundingClientRect()&&(r=o.current.getBoundingClientRect().width);let c=parseInt(String(64*Math.ceil(r*(0,i.m8)()/64)));c>1920&&(c=1920),l=c>512?"variantBig":"variantSmall";let d=l+(e.imageVariant?e.imageVariant:"16x9");return"kika"===(null==n?void 0:n.global.client)&&(u="**aspectRatio**",d="tlarge169"),a&&(s=a.split("**width**").join(String(c)).split(u).join(d),p.A.MDR_BASE_URL&&-1===s.indexOf("https://")&&(s=`${p.A.MDR_BASE_URL}${s}`)),s},I=(t,n)=>{if(y&&!0!==n)return;const r=P(t||e.url);if(!r)return!1;C(Date.now()),T(!0),b(!0);const i=new Image;let a=null;a=setTimeout((()=>{!1===i.complete&&_("")}),100),i.onload=()=>{T(!1),v(r),_("loaded"),clearTimeout(a),i.onload=null,"posterImage"===e.type&&D(r)},i.src=r};(0,r.useEffect)((()=>{"posterImage"===e.type&&I(e.url,!0)}),[e.url]),(0,r.useEffect)((()=>{let e=null;if(E)_("");else{Date.now()-S<300?e=setTimeout((()=>{_("loaded")}),300):_("loaded")}return()=>{clearTimeout(e)}}),[E]),(0,r.useEffect)((()=>{(()=>{if(!e.shouldPreloadNeighbors)return;const t=P(e.nextImageUrl);(new Image).src=t;const n=P(e.prevImageUrl);(new Image).src=n})()}),[e.nextImageUrl,e.prevImageUrl]);const O=(0,r.useCallback)((()=>{const t=P(e.url);c!==t&&!0!==e.noPreload&&b(!1)}),[c,P,e.noPreload]),{ref:M}=(0,a.u)({handleWidth:!0,onResize:O,refreshMode:"debounce",refreshRate:1e3}),N=Object.assign({},e);return null==N||delete N.onImageClick,(0,g.jsx)(l(),{partialVisibility:!0,onChange:t=>{if(!0===t){var n;A(!0);const t=null!=(n=e.ratio)?n:m(e.imageVariant);R(t),I()}},children:(0,g.jsx)(h,Object.assign({},N,{height:e.noAspectRatio?"100%":e.height||null,ratio:e.noAspectRatio?"unset":L,ref:o,children:(0,g.jsxs)("div",{className:"react-resize-detector-image-wrapper",style:{minWidth:"100%"},ref:M,children:["loaded"!==w&&(0,g.jsx)(u.ps,{position:"absolute",width:"6rem",height:"6rem",bgColor:"#fff",top:"50%",right:"50%",margin:"-3rem -3rem 0 0"}),"posterImage"===e.type?k?(0,g.jsx)(f,{onMouseDown:e.onImageClick,src:x?e.noPreload?k:c:"",className:w,alt:e.altText||"",title:e.titleText||""}):null:(0,g.jsx)(d,{onMouseDown:e.onImageClick,height:e.height,width:e.width,alt:e.altText||"",title:e.titleText||"",className:c?"loaded":"",src:x?c:""}),"loaded"===w&&e.children]})}))})}},8621:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});n(4041);var r=n(1238),i=n(5655),a=n(1085);const s="\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: 0.0625rem;\n\t\tposition: absolute;\n\t\tcontent: '';\n\n",o=r.Ay.a.withConfig({displayName:"Link__Wrapper",componentId:"sc-13jsbww-0"})(["color:",";cursor:pointer;padding:",";width:",";font-family:",";display:",";background-color:",";border:0;font-weight:",";position:relative;align-items:center;",";&:focus{outline:2px solid;}",""],(e=>e.color?e.color:"#0062ae"),(e=>e.padding?e.padding:"0"),(e=>e.width?e.width:"auto"),(({theme:e})=>e.textFont?e.textFont:null),(e=>e.display?e.display:"flex"),(e=>e.bgColor?e.bgColor:"transparent"),(e=>e.fontWeight?e.fontWeight:"normal"),(e=>e.isActive&&(0,r.AH)(["color:",";&:before{",";background-color:",";}"],(t=>e.activeColor?e.activeColor:null),s,(t=>e.activeLineColor?e.activeLineColor:"rgba(0,0,0,.33)"))),(e=>!(0,i.CN)()&&(0,r.AH)(["&:hover{color:",";&:before{",";background-color:",";}> *{color:",";}}"],(t=>e.hoverColor?e.hoverColor:null),s,(t=>e.hoverLineColor?e.hoverLineColor:"rgba(0,0,0,.33)"),(t=>e.hoverColor?e.hoverColor:null)))),l=e=>(0,a.jsx)(o,Object.assign({},e,{children:e.children}))},8400:(e,t,n)=>{"use strict";n.d(t,{mj:()=>b,ps:()=>c});var r=n(1238),i=n(2968),a=n(8090);const s=(0,r.i7)(["0%{transform :scale(0);opacity :0;}5%{opacity :1;}100%{transform :scale(1);opacity :0;}"]),o=(0,r.Ay)(a.az).withConfig({displayName:"LoaderStyle__Wrapper",componentId:"sc-1m58uo-0"})(["width:",";height:",";position:",";z-index:3;margin-left:auto;pointer-events:",";margin-right:auto;margin:",";top:",";right:",";display:flex;svg{width:100%;vertical-align:middle;}.CircularProgressbar .CircularProgressbar-path{stroke:",";stroke-linecap:round;-webkit-transition:stroke-dashoffset 0.5s ease 0s;transition:stroke-dashoffset 0.5s ease 0s;}.CircularProgressbar .CircularProgressbar-trail{stroke:",";stroke-linecap:round;}.CircularProgressbar .CircularProgressbar-text{fill:",";font-size:1rem;dominant-baseline:middle;text-anchor:middle;}.CircularProgressbar .CircularProgressbar-background{fill:",";}.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-background{fill:#3e98c7;}.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-text{fill:#fff;}.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-path{stroke:#fff;}.CircularProgressbar.CircularProgressbar-inverted .CircularProgressbar-trail{stroke:transparent;}"],(e=>e.width?e.width:"100%"),(e=>e.height?e.height:"100%"),(({position:e})=>e||"relative"),(({pointerEvents:e})=>e||null),(({margin:e})=>e||null),(({top:e})=>e||null),(({right:e})=>e||null),(({progressColor:e})=>e||i.Jy.blue),(({progressBgColor:e})=>e||i.Jy.blue),(({color:e})=>e||"#313131"),(({backgroundColor:e})=>e||"#dcdcdc")),l=r.Ay.div.withConfig({displayName:"LoaderStyle__Pulse",componentId:"sc-1m58uo-1"})(["width:100%;height:100%;position:absolute;left:0;top:0;animation:"," 1s 0s linear infinite;animation-delay:",";animation-fill-mode:forwards;background-color:",";border-radius:50%;opacity:0;"],s,(({delay:e})=>e||"0s"),(({bgColor:e})=>e||"rgba(0, 0, 0, 0.25)"));var u=n(1085);const c=e=>(0,u.jsxs)(o,Object.assign({},e,{children:[(0,u.jsx)(l,{bgColor:e.bgColor}),(0,u.jsx)(l,{bgColor:e.bgColor,delay:"0.2s"}),(0,u.jsx)(l,{bgColor:e.bgColor,delay:"0.4s"}),(0,u.jsx)(l,{bgColor:e.bgColor,delay:"0.6s"})]}));var d=n(4041),h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},h(e,t)};var f=50,p=50;function g(e){var t=e.className,n=e.counterClockwise,r=e.dashRatio,i=e.pathRadius,a=e.strokeWidth,s=e.style;return(0,d.createElement)("path",{className:t,style:Object.assign({},s,v({pathRadius:i,dashRatio:r,counterClockwise:n})),d:m({pathRadius:i,counterClockwise:n}),strokeWidth:a,fillOpacity:0})}function m(e){var t=e.pathRadius,n=e.counterClockwise?1:0;return"\n M "+f+","+p+"\n m 0,-"+t+"\n a "+t+","+t+" "+n+" 1 1 0,"+2*t+"\n a "+t+","+t+" "+n+" 1 1 0,-"+2*t+"\n "}function v(e){var t=e.counterClockwise,n=e.dashRatio,r=e.pathRadius,i=2*Math.PI*r,a=(1-n)*i;return{strokeDasharray:i+"px "+i+"px",strokeDashoffset:(t?-a:a)+"px"}}var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return function(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.getBackgroundPadding=function(){return this.props.background?this.props.backgroundPadding:0},t.prototype.getPathRadius=function(){return 50-this.props.strokeWidth/2-this.getBackgroundPadding()},t.prototype.getPathRatio=function(){var e=this.props,t=e.value,n=e.minValue,r=e.maxValue;return(Math.min(Math.max(t,n),r)-n)/(r-n)},t.prototype.render=function(){var e=this.props,t=e.circleRatio,n=e.className,r=e.classes,i=e.counterClockwise,a=e.styles,s=e.strokeWidth,o=e.text,l=this.getPathRadius(),u=this.getPathRatio();return(0,d.createElement)("svg",{className:r.root+" "+n,style:a.root,viewBox:"0 0 100 100","data-test-id":"CircularProgressbar"},this.props.background?(0,d.createElement)("circle",{className:r.background,style:a.background,cx:f,cy:p,r:50}):null,(0,d.createElement)(g,{className:r.trail,counterClockwise:i,dashRatio:t,pathRadius:l,strokeWidth:s,style:a.trail}),(0,d.createElement)(g,{className:r.path,counterClockwise:i,dashRatio:u*t,pathRadius:l,strokeWidth:s,style:a.path}),o?(0,d.createElement)("text",{className:r.text,style:a.text,x:f,y:p},o):null)},t.defaultProps={background:!1,backgroundPadding:0,circleRatio:1,classes:{root:"CircularProgressbar",trail:"CircularProgressbar-trail",path:"CircularProgressbar-path",text:"CircularProgressbar-text",background:"CircularProgressbar-background"},counterClockwise:!1,className:"",maxValue:100,minValue:0,strokeWidth:8,styles:{root:{},trail:{},path:{},text:{},background:{}},text:""},t}(d.Component);const b=e=>(0,u.jsxs)(o,Object.assign({as:"button",margin:"0"},e,{children:[(0,u.jsx)(y,{value:e.progress,strokeWidth:e.progressWidth,text:e.text?`${e.text}%`:null}),e.children]}))},483:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(4041);var r=n(1238),i=n(1085);const a=r.Ay.p.withConfig({displayName:"Text__Wrapper",componentId:"sc-2zoxnm-0"})(["color:",";font-size:",";font-weight:",";margin:",";text-align:",";max-width:",";font-style:",";"],(({color:e})=>e||"#313131"),(({fontSize:e})=>e||"1rem"),(({fontWeight:e})=>e||"normal"),(({margin:e})=>e||"0"),(({textAlign:e})=>e||"left"),(({maxWidth:e})=>e||null),(({fontStyle:e})=>e||null)),s=(0,r.Ay)(a).withConfig({displayName:"Text__SmallText",componentId:"sc-2zoxnm-1"})(["text-align:left;font-size:0.8125rem;margin-bottom:0.25rem;background-color:#0673b8;"]),o=(0,r.Ay)(a).withConfig({displayName:"Text__ItalicSubline",componentId:"sc-2zoxnm-2"})(["width:100%;margin-bottom:1rem;text-align:center;"]),l=(0,r.Ay)(a).withConfig({displayName:"Text__PlayerText",componentId:"sc-2zoxnm-3"})(["white-space:nowrap;font-size:0.75rem;"]),u=e=>"small"===e.variant?(0,i.jsx)(s,Object.assign({},e,{children:e.children})):"italicSubline"===e.variant?(0,i.jsx)(o,Object.assign({},e,{children:e.children})):"playerText"===e.variant?(0,i.jsx)(l,Object.assign({},e,{children:e.children})):"paragraph"===e.variant?(0,i.jsx)(a,Object.assign({},e,{margin:"0 0 1rem 0",children:e.children})):(0,i.jsx)(a,Object.assign({},e,{children:e.children}))},3789:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(4041),i=n(1361),a=n(8649),s=n(9102),o=n(2968),l=n(7323),u=n(1085);const c=e=>((0,r.useEffect)((()=>("undefined"!=typeof document&&(!0===e.active?document.documentElement.classList.add("lightboxOpen"):document.documentElement.classList.remove("lightboxOpen")),e.active&&e.onOpened&&e.onOpened(),()=>{document.documentElement.classList.remove("lightboxOpen")})),[e.active]),(0,u.jsx)(i.A,{unmountOnExit:!0,appear:e.active,in:e.active,timeout:!1===e.active?500:0,classNames:"animation",children:(0,u.jsxs)(s.mO,{onKeyDown:t=>{e.onKeyDown&&e.onKeyDown(t.keyCode)},children:[(0,u.jsx)(s.as,{onClick:e.onClicked}),(0,u.jsxs)(s.TR,{mode:e.mode,maxWidth:"player"===e.mode?"100%":e.maxWidth,maxHeight:e.maxHeight||null,children:[e.header?e.header:null===e.header?null:(0,u.jsxs)(s.jP,{children:[e.title,(0,u.jsx)(s.R7,{children:(0,u.jsx)(a.$,{onClick:e.onClicked,bgColor:"#ebebeb",variant:"standard",icon:o.FI.close,children:"Fertig"})})]}),"player"===e.mode||"modal"===e.mode?e.children:(0,u.jsx)(l.az,{overflowY:"scroll",width:"100%",maxWidth:"calc(100% - 1rem)",margin:"0.5rem auto",children:e.children}),e.footer?e.footer:null]})]})}))},9102:(e,t,n)=>{"use strict";n.d(t,{QK:()=>l,R7:()=>o,TR:()=>s,as:()=>a,jP:()=>u,mO:()=>i});var r=n(1238);const i=r.Ay.div.withConfig({displayName:"LightboxStyle__Wrapper",componentId:"sc-k67666-0"})(["width:100%;height:100%;position:fixed;text-align:left;top:0;left:0;z-index:1000;display:flex;align-items:center;justify-content:center;> div,> span{transition:all 0.3s ease-out;}> div{transform:translate3d(0,-200%,0);}&.animation-enter{> span{opacity:0;}> div{transform:translate3d(0,-200%,0);}}&.animation-enter-active,&.animation-enter-done{> span{opacity:1;}> div{transform:translate3d(0,0,0);}}&.animation-exit{> span{opacity:0;}> div{transform:translate3d(0,-200%,0);}}&.animation-exit-active{> span{opacity:0;}> div{transform:translate3d(0,-200%,0);}}"]),a=r.Ay.span.withConfig({displayName:"LightboxStyle__LightboxBackground",componentId:"sc-k67666-1"})(["width:100%;height:100%;position:absolute !important;top:0;left:0;background-color:rgba(0,0,0,0.5);opacity:0;"]),s=r.Ay.div.withConfig({displayName:"LightboxStyle__LightboxContent",componentId:"sc-k67666-2"})(["position:relative;width:",";height:",";border-radius:",";overflow:hidden;max-width:",";max-height:",";background-color:",";box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2);display:flex;flex-direction:column;align-items:center;justify-content:center;",""],(e=>"100%"===e.maxWidth?"100vw":"90vw"),(e=>"100%"===e.maxWidth?"100vh":"90vh"),(e=>"player"===e.mode?"0":" 2px"),(e=>e.maxWidth?e.maxWidth:"540px"),(e=>e.maxHeight?e.maxHeight:null),(e=>"player"===e.mode?"rgba(0,0,0,1)":" #fefefe"),(e=>"modal"===e.mode&&(0,r.AH)(["max-height:450px;"]))),o=r.Ay.div.withConfig({displayName:"LightboxStyle__CloseButtonPositioner",componentId:"sc-k67666-4"})(["position:absolute;z-index:1;right:0.5rem;top:50%;transform:translate3d(0,-50%,0);"]),l=r.Ay.div.withConfig({displayName:"LightboxStyle__TopRightCloseButtonPositioner",componentId:"sc-k67666-5"})(["position:fixed;z-index:10;right:0.5rem;top:0.5rem;transform:translate3d(0,0,0);"]),u=r.Ay.div.withConfig({displayName:"LightboxStyle__LightboxHeader",componentId:"sc-k67666-6"})(["text-align:center;width:100%;position:relative;z-index:1;background-color:#ebebeb;padding:1rem;border-bottom:1px solid #dcdcdc;font-weight:bold;text-transform:uppercase;letter-spacing:2px;"])},5655:(e,t,n)=>{"use strict";function r(e){const t=Object.assign({},e),n="top="+t.top+",left="+t.left+",width="+t.width+",height="+t.height+",toolbar="+t.toolbar+",scrollbars="+t.scroll+",status="+t.status+",resizable="+t.resizable+",location="+t.location+",menuBar=0,address=0";window.open(t.url,t.title,n).focus()}function i(e,t,n,r){void 0===n?n=!1:void 0===r&&(r=25);const i=Math.floor(e/3600)%24,a=Math.floor(e/60)%60,s=Math.floor(e%60),o=Math.floor((e%1*r).toFixed(3));return(t||i>0?(i<10?"0"+i:i)+":":"")+(a<10?"0"+a:a)+":"+(s<10?"0"+s:s)+(n?":"+(o<10?"0"+o:o):"")}function a(){return"undefined"==typeof window}function s(e,t){let n=null;const r=e.getAttribute(`data-ctrl-${t}`);if(r)try{n=JSON.parse(r.replace(/'/g,'"'))}catch(i){console.error("#error config parsing",e,t)}return n}function o(e){if(a())return"";const t=document.createElement("textarea");return t.innerHTML=e,t.value}function l(){let e=1;return void 0!==window.devicePixelRatio&&null!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e=window.devicePixelRatio),e}function u(e){return!1}function c(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function d(e,t,n,r){const i=n;let a="variant"+(i<512?"Small":"Big")+(t||"16x9");if(r&&r.length>0){let e=r.filter((e=>e.imageType&&-1!==e.imageType.indexOf("tlarge169")));e||(e=r.filter((e=>e.imageType&&-1!==e.imageType.indexOf("original")))),e&&e[0]&&(a=e[0].imageType)}return e=(e=e.split("**imageVariant**").join(a)).split("**aspectRatio**").join("tlarge169"),i&&(e=e.split("**width**").join(String(i))),e}function h(){return!a()&&void 0!==window.orientation}function f(){return document.documentElement.classList.contains("no-touch")}function p(e,t,n){void 0===t?t=!1:void 0===n&&(n=25);let r=0,i=0;const a=e.split(":");let s=parseInt(a[0],10);const o=parseInt(a[1],10),l=parseInt(a[2],10);return"1"===a[0].substr(0,1)&&(s=parseInt("0"+a[0].substr(1),10)),t&&(r=parseInt(a[3],10)/n),i=3600*s+60*o+l+r,i}n.d(t,{CN:()=>h,Pn:()=>p,Q3:()=>s,S$:()=>a,TU:()=>f,XL:()=>c,Xx:()=>o,bG:()=>d,bP:()=>r,m8:()=>l,tr:()=>i,wi:()=>u})},4022:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let r={};(0,n(5655).S$)()||(r=window);const i=r},3034:(e,t,n)=>{"use strict";n.d(t,{V:()=>c});var r=n(5655),i=n(6660),a=n.n(i),s=n(2763),o=n(4041),l=n(133);const u=(e,t)=>{const n={all:({url:"",title:"",name:"",icon:""},{title:"RSS Feed",name:"rss",icon:"rss",url:""})};let r=null;if(t.rss){const a=t.rss.channel.image.url,s=t.rss.channel.image.title,o=t.rss.channel.item[0],l=o.enclosure["@_url"];var i;if(r={currentAv:{title:null,type:"audio",topline:t.rss.channel.title,headline:o["itunes:title"],sophoraId:"player"+(new Date).getTime(),teaserimages:{teaserimageResponsive:{url:a},alttext:s},assets:{asset:{progressiveDownloadUrl:l}}},podcasts:[],podcast:{url:e.mmgXml,itunesLogoUrl:a}},n.all.url=e.mmgXml,e.platforms&&e.platforms instanceof Array&&e.platforms.length>0)e.platforms.map(((e,t)=>r.podcasts.push({title:e.title,name:e.title,url:e.url,icon:e.icon})));else null!=(i=e.platforms)&&i.icon&&r.podcasts.push({title:e.platforms.title,name:e.platforms.title,url:e.platforms.url,icon:e.platforms.icon});return r}var a,s;(t.multimediagallery&&(r=t.multimediagallery),r)&&(r.podcasts=[],r.podcast&&r.podcasts.push({title:"RSS-Feed",name:r.podcast.title,url:r.podcast.url,icon:r.podcast.itunesLogoUrl}),(null==(a=r.podcast)||null==(a=a.podcastProvider)?void 0:a.provider)instanceof Array?r.podcast.podcastProvider.provider.map(((e,t)=>r.podcasts.push({title:e.providerTitle,name:e.providerName,url:e.providerUrl,icon:e.providerName}))):null!=(s=r.podcast)&&null!=(s=s.podcastProvider)&&s.provider&&r.podcasts.push({url:r.podcast.podcastProvider.provider.providerUrl,title:r.podcast.podcastProvider.provider.providerTitle,name:r.podcast.podcastProvider.provider.providerName,icon:r.podcast.podcastProvider.provider.providerName}));return r},c=(e,t,n,i)=>{const[c,d]=(0,o.useState)(null),[h,f]=(0,o.useState)(null),[p,g]=(0,o.useState)(null),[m,v]=(0,o.useState)(!0),[y,b]=(0,o.useState)(!1),w=new s.XMLParser({ignoreAttributes:!1});(0,o.useEffect)((()=>{v(!0),b(!1);let i=null;const s=(e=>"string"==typeof e?e:null)(e),o=(e=>"object"==typeof e?e:null)(e),c=async()=>{var e,o,c,h;let p=null;const m={avDocument:null};if(-1===(null==s?void 0:s.indexOf(".xml"))&&-1===(null==s?void 0:s.indexOf(".php")))try{var y,b;const e=await a().get(s);null!=e&&null!=(y=e.data)&&y.avPlusInfos&&(m.avPlusInfos=e.data,p=e.data.avPlusInfos.avCustomUrl),null!=e&&null!=(b=e.data)&&b.galleryInfos&&(m.galleryInfos=e.data,p=e.data.galleryInfos.avCustomUrl)}catch(S){console.error("Upps something went wrong",null==S?void 0:S.message)}try{const e=await a().get(p||s);i=w.parse(e.data)}catch(S){console.error(`Upps something went wrong. Cannot fetch playerXml with url ${p||s} inside => useGetPlayerData ${null==S?void 0:S.message}`)}if(!i)return;if(null!=(e=i)&&e.rss){const e=u(n,i);i.avDocument=e.currentAv,m.multimediagallery=e}else if(null!=(o=i)&&o.multimediagallery){try{i.avDocument=i.multimediagallery.avDocuments.avDocument[n.index||0],i.avDocument||(i.avDocument=i.multimediagallery.avDocuments.avDocument)}catch(C){return void console.error("Multimediagallery missing AV Documents")}m.mmgInfos=(e=>{var t,n;const r=[];return null!=(t=e.avDocuments)&&t.avDocument.length&&(null==(n=e.avDocuments)?void 0:n.avDocument.length)>1&&e.avDocuments.avDocument.map(((e,t)=>{var n;const i={urlScheme:(null==(n=e.teaserimages)||null==(n=n.teaserimageResponsive)?void 0:n.url)||""},a={title:e.title,url:e.avcustomUrl,teaserText:e.teaserText,image:i,assets:e.assets,type:e.type,transmissionType:e.transmissionType};r.push(a)})),r})(i.multimediagallery),m.multimediagallery=u(n,i),i.avDocument.topline=m.multimediagallery.title}if(null!=(c=i)&&null!=(c=c.avDocument)&&c.relatedVideosUrl){var _;const e=await a().get(null==(_=i.avDocument)?void 0:_.relatedVideosUrl);m.mmgInfos=(e=>{const t=[],n=(new DOMParser).parseFromString(e,"text/html").querySelectorAll(".box");for(let a=0;a0){const e=n.forceAudio,t=(-1!==document.location.href.indexOf("stg2.")?"https://stg2.mdr.de":"https://www.mdr.de")+`/${e}-avCustom.xml`,r=await a().get(t);m.avDocument=w.parse(r.data).avDocument}const T=Object.assign({},i,m);d(T),f((0,l.hi)(T)),g((0,l.oX)(t,T,n.client)),v(!1),n.onDataLoaded&&n.onDataLoaded(T)};if(s)c();else try{d(o),f((0,l.hi)(o)),g((0,l.oX)(t,o,n.client)),v(!1)}catch(h){}}),[e,i]);return{data:c,mediaCollection:h,playerConfiguration:p,isLoading:m,isError:y}}},6206:(e,t,n)=>{"use strict";n.d(t,{g:()=>Tu});var r=n(4041);const i=(0,r.createContext)(null),a=(0,r.createContext)(null),s=()=>(0,r.useContext)(i),o=()=>(0,r.useContext)(a);var l=n(4022),u=n(4947),c=n.n(u);const d=(e,t)=>{const[n,i]=(0,r.useState)(!l.A.ardPlayerLoaded),[a,s]=(0,r.useState)(!1);(0,r.useEffect)((()=>{!0===l.A.ardPlayerLoaded?i(!1):(async()=>{if(!0!==l.A.ardPlayerLoaded){try{await Promise.all([c().css(t),c().js(e)]),l.A.ardPlayerLoaded=!0}catch(n){s(!0)}i(!1)}})()}),[e]);return{isLoading:n,isError:a}};let h=function(e){return e.RECONFIGURE="Player.RECONFIGURE",e.CONFIG_READY="Player.CONFIG_READY",e.EVENT_INIT="Player.EVENT_INIT",e.EVENT_READY="Player.EVENT_READY",e.EVENT_STATUS_CHANGE="Player.EVENT_STATUS_CHANGE",e.EVENT_QUALITY_CHANGE="Player.EVENT_QUALITY_CHANGE",e.EVENT_MEDIUM_CHANGE="Player.EVENT_MEDIUM_CHANGE",e.EVENT_ERROR="Player.EVENT_ERROR",e.EVENT_LOAD_STREAM="Player.EVENT_LOAD_STREAM",e.EVENT_STREAM_LOADED="Player.EVENT_STREAM_LOADED",e.EVENT_INITIAL_FRAME="Player.EVENT_INITIAL_FRAME",e.EVENT_PLAY_STREAM="Player.EVENT_PLAY_STREAM",e.EVENT_AUTOPLAY_STREAM_PROHIBITED="Player.EVENT_AUTOPLAY_STREAM_PROHIBITED",e.EVENT_END_STREAM="Player.EVENT_END_STREAM",e.EVENT_PAUSE_STREAM="Player.EVENT_PAUSE_STREAM",e.EVENT_SEEK_START="Player.EVENT_SEEK_START",e.EVENT_SEEK_START_INTENT="Player.EVENT_SEEK_START_INTENT",e.EVENT_SEEK_END="Player.EVENT_SEEK_END",e.EVENT_STOP_STREAM="Player.EVENT_STOP_STREAM",e.EVENT_BUFFERING="Player.EVENT_BUFFERING",e.EVENT_DVR_CHANGE="Player.EVENT_DVR_CHANGE",e.PLAYBACK_RATE_CHANGE="Player.PLAYBACK_RATE_CHANGE",e.EVENT_UPDATE_STREAM_TIME="Player.EVENT_UPDATE_STREAM_TIME",e.EVENT_UPDATE_STREAM_DURATION="Player.EVENT_UPDATE_STREAM_DURATION",e.EVENT_KEYBOARD_RELEASE="Player.EVENT_KEYBOARD_RELEASE",e.EVENT_CTRLBAR_FADEOUT="Player.EVENT_CTRLBAR_FADEOUT",e.EVENT_CTRLBAR_FADEIN="Player.EVENT_CTRLBAR_FADEIN",e.EVENT_SHOW_OPTIONS="Player.EVENT_SHOW_OPTIONS",e.VIEW_RESTORE_DEFAULTS="Player.VIEW_RESTORE_DEFAULTS",e.SETUP_VIEW="Player.SETUP_VIEW",e.SETUP_VIEW_COMPLETE="Player.SETUP_VIEW_COMPLETE",e.VIEWPORT_RESIZE="Player.VIEWPORT_RESIZE",e.TOGGLE_FULLSCREEN="Player.TOGGLE_FULLSCREEN",e.AUDIO_TRACK_LIST_CHANGED="Player.AUDIO_TRACK_LIST_CHANGED",e.CURRENT_AUDIO_TRACK_CHANGED="Player.CURRENT_AUDIO_TRACK_CHANGED",e.MATURITY_LOGIN="Player.MATURITY_LOGIN",e.BACK_BUTTON_PRESSED="Player.BACK_BUTTON_PRESSED",e.EMBED_BUTTON_PRESSED="Player.EMBED_BUTTON_PRESSED",e.POSTER_FRAME_PRESSED="Player.POSTER_FRAME_PRESSED",e.STICKY_STATE_CHANGED="Player.STICKY_STATE_CHANGED",e.TITLE_TEXT_CLICKED="Player.TITLE_TEXT_CLICKED",e.REMOTE_PLAYBACK_CHANGED="Player.REMOTE_PLAYBACK_CHANGED",e.PIP_CHANGE_REQUEST="Player.PIP_CHANGE_REQUEST",e.PIP_STATUS_CHANGE="Player.PIP_STATUS_CHANGE",e}({}),f=function(e){return e.IA_MOUSE_SUBTITLE_ACTIVATION="ia_mouse_subtitle_activation",e.IA_MOUSE_SUBTITLE_DEACTIVATION="ia_mouse_subtitle_deactivation",e.IA_MOUSE_VOLUME_MUTE="ia_mouse_volume_mute",e.IA_MOUSE_VOLUME_UNMUTE="ia_mouse_volume_unmute",e.IA_MOUSE_VOLUME_CHANGE="ia_mouse_volume_change",e.IA_MOUSE_SCRUBBAR_CHANGE_POSITION_FORWARD="ia_mouse_scrubbar_change_position_forward",e.IA_MOUSE_SCRUBBAR_CHANGE_POSITION_REWIND="ia_mouse_scrubbar_change_position_rewind",e.IA_MOUSE_SCRUBBAR_CHANGE_POSITION_REWIND_TIMESHIFT="ia_mouse_scrubbar_change_position_rewind_timeshift",e.IA_MOUSE_FULLSCREEN_ACTIVATION_BUTTON="ia_mouse_fullscreen_activation_button",e.IA_MOUSE_FULLSCREEN_DEACTIVATION_BUTTON="ia_mouse_fullscreen_deactivation_button",e.IA_MOUSE_PLAY_BUTTON="ia_mouse_play_button",e.IA_MOUSE_PLAY_VIEWPORT="ia_mouse_play_viewport",e.IA_MOUSE_PAUSE_BUTTON="ia_mouse_pause_button",e.IA_MOUSE_PAUSE_VIEWPORT="ia_mouse_pause_viewport",e.IA_MOUSE_PLAY_AGAIN_BUTTON="ia_mouse_play_again_button",e.IA_MOUSE_PLAY_AGAIN_VIEWPORT="ia_mouse_play_again_viewport",e.IA_MOUSE_QUALITY_CHANGE="ia_mouse_quality_change",e.IA_KEY_SUBTITLE_ACTIVATION="ia_key_subtitle_activation",e.IA_KEY_SUBTITLE_DEACTIVATION="ia_key_subtitle_deactivation",e.IA_KEY_AUDIODESCRIPTION_ACTIVATION="ia_key_audiodescription_activation",e.IA_KEY_AUDIODESCRIPTION_DEACTIVATION="ia_key_audiodescription_deactivation",e.IA_KEY_SIGN_LANGUAGE_ACTIVATION="ia_key_sign_language_activation",e.IA_KEY_SIGN_LANGUAGE_DEACTIVATION="ia_key_sign_language_deactivation",e.IA_KEY_VOLUME_MUTE="ia_key_volume_mute",e.IA_KEY_VOLUME_UNMUTE="ia_key_volume_unmute",e.IA_KEY_VOLUME_CHANGE="ia_key_volume_change",e.IA_KEY_SCRUBBAR_CHANGE_POSITION_FORWARD="ia_key_scrubbar_change_position_forward",e.IA_KEY_SCRUBBAR_CHANGE_POSITION_REWIND="ia_key_scrubbar_change_position_rewind",e.IA_KEY_SCRUBBAR_CHANGE_POSITION_REWIND_TIMESHIFT="ia_key_scrubbar_change_position_rewind_timeshift",e.IA_KEY_PLAY="ia_key_play",e.IA_KEY_PAUSE="ia_key_pause",e.IA_KEY_PLAY_AGAIN="ia_key_play_again",e.IA_KEY_QUALITY_CHANGE="ia_key_quality_change",e.STREAM_LOAD="stream_load",e.INTERACTION_INITIAL_PLAY="interaction_initial_play",e.CLIP_ENDED="clip_ended",e.SHARE="share",e.STREAM_ERROR="Stream_error",e.PLAYER_LOADING="player_loading",e.PLAYER_UNLOAD="player_unloading",e.SUPER_SUBTITLE_ACTIVATION="super_subtitle_activation",e.SUPER_SUBTITLE_DEACTIVATION="super_subtitle_deactivation",e.SUPER_SUBTITLE_UNAVAILABLE="super_subtitle_unavailable",e.SUPER_AUDIODESCRIPTION_ACTIVATION="super_audiodescription_activation",e.SUPER_AUDIODESCRIPTION_DEACTIVATION="super_audiodescription_deactivation",e.SUPER_AUDIODESCRIPTION_UNAVAILABLE="super_audiodescription_unavailable",e.SUPER_AUDIOSTREAM_CHANGE="super_audiostream_change",e.SUPER_SIGN_LANGUAGE_ACTIVATION="super_sign_language_activation",e.SUPER_SIGN_LANGUAGE_DEACTIVATION="super_sign_language_deactivation",e.SUPER_SIGN_LANGUAGE_UNAVAILABLE="super_sign_language_unavailable",e.SUPER_VOLUME_MUTE="super_volume_mute",e.SUPER_VOLUME_UNMUTE="super_volume_unmute",e.SUPER_VOLUME_CHANGE="super_volume_change",e.SUPER_SCRUBBAR_CHANGE_POSITION_FORWARD="super_scrubbar_change_position_forward",e.SUPER_SCRUBBAR_CHANGE_POSITION_REWIND="super_scrubbar_change_position_rewind",e.SUPER_FULLSCREEN_ACTIVATION="super_fullscreen_activation",e.SUPER_FULLSCREEN_DEACTIVATION="super_fullscreen_deactivation",e.SUPER_PLAY="super_play",e.SUPER_PAUSE="super_pause",e.SUPER_REPLAY="super_replay",e.SUPER_INITIAL_PLAY="super_initial_play",e.SUPER_QUALITY_CHANGE="super_quality_change",e.SUPER_BACK_TO_LIVE="super_back_to_live",e.SUPER_DVR_ACTIVE="super_dvr_active",e.SUPER_PLAYHEAD_POSITION="super_playhead_position",e.JUMPMARK_SELECT="jumpmark_select",e}({});var p=n(1238),g=n(2968);const m=p.Ay.div.withConfig({displayName:"ARDPlayerStyle__Wrapper",componentId:"sc-b5wlph-7"})(["position:",";width:100%;height:",";top:0;left:0;padding-top:",";}.ardplayer-posterframe{background-color:#000;}.ardplayer-select select{color:#fff !important;}"," ",""],(e=>e.position?e.position:"absolute"),(e=>e.height?e.height:"100%"),(e=>e.ratio?e.ratio:"0"),(e=>"kika"===e.theme.global.client&&(0,p.AH)(["h2,h3,p{color:#fff;}.ardplayer-chip{background-color:",";}.ardplayer-state-completed .ardplayer-center .ardplayer-buttons-main{display:block;transform:scale(2.5);}"],e.theme.player.mainColor)),(e=>"full"===e.mode&&(0,p.AH)(["padding-top:0;position:relative;display:flex;align-items:center;justify-content:center;margin:0 auto;background-color:rgba(0,0,0,0.8);width:calc(100vw);max-width:calc(1.77778 * (100vh - ","px));height:100%;max-height:100%;"],e.frameHeight))),v=p.Ay.div.withConfig({displayName:"ARDPlayerStyle__PlayerContainer",componentId:"sc-b5wlph-8"})(["position:absolute !important;top:0;left:0;width:100%;opacity:",";&.ardplayer.ardplayer-state-audio-inline{background-color:rgba(0,0,0,0.5);max-height:48px;min-height:128px !important;margin-top:auto;top:auto;bottom:0;opacity:0;visibility:hidden;pointer-events:none;.ardplayer-posterbackdrop,.ardplayer-audio{display:none !important;}.ardplayer-footer{display:none;}.ardplayer-buffering{left:50%;top:50%;margin-left:-36px;margin-top:-36px;position:absolute;}}&.reinit-ardplayer{*,*:before{animation-duration:1s !important;}}",""],(e=>e.opacity?e.opacity:null),(e=>"full"===e.mode&&(0,p.AH)(["position:relative !important;"]))),y=p.Ay.button.withConfig({displayName:"ARDPlayerStyle__PreviewPlayerWrapper",componentId:"sc-b5wlph-9"})([""]);var b=n(5655);const w=(0,p.i7)(["from{opacity:0;}to{opacity:1;}"]),_=p.Ay.div.withConfig({displayName:"ARDAudioPlayerStyle__PlayerControls",componentId:"sc-dknhcg-2"})(["width:100%;position:absolute;display:flex;bottom:0;flex-direction:column;padding:0.5rem;padding-top:1.25rem;overflow:hidden;background-color:",";height:",";",""],(({bgColor:e})=>e||g.Jy.blue),(({height:e})=>e||null),(({solid:e})=>e&&(0,p.AH)(["position:relative;flex-direction:row;padding:0.5rem;height:auto;"]))),E=p.Ay.div.withConfig({displayName:"ARDAudioPlayerStyle__PlayerControlsTop",componentId:"sc-dknhcg-3"})(["position:relative;display:flex;height:100%;align-items:center;justify-content:center;margin-right:",";z-index:",";"],(({marginRight:e})=>e||0),(({zIndex:e})=>e||null)),T=p.Ay.div.withConfig({displayName:"ARDAudioPlayerStyle__PlayerControlsBottom",componentId:"sc-dknhcg-4"})(["width:100%;position:relative;display:flex;align-items:center;justify-content:flex-start;overflow:",";pointer-events:",";z-index:",";"],(({overflow:e})=>e||null),(({pointerEvents:e})=>e||null),(({zIndex:e})=>e||null)),S=p.Ay.div.withConfig({displayName:"ARDAudioPlayerStyle__RightMenu",componentId:"sc-dknhcg-5"})(["position:absolute;right:0.5rem;top:0;height:100%;cursor:pointer;z-index:1;display:flex;align-items:center;background-color:",";"],(({bgColor:e})=>e||g.Jy.blue)),C=p.Ay.button.withConfig({displayName:"ARDAudioPlayerStyle__StreamButton",componentId:"sc-dknhcg-7"})(["color:",";display:flex;width:100%;align-items:center;text-align:start;padding:0.75rem;transition:all 0.5s ease 0s;cursor:pointer;"," ",""],(({color:e})=>e||g.Jy.blue),(({active:e})=>e&&(0,p.AH)(["background-color:",";"],(({activeBgColor:e})=>e||"rgba(35, 92, 122, 0.1)"))),!(0,b.CN)()&&(0,p.AH)(["&:hover{background-color:",";}"],(({activeBgColor:e})=>e||"rgba(35, 92, 122, 0.1)"))),x=p.Ay.ul.withConfig({displayName:"ARDAudioPlayerStyle__StreamLayer",componentId:"sc-dknhcg-8"})(["position:absolute;left:0;top:0;height:auto;width:",";background-color:",";z-index:2;box-shadow:0px 5px 12px 0px rgb(0,0,0,0.5);"],(({width:e})=>e||"100%"),(({bgColor:e})=>e||g.Jy.blue)),A=p.Ay.div.withConfig({displayName:"ARDAudioPlayerStyle__MarqueeWrapper",componentId:"sc-dknhcg-10"})(["display:flex;position:relative;white-space:nowrap;transition:all "," linear;transform:",";"],(({time:e})=>e||"1s"),(({transform:e})=>e||null)),k=p.Ay.div.withConfig({displayName:"ARDAudioPlayerStyle__MarqueeItem",componentId:"sc-dknhcg-11"})(["display:flex;margin:0 1rem 0 0;height:100%;position:relative;animation:"," 0.6s ease-out;animation-fill-mode:forwards;color:",";"],w,(({color:e})=>e||null));var D=n(483),L=n(9067),R=n.n(L),P=function(){function e(e,t){for(var n=0;ne.bgColor?e.bgColor:"#fff"),(e=>e.border?e.border:"0"),(e=>e.width?e.width:"auto"),(e=>e.height?e.height:"auto"),(e=>e.pos?e.pos:"0")),V=e=>(0,U.jsx)($,Object.assign({},e));var H=n(8383);const z=p.Ay.div.withConfig({displayName:"styles__Wrapper",componentId:"sc-hl3bao-0"})(["position:relative;width:100%;height:100%;display:flex;align-items:center;cursor:pointer;transition:all 0.3s ease-out;.ardplayer-progress-wrapper{transition:all 0.3s ease-out;}",""],!(0,b.CN)()&&(0,p.AH)(["&:hover .ardplayer-progress-wrapper{transform:scaleY(1.25);}"])),G=p.Ay.div.withConfig({displayName:"styles__ProgressbarWrapper",componentId:"sc-hl3bao-1"})(["position:relative;width:100%;display:flex;height:100%;align-items:center;"]),W=p.Ay.div.withConfig({displayName:"styles__OuterWrapper",componentId:"sc-hl3bao-2"})(["position:relative;width:100%;height:2rem;display:flex;align-items:center;"," "," &.volumeVisible{pointer-events:auto;opacity:1;transform:scale(1,1);.ardplayer-progress-drag{transform:scale(1,1);transition-delay:.2s;}}"],(e=>e.small&&(0,p.AH)(["transform:none;border-radius:0;height:0.5rem;"])),(({variant:e,bgColor:t})=>e&&"volume"===e&&(0,p.AH)(["width:102px;height:100%;background-color:",";left:48px;top:0;position:absolute;pointer-events:none;transition:transform 0.3s ease-out;transform:scale(0,1);opacity:1;padding:0 1rem 0 0;transform-origin:0 0;.ardplayer-progress-drag{transform:scale(0,0);transition:transform 0.3s ease-out;}"],(()=>t||"")))),q=p.Ay.div.withConfig({displayName:"styles__Background",componentId:"sc-hl3bao-3"})(["position:relative;width:100%;border-radius:0.5rem;display:flex;align-items:center;background-color:",";overflow:hidden;height:",";transition:all 0.3s ease-out;"," ",""],(e=>e.bgColor?e.bgColor:"rgba(0,0,0,.1)"),(e=>e.barHeight?e.barHeight:"0.25rem"),(e=>e.variant&&"volume"===e.variant&&(0,p.AH)(["height:0.125rem;"])),(e=>e.small&&(0,p.AH)(["transform:none;border-radius:0;"]))),Y=p.Ay.div.withConfig({displayName:"styles__Progress",componentId:"sc-hl3bao-4"})(["position:relative;width:0;height:100%;background-color:",";"],(e=>e.bgColor?e.bgColor:"#235c7a")),K=p.Ay.div.withConfig({displayName:"styles__ProgressDrag",componentId:"sc-hl3bao-5"})(["display:block;position:absolute;height:14px;width:14px;top:50%;border-radius:50%;margin:-7px 0 0 -7px;left:0;background-color:",";"],(e=>e.bgColor?e.bgColor:"#235c7a")),X=p.Ay.span.withConfig({displayName:"styles__CurrentTimeHover",componentId:"sc-hl3bao-6"})(["position:absolute;left:0;pointer-events:none;font-size:0.8125rem;top:-42px;color:#fff;background-color:",";padding:0.25rem 0.5rem;border-radius:0.5rem;transform:translate3d(-50%,0,0);opacity:0;transition:opacity 0.3s ease-out;&:after{display:block;content:' ';position:absolute;height:30px;width:1px;border-right:2px solid ",";left:calc(50% - 2px);top:100%;}&.animation-enter{opacity:0;}&.animation-enter-active,&.animation-enter-done{opacity:1;}&.animation-exit{opacity:0;}&.animation-exit-active{opacity:0;}",""],(e=>g.Jy.default),(e=>e.bgColor?e.bgColor:g.Jy.default),(e=>"podcast"===e.variant&&(0,p.AH)(["top:-1rem;&:after{display:none;}"]))),Q=e=>{const t=(0,r.useRef)(null),n=(0,r.useRef)(null);let i=!1;const[a,s]=(0,r.useState)(null),[o,l]=(0,r.useState)(null),[u,c]=(0,r.useState)(!1),[d,h]=(0,r.useState)(!1),[f,p]=(0,r.useState)(null),[g,m]=(0,r.useState)(!1),v=(e,t)=>{let r;if(null!=n&&n.current){const i=n.current.getBoundingClientRect().width;et.getBoundingClientRect().width-i/2&&(r=t.getBoundingClientRect().width-i/2)}return r||e},y=n=>{const r=t.current,a=n.srcEvent.type,o=n.srcEvent.clientX-r.getBoundingClientRect().left,u=n.srcEvent.clientY-r.getBoundingClientRect().top,d=n.srcEvent.clientY-(r.getBoundingClientRect().top+r.getBoundingClientRect().height),f=Math.max(0,o),g=f>r.getBoundingClientRect().width;let y=0;const b=-1!==["pointerup","touchend","mouseup"].indexOf(a);!1===i&&e.onProgressDown&&e.onProgressDown(),i=!0;let w=f;f<0&&(w=0),g&&(w=r.getBoundingClientRect().width),y=w/r.getBoundingClientRect().width,s(100*y+"%"),m(!b),"volume"===e.variant&&e.onProgressChanged&&(h(!0),e.onProgressChanged(y)),l(v(w,r)),p(w/r.getBoundingClientRect().width),!0===b&&(i=!1,e.onProgressChanged&&e.onProgressChanged(y),e.onProgressUp&&e.onProgressUp(),m(!1),c(!1),"volume"===e.variant&&(o<0||f>r.getBoundingClientRect().width+16||u<0||d>0)&&h(!1))};if(!1===e.active)return(0,U.jsx)(W,{variant:e.variant,small:e.small,ref:t,children:(0,U.jsx)(q,{barHeight:e.barHeight,bgColor:e.bgColor,variant:e.variant,small:e.small})});const w=`${0===e.progress?"160":e.progress>.5?"15e":"15f"};`;return(0,U.jsxs)(G,{onMouseMove:()=>{"volume"===e.variant&&h(!0)},onMouseLeave:()=>{"volume"===e.variant&&h(!1)},children:["volume"===e.variant&&(0,U.jsx)("button",{type:"button",style:{cursor:"pointer",backgroundColor:"transparent"},onClick:()=>{e.onProgressChanged(e.progress>0?0:1,!0)},children:(0,U.jsx)(H.N,{color:e.progressColor,height:"48px",width:"48px",code:w})}),(0,U.jsx)(W,{className:d?"volumeVisible":"",variant:e.variant,small:e.small,ref:t,bgColor:e.wrapperBgColor,children:(0,U.jsx)(B,{onPress:y,onMouseOut:e=>{if(g)return!1;c(!1)},onMouseMove:e=>{if(g)return!1;const n=t.current,r=Math.max(0,e.pageX-n.getBoundingClientRect().left),i=v(r,n);l(i),c(!0),p(r/n.getBoundingClientRect().width)},onPan:y,onTap:y,children:(0,U.jsxs)(z,{children:["volume"!==e.variant?(0,U.jsx)(j.A,{in:u,timeout:600,classNames:"animation",children:(0,U.jsx)(X,{variant:e.variant,ref:n,bgColor:e.progressColor,style:{left:o},children:(0,b.tr)(f*e.duration)})}):null,(0,U.jsx)(q,{style:{pointerEvents:"none"},className:"ardplayer-progress-wrapper",bgColor:e.bgColor,variant:e.variant,small:e.small,barHeight:e.barHeight,children:(0,U.jsx)(Y,{bgColor:e.progressColor,style:{width:g?a:100*e.progress+"%"}})}),(0,U.jsx)(K,{className:"ardplayer-progress-drag",bgColor:e.progressColor,style:{left:g?a:100*e.progress+"%"}}),(()=>{const n=t.current,r=[];return e.jumpmarks?(e.jumpmarks.chapterArray.map(((t,i)=>{if(e.duration&&e.duration>0){const i=t.chapterTime/e.duration;r.push((0,U.jsx)(V,{width:"0.5rem",height:"0.5rem",pos:i*n.getBoundingClientRect().width+"px"}))}})),r):null})()]})})})]})};var J=n(8014),Z=n(8400);const ee=p.Ay.button.withConfig({displayName:"ControlsButton__Wrapper",componentId:"sc-1jd0l7-0"})(["background-color:",";cursor:pointer;height:",";width:",";min-height:",";min-width:",";text-align:center;line-height:1.875em;bottom:0;top:auto;display:flex;align-items:center;justify-content:center;margin:",";border-radius:50%;border:",";",""],(e=>e.bgColor?e.bgColor:"transparent"),(e=>e.height?e.height:"44px"),(e=>e.width?e.width:"44px"),(e=>e.minHeight?e.minHeight:"44px"),(e=>e.minWidth?e.minWidth:"44px"),(e=>e.margin?e.margin:"0"),(e=>e.border&&!e.bgColor?e.border:"0"),!(0,b.CN)()&&(0,p.AH)(["&:hover{background-color:",";}"],(({activeBgColor:e})=>e||"rgba(35, 92, 122, 0.1)"))),te=e=>(0,U.jsx)(ee,Object.assign({},e,{onClick:e.onClick,title:e.label||null,type:"button",children:(()=>{if(!0===e.isLoading)return(0,U.jsx)(Z.ps,{bgColor:e.color});return e.icon===g.FI.play?(0,U.jsx)(H.N,{color:e.color,width:e.width||"2rem",height:e.height||"2rem",code:""}):e.icon===g.FI.pause?(0,U.jsx)(H.N,{color:e.color,width:e.width||"2rem",height:e.height||"2rem",code:""}):(0,U.jsx)(J.I,{fontSize:e.fontSize,width:e.fontSize||"2rem",height:e.fontSize||"2rem",color:e.color,code:e.icon})})()})),ne=p.Ay.button.withConfig({displayName:"PlaybackRateButton__Wrapper",componentId:"sc-2xlq6v-0"})(["background:none;cursor:pointer;text-align:center;line-height:1.875em;top:auto;display:flex;align-items:center;justify-content:center;padding:0 0.5rem;margin:",";border-radius:1rem;border:",";height:",";"],(e=>e.margin?e.margin:"0"),(e=>e.border?e.border:"0"),(e=>e.size?e.size:"auto")),re=p.Ay.span.withConfig({displayName:"PlaybackRateButton__CurrentRate",componentId:"sc-2xlq6v-1"})(["color:",";"],(e=>e.color?e.color:"#fff")),ie=e=>(0,U.jsx)(ne,Object.assign({},e,{title:"Abspielgeschwindigkeit \xe4ndern",type:"button",children:(0,U.jsxs)(re,{color:e.color,children:[e.currentRate,"x"]})}));var ae=n(6660),se=n.n(ae),oe=n(8649);const le=p.Ay.div.withConfig({displayName:"SharingStyle__ServicesWrapper",componentId:"sc-aol3sa-1"})(["position:",";display:flex;align-items:center;justify-content:center;left:",";top:",";z-index:1;width:auto;background-color:",";height:2.75rem;border-radius:25px;"],(({position:e})=>e||"absolute"),(({isSmall:e})=>e?"0":"3.25rem"),(({isSmall:e})=>e?"0":"0.125rem"),(({backgroundColor:e})=>e||"#fefefe")),ue=p.Ay.div.withConfig({displayName:"AnimationStyle__FadeAnimationStyle",componentId:"sc-2op9ci-0"})(["transition:opacity 0.3s ease-out;opacity:0;&.animation-enter{opacity:0;}&.animation-enter-active,&.animation-enter-done{opacity:1;}&.animation-exit{opacity:0;}&.animation-exit-active{opacity:0;}"]),ce=e=>(0,U.jsx)(j.A,{unmountOnExit:e.unmountOnExit||!0,appear:e.active,in:e.active,timeout:!1===e.active?500:0,classNames:"animation",children:(0,U.jsx)(ue,{children:e.children})});var de=n(8090);const he=e=>{const[t,n]=(0,r.useState)(!1),i=[];const a=t=>{const n=encodeURIComponent(e.shareUrl);let r=encodeURIComponent(e.title);const i=`//www.facebook.com/sharer.php?u=${n}&t=${r}`,a=`//twitter.com/intent/tweet?text=${r}&url=${n}`,s=function(){const e=navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?`https://wa.me/?text=${r} - ${n}`:`https://web.whatsapp.com/send?text=${r} - ${n}`,o=document.querySelector('[property="og:image"]'),l=document.querySelector('[property="og:title"]');let u="",c="";o&&o.getAttribute("content")&&(u=encodeURIComponent(o.getAttribute("content"))),l&&l.getAttribute("content")&&(c=encodeURIComponent(l.getAttribute("content"))),"undefined"===r&&(r=c);const d=`//www.pinterest.de/pin/create/link/?url=${document.location.href}&media=${u}&description=${c}`,h={title:r,left:100,top:100,height:600,width:600,toolbar:"0",scroll:"1",status:"0",location:"0",resizable:"1",url:n};if("twitter"===t&&(h.url=a,(0,b.bP)(h)),"facebook"===t&&(h.url=i,(0,b.bP)(h)),"pinterest"===t&&(h.url=d,(0,b.bP)(h)),"whatsapp"===t&&(h.url=s,document.location.href=s),"mail"===t){const t=document.querySelector('[name="description"]');let i=e.teaserText;!i&&t&&(i=t.getAttribute("content")),i||(i="");const a="Link-Tipp: "+r,s=r+encodeURIComponent("\r\r"+i);h.url=n,document.location.href="mailto:?subject="+a+"&body=Link-Tipp: "+s+"%0D%0A%0D%0A"+n}((e,t,n,r)=>{null===t&&((t=document.createElement("A")).href=n,t.title=r);let i="",a="";switch(e){case"facebook":a="social_fv",i="Facebook";break;case"twitter":a="social_fw",i="Twitter";break;case"pinterest":a="social_pinterest",i="Pintersst";break;case"whatsapp":a="social_wa",i="Facebook";break;case"mail":a="social_mail",i="Mail";break;case"print":a="social_print",i="Print"}window.app&&a.length>0&&window.app.dispatchEvent(window.Application.EVENT_TRACKING,{name:"social",type:a,id:e,url:n,item:[null],platform:i})})(t,null,h.url,r)};e.services.map(((t,n)=>{i.push((t=>{let n="#000";"twitter"===t.type&&(n="#1da1f2"),"facebook"===t.type&&(n="#1877f2"),"pinterest"===t.type&&(n="#bd081c"),"whatsapp"===t.type&&(n="#5fad2f");let r="2.5rem",i="2rem";return"gallery"===e.variant&&(r="2rem",i="1.5rem"),(0,U.jsx)(oe.$,{variant:"icon",margin:"0 0.25rem",borderRadius:"50%",width:r,height:r,color:"#fff",fontSize:i,bgColor:n,border:"0",onClick:()=>{a(t.type)},icon:g.FI[t.type]},t.type)})(t))}));const s=()=>{n(!t)};return"gallery"===e.variant?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(de.az,{position:"absolute",right:"0",top:"-6px",children:(0,U.jsx)(ce,{active:t&&i.length>0,children:(0,U.jsxs)(le,{isSmall:e.isSmall,backgroundColor:"#000",children:[i,(0,U.jsx)(oe.$,{variant:"icon",margin:"0",borderRadius:"50%",width:"3rem",height:"3rem",color:"#000",fontSize:"2rem",bgColor:"transparent",border:"0",onClick:()=>{n(!1)},icon:g.FI.close})]})})}),(0,U.jsx)(oe.S,{padding:"0.5rem 1rem",height:"44px",width:"44px",borderRadius:"50%","aria-label":"Teilen",title:"Teilen",top:"0",focus:{outline:"0.125rem solid #fff"},backgroundColor:"rgba(0,0,0,.9)",onClick:s,children:(0,U.jsx)(J.I,{fontSize:"1.5rem",color:"#fff",code:t?g.FI.close:g.FI.share})})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oe.$,{position:"relative",borderRadius:"50%",right:"0",top:"0",margin:"0 1rem 0 .5rem",minWidth:"2.75rem",minHeight:"2.75rem",width:"2.75rem",height:"2.75rem",fontSize:"1.5rem",onClick:s,icon:t?g.FI.close:g.FI.share}),(0,U.jsx)(ce,{active:t&&i.length>0,children:(0,U.jsxs)(le,{isSmall:e.isSmall,children:[(0,U.jsx)(oe.$,{variant:"icon",margin:"0",borderRadius:"50%",width:"2.5rem",height:"2.5rem",color:"#000",fontSize:"2rem",bgColor:"transparent",border:"0",onClick:()=>{n(!1)},icon:g.FI.close}),i]})})]})};var fe=n(2586);const pe=e=>{const t=e.imgUrl||"";return(0,U.jsx)(fe.h,{noPreload:!0,position:"absolute",top:"0",left:"0",bgColor:"#000",type:"posterImage",url:t,imageVariant:"16x9",maxWidth:"100%",minWidth:"100%"})},ge=({width:e,variant:t})=>{var n,i,a,u,c,d,h,f,m,v,y,w;const L=(0,r.useContext)(p.Dx),{currentAv:R,config:P,onPlayerUrlUpdate:I,jumpmarks:O}=s(),{currentTime:M,volume:N,onVolumeChange:F,onTogglePlay:B,isBuffering:j,paused:$,duration:V,playbackRate:H,playbackRates:z,onPlaybackRateChange:G,playerApi:W,onSeek:q}=o(),Y=L.global;let K=L.player;const X="radiolivestream"===t,Z="live"===R.transmissionType,ee=P.livestreamConfig,ne=null==(n=P.livestreamConfig)?void 0:n.streams;X&&(K=L.radioLivestreamPlayer);const[re,ae]=(0,r.useState)(!1),oe=(0,r.useRef)(null),le=(0,r.useRef)(null),ue=(0,r.useRef)(null),[ce,de]=(0,r.useState)(null),[fe,ge]=(0,r.useState)(!1),[me,ve]=(0,r.useState)(!1),[ye,be]=(0,r.useState)("0"),[we,_e]=(0,r.useState)(null),Ee=(0,r.useRef)(null),Te=(0,r.useRef)(null),[Se,Ce]=(0,r.useState)([]),xe=(0,r.useRef)(0),Ae=!e||P.solid&&e<480||e<200,ke=P.id,De=()=>{var e,t;return(0,U.jsx)(k,{color:null==(e=K)?void 0:e.mainColor,children:(0,U.jsx)(D.A,{fontWeight:"bold",color:null==(t=K)?void 0:t.mainColor,children:ne[null==xe?void 0:xe.current].id})},`marqueItem-${null==xe?void 0:xe.current}`)},Le=async()=>{if(R.playList&&ne){ae(!1),de("0s"),Ce([]);const c=ne[null==xe?void 0:xe.current],d=!!c.klassikStyle,h=!!c.aktuellStyle;let f={data:{Songs:{}}};try{var e;f=await se().get(null==R||null==(e=R.playList)?void 0:e.cachedDataUrl.split(".xml").join(".json"))}catch(u){console.log("#error",u)}const p=[];if(p.push(De()),f.data)for(const e in f.data.Songs){const l=f.data.Songs[e];if("now"===l.status){var t,n,r,i,a,s,o;let e="",u="";(null==(t=l.title)?void 0:t.length)>0&&(e=l.title),"metadatentext"===c.titlefield&&(e=l.metadatentext),h&&(e=`Jetzt im Radio: ${e}`),(null==(n=l.subtitle)?void 0:n.length)>0&&(u=`- ${l.subtitle}`),(null==(r=l.interpret)?void 0:r.length)>0&&(u=`von ${l.interpret}`),d&&(l.komponist.length>0&&(u=`von ${l.komponist}`),l.interpret.length>0&&(u=`${u} mit ${l.interpret} jetzt bei ${c.id}`)),p.push((0,U.jsxs)(k,{color:null==(i=K)?void 0:i.mainColor,width:`${null==Ee||null==(a=Ee.current)?void 0:a.getBoundingClientRect().width}px`,children:[(0,U.jsx)(D.A,{margin:"0 .5rem 0 0",color:null==(s=K)?void 0:s.mainColor,children:e}),(0,U.jsx)(D.A,{color:null==(o=K)?void 0:o.mainColor,fontStyle:d?"normal":"italic",children:u})]},`marqueItem${l.title}`))}}Ce(p);let g=0;l.A.clearTimeout(oe.current),l.A.clearTimeout(le.current),l.A.clearTimeout(ue.current),oe.current=l.A.setTimeout((()=>{const e=null!=Te&&Te.current?Number(null==Te?void 0:Te.current.getBoundingClientRect().width):0;g=e/100,be("-100%"),de(`${g}s`),ae(!0),le.current=l.A.setTimeout((()=>{Ce([]),de("0s"),Ce([De()]),ae(!1),Le()}),1e3*g)}),2e3)}};(0,r.useEffect)((()=>{if(ne){try{const e=localStorage.getItem(ke);e&&(xe.current=Number(e))}catch(e){return}null!=l.A&&l.A.mdrReact&&null!=l.A&&l.A.mdrReact[ke]&&(xe.current=Number(null==l.A?void 0:l.A.mdrReact[ke]))}return Le(),()=>{l.A.clearTimeout(le.current),l.A.clearTimeout(oe.current),l.A.clearTimeout(ue.current)}}),[]),(0,r.useEffect)((()=>{O&&O.chapterArray.map(((e,t)=>{const n=O.chapterArray[t].chapterTime,r=O.chapterArray[t+1];let i=null;i=r?r.chapterTime:V,M>n&&M{var e;return null==(e=K)?void 0:e.mainColor},Pe=[],Ie=[];let Oe="Titelliste";ne&&ne[null==xe?void 0:xe.current]&&ne[null==xe?void 0:xe.current].playlistText&&(Oe=ne[null==xe?void 0:xe.current].playlistText);const Me=[{id:"popout",title:"Player in neuem Fenster \xf6ffnen"},{id:"info",title:"Streamlinks und Informationen"},{id:"playlist",title:Oe||"Titelliste"}];ne&&ne.map(((e,t)=>{var n,r;Pe.push((0,U.jsx)(C,{color:null==(n=K)?void 0:n.mainColor,activeBgColor:null==(r=K)?void 0:r.hoverColor,active:t===(null==xe?void 0:xe.current),onClick:()=>{const e=ne[t].url;I&&I(e),xe.current=t,ge(!1),null!=l.A&&l.A.mdrReact&&(l.A.mdrReact[ke]=String(t));try{localStorage.setItem(ke,String(t))}catch(n){console.error("error saving local station")}},children:e.stationname},`stream-selector-${t}`))})),Me.map(((e,t)=>{var n,r,i,a;const s={title:"Radioplayer",left:100,top:100,width:420,toolbar:"0",scroll:"1",status:"0",location:"0",resizable:"0",url:null==ee?void 0:ee.popoutUrl,height:(null==ne?void 0:ne.length)>1?50*ne.length:40};if("playlist"===e.id&&(null==R||null==(n=R.playList)||!n.htmlUrl))return null;Ie.push((0,U.jsxs)(C,{activeBgColor:null==(r=K)?void 0:r.hoverColor,color:null==(i=K)?void 0:i.mainColor,onClick:()=>{switch(e.id){case"popout":(0,b.bP)(s);break;case"info":document.location.href=null==R?void 0:R.htmlUrl;break;case"playlist":document.location.href=null==R?void 0:R.playList.htmlUrl}},children:[(0,U.jsx)(J.I,{margin:"0 .5rem 0 0",fontSize:"1.5rem",color:null==(a=K)?void 0:a.mainColor,code:g.FI[e.id]})," ",e.title]},`playeroptions-${t}`))}));let Ne=(null==(i=K)?void 0:i.bgColor)||"rgba(0,0,0,0.05)";return Z&&!X&&(Ne="transparent"),W?(0,U.jsxs)(U.Fragment,{children:[we?(0,U.jsx)(pe,{imgUrl:we}):null,(0,U.jsxs)(_,{ref:Ee,solid:P.solid||!1,bgColor:Ne,height:Ae?"100%":null,children:[(0,U.jsxs)(E,{zIndex:P.solid||X?2:null,marginRight:Ae?"0":"auto",children:[((e,t,n)=>{var r,i,a,s,o,l,u;const c=`0.25rem solid ${null==(r=K)?void 0:r.hoverColor}`;let d=!0===$?(null==Y||null==(i=Y.icons)?void 0:i.play)||g.FI.play:(null==Y||null==(a=Y.icons)?void 0:a.pause)||g.FI.pause;var h,f;Z&&(d=!0===$?(null==Y||null==(h=Y.icons)?void 0:h.play)||g.FI.play:(null==Y||null==(f=Y.icons)?void 0:f.stop)||g.FI.stop);let p=$?"Abspielen":"Pausieren";return Z&&(p=$?"Abspielen":"Stoppen"),(0,U.jsx)(te,{border:c,bgColor:(null==(s=K)?void 0:s.playerBgColor)||(null==(o=K)?void 0:o.bgColor),activeBgColor:null==(l=K)?void 0:l.hoverColor,color:null==(u=K)?void 0:u.mainColor,onClick:B,isLoading:j,icon:d,margin:"0",fontSize:t,width:n,height:n,label:p})})(0,"1.75rem","2.75rem"),P.hasSharing?(0,U.jsx)(he,{label:"Teilen",teaserText:null==R?void 0:R.teaserText,shareUrl:null==R?void 0:R.htmlUrl,title:null==R?void 0:R.title,isSmall:Ae,services:[{type:"facebook"},{type:"twitter"},{type:"pinterest"},{type:"whatsapp"},{type:"mail"}]}):null,Z||Ae?null:(0,U.jsx)(ie,{color:Re(),border:`2px solid ${Re()} `,margin:"0 0.5rem 0 .5rem",onClick:G,currentRate:z[H]}),!(0,b.CN)()&&(!Ae||X)&&(0,U.jsx)(Q,{wrapperBgColor:X||P.solid?Ne:null,variant:"volume",barHeight:"kika"===(null==(a=L.global)?void 0:a.client)?".5rem":null,active:!0,progressColor:Re(),duration:1,bgColor:X?"rgba(0,0,0,.1)":"rgba(255,255,255,.1)",onProgressChanged:F,progress:N/1})]}),Z?null:(0,U.jsxs)(T,{zIndex:1,children:[!Ae&&(0,U.jsx)(D.A,{color:Re(),variant:"playerText",margin:"0 1rem 0 0",children:(0,b.tr)(M)}),(0,U.jsx)(Q,{variant:"podcast",wrapperBgColor:P.solid?Ne:null,barHeight:"kika"===(null==(Fe=L.global)?void 0:Fe.client)?".5rem":null,active:!0,jumpmarks:O,bgColor:"rgba(255,255,255,.1)",progressColor:Re(),duration:V,onProgressChanged:q,progress:M/V}),!Ae&&(0,U.jsx)(D.A,{color:Re(),variant:"playerText",margin:"0 0 0 1rem",children:(0,b.tr)(V)})]}),X&&(0,U.jsx)(T,{overflow:"hidden",pointerEvents:"none",children:(0,U.jsx)(A,{transform:re?`translate3d(${ye},0,0)`:"translate3d(0,0,0)",time:ce,ref:Te,children:Se||null})})]}),ne?(0,U.jsxs)(S,{bgColor:null==(u=K)?void 0:u.bgColor,children:[Pe.length>1?(0,U.jsx)(te,{label:"Livestreamchannels",height:"2rem",width:"2rem",alignItems:"center",activeBgColor:null==(c=K)?void 0:c.hoverColor,bgColor:null==(d=K)?void 0:d.bgColor,fontSize:"1rem",color:null==(h=K)?void 0:h.mainColor,icon:fe?g.FI.arrowUp:g.FI.arrowDown,onClick:()=>{ge(!fe)}}):null,(0,U.jsx)(te,{icon:me?g.FI.close:g.FI.menu,bgColor:null==(f=K)?void 0:f.bgColor,color:null==(m=K)?void 0:m.mainColor,activeBgColor:null==(v=K)?void 0:v.hoverColor,height:"2rem",label:"weitere Optionen",width:"2rem",fontSize:"1.5rem",onClick:()=>{ve(!me)}})]}):null,fe?(0,U.jsx)(x,{width:"calc(100% - 6.75rem)",bgColor:null==(y=K)?void 0:y.bgColor,children:Pe}):null,me?(0,U.jsx)(x,{width:"calc(100% - 3.75rem)",bgColor:null==(w=K)?void 0:w.bgColor,children:Ie}):null]}):null;var Fe};var me=n(5143),ve=n(3144),ye=n(7999);const be=({width:e})=>{const{currentTime:t,onTogglePlay:n,isBuffering:i,duration:a,playerApi:l,onSeek:u}=o(),{currentAv:c}=s(),d=(0,r.useContext)(p.Dx).podcastPlayer,h="3rem",f="4rem";let m=e<480;window&&window.innerWidth<768&&(m=!0);const v=(e,t)=>(0,U.jsx)(ye.ZY,{width:t,height:t,hoverColor:d.hoverColor,onClick:()=>{u(e?l.getCurrentTime()+15:l.getCurrentTime()-15,!1,"seconds")},children:(0,U.jsx)(J.I,{width:t,height:t,fontSize:t,color:d.activeColor,code:!1===e?g.FI.skipRew:g.FI.skipFwd})}),y=e=>(0,U.jsx)(U.Fragment,{children:v(e,m?h:f)}),w=m?"4rem":"6rem",_=m?h:f;return(0,U.jsxs)(ye.qz,{children:[(0,U.jsxs)(ye.f$,{children:[y(!1),((e,t,r)=>{const a=`0.25rem solid ${d.activeColor}`;return(0,U.jsx)(te,{border:a,activeBgColor:d.hoverColor,color:d.activeColor,onClick:n,isLoading:i,icon:!0!==(null==l?void 0:l.isPlaying)?g.FI.play:g.FI.pause,margin:e?"0 0.5rem":"0 1rem",fontSize:t,width:r,height:r,label:!0!==(null==l?void 0:l.isPlaying)?"Abspielen":"Pausieren"})})(m,_,w),y(!0)]}),(0,U.jsxs)(ye.Tz,{children:[(0,U.jsx)(D.A,{color:d.mainColor,variant:"playerText",margin:"0 1rem 0 0",children:(0,b.tr)(t)}),(0,U.jsx)(Q,{variant:"podcast",active:!0,progressColor:d.activeColor,duration:a,bgColor:"rgba(0,0,0,.1)",onProgressChanged:u,progress:t/a}),(0,U.jsx)(D.A,{color:d.mainColor,variant:"playerText",textAlign:"right",margin:"0 0 0 1rem",children:a?(0,b.tr)(a):(null==c?void 0:c.duration)||0})]})]})},we=({variant:e,frameHeight:t,mode:n})=>{var i;const{playerApi:a,onPlayerStateHandler:u,onClose:c}=o(),{currentAv:d,allAvData:p,ardPlayerMediaCollection:g,config:y}=s(),[b,w]=(0,r.useState)(),[_,E]=(0,r.useState)(0),[T,S]=(0,r.useState)(0),C=(0,r.useRef)(0),{ref:x}=(0,me.u)({handleWidth:!0,handleHeight:!0,onResize:(e,t)=>{e&&e>0&&E(e),t&&t>0&&S(t)}}),A=(0,r.useRef)({playbackRate:1,ended:!1,duration:0,paused:!1,started:!1,loading:!0,currentTime:0}),k=(0,r.useRef)(!1),D=({type:e})=>{u&&u({type:e,props:p,playerState:A.current,playerApi:a})};if((0,r.useEffect)((()=>{if(a&&!0!==(null==k?void 0:k.current)){a.on(h.EVENT_READY,(e=>{})),a.on(h.SETUP_VIEW_COMPLETE,(function(){var t;if(null!=(t=a.viewCtrl)&&t.playerView){a.viewCtrl.btnPlayPause[1]&&a.viewCtrl.btnPlayPause[1].focus();const t=a.viewCtrl.playerView.querySelector(".ardplayer-posterbackdrop"),n=a.viewCtrl.playerView.querySelectorAll("button");n&&n.forEach((e=>{e.setAttribute("type","button")})),t&&(t.classList.remove("force-display"),t.querySelector("img")&&"audio"===d.type&&(t.querySelector("img").src=g.meta.images[0].url,t.classList.add("force-display"))),"custom-ui"===e&&(a.setVolume(100),a.setMuted(!1)),"podcast"!==e&&"radiolivestream"!==e||"radiolivestream"===e&&l.A.mdrReact[y.id]?(a.play(),A.current.started=!0,D({type:"start"})):A.current.loading=!1}})),a.on(h.EVENT_AUTOPLAY_STREAM_PROHIBITED,(function(){A.current.loading=!1,A.current.paused=!0,D({type:"autostart_prohibited"})})),a.on(h.PLAYBACK_RATE_CHANGE,(function(e){D({type:"metaUpdate"})})),a.on(h.EVENT_QUALITY_CHANGE,(function(e){D({type:"metaUpdate"})})),a.on(f.SUPER_SUBTITLE_ACTIVATION,(function(e){D({type:"metaUpdate"})})),a.on(f.SUPER_SUBTITLE_DEACTIVATION,(function(e){D({type:"metaUpdate"})})),a.on(h.EVENT_UPDATE_STREAM_TIME,(e=>{A.current.currentTime=a.getCurrentTime(),A.current.duration=a.getDuration(),!0===A.current.started&&(A.current.loading=!1),!0!==A.current.paused&&D({type:"progress"})})),a.on(h.EVENT_PAUSE_STREAM,(e=>{A.current.paused=!0,D({type:"pause"})})),a.on(h.EVENT_BUFFERING,(e=>{A.current.loading=!0,D({type:"waiting"})})),a.on(h.EVENT_PLAY_STREAM,(function(){A.current.paused=!1,!0!==A.current.started&&(A.current.started=!0,D({type:"start"})),A.current.ended&&(A.current.ended=!1),D({type:"play"})})),a.on(l.A.ardplayer.Player.EVENT_END_STREAM,(e=>{A.current.ended=!0,A.current.started=!1,D({type:"ended"})})),a.on(l.A.ardplayer.Player.EVENT_STOP_STREAM,(e=>{A.current.ended=!0,A.current.started=!1,D({type:"stop"})}));try{const e=x.current.closest(".box"),t=x.current.closest(".imageWrapper"),n=e.classList.contains("cssAudio")||e.classList.contains("cssAudioLivestream");e.classList.add("react-ardplayer-loaded");let r=!1;if(t){(.5625!==t.getBoundingClientRect().height/t.getBoundingClientRect().width||e.classList.contains("boxSmallExtended")||e.classList.contains("boxSmall"))&&(r=!0),_>256&&n&&(r=!1)}r&&w(e.querySelector(".mediaCon"))}catch(t){return}k.current=!0}}),[a]),T>0&&_>0){const e=T/_;.5625===e&&.5625!==C.current&&(C.current=e),1===e&&1!==C.current&&(C.current=e)}return(0,U.jsxs)(m,{ref:x,position:"radiolivestream"===e||"podcast"===e?"relative":"absolute",frameHeight:t,height:"podcast"===e?"auto":"100%",mode:"solid"===n?"full":null,ratio:"0",children:[C.current>0&&"radiolivestream"!==e&&"audio"===p.avDocument.type&&(null==(i=p.avDocument)||null==(i=i.teaserimages)?void 0:i.teaserimageResponsive)&&(0,U.jsx)(fe.h,{noAspectRatio:!0,bgColor:"#000",type:"posterImage",url:p.avDocument.teaserimages.teaserimageResponsive.url,imageVariant:.5625!==C.current?"1x1":"16x9",maxWidth:"100%",minWidth:"100%"}),(0,U.jsx)(v,{id:"playerreact-"+y.id}),("custom-ui"===e||"radiolivestream"===e)&&(0,U.jsx)(ge,{variant:"radiolivestream"!==e?"standard":"radiolivestream",width:_}),"podcast"===e&&(0,U.jsx)(be,{width:_}),b&&(0,ve.createPortal)((0,U.jsx)("button",{"aria-label":"Video beenden",title:"Video beenden",onClick:()=>{x.current.closest(".box").classList.remove("react-ardplayer-loaded"),a.dispose(),c()},className:"react-ardplayer-close"}),b)]})};var _e=n(3789);const Ee=p.Ay.div.withConfig({displayName:"MDRPlayerLightboxStyle__MDRPlayerLightboxHeaderStyle",componentId:"sc-99yy9m-0"})(["text-align:center;background-color:#000;position:relative;z-index:1;min-height:44px;padding:1rem;font-weight:bold;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;opacity:",";"],(({isLoading:e})=>e?"0":null)),Te=p.Ay.div.withConfig({displayName:"MDRPlayerLightboxStyle__BroadcastLinkWrapper",componentId:"sc-99yy9m-1"})(["display:flex;"]),Se=p.Ay.div.withConfig({displayName:"MDRPlayerLightboxStyle__DeepLinkWrapper",componentId:"sc-99yy9m-2"})(["position:absolute;left:0;width:100%;top:-64px;background-color:#313131;height:64px;display:flex;align-items:center;justify-content:center;"]),Ce=p.Ay.div.withConfig({displayName:"MDRPlayerLightboxStyle__FooterItem",componentId:"sc-99yy9m-3"})(["color:#fefefe;display:flex;align-items:center;justify-content:center;padding:0.5rem 1rem;border-right:",";opacity:",";font-weight:bold;"],(({border:e})=>e||null),(({isLoading:e})=>e?"0":null)),xe=p.Ay.div.withConfig({displayName:"MDRPlayerLightboxStyle__MDRPlayerLightboxFooterStyle",componentId:"sc-99yy9m-4"})(["text-align:center;background-color:#000;position:relative;z-index:1;padding:1rem;font-weight:bold;color:#fff;min-height:44px;display:flex;width:100%;opacity:",";flex-direction:row;align-items:center;justify-content:center;"],(({isLoading:e})=>e?"0":null));var Ae=n(9102),ke=n(5424),De=n(4086),Le=n(1092);var Re=n(5286);function Pe(e){if((0,Le.A)(1,arguments),!function(e){return(0,Le.A)(1,arguments),e instanceof Date||"object"===(0,De.A)(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=(0,Re.A)(e);return!isNaN(Number(t))}var Ie=n(3733);function Oe(e,t){return(0,Le.A)(2,arguments),function(e,t){(0,Le.A)(2,arguments);var n=(0,Re.A)(e).getTime(),r=(0,Ie.A)(t);return new Date(n+r)}(e,-(0,Ie.A)(t))}function Me(e){(0,Le.A)(1,arguments);var t=(0,Re.A)(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function Ne(e){(0,Le.A)(1,arguments);var t=(0,Re.A)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Me(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var s=Me(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Fe(e){(0,Le.A)(1,arguments);var t=(0,Re.A)(e),n=Me(t).getTime()-function(e){(0,Le.A)(1,arguments);var t=Ne(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),Me(n)}(t).getTime();return Math.round(n/6048e5)+1}var Be={};function je(){return Be}function Ue(e,t){var n,r,i,a,s,o,l,u;(0,Le.A)(1,arguments);var c=je(),d=(0,Ie.A)(null!==(n=null!==(r=null!==(i=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t||null===(s=t.locale)||void 0===s||null===(o=s.options)||void 0===o?void 0:o.weekStartsOn)&&void 0!==i?i:c.weekStartsOn)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=(0,Re.A)(e),f=h.getUTCDay(),p=(f=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var g=Ue(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var v=Ue(m,t);return c.getTime()>=g.getTime()?d+1:c.getTime()>=v.getTime()?d:d-1}function Ve(e,t){(0,Le.A)(1,arguments);var n=(0,Re.A)(e),r=Ue(n,t).getTime()-function(e,t){var n,r,i,a,s,o,l,u;(0,Le.A)(1,arguments);var c=je(),d=(0,Ie.A)(null!==(n=null!==(r=null!==(i=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(s=t.locale)||void 0===s||null===(o=s.options)||void 0===o?void 0:o.firstWeekContainsDate)&&void 0!==i?i:c.firstWeekContainsDate)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),h=$e(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),Ue(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function He(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?n:1-n;return He("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):He(n+1,2)},d:function(e,t){return He(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return He(e.getUTCHours()%12||12,t.length)},H:function(e,t){return He(e.getUTCHours(),t.length)},m:function(e,t){return He(e.getUTCMinutes(),t.length)},s:function(e,t){return He(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return He(Math.floor(r*Math.pow(10,n-3)),t.length)}};var Ge="midnight",We="noon",qe="morning",Ye="afternoon",Ke="evening",Xe="night",Qe={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return ze.y(e,t)},Y:function(e,t,n,r){var i=$e(e,r),a=i>0?i:1-i;return"YY"===t?He(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):He(a,t.length)},R:function(e,t){return He(Ne(e),t.length)},u:function(e,t){return He(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return He(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return He(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ze.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return He(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=Ve(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):He(i,t.length)},I:function(e,t,n){var r=Fe(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):He(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ze.d(e,t)},D:function(e,t,n){var r=function(e){(0,Le.A)(1,arguments);var t=(0,Re.A)(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):He(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return He(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return He(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return He(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?We:0===i?Ge:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?Ke:i>=12?Ye:i>=4?qe:Xe,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ze.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ze.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):He(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):He(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ze.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ze.s(e,t)},S:function(e,t){return ze.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Ze(i);case"XXXX":case"XX":return et(i);default:return et(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ze(i);case"xxxx":case"xx":return et(i);default:return et(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Je(i,":");default:return"GMT"+et(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Je(i,":");default:return"GMT"+et(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e;return He(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,n,r){return He((r._originalDate||e).getTime(),t.length)}};function Je(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),a=r%60;if(0===a)return n+String(i);var s=t||"";return n+String(i)+s+He(a,2)}function Ze(e,t){return e%60==0?(e>0?"-":"+")+He(Math.abs(e)/60,2):et(e,t)}function et(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+He(Math.floor(i/60),2)+n+He(i%60,2)}const tt=Qe;var nt=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},rt=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},it={p:rt,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],i=r[1],a=r[2];if(!a)return nt(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",nt(i,t)).replace("{{time}}",rt(a,t))}};const at=it;var st=["D","DD"],ot=["YY","YYYY"];function lt(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ut={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const ct=function(e,t,n){var r,i=ut[e];return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function dt(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ht={date:dt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:dt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function pt(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):i;r=e.formattingValues[a]||e.formattingValues[i]}else{var s=e.defaultWidth,o=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function gt(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var s,o=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],a=t.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(i.length)}}}const vt={code:"en-US",formatDistance:ct,formatLong:ht,formatRelative:function(e,t,n,r){return ft[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:pt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:pt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:pt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:pt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:pt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:mt({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:gt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:gt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:gt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:gt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:gt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var yt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wt=/^'([^]*?)'?$/,_t=/''/g,Et=/[a-zA-Z]/;function Tt(e,t,n){var r,i,a,s,o,l,u,c,d,h,f,p,g,m,v,y,b,w;(0,Le.A)(2,arguments);var _=String(t),E=je(),T=null!==(r=null!==(i=null==n?void 0:n.locale)&&void 0!==i?i:E.locale)&&void 0!==r?r:vt,S=(0,Ie.A)(null!==(a=null!==(s=null!==(o=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(u=n.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==o?o:E.firstWeekContainsDate)&&void 0!==s?s:null===(d=E.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==a?a:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=(0,Ie.A)(null!==(f=null!==(p=null!==(g=null!==(m=null==n?void 0:n.weekStartsOn)&&void 0!==m?m:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==g?g:E.weekStartsOn)&&void 0!==p?p:null===(b=E.locale)||void 0===b||null===(w=b.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==f?f:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var x=(0,Re.A)(e);if(!Pe(x))throw new RangeError("Invalid time value");var A=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}(x),k=Oe(x,A),D={firstWeekContainsDate:S,weekStartsOn:C,locale:T,_originalDate:x};return _.match(bt).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,at[t])(e,T.formatLong):e})).join("").match(yt).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return function(e){var t=e.match(wt);if(!t)return e;return t[1].replace(_t,"'")}(r);var a,s=tt[i];if(s)return null!=n&&n.useAdditionalWeekYearTokens||(a=r,-1===ot.indexOf(a))||lt(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==st.indexOf(e)}(r)||lt(r,t,String(e)),s(k,r,T.localize,D);if(i.match(Et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}var St={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"halbe Minute",withPreposition:"halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}};const Ct=function(e,t,n){var r,i=null!=n&&n.addSuffix?St[e].withPreposition:St[e].standalone;return r="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",String(t)),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:"vor "+r:r};var xt={date:dt({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:dt({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:dt({formats:{full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})};var At={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"};var kt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","M\xe4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","M\xe4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},Dt={narrow:kt.narrow,abbreviated:["Jan.","Feb.","M\xe4rz","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:kt.wide};const Lt={code:"de",formatDistance:Ct,formatLong:xt,formatRelative:function(e,t,n,r){return At[e]},localize:{ordinalNumber:function(e){return Number(e)+"."},era:pt({values:{narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},defaultWidth:"wide"}),quarter:pt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:pt({values:kt,formattingValues:Dt,defaultWidth:"wide"}),day:pt({values:{narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},defaultWidth:"wide"}),dayPeriod:pt({values:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},defaultWidth:"wide",formattingValues:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:mt({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e)}}),era:gt({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:"any"}),quarter:gt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:gt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[a\xe4]n|feb|m\xe4r[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|m\xe4rz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[a\xe4]/i,/^f/i,/^m\xe4r/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:gt({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:gt({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Rt=e=>{const t=(null==l.A?void 0:l.A.innerWidth)<768,{currentAv:n}=s(),i=n;let a=i.title,o=null==i?void 0:i.subtitle,u=null==i?void 0:i.teaserText;const c=(0,r.useContext)(p.Dx),d=null==c?void 0:c.global.icons;let h=null,f="1.5rem";if("kika"===(null==c?void 0:c.global.client)){var m,v,y,w;h="1.5rem",f="2.75rem";if(a=`${(null==i||null==(m=i.broadcast)?void 0:m.channelName)||(null==i?void 0:i.topline)} - ${(null==i||null==(v=i.broadcast)?void 0:v.broadcastName)||(null==i?void 0:i.title)}`,null!=e&&null!=(y=e.data)&&y.webTime){const e=null==i?void 0:i.webTime.split(" ")[0],t=Number(null==e?void 0:e.split(".")[0]),n=Number(null==e?void 0:e.split(".")[1]),r=Number(null==e?void 0:e.split(".")[2]);o=`Folge vom ${Tt(new Date(r,n-1,t),"dd.MM.y",{locale:Lt})}`}u=(null==i||null==(w=i.broadcast)?void 0:w.broadcastDescription)||(null==i?void 0:i.teaserText)}return t?(0,U.jsx)(de.az,{position:"relative",top:0,left:0,width:"100%",height:"44px",zIndex:10,children:(0,U.jsx)(Ae.QK,{children:(0,U.jsx)(oe.$,{onClick:e.onClicked,variant:"icon",icon:(null==d?void 0:d.close)||g.FI.close,width:f,fontSize:h,height:f,color:"#fff"})})}):(0,U.jsxs)(Ee,{isLoading:!1,ref:e.innerRef,children:[!t&&a?(0,U.jsx)(ke.$,{margin:"2rem 0 1rem 0",color:"#fff",type:"big",children:(0,b.Xx)(a)}):null,!t&&o?(0,U.jsx)(ke.$,{margin:"0 0 1rem 0",color:"#fff",type:"medium",children:(0,b.Xx)(o)}):null,!t&&u?(0,U.jsx)(D.A,{textAlign:"center",maxWidth:"1280px",color:"#fff",children:(0,b.Xx)(u)}):null,(0,U.jsx)(Ae.QK,{children:(0,U.jsx)(oe.$,{onClick:e.onClicked,variant:"icon",icon:(null==d?void 0:d.close)||g.FI.close,width:f,fontSize:h,height:f,color:"#fff"})})]})};var Pt=n(8621);const It=e=>{var t,n,i;const a=(null==l.A?void 0:l.A.innerWidth)<768,{currentAv:o}=s(),u=(0,r.useContext)(p.Dx),c=null!=u&&null!=(t=u.global)&&t.icons?null==u||null==(n=u.global)?void 0:n.icons:g.FI,d=o,[h,f]=(0,r.useState)(!1);let m=d.broadcast&&d.broadcast.broadcastSeriesName||"";const v=d.broadcast&&d.broadcast.channelOrRegionName||"";0===m.length&&(m=v);const y=d.broadcast&&d.broadcast.homepageUrl,w=d.htmlUrl,_=d.broadcast&&d.broadcast.broadcastStartDate||null,E=d.duration;return a?null:(0,U.jsxs)(xe,{isLoading:e.isLoading,ref:e.innerRef,children:[h?(0,U.jsx)(Se,{children:(0,U.jsx)(Pt.A,{color:"#fff",href:w,children:w})}):null,(0,U.jsxs)(Te,{children:["kika"===(null==u||null==(i=u.global)?void 0:i.client)?m.length>0?(0,U.jsx)(Ce,{border:"1px solid #585858",children:(0,U.jsxs)(Pt.A,{color:"#fff",href:y,children:[(0,U.jsx)(J.I,{color:"#fff",margin:"0 .5rem 0 0",code:c.channel||g.FI.arrowRight}),(0,b.Xx)(m)]})}):null:m.length>0?(0,U.jsx)(Ce,{border:"1px solid #585858",children:(0,U.jsxs)(Pt.A,{color:"#fff",href:y,children:[(0,b.Xx)(m),(0,U.jsx)(J.I,{color:"#fff",margin:"0 0 0 0.5rem",code:c.channel||g.FI.arrowRight})]})}):null,_&&_.length>0?(0,U.jsx)(Ce,{border:"1px solid #585858",children:_}):null,E&&E.length>0?(0,U.jsxs)(Ce,{border:"1px solid #585858",children:[E," min"]}):null,null]}),(0,U.jsx)(Te,{children:w&&w.length>0?(0,U.jsx)(Ce,{children:(0,U.jsxs)(Pt.A,{color:"#fff",onClick:()=>(f(!h),!1),children:["Link des Videos",(0,U.jsx)(J.I,{color:"#fff",margin:"0 0 0 0.5rem",code:h?c.arrowUp:c.arrowDown})]})}):null})]})},Ot=p.Ay.div.withConfig({displayName:"ARDPlayerRelatedStyle__RelatedTeaser",componentId:"sc-bo3lyv-0"})(["height:100%;"]),Mt=p.Ay.div.withConfig({displayName:"ARDPlayerRelatedStyle__ScrollerWrapper",componentId:"sc-bo3lyv-1"})(["position:fixed;top:0;left:0;z-index:1;align-items:center;justify-content:center;display:flex;flex-direction:column;transition:all 0.3s ease-out;transform:translate3d(0,",",0);background-color:",";width:100%;padding:0.5rem 0 0 0;"],(({open:e})=>e?"0":"-100%"),(({open:e})=>e?"rgba(0,0,0.8)":null)),Nt=p.Ay.div.withConfig({displayName:"ARDPlayerRelatedStyle__PlaylistCountdown",componentId:"sc-bo3lyv-2"})(["position:absolute;top:0.5rem;right:0.5rem;z-index:1;width:calc(100% - 1rem);padding:0.5rem;background-color:rgba(0,0,0,0.8);display:flex;align-items:center;justify-content:space-between;> p{color:#fff;margin-right:1rem;}"]),Ft=p.Ay.div.withConfig({displayName:"Label__Wrapper",componentId:"sc-10vrbn2-0"})(["font-size:",";color:",";padding:",";background-color:",";margin:",";font-weight:bold;white-space:nowrap;position:absolute;",";",";",";",";",""],(({fontSize:e})=>e||"0.75rem"),(({color:e})=>e||"#fff"),(({padding:e})=>e||null),(({bgColor:e})=>e||null),(({margin:e})=>e||null),(e=>"solid"===e.variant&&(0,p.AH)(["top:0;left:0;position:relative;"])),(e=>"topLeft"===e.variant&&(0,p.AH)(["top:0;left:0;"])),(e=>"topRight"===e.variant&&(0,p.AH)(["top:0;right:0;"])),(e=>"bottomLeft"===e.variant&&(0,p.AH)(["bottom:0;left:0;"])),(e=>"bottomRight"===e.variant&&(0,p.AH)(["bottom:0;right:0;"]))),Bt=e=>(0,U.jsx)(Ft,Object.assign({},e,{children:e.children})),jt=p.Ay.a.withConfig({displayName:"Teaser__LinkWrapper",componentId:"sc-1cb9u5z-0"})(["border-radius:0.125rem;overflow:hidden;height:",";flex-direction:",";align-items:",";display:flex;width:",";flex:1 1 auto;padding:",";margin:",";max-width:",";&:focus{text-decoration:none !important;*{text-decoration:none !important;}h4{text-decoration:underline !important;}}"],(e=>e.height?e.height:"100%"),(e=>e.flow?e.flow:"column"),(e=>"small"===e.type?"center":"flex-start"),(e=>e.width?e.width:"100%"),(e=>e.padding?e.padding:0),(e=>e.margin?e.margin:0),(e=>e.maxWidth?e.maxWidth:null)),Ut=(0,p.Ay)(g.VP).withConfig({displayName:"Teaser__InnerWrapper",componentId:"sc-1cb9u5z-1"})(["padding:",";transition:background-color 0.2s ease-out;"],(e=>e.innerPadding?e.innerPadding:"0"));class Teaser extends r.Component{constructor(e){super(e),this.imageVariant="16x9",this.mainRef=null,this.state={over:!1},this.onMouseOver=()=>{(0,b.CN)()||this.setState({over:!0})},this.onMouseOut=()=>{(0,b.CN)()||this.setState({over:!1})},this.getInnerTeaser=()=>{let e=this.props.teaserData,t=this.props.innerPadding||"0",n=this.props.noMainImage;"list"===this.props.type&&(t="1rem");let r="column",i="1rem",a="1.25rem";return"small"!==this.props.type&&"video"!==e.docType&&"audio"!==e.docType||(a="1rem"),this.isListTeaser()&&!0===this.props.isSmall&&(a=i="0.875rem"),"100%"!==this.props.imageSize&&(r="row"),(0,U.jsxs)(jt,{margin:this.props.margin,width:this.props.width,maxWidth:this.props.maxWidth,padding:this.props.padding,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,type:this.props.type,height:this.props.height,flow:r,href:e.url||null,onClick:t=>{if(this.props.onClickTrack&&this.props.onClickTrack(this.props.index,e),this.props.onClicked){t.preventDefault();let n=`/${e.sophoraId}.html`;return this.props.onClicked(n),!1}},ref:this.mainRef,children:[!0!==n?this.getImage(e.image,r):null,(0,U.jsxs)(Ut,{bgColor:!0===this.state.over?this.props.activeBgColor:this.props.bgColor,height:"row"===r?"100%":"auto",innerPadding:this.props.bgColor||"row"===r?t:"0",justify:"row"===r?"center":"flex-start",children:[this.isPodcastStyle()?this.getTitleWithImage(e,e.image,r,a,"0 0.5rem"):this.getTitle(e,r,a),e.copytext&&this.isListTeaser()?(0,U.jsx)(D.A,{fontSize:i,color:this.props.secondColor,margin:".5rem 0 0 0",dangerouslySetInnerHTML:{__html:e.copytext}}):null,e.teaserText&&!0===this.props.showTeaserText?(0,U.jsx)(D.A,{fontSize:i,color:"#000",margin:".5rem 0 .5rem 0",children:(0,b.XL)(e.teaserText)}):null,!this.isPodcastStyle()&&e.topline?(0,U.jsxs)(g.fI,{marginTop:".5rem",align:"center",margin:"0 0 0.5rem 0",canWrap:this.props.isVerySmall,children:[!0!==this.props.noTimeStamp?(0,U.jsx)(Bt,{variant:"solid",color:this.props.secondColor,margin:"0 .5rem 0 0",children:(0,b.Xx)(e.topline)}):null,e.url&&"list"===this.props.type?(0,U.jsx)(g.RA,{fontColor:this.props.fontColor,children:e.url}):null]}):null]})]})},this.getTitleWithImage=(e,t,n,r,i)=>(0,U.jsxs)(g.fI,{height:"100%",align:"flex-start",children:[this.getImage(t,n),(0,U.jsxs)(Ut,{justify:"space-between",innerPadding:i,children:[this.getTitle(e,n,r),e.topline?(0,U.jsx)(g.fI,{marginTop:".5rem",align:"flex-start",marginBottom:"0.5rem",children:(0,U.jsx)(Bt,{variant:"solid",color:this.props.secondColor,children:(0,b.Xx)(e.topline)})}):null]})]}),this.isListTeaser=()=>"list"===this.props.type,this.isSmallTeaser=()=>"small"===this.props.type,this.isListWithAvContent=()=>this.isListTeaser()&&("video"===this.props.teaserData.docType||"audio"===this.props.teaserData.docType),this.isPodcastStyle=()=>"podcast"===this.props.type,this.getImage=e=>{if(!e)return null;let t=this.props.imageVariant||"16x9";this.isPodcastStyle()&&(t="1x1"),this.props.teaserData&&"big"===this.props.teaserData.variant&&(t="24x9");let n=this.props.origin||"",r=e.structureNodePath||"",i=e&&(e.urlSchemeResponsiv||e.urlScheme)||"",a=n+r+e.sophoraId+i+".jpg";e&&e.variants&&e.variants[t]&&(a=e.variants[t].big||e.variants[t].small),i&&(a=i);let s=(0,b.bG)(a,t);return(0,U.jsx)(fe.h,{url:s,bgColor:"rgba(255,255,255,.25)",imageVariant:t,imageData:e,maxWidth:this.props.imageSize,minWidth:this.props.imageSize})},this.getTitle=(e,t,n)=>(this.isPodcastStyle()&&(n="1rem"),(0,U.jsxs)(ke.$,{color:this.props.fontColor,fontSize:n,fontWeight:this.props.titleFontWeight,type:"teaser",children:[(0,b.wi)(e.docType)&&"small"!==this.props.type?(0,U.jsx)(J.I,Object.assign({margin:"0 0.25rem 0 0",fontSize:"1.25rem"},this.props,{code:g.FI[e.docType]})):null,(0,b.XL)(e.title||e.headline)]})),this.render=()=>this.getInnerTeaser(),this.mainRef=r.createRef()}}const $t=Teaser;var Vt=n(7323);const Ht=(0,p.Ay)(Vt.az).withConfig({displayName:"SliderBaseStyle",componentId:"sc-4u29p3-0"})(["",""],"\n\t/**\n\t* Swiper 4.5.0\n\t* Most modern mobile touch slider and framework with hardware accelerated transitions\n\t* http://www.idangero.us/swiper/\n\t*\n\t* Copyright 2014-2019 Vladimir Kharlampidi\n\t*\n\t* Released under the MIT License\n\t*\n\t* Released on: February 22, 2019\n\t*/\n\t.swiper{margin:0 auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-no-flexbox .swiper-slide{float:left}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{transform:translate3d(0,0,0)}.swiper-multirow>.swiper-wrapper{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.swiper-free-mode>.swiper-wrapper{transition-timing-function:ease-out;margin:0 auto}.swiper-slide{flex-shrink:0;width:100%;position:relative;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:height,-webkit-transform;transition-property:transform,height;transition-property:transform,height,-webkit-transform}.swiper-3d{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,rgb(0 0 0 / .5),#fff0)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,rgb(0 0 0 / .5),#fff0)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,rgb(0 0 0 / .5),#fff0)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,rgb(0 0 0 / .5),#fff0)}.swiper-wp8-horizontal,.swiper-wp8-horizontal>.swiper-wrapper{touch-action:pan-y}.swiper-wp8-vertical,.swiper-wp8-vertical>.swiper-wrapper{touch-action:pan-x}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:27px;height:44px;margin-top:-22px;z-index:10;cursor:pointer;background-size:27px 44px;background-position:center;background-repeat:no-repeat}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev,.swiper-rtl .swiper-button-next{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\");left:10px;right:auto}.swiper-button-next,.swiper-rtl .swiper-button-prev{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\");right:10px;left:auto}.swiper-button-prev.swiper-button-white,.swiper-rtl .swiper-button-next.swiper-button-white{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-next.swiper-button-white,.swiper-rtl .swiper-button-prev.swiper-button-white{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-prev.swiper-button-black,.swiper-rtl .swiper-button-next.swiper-button-black{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-next.swiper-button-black,.swiper-rtl .swiper-button-prev.swiper-button-black{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-lock{display:none}.swiper-pagination{position:absolute;text-align:center;transition:0.3s opacity;transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet-active{opacity:1;background:#007aff}.swiper-vertical>.swiper-pagination-bullets{right:10px;top:50%;transform:translate3d(0,-50%,0)}.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:6px 0;display:block}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:0.2s top,0.2s -webkit-transform;transition:0.2s transform,0.2s top;transition:0.2s transform,0.2s top,0.2s -webkit-transform}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 4px}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translateX(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:0.2s left,0.2s -webkit-transform;transition:0.2s transform,0.2s left;transition:0.2s transform,0.2s left,0.2s -webkit-transform}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:0.2s right,0.2s -webkit-transform;transition:0.2s transform,0.2s right;transition:0.2s transform,0.2s right,0.2s -webkit-transform}.swiper-pagination-progressbar{background:rgb(0 0 0 / .25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:#007aff;position:absolute;left:0;top:0;width:100%;height:100%;transform:scale(0);transform-origin:left top}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-vertical>.swiper-pagination-progressbar{width:4px;height:100%;left:0;top:0}.swiper-pagination-white .swiper-pagination-bullet-active{background:#fff}.swiper-pagination-progressbar.swiper-pagination-white{background:rgb(255 255 255 / .25)}.swiper-pagination-progressbar.swiper-pagination-white .swiper-pagination-progressbar-fill{background:#fff}.swiper-pagination-black .swiper-pagination-bullet-active{background:#000}.swiper-pagination-progressbar.swiper-pagination-black{background:rgb(0 0 0 / .25)}.swiper-pagination-progressbar.swiper-pagination-black .swiper-pagination-progressbar-fill{background:#000}.swiper-pagination-lock{display:none}.swiper-scrollbar{border-radius:1rem;position:relative;-ms-touch-action:none;background:rgb(255 255 255 / .1)}.swiper-horizontal>.swiper-scrollbar{position:absolute;left:0;bottom:.375rem;z-index:50;height:.1875rem;width:100%}.swiper-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgb(255 255 255 / .5);border-radius:1rem;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center;text-align:center}.swiper-zoom-container>canvas,.swiper-zoom-container>img,.swiper-zoom-container>svg{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}.swiper-slide-zoomed{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12,end) infinite;animation:swiper-preloader-spin 1s steps(12,end) infinite}.swiper-lazy-preloader:after{display:block;content:'';width:100%;height:100%;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\");background-position:50%;background-size:100%;background-repeat:no-repeat}.swiper-lazy-preloader-white:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\")}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-fade.swiper-free-mode .swiper-slide{transition-timing-function:ease-out}.swiper-fade .swiper-slide{pointer-events:none;transition-property:opacity}.swiper-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-fade .swiper-slide-active,.swiper-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube{overflow:visible}.swiper-cube .swiper-slide{pointer-events:none;backface-visibility:hidden;z-index:1;visibility:hidden;transform-origin:0 0;width:100%;height:100%}.swiper-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-cube.swiper-rtl .swiper-slide{transform-origin:100% 0}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-cube .swiper-slide-active,.swiper-cube .swiper-slide-next,.swiper-cube .swiper-slide-next+.swiper-slide,.swiper-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-cube .swiper-slide-shadow-bottom,.swiper-cube .swiper-slide-shadow-left,.swiper-cube .swiper-slide-shadow-right,.swiper-cube .swiper-slide-shadow-top{z-index:0;backface-visibility:hidden}.swiper-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0;width:100%;height:100%;background:#000;opacity:.6;-webkit-filter:blur(50px);filter:blur(50px);z-index:0}.swiper-flip{overflow:visible}.swiper-flip .swiper-slide{pointer-events:none;backface-visibility:hidden;z-index:1}.swiper-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-flip .swiper-slide-active,.swiper-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-flip .swiper-slide-shadow-bottom,.swiper-flip .swiper-slide-shadow-left,.swiper-flip .swiper-slide-shadow-right,.swiper-flip .swiper-slide-shadow-top{z-index:0;backface-visibility:hidden}.swiper-coverflow .swiper-wrapper{-ms-perspective:1200px}\n");var zt=n(8700);function Gt(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function Wt(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter((e=>n.indexOf(e)<0)).forEach((n=>{void 0===e[n]?e[n]=t[n]:Gt(t[n])&&Gt(e[n])&&Object.keys(t[n]).length>0?t[n].__swiper__?e[n]=t[n]:Wt(e[n],t[n]):e[n]=t[n]}))}function qt(e={}){return e.navigation&&void 0===e.navigation.nextEl&&void 0===e.navigation.prevEl}function Yt(e={}){return e.pagination&&void 0===e.pagination.el}function Kt(e={}){return e.scrollbar&&void 0===e.scrollbar.el}function Xt(e=""){const t=e.split(" ").map((e=>e.trim())).filter((e=>!!e)),n=[];return t.forEach((e=>{n.indexOf(e)<0&&n.push(e)})),n.join(" ")}const Qt=["modules","init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopedSlidesLimit","_loopFillGroupWithBlank","loopPreventsSlide","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"];const Jt=(e,t)=>{let n=t.slidesPerView;if(t.breakpoints){const e=zt.Ay.prototype.getBreakpoint(t.breakpoints),r=e in t.breakpoints?t.breakpoints[e]:void 0;r&&r.slidesPerView&&(n=r.slidesPerView)}let r=Math.ceil(parseFloat(t.loopedSlides||n,10));return r+=t.loopAdditionalSlides,r>e.length&&t.loopedSlidesLimit&&(r=e.length),r};function Zt(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function en(e){const t=[];return r.Children.toArray(e).forEach((e=>{Zt(e)?t.push(e):e.props&&e.props.children&&en(e.props.children).forEach((e=>t.push(e)))})),t}function tn(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return r.Children.toArray(e).forEach((e=>{if(Zt(e))t.push(e);else if(e.props&&e.props.slot&&n[e.props.slot])n[e.props.slot].push(e);else if(e.props&&e.props.children){const r=en(e.props.children);r.length>0?r.forEach((e=>t.push(e))):n["container-end"].push(e)}else n["container-end"].push(e)})),{slides:t,slots:n}}function nn({swiper:e,slides:t,passedParams:n,changedParams:r,nextEl:i,prevEl:a,scrollbarEl:s,paginationEl:o}){const l=r.filter((e=>"children"!==e&&"direction"!==e)),{params:u,pagination:c,navigation:d,scrollbar:h,virtual:f,thumbs:p}=e;let g,m,v,y,b;r.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&u.thumbs&&!u.thumbs.swiper&&(g=!0),r.includes("controller")&&n.controller&&n.controller.control&&u.controller&&!u.controller.control&&(m=!0),r.includes("pagination")&&n.pagination&&(n.pagination.el||o)&&(u.pagination||!1===u.pagination)&&c&&!c.el&&(v=!0),r.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||s)&&(u.scrollbar||!1===u.scrollbar)&&h&&!h.el&&(y=!0),r.includes("navigation")&&n.navigation&&(n.navigation.prevEl||a)&&(n.navigation.nextEl||i)&&(u.navigation||!1===u.navigation)&&d&&!d.prevEl&&!d.nextEl&&(b=!0);if(l.forEach((t=>{if(Gt(u[t])&&Gt(n[t]))Wt(u[t],n[t]);else{const i=n[t];!0!==i&&!1!==i||"navigation"!==t&&"pagination"!==t&&"scrollbar"!==t?u[t]=n[t]:!1===i&&e[r=t]&&(e[r].destroy(),"navigation"===r?(u[r].prevEl=void 0,u[r].nextEl=void 0,e[r].prevEl=void 0,e[r].nextEl=void 0):(u[r].el=void 0,e[r].el=void 0))}var r})),l.includes("controller")&&!m&&e.controller&&e.controller.control&&u.controller&&u.controller.control&&(e.controller.control=u.controller.control),r.includes("children")&&t&&f&&u.virtual.enabled?(f.slides=t,f.update(!0)):r.includes("children")&&e.lazy&&e.params.lazy.enabled&&e.lazy.load(),g){p.init()&&p.update(!0)}m&&(e.controller.control=u.controller.control),v&&(o&&(u.pagination.el=o),c.init(),c.render(),c.update()),y&&(s&&(u.scrollbar.el=s),h.init(),h.updateSize(),h.setTranslate()),b&&(i&&(u.navigation.nextEl=i),a&&(u.navigation.prevEl=a),d.init(),d.update()),r.includes("allowSlideNext")&&(e.allowSlideNext=n.allowSlideNext),r.includes("allowSlidePrev")&&(e.allowSlidePrev=n.allowSlidePrev),r.includes("direction")&&e.changeDirection(n.direction,!1),e.update()}function rn(e,t){return"undefined"==typeof window?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}const an=(0,r.createContext)(null),sn=(0,r.createContext)(null);function on(){return on=Object.assign?Object.assign.bind():function(e){for(var t=1;te.replace(/_/,""))),o=Object.assign({},e);return Object.keys(o).forEach((o=>{void 0!==e[o]&&(s.indexOf(o)>=0?Gt(e[o])?(n[o]={},i[o]={},Wt(n[o],e[o]),Wt(i[o],e[o])):(n[o]=e[o],i[o]=e[o]):0===o.search(/on[A-Z]/)&&"function"==typeof e[o]?t?r[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:n.on[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:a[o]=e[o])})),["navigation","pagination","scrollbar"].forEach((e=>{!0===n[e]&&(n[e]={}),!1===n[e]&&delete n[e]})),{params:n,passedParams:i,rest:a,events:r}}(l),{slides:D,slots:L}=tn(s),R=()=>{g(!p)};Object.assign(C.on,{_containerClasses(e,t){d(t)}});const P=()=>{if(Object.assign(C.on,k),u=!0,y.current=new zt.Ay(C),y.current.loopCreate=()=>{},y.current.loopDestroy=()=>{},C.loop&&(y.current.loopedSlides=Jt(D,C)),y.current.virtual&&y.current.params.virtual.enabled){y.current.virtual.slides=D;const e={cache:!1,slides:D,renderExternal:f,renderExternalUpdate:!1};Wt(y.current.params.virtual,e),Wt(y.current.originalParams.virtual,e)}};v.current||P(),y.current&&y.current.on("_beforeBreakpoint",R);return(0,r.useEffect)((()=>()=>{y.current&&y.current.off("_beforeBreakpoint",R)})),(0,r.useEffect)((()=>{!m.current&&y.current&&(y.current.emitSlidesClasses(),m.current=!0)})),rn((()=>{if(t&&(t.current=v.current),v.current)return y.current.destroyed&&P(),function({el:e,nextEl:t,prevEl:n,paginationEl:r,scrollbarEl:i,swiper:a},s){qt(s)&&t&&n&&(a.params.navigation.nextEl=t,a.originalParams.navigation.nextEl=t,a.params.navigation.prevEl=n,a.originalParams.navigation.prevEl=n),Yt(s)&&r&&(a.params.pagination.el=r,a.originalParams.pagination.el=r),Kt(s)&&i&&(a.params.scrollbar.el=i,a.originalParams.scrollbar.el=i),a.init(e)}({el:v.current,nextEl:_.current,prevEl:E.current,paginationEl:T.current,scrollbarEl:S.current,swiper:y.current},C),o&&o(y.current),()=>{y.current&&!y.current.destroyed&&y.current.destroy(!0,!1)}}),[]),rn((()=>{!u&&k&&y.current&&Object.keys(k).forEach((e=>{y.current.on(e,k[e])}));const e=function(e,t,n,r,i){const a=[];if(!t)return a;const s=e=>{a.indexOf(e)<0&&a.push(e)};if(n&&r){const e=r.map(i),t=n.map(i);e.join("")!==t.join("")&&s("children"),r.length!==n.length&&s("children")}return Qt.filter((e=>"_"===e[0])).map((e=>e.replace(/_/,""))).forEach((n=>{if(n in e&&n in t)if(Gt(e[n])&&Gt(t[n])){const r=Object.keys(e[n]),i=Object.keys(t[n]);r.length!==i.length?s(n):(r.forEach((r=>{e[n][r]!==t[n][r]&&s(n)})),i.forEach((r=>{e[n][r]!==t[n][r]&&s(n)})))}else e[n]!==t[n]&&s(n)})),a}(x,b.current,D,w.current,(e=>e.key));return b.current=x,w.current=D,e.length&&y.current&&!y.current.destroyed&&nn({swiper:y.current,slides:D,passedParams:x,changedParams:e,nextEl:_.current,prevEl:E.current,scrollbarEl:S.current,paginationEl:T.current}),()=>{k&&y.current&&Object.keys(k).forEach((e=>{y.current.off(e,k[e])}))}})),rn((()=>{var e;!(e=y.current)||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.lazy&&e.params.lazy.enabled&&e.lazy.load(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())}),[h]),r.createElement(i,on({ref:v,className:Xt(`${c}${n?` ${n}`:""}`)},A),r.createElement(sn.Provider,{value:y.current},L["container-start"],r.createElement(a,{className:"swiper-wrapper"},L["wrapper-start"],C.virtual?function(e,t,n){if(!n)return null;const i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`};return t.filter(((e,t)=>t>=n.from&&t<=n.to)).map((t=>r.cloneElement(t,{swiper:e,style:i})))}(y.current,D,h):!C.loop||y.current&&y.current.destroyed?D.map((e=>r.cloneElement(e,{swiper:y.current}))):function(e,t,n){const i=t.map(((t,n)=>r.cloneElement(t,{swiper:e,"data-swiper-slide-index":n})));function a(e,t,i){return r.cloneElement(e,{key:`${e.key}-duplicate-${t}-${i}`,className:`${e.props.className||""} ${n.slideDuplicateClass}`})}if(n.loopFillGroupWithBlank){const e=n.slidesPerGroup-i.length%n.slidesPerGroup;if(e!==n.slidesPerGroup)for(let t=0;t{if(t&&(t.current=c.current),c.current&&s){if(!s.destroyed)return s.on("_slideClass",f),()=>{s&&s.off("_slideClass",f)};"swiper-slide"!==d&&h("swiper-slide")}})),rn((()=>{s&&c.current&&!s.destroyed&&h(s.getSlideClasses(c.current))}),[s]);const p={isActive:d.indexOf("swiper-slide-active")>=0||d.indexOf("swiper-slide-duplicate-active")>=0,isVisible:d.indexOf("swiper-slide-visible")>=0,isDuplicate:d.indexOf("swiper-slide-duplicate")>=0,isPrev:d.indexOf("swiper-slide-prev")>=0||d.indexOf("swiper-slide-duplicate-prev")>=0,isNext:d.indexOf("swiper-slide-next")>=0||d.indexOf("swiper-slide-duplicate-next")>=0},g=()=>"function"==typeof i?i(p):i;return r.createElement(n,un({ref:c,className:Xt(`${d}${a?` ${a}`:""}`),"data-swiper-slide-index":l},u),r.createElement(an.Provider,{value:p},o?r.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"==typeof o?o:void 0},g()):g()))}));cn.displayName="SwiperSlide";const dn=p.Ay.button.withConfig({displayName:"SliderStyle__NaviButton",componentId:"sc-1r6p2ob-1"})(["background:none;&.swiper-button-disabled{opacity:0.5;}&.swiper-button-lock{display:none;}"]),hn=(0,p.Ay)(Vt.az).withConfig({displayName:"SliderStyle__NaviWrapper",componentId:"sc-1r6p2ob-3"})(["position:absolute;z-index:2;display:flex;align-items:center;justify-content:space-between;width:3rem;height:",";opacity:",";pointer-events:",";",""],(e=>e.height?e.height:"100%"),(({opacity:e})=>e),(({pointerEvents:e})=>e),(e=>e.arrowNaviOnTop&&(0,p.AH)(["height:2rem;background-color:transparent;"]))),fn=(0,p.Ay)(Ht).withConfig({displayName:"SliderStyle__Wrapper",componentId:"sc-1r6p2ob-4"})(["display:flex;flex-wrap:wrap;width:100%;height:",";max-height:",";position:relative;justify-content:center;padding:",";.swiper-button-next,.swiper-button-prev{&:before{font-family:'mdricons' !important;display:inline-block;color:#000;}}.swiper-wrapper{width:100%;justify-content:",";flex-wrap:nowrap;}.swiper-scrollbar{background-color:rgba(0,0,0,0.1);bottom:0;}.swiper{padding-bottom:",";margin-top:",";width:100%;height:100%;flex-wrap:nowrap;","}.swiper-scrollbar-drag{background-color:",";}.swiper-horizontal > .swiper-scrollbar{position:absolute;width:",";left:",";}.swiper-slide{height:",";display:flex;align-items:center;width:",";> *{width:100%;}}.swiper-vertical .swiper-slide{flex-direction:column;}"," "," ",""],(e=>e.contentHeight?e.contentHeight:"auto"),(e=>e.maxHeight?e.maxHeight:null),(e=>e.padding?e.padding:null),(e=>e.justifyContent?e.justifyContent:null),(e=>e.paddingBottom),(e=>e.marginTop?e.marginTop:"0"),(e=>!0===e.arrowNaviOnTop&&(0,p.AH)(["padding-top:2.5rem;padding-bottom:1rem;margin-top:-2.5rem;"])),(e=>e.scrollbarColor?e.scrollbarColor:"rgba(255, 255, 255, 0.25)"),(e=>e.offsetBefore?"calc(100% - "+2*e.offsetBefore+"px)":"100%"),(e=>e.offsetBefore?e.offsetBefore+"px":0),(e=>e.itemHeight?e.itemHeight:"auto"),(e=>e.itemWidth?e.itemWidth:"auto"),(e=>!0===e.deactivated&&(0,p.AH)([".swiper-scrollbar-drag{background-color:rgba(255,255,255,0.5);}"])),(e=>!0===e.light&&(0,p.AH)([".swiper-scrollbar-drag{background-color:rgba(255,255,255,0.5);}"])),(e=>!0===e.fade&&(0,p.AH)(["transition:opacity 0.3s ease-out;opacity:0;&.animation-enter{opacity:0;}&.animation-enter-active,&.animation-enter-done{opacity:1;}&.animation-exit{opacity:0;}&.animation-exit-active{opacity:0;}"])));zt.Ay.use([zt.Vx,zt.Ze,zt.FJ,zt.t9,zt.dK]);const pn=(0,r.createContext)(null),gn=e=>{const t=(0,r.useRef)(null),n=r.Children.toArray(e.children),[i,a]=(0,r.useState)(null);if((0,r.useEffect)((()=>{null==i||i.slideTo(null==e?void 0:e.slideTo)}),[e.slideTo]),e.deactivated)return(0,U.jsx)(fn,{itemWidth:e.itemWidth,children:n.map(((e,t)=>(0,U.jsx)(cn,{children:e},t)))});let s={hide:!1,snapOnRelease:!1,dragSize:"auto",draggable:!0};!1===e.scrollbar&&(s.el=null),e.scrollbar&&(s=e.scrollbar);const o=[];return n.map(((e,t)=>{o.push((0,U.jsx)(cn,{children:e},t))})),(0,U.jsxs)(fn,{paddingBottom:null!==s.el?e.paddingBottom||"1rem":"0",itemWidth:e.itemWidth||"75%",maxHeight:e.maxHeight,contentHeight:e.contentHeight,ref:t,children:[(0,U.jsx)(pn.Provider,{value:{isSlider:!0},children:(0,U.jsx)(ln,{onSwiper:e.onSwiper||a,allowTouchMove:e.allowTouchMove||!0,slidesPerView:"auto",slidesOffsetBefore:e.slidesOffsetBefore||0,slidesOffsetAfter:e.slidesOffsetAfter||0,spaceBetween:e.spaceBetween||0,simulateTouch:!0,threshold:20,freeMode:e.freeMode||!1,loop:e.loop,grabCursor:!1,centeredSlides:e.centeredSlides,pagination:e.pagination,onSetTransition:e.onTransitionEnd,onSlideChange:e.onSlideChange,onSliderFirstMove:e.onSliderFirstMove,mousewheel:e.mousewheel||!1,navigation:e.navigation||{nextEl:null,prevEl:null},onResize:e.onResize,preventClicksPropagation:!0,preventClicks:!0,onInit:e.onInit,breakpoints:e.breakpoints,effect:e.coverflowEffect?"coverflow":null,coverflowEffect:e.coverflowEffect,scrollbar:s,watchOverflow:!0,keyboard:{enabled:!0,onlyInViewport:!1},onBeforeDestroy:e=>{if(e){const t=e.$el&&e.$el[0];t&&(t.onkeydown=null)}},children:o})}),e.sliderButtons]})},mn=e=>{const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useRef)(null),a=r.Children.toArray(e.children),s=t=>{if("vertical"===e.direction)return!1;t&&a.map(((e,n)=>{e.props.isActive&&t.slideTo(n)}))},[o,l]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{l(!0),void 0!==e.active&&s(null==i?void 0:i.current)}),[e.active]),(0,U.jsxs)(U.Fragment,{children:[o&&(0,U.jsx)(gn,Object.assign({},e,{slidesPerView:"auto",onResize:e=>{s(e)},navigation:e.showNavi?{nextEl:n.current,prevEl:t.current}:{nextEl:null,prevEl:null},pagination:{el:null},keyboard:{enabled:!0,onlyInViewport:!1},onSwiper:e=>{i.current=e,s(e)},onInit:t=>{if("vertical"===e.direction)return!1;setTimeout((()=>{s(t);const e=t.$el&&t.$el[0];e&&e.addEventListener("keydown",(n=>{9===n.keyCode&&t&&t.allowTouchMove&&setTimeout((function(){e.scrollLeft=0,!0===n.shiftKey?t.slidePrev():t.slideNext()}),0)}))}),250)},onUpdate:e=>{s(e)},onBeforeDestroy:e=>{if(e){const t=e.$el&&e.$el[0];t&&(t.onkeydown=null)}},children:a})),(0,U.jsxs)(hn,{backgroundColor:e.naviBgColor,arrowNaviOnTop:e.arrowNaviOnTop,top:e.topNavi||"0",right:e.rightNavi||"0",height:e.heightNavi,opacity:!0===e.showNavi?1:0,pointerEvents:!0!==e.showNavi?"none":null,children:[(0,U.jsx)(dn,{ref:t,children:(0,U.jsx)(J.I,{color:e.naviBtnColor||"#fff",code:g.FI.arrowLeft})}),(0,U.jsx)(dn,{ref:n,children:(0,U.jsx)(J.I,{color:e.naviBtnColor||"#fff",code:g.FI.arrowRight})})]})]})},vn=e=>{const t=(0,r.useContext)(p.Dx),[n,i]=(0,r.useState)(!1),[a,s]=(0,r.useState)(e.firstIndex||0),[o,l]=(0,r.useState)(0),[u,c]=(0,r.useState)(10);let d=0,h=a+1;h>=e.data.length-1&&(h=0);const f=[],m=(0,r.useRef)(null);if((0,r.useEffect)((()=>{!0===e.active&&f.length>0&&(i(!0),y())}),[e.active]),!e.data)return null;const v=t=>{i(!1),e.onRelatedUpdate(t),window.clearInterval(m.current),l(0),c(10),s(t)},y=()=>{let e=0,t=0;m.current=window.setInterval((()=>{e+=1,10===t&&(d+=1,c(10-d),t=0),t++,l(e),100===e&&(window.clearInterval(0),v(h))}),100)};var b;return e.data.map(((t,r)=>{f.push(((t,r)=>{const i=e.active&&h===r;return(0,U.jsxs)(Ot,{children:[e.active&&n&&r===h?(0,U.jsxs)(Nt,{children:[(0,U.jsx)("p",{children:`startet in ${u} Sekunden`}),(0,U.jsx)(Z.mj,{progress:o,color:g.Jy.grey,progressBgColor:g.Jy.blue,width:"2rem",height:"2rem"})]}):null,(0,U.jsx)($t,{fontColor:i?"#fff":"#313131",secondColor:"#313131",width:"256px",type:"standard",bgColor:i?g.Jy.blue:"#f9f9f9",height:"100%",imageSize:"100%",activeBgColor:i?g.Jy.blue:"#f9f9f9",imageVariant:"16x9",innerPadding:"0.5rem",teaserData:t,onClicked:e=>(v(r),!1)})]},"avplayerrelated"+r)})(t,r))})),f.length>0?(0,U.jsxs)(Mt,{open:n,children:[(0,U.jsx)(mn,{spaceBetween:8,slidesOffsetBefore:8,id:"playerRelatedSlider",freeMode:!0,deactivated:!1,mousewheel:!0,naviBgColor:"transparent",naviBtnColor:"transparent",topNavi:"0.25rem",heightNavi:"calc(100% - 0.5rem)",itemWidth:"256px",active:e.active,scrollbar:!0,showNavi:!1,children:f}),(0,U.jsxs)(oe.$,{top:"2rem",boxShadow:"0 0.25rem 0.25rem rgba(0,0,0,.5)",margin:"0",border:"0",onClick:()=>{i(!n)},children:[(0,U.jsx)(J.I,{margin:"0 .25rem 0 0",code:(null==t||null==(b=t.global)||null==(b=b.icons)?void 0:b.playlist)||g.FI.playlist}),(0,U.jsx)("span",{children:"Playlist "+(n?"schliessen":"anzeigen")})]})]}):null},yn=()=>{var e;const{playerApi:t,onClose:n}=o(),{allAvData:i,config:a,onPlayerUrlUpdate:l}=s(),u=(0,r.useRef)(),c=(0,r.useRef)(),d=()=>{t&&t.dispose(),n()};let h=0;return null!=u&&u.current&&null!=c&&c.current&&(h=u.current.getBoundingClientRect().height,h+=c.current.getBoundingClientRect().height),(0,U.jsxs)(_e.A,{onOpened:()=>{},onKeyDown:e=>{27===e&&d()},footer:(0,U.jsx)(It,{isLoading:!1,innerRef:c}),header:(0,U.jsx)(Rt,{isLoading:!1,innerRef:u,onClicked:()=>{d()}}),mode:"player",title:"Player",active:!0,maxHeight:"calc(100%)",children:[(0,U.jsx)(we,{variant:"audio"===(null==i||null==(e=i.avDocument)?void 0:e.type)?"custom-ui":null,frameHeight:h,mode:"solid"}),null!=i&&i.mmgInfos?(0,U.jsx)(vn,{firstIndex:a.index,active:!1,onRelatedUpdate:e=>{a.index=e,l(a.playerXml)},data:i.mmgInfos}):null]})},bn=e=>{const t=(0,r.useContext)(p.Dx).podcastPlayer,{currentAv:n}=s(),i=(0,b.bG)(n.teaserimages.teaserimageResponsive.url,"1x1",512,n.teaserimages.teaserimageResponsive.variants),a=(e,r,a,s)=>(0,U.jsxs)(ye.Pr,{colMode:e,padding:r,children:[(0,U.jsxs)(ye.$P,{padding:e?"1rem":null,order:e?"1":null,isSmall:a,children:[(0,U.jsx)(ke.$,{type:"medium",textAlign:"left",margin:"0 0 .25rem 0",color:t.secondColor,fontSize:a?"0.6875rem":null,children:(0,b.XL)(n.topline)}),(0,U.jsx)(ke.$,{fontWeight:"bold",type:"teaser",color:t.mainColor,fontSize:a?"1rem":"1.25rem",children:(0,b.XL)(n.title)})]}),i&&(0,U.jsx)(fe.h,{altText:n.title,titleText:n.title,imageVariant:"1x1",minWidth:s,maxWidth:s,margin:"0 0 0 auto",url:i})]});let o=e.width<480;return window&&window.innerWidth<768&&(o=!0),o?a(!1,"1rem",!0,"80px"):a(!1,"2rem 2rem 1rem 2rem",!1,"168px")};var wn=n(7958),_n=n(8380);function En(e){(function(e){return e&&"touches"in e})(e)&&e.touches.length<2&&e.preventDefault&&e.preventDefault()}function Tn({onLongPress:e,onClick:t},{delay:n=300,shouldPreventDefault:i=!0}={},a,s){const[o,l]=(0,r.useState)(!1),u=(0,r.useRef)(),c=(0,r.useRef)(),d=(0,r.useCallback)(((t,r)=>{const s=Object.assign({},t);i&&t.target&&(t.target.addEventListener("touchend",En,{passive:!0}),c.current=t.target),u.current=setTimeout((()=>{a.current&&(e(s,r),l(!0),d(t,r))}),n)}),[e,n,i,a]),h=(0,r.useCallback)(((e,n=!0,r)=>{u.current&&clearTimeout(u.current),n&&!o&&(null==t||t(e,r)),l(!1),i&&c.current&&c.current.removeEventListener("touchend",En)}),[i,t,o]);return{onMouseDown:e=>d(e,s),onTouchStart:e=>d(e,s),onMouseUp:e=>h(e,!0,s),onMouseLeave:e=>h(e,!1,s),onTouchEnd:e=>h(e,!0,s)}}var Sn=n(2307),Cn=n(6225);const xn=Cn.A.podcastPlayer.teaserPlusLinks,An=p.Ay.div.withConfig({displayName:"TeaserPlusLinksStyle__Wrapper",componentId:"sc-1paufzz-0"})(["width:100%;padding:2rem 0.5rem 0 0.5rem;background-color:",";background-repeat:no-repeat;display:flex;align-items:flex-end;flex-grow:1;& > div{width:100%;}@media (min-width:","){background-image:",";background-size:85%;background-position:center top;padding:0 1rem 0 1.5rem;width:33%;}"],(({bgColor:e})=>e||xn.bgColor),(({breakpoints:e})=>e.m?`${e.m}px`:`${Cn.A.breakpoints.m}px`),(({bgImage:e})=>`url(${e||xn.bgImage})`)),kn=p.Ay.div.withConfig({displayName:"TeaserPlusLinksStyle__Main",componentId:"sc-1paufzz-1"})(["margin-bottom:1rem;position:relative;"]),Dn=p.Ay.ul.withConfig({displayName:"TeaserPlusLinksStyle__LinkList",componentId:"sc-1paufzz-2"})(["max-height:310px;overflow-y:auto;&::-webkit-scrollbar{display:none;}scrollbar-width:none;li{&:hover{background-color:",";}a{display:block;color:",";padding:0.375rem 0.75rem;}color:",";border:none;border-radius:0.125rem;margin-bottom:0.125rem;background-color:",";-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);}"],(({bgColorHover:e})=>e||xn.linkBgColorHover),(({color:e})=>e||xn.textColor),(({color:e})=>e||xn.textColor),(({bgColor:e})=>e||xn.linkBgColor)),Ln=p.Ay.header.withConfig({displayName:"TeaserPlusLinksStyle__Header",componentId:"sc-1paufzz-3"})(["margin-bottom:0.75rem;"]),Rn=p.Ay.h4.withConfig({displayName:"TeaserPlusLinksStyle__Headline",componentId:"sc-1paufzz-4"})(["border-bottom:",";color:",";padding:0 1rem 0.125rem 1rem;font-size:1rem;text-transform:uppercase;letter-spacing:1px;font-weight:bold;"],(({borderColor:e})=>`0.25rem solid ${e||xn.borderColor}`),(({color:e})=>e||xn.textColor)),Pn=p.Ay.footer.withConfig({displayName:"TeaserPlusLinksStyle__Footer",componentId:"sc-1paufzz-5"})(["color:",";padding:0 0.5rem 0.5rem;display:flex;justify-content:flex-end;margin-right:-1rem;"],(({color:e})=>e||xn.btnColor)),In=p.Ay.a.withConfig({displayName:"TeaserPlusLinksStyle__MoreBtn",componentId:"sc-1paufzz-6"})(["background-color:",";color:",";font-size:0.875rem;font-weight:700;width:auto;border-radius:0.125rem;padding:8px 12px 8px 16px;&:after{content:'\\E632';display:inline-block;font-family:'mdricons';font-weight:normal;padding-left:0.125rem;vertical-align:bottom;}"],(({bgColor:e})=>e||xn.btnBgColor),(({color:e})=>e||xn.btnColor)),On=p.Ay.button.withConfig({displayName:"TeaserPlusLinksStyle__ArrowButton",componentId:"sc-1paufzz-7"})(["cursor:pointer;width:100%;position:absolute;top:",";bottom:",";height:2rem;background-color:transparent;background-image:",";text-align:center;&::after{display:inline-block;font-family:'mdricons';font-size:2rem;color:white;content:",";position:relative;top:",";}&:hover::after{transition:transform 0.2s ease-out;transform:",";}"],(({direction:e})=>"up"===e?0:null),(({direction:e})=>"down"===e?0:null),(({bgColor:e,direction:t})=>{const n=e||xn.bgColor;return"linear-gradient(to top, "+n+("up"===t?"00":"")+", "+n+("down"===t?"00":"")+");"}),(({direction:e})=>({up:'"\\F807"',down:'"\\F806"'}[e])),(({direction:e})=>"up"===e?null:" 0.75rem"),(({direction:e})=>"up"===e?"translateY(-0.2rem)":"translateY(0.2rem)")),Mn=e=>{var t,n,i,a,s,o,l,u,c,d;const h=e.config,f=(0,r.useContext)(p.Dx),g=f.podcastPlayer,m=h.title?h.title:"",v=(0,r.useRef)(null),y=(0,r.useRef)(null),b=(0,r.useRef)(null),[w,_]=(0,r.useState)(!1),[E,T]=(0,r.useState)(!1),S=(e,t)=>{const n=v.current;let r=-1===["mouseup","touchend"].indexOf(e.type)?20:40;r="up"===t?-1*r:r,n&&n.scrollBy({top:r,left:0,behavior:"smooth"})},C=t=>(!(0,Sn.KC)()||(0,Sn.lR)()||(e.onTeaserPlusLinkClicked&&e.onTeaserPlusLinkClicked(t.target),t.preventDefault()),!1),x={shouldPreventDefault:!0,delay:75,hold:!0},A=Tn({onLongPress:S,onClick:S},x,y,"up"),k=Tn({onLongPress:S,onClick:S},x,b,"down");return(0,r.useEffect)((()=>{const e=e=>{const t=e.target;t.scrollTop>0?!w&&_(!0):w&&_(!1),t.scrollTop+t.clientHeight===t.scrollHeight?T(!1):T(!0)},t=v.current;return t.addEventListener("scroll",e),()=>{t.removeEventListener("scroll",e)}}),[w]),(0,r.useEffect)((()=>{const e=v.current;e.scrollHeight>e.clientHeight&&T(!0)}),[]),(0,U.jsx)(An,{className:"_sectionWrapperRelated",bgColor:null==(t=g.teaserPlusLinks)?void 0:t.bgColor,bgImage:null==(n=g.teaserPlusLinks)?void 0:n.bgImage,breakpoints:f.breakpoints,children:(0,U.jsxs)("div",{children:[(0,U.jsx)(Ln,{children:(0,U.jsx)(Rn,{color:null==(i=g.teaserPlusLinks)?void 0:i.textColor,borderColor:null==(a=g.teaserPlusLinks)?void 0:a.borderColor,children:m})}),(0,U.jsxs)(kn,{children:[(0,U.jsx)(Dn,{className:"list",color:null==(s=g.teaserPlusLinks)?void 0:s.textColor,bgColorHover:null==(o=g.teaserPlusLinks)?void 0:o.linkBgColorHover,bgColor:null==(l=g.teaserPlusLinks)?void 0:l.linkBgColor,ref:v,children:e.config.morePodcasts&&e.config.morePodcasts.map(((e,t)=>(0,U.jsx)("li",{children:(0,U.jsx)("a",{"data-xml":e.mmgXml,href:e.href,onClick:C,children:e.text})},t)))}),w&&(0,U.jsx)(On,Object.assign({ref:y,"aria-label":"nach oben"},A,{type:"button",direction:"up"})),E&&(0,U.jsx)(On,Object.assign({ref:b,"aria-label":"nach unten"},k,{type:"button",direction:"down"}))]}),h.moreBtn&&(0,U.jsx)(Pn,{color:null==(u=g.teaserPlusLinks)?void 0:u.btnColor,children:(0,U.jsx)(In,{href:h.moreBtn.href,color:null==(c=g.teaserPlusLinks)?void 0:c.btnColor,bgColor:null==(d=g.teaserPlusLinks)?void 0:d.btnBgColor,children:h.moreBtn.text})})]})})},Nn=()=>{var e;const t=(0,r.useContext)(p.Dx).podcastPlayer,n=(0,r.useRef)(null),[i,a]=(0,r.useState)(0),{currentAv:l,allAvData:u,config:c}=s(),{onTeaserPlusLinkClicked:d,onLightboxOpened:h}=o(),f=l,m=(0,r.useCallback)((e=>{a(e)}),[]),{ref:v}=(0,me.u)({handleWidth:!0,onResize:m,refreshMode:"debounce",refreshRate:1e3}),y=(null==c||null==(e=c.teaserPlusLinks)||null==(e=e.morePodcasts)?void 0:e.length)>0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(ye.mO,{bgColor:t.bgColor,hasTeaserPlusLinksBox:y,children:[f?(0,U.jsxs)("div",{id:"react-resize-detector-podcast-player-wrapper",style:{minWidth:"100%"},ref:v,children:[(0,U.jsx)(bn,{width:i}),(0,U.jsx)(we,{variant:"podcast"}),(0,U.jsxs)(ye.wi,{children:[l.htmlUrl?(0,U.jsxs)(oe.$,{color:t.playlistBtn.textColor,activeColor:t.playlistBtn.hoverTextColor,activeBgColor:t.playlistBtn.hoverBgColor,onClick:()=>{document.location.href=u.multimediagallery.htmlUrl},bgColor:t.playlistBtn.bgColor,variant:"playerStandard",margin:"0 auto 0 0",fontSize:"0.875rem",minWidth:"0",children:[(0,U.jsx)(J.I,{width:"1.25rem",height:"1.25rem",color:t.playlistBtn.textColor,code:g.FI.playlist}),(0,U.jsx)(wn.$U,{at:"xs",children:(0,U.jsx)("span",{style:{marginLeft:"0.25rem"},children:"Alle Audios"})})]}):null,(0,U.jsx)(_n.A,{onLightboxOpened:()=>{h&&h()},data:u,theme:t,subMode:!0})]})]}):null,(0,U.jsx)("div",{ref:n})]}),y&&(0,U.jsx)(Mn,{config:c.teaserPlusLinks,onTeaserPlusLinkClicked:d})]})},Fn=p.Ay.div.withConfig({displayName:"ARDPlayerPlusContentStyle__Layer",componentId:"sc-1nnxfp9-0"})(["position:absolute;top:0;width:calc(100% - 180px);left:0;"]),Bn=p.Ay.div.withConfig({displayName:"ARDPlayerPlusContentStyle__ScrollerWrapper",componentId:"sc-1nnxfp9-1"})(["position:relative;background-color:#dcdcdc;width:100%;padding:0.5rem 0;"]),jn=p.Ay.div.withConfig({displayName:"ARDPlayerPlusContentStyle__DetailLayer",componentId:"sc-1nnxfp9-2"})(["position:absolute;width:100%;height:100%;top:0;display:flex;align-items:center;justify-content:center;left:0;padding-top:5rem;"]),Un=p.Ay.div.withConfig({displayName:"ARDPlayerPlusContentStyle__DetailLayerBackground",componentId:"sc-1nnxfp9-3"})(["position:absolute;width:100%;height:100%;background-color:rgba(0,0,0,0.8);top:0;left:0;"]),$n=p.Ay.div.withConfig({displayName:"ARDPlayerPlusContentStyle__TeaserWrapper",componentId:"sc-1nnxfp9-4"})(["width:100%;display:flex;position:relative;"]),Vn=e=>{if(!e.chapters)return null;const t=e.chapters.map(((t,n)=>(0,U.jsx)(oe.$,{margin:"0 0.25rem 1rem 0",border:"0",onClick:()=>{e.onClicked&&e.onClicked(t)},children:`${(0,b.Xx)(t.title)}`},n)));return t.length>0?(0,U.jsx)(Bn,{children:(0,U.jsx)(mn,{spaceBetween:8,slidesOffsetBefore:8,id:"channel",freeMode:!0,deactivated:!1,naviBgColor:"transparent",naviBtnColor:"transparent",topNavi:"0.25rem",heightNavi:"calc(100% - 0.5rem)",itemWidth:"auto !important",scrollbar:!0,showNavi:!1,children:t})}):null},Hn=e=>{var t,n;return(0,U.jsx)(mn,{rightNavi:e.isSmall?"1rem":"0",topNavi:"-2.5rem",spaceBetween:8,deactivated:e.deactivated||!1,itemWidth:e.itemWidth||"100%",isSmall:e.isSmall,arrowColor:null==(t=e.theme)?void 0:t.textColor,slidesOffsetBefore:e.offsetBefore||(e.isSmall?16:0),scrollbarColor:null==(n=e.theme)?void 0:n.scrollbarColor,justifyContent:"flex-start",arrowNaviOnTop:void 0===e.showNavi||e.showNavi,offsetAfter:0,scrollbar:!0,showNavi:void 0!==e.showNavi?e.showNavi:!e.isSmall,children:e.children})},zn=e=>{const[t,n]=(0,r.useState)(null),i=[];if(!e.data||!e.data.themes)return null;const a=()=>{if(!t)return null;const r=[];return t.teaser.map(((t,n)=>{s(t)&&r.push(((t,n)=>{const r=(new DOMParser).parseFromString(t.html,"text/html");let i=null;const a=r.querySelector(".linkAll");a&&(i=a.getAttribute("href"));const s=r.querySelector(".mediaCon img");let o="";s&&(o=(0,b.Q3)(s,"image").urlScheme);const l={title:t.title,url:i,teaserText:t.teasertext,image:{urlScheme:o}};return(0,U.jsx)($t,{fontColor:"#313131",secondColor:"#313131",width:"100%",titleFontWeight:"bold",isSmall:e.isSmall,margin:"0 0 1rem 0",bgColor:"#f9f9f9",showTeaserText:!e.isSmall,height:"100%",activeBgColor:"#dcdcdc",imageVariant:"16x9",type:"small",innerPadding:"0.5rem",imageSize:"100%",teaserData:l},"avplusteaser"+n)})(t,n))})),r.length>0?(0,U.jsxs)(jn,{children:[(0,U.jsx)(Un,{onClick:()=>{n(null)}}),(0,U.jsx)($n,{children:(0,U.jsx)(Hn,{showNavi:!1,offsetBefore:16,justifyContent:"space-between",itemWidth:"33.333%",isSmall:e.isSmall,children:r})})]}):null},s=t=>e.currentTime>(0,b.Pn)(t.avCueIn)&&e.currentTime<(0,b.Pn)(t.avCueOut);return e.data.themes.map(((e,r)=>{let a=0;e.teaser.map(((e,t)=>{s(e)&&a++}));let o=g.FI.internalLink;"cssVideo"===e.type&&(o=g.FI.video),"cssAudio"===e.type&&(o=g.FI.audio),"cssImage"===e.type&&(o=g.FI.image),"cssImageGallery"===e.type&&(o=g.FI.image);const l=(null==t?void 0:t.type)===e.type,u=a>1?`(${a})`:null;a>0&&i.push((0,U.jsxs)(oe.$,{bgColor:l?g.Jy.blue:null,border:"0",whiteSpace:"initial",maxWidth:"100%",color:l?"#fff":null,activeColor:l?"#fff":null,onClick:()=>{n(null),setTimeout((()=>{l||n(e)}),0)},children:[(0,U.jsx)(J.I,{color:l?"#fff":null,margin:"0 .25rem 0 0 ",code:o})," ",`${e.title}`," ",u]}))})),i.length>0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Fn,{children:(0,U.jsx)(mn,{spaceBetween:8,slidesOffsetBefore:16,id:"avPlusContentNavi",freeMode:!0,deactivated:!1,naviBgColor:"transparent",naviBtnColor:"transparent",topNavi:"0.25rem",heightNavi:"calc(100% - 0.5rem)",itemWidth:"auto !important",scrollbar:!1,showNavi:!1,children:i})}),a()]}):null},Gn=()=>{var e;const{allAvData:t}=s(),{currentTime:n,onSeek:i}=o(),[a,l]=(0,r.useState)(0),{ref:u}=(0,me.u)({handleWidth:!0,onResize:e=>{e&&e>0&&l(e)}});return(0,U.jsxs)(U.Fragment,{children:[null!=t&&null!=(e=t.avPlusInfos)&&e.chapters?(0,U.jsx)(Vn,{onClicked:e=>{const t=(0,b.Pn)(e.avCueIn);i(t,!1,"seconds")},chapters:t.avPlusInfos.chapters}):null,(0,U.jsxs)("div",{ref:u,style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:[(0,U.jsx)(we,{}),t.avPlusInfos?(0,U.jsx)(zn,{isSmall:a<768,currentTime:n,data:t.avPlusInfos}):null]})]})};var Wn=n(133);const qn=({variant:e,onClose:t,onPlayerStateHandlerExt:n})=>{const{currentAv:i,config:o,ardPlayerMediaCollection:u,ardPlayerConfig:c,onTeaserPlusLinkClicked:h}=s(),[f,p]=(0,r.useState)(),[g,m]=(0,r.useState)(0),[v,y]=(0,r.useState)(1),b=(0,r.useRef)(1),[w,_]=(0,r.useState)(0),[E,T]=(0,r.useState)(!1),[S,C]=(0,r.useState)(!0),[x,A]=(0,r.useState)(3),k=["0.25","0.5","0.75","1.0","1.25","1.5","1.75","2.0"],{isLoading:D}=d(o.ardPlayerJS,o.ardPlayerCSS),L=(0,r.useRef)(!1),R=(0,r.useRef)(!0),P=(0,r.useRef)(!1),I=(0,r.useRef)(!1);(0,r.useEffect)((()=>{!1===D&&u&&c&&!f&&null!=l.A&&l.A.ardplayer?p(new l.A.ardplayer.Player("playerreact-"+o.id,c,u)):f&&f.setConfig(c,u)}),[i,D]);return(0,U.jsx)(a.Provider,{value:{currentTime:g,duration:w,playerApi:f,paused:S,isBuffering:E,playbackRate:x,volume:v,onTeaserPlusLinkClicked:h,playbackRates:k,onPlaybackRateChange:e=>{let t=x;t{if("seconds"===n)return f.seekTo(e),f.play(),!1;f.seekTo(e*w),f.play()},onVolumeChange:(e,t)=>{if(t){const t=0===e?0:0===b.current?1:b.current;y(t),f.setMuted(0===t),f.setVolume(100*t)}else y(e),f.setMuted(!1),f.setVolume(100*e),b.current=e},onTogglePlay:()=>{if((0,Wn.DG)(i)&&"audio"===i.type.toLowerCase()){if(!0===I.current){const e=Object.assign({},c);e.generic.isAutoplay=!0,e.web.isForcedAutoplay=!0,e.web.mediaContainer=(0,Wn.Cr)((null==i?void 0:i.type)||"video",o.id);const t=new l.A.ardplayer.Player("playerreact-"+o.id,e,u);return p(t),C(!1),I.current=!1,!1}return f&&f.isPlaying?(f.dispose(),C(!0),I.current=!0):(f.seekToLive(),f.play()),!1}f.isPlaying?f.pause():f.play()},onPlayerStateHandler:({type:e,props:t,playerState:r})=>{let i=e;!w&&r.duration&&(_(r.duration),y(f.getVolume()/100)),r.currentTime&&"progress"===e&&(!0===(null==L?void 0:L.current)&&(T(!1),P.current=!1,L.current=!1),!0===(null==R?void 0:R.current)&&(C(!1),R.current=!1),m(r.currentTime)),"waiting"===e&&!0!==P.current&&(L.current=!0,T(!0)),"ended"===e&&(f.pause(),P.current=!0,C(!0),m(0)),"pause"===e&&(R.current=!0,C(!0)),"stop"===e&&(R.current=!0,C(!0),i="ended"),n({type:i,props:t,playerState:r,playerApi:f})},onClose:()=>{t()}},children:(()=>{switch(e){case"inline-audio":return(0,U.jsx)(we,{variant:"custom-ui"});case"radiolivestream":return(0,U.jsx)(we,{variant:"radiolivestream"});case"inline":return(0,U.jsx)(we,{});case"lightbox":return(0,U.jsx)(yn,{});case"podcast":return(0,U.jsx)(Nn,{});case"avplus":return(0,U.jsx)(Gn,{})}})()})};var Yn=n(3034);function Kn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xn,Qn,Jn,Zn,er,tr={exports:{}};Xn=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Qn=/^(?=([^\/?#]*))\1([^]*)$/,Jn=/(?:\/|^)\.(?=\/)/g,Zn=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,tr.exports=er={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=er.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=er.normalizePath(r.path),er.buildURLFromParts(r)}var i=er.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return n.alwaysNormalize?(i.path=er.normalizePath(i.path),er.buildURLFromParts(i)):t;var a=er.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var s=Qn.exec(a.path);a.netLoc=s[1],a.path=s[2]}a.netLoc&&!a.path&&(a.path="/");var o={scheme:a.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(o.netLoc=a.netLoc,"/"!==i.path[0]))if(i.path){var l=a.path,u=l.substring(0,l.lastIndexOf("/")+1)+i.path;o.path=er.normalizePath(u)}else o.path=a.path,i.params||(o.params=a.params,i.query||(o.query=a.query));return null===o.path&&(o.path=n.alwaysNormalize?er.normalizePath(i.path):i.path),er.buildURLFromParts(o)},parseURL:function(e){var t=Xn.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(Jn,"");e.length!==(e=e.replace(Zn,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};var nr=tr.exports;function rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t`):pr}(t)}))}const yr=mr,br=/^(\d+)x(\d+)$/,wr=/(.+?)=(".*?"|.*?)(?:,|$)/g;class AttrList{constructor(e){"string"==typeof e&&(e=AttrList.parseAttrList(e)),or(this,e)}get clientAttrs(){return Object.keys(this).filter((e=>"X-"===e.substring(0,2)))}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const n=new Uint8Array(t.length/2);for(let e=0;eNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=br.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const n={};for(wr.lastIndex=0;null!==(t=wr.exec(e));){let e=t[2];0===e.indexOf('"')&&e.lastIndexOf('"')===e.length-1&&(e=e.slice(1,-1));n[t[1].trim()]=e}return n}}function _r(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class DateRange{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const n=t.attr;for(const t in n)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==n[t]){yr.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=or(new AttrList({}),n,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);lr(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(lr(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&lr(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class LoadStats{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var Er="audio",Tr="video",Sr="audiovideo";class BaseSegment{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Er]:null,[Tr]:null,[Sr]:null},this.baseurl=e}setByteRange(e,t){const n=e.split("@",2);let r;r=1===n.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=nr.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Fragment extends BaseSegment{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new LoadStats,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!lr(this.programDateTime))return null;const e=lr(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,n,r,i,a=!1){const{elementaryStreams:s}=this,o=s[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,n),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,i)):s[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:a}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[Er]=null,e[Tr]=null,e[Sr]=null}}class Part extends BaseSegment{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new LoadStats,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const a=e.enumeratedString("BYTERANGE");a&&this.setByteRange(a,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}class LevelDetails{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&lr(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Cr(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function xr(e){const t=e.split(":");let n=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),r=e[e.length-1].split(",");if(2===r.length){const t="base64"===r[0],i=r[1];t?(e.splice(-1,1),n=Cr(i)):n=function(e){const t=Ar(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}(i)}}return n}function Ar(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}const kr="undefined"!=typeof self?self:void 0;var Dr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Lr="org.w3.clearkey",Rr="com.apple.streamingkeydelivery",Pr="com.microsoft.playready",Ir="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Or(e){switch(e){case Rr:return Dr.FAIRPLAY;case Pr:return Dr.PLAYREADY;case Ir:return Dr.WIDEVINE;case Lr:return Dr.CLEARKEY}}var Mr="edef8ba979d64acea3c827dcd51d21ed";function Nr(e){switch(e){case Dr.FAIRPLAY:return Rr;case Dr.PLAYREADY:return Pr;case Dr.WIDEVINE:return Ir;case Dr.CLEARKEY:return Lr}}function Fr(e){const{drmSystems:t,widevineLicenseUrl:n}=e,r=t?[Dr.FAIRPLAY,Dr.WIDEVINE,Dr.PLAYREADY,Dr.CLEARKEY].filter((e=>!!t[e])):[];return!r[Dr.WIDEVINE]&&n&&r.push(Dr.WIDEVINE),r}const Br=null!=kr&&null!=(jr=kr.navigator)&&jr.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var jr;function Ur(e,t,n){return Uint8Array.prototype.slice?e.slice(t,n):new Uint8Array(Array.prototype.slice.call(e,t,n))}const $r=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,Vr=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,Hr=(e,t)=>{const n=t;let r=0;for(;$r(e,t);){r+=10;r+=zr(e,t+6),Vr(e,t+10)&&(r+=10),t+=r}if(r>0)return e.subarray(n,n+r)},zr=(e,t)=>{let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n},Gr=(e,t)=>$r(e,t)&&zr(e,t+6)+10<=e.length-t,Wr=e=>{const t=Kr(e);for(let n=0;ne&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,Yr=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=zr(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}},Kr=e=>{let t=0;const n=[];for(;$r(e,t);){const r=zr(e,t+6);t+=10;const i=t+r;for(;t+8"PRIV"===e.type?Qr(e):"W"===e.type[0]?Zr(e):Jr(e),Qr=e=>{if(e.size<2)return;const t=ti(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}},Jr=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const n=ti(e.data.subarray(t),!0);t+=n.length+1;const r=ti(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=ti(e.data.subarray(1));return{key:e.type,data:t}},Zr=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const n=ti(e.data.subarray(t),!0);t+=n.length+1;const r=ti(e.data.subarray(t));return{key:e.type,info:n,data:r}}const t=ti(e.data);return{key:e.type,data:t}},ei=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),n=1&t[3];let r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}},ti=(e,t=!1)=>{const n=ri();if(n){const r=n.decode(e);if(t){const e=r.indexOf("\0");return-1!==e?r.substring(0,e):r}return r.replace(/\0/g,"")}const r=e.length;let i,a,s,o="",l=0;for(;l>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:a=e[l++],o+=String.fromCharCode((31&i)<<6|63&a);break;case 14:a=e[l++],s=e[l++],o+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}}return o};let ni;function ri(){if(!navigator.userAgent.includes("PlayStation 4"))return ni||void 0===self.TextDecoder||(ni=new self.TextDecoder("utf-8")),ni}const ii=function(e){let t="";for(let n=0;n>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function pi(e,t){const n=[];if(!t.length)return n;const r=e.byteLength;for(let i=0;i1?i+a:r;if(li(e.subarray(i+4,i+8))===t[0])if(1===t.length)n.push(e.subarray(i+8,s));else{const r=pi(e.subarray(i+8,s),t.slice(1));r.length&&si.apply(n,r)}i=s}return n}function gi(e){const t=[],n=e[0];let r=8;const i=ci(e,r);r+=4;let a=0,s=0;0===n?(a=ci(e,r),s=ci(e,r+4),r+=8):(a=di(e,r),s=di(e,r+8),r+=16),r+=2;let o=e.length+s;const l=ui(e,r);r+=2;for(let u=0;u>>31)return yr.warn("SIDX has hierarchical references (not supported)"),null;const l=ci(e,n);n+=4,t.push({referenceSize:s,subsegmentDuration:l,info:{duration:l/i,start:o,end:o+s-1}}),o+=s,n+=4,r=n}return{earliestPresentationTime:a,timescale:i,version:n,referencesCount:l,references:t}}function mi(e){const t=[],n=pi(e,["moov","trak"]);for(let r=0;r{const n=ci(e,4),r=t[n];r&&(r.default={duration:ci(e,12),flags:ci(e,20)})})),t}function vi(e){const t=e.subarray(8),n=t.subarray(86),r=li(t.subarray(4,8));let i=r;const a="enca"===r||"encv"===r;if(a){const e=pi(t,[r])[0];pi(e.subarray("enca"===r?28:78),["sinf"]).forEach((e=>{const t=pi(e,["schm"])[0];if(t){const n=li(t.subarray(4,8));if("cbcs"===n||"cenc"===n){const t=pi(e,["frma"])[0];t&&(i=li(t))}}}))}switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const e=pi(n,["avcC"])[0];i+="."+bi(e[1])+bi(e[2])+bi(e[3]);break}case"mp4a":{const e=pi(t,[r])[0],n=pi(e.subarray(28),["esds"])[0];if(n&&n.length>12){let e=4;if(3!==n[e++])break;e=yi(n,e),e+=2;const t=n[e++];if(128&t&&(e+=2),64&t&&(e+=n[e++]),4!==n[e++])break;e=yi(n,e);const r=n[e++];if(64!==r)break;if(i+="."+bi(r),e+=12,5!==n[e++])break;e=yi(n,e);const a=n[e++];let s=(248&a)>>3;31===s&&(s+=1+((7&a)<<3)+((224&n[e])>>5)),i+="."+s}break}case"hvc1":case"hev1":{const e=pi(n,["hvcC"])[0],t=e[1],r=["","A","B","C"][t>>6],a=31&t,s=ci(e,2),o=(32&t)>>5?"H":"L",l=e[12],u=e.subarray(6,12);i+="."+r+a,i+="."+s.toString(16).toUpperCase(),i+="."+o+l;let c="";for(let n=u.length;n--;){const e=u[n];if(e||c){c="."+e.toString(16).toUpperCase()+c}}i+=c;break}case"dvh1":case"dvhe":{const e=pi(n,["dvcC"])[0],t=e[2]>>1&127,r=e[2]<<5&32|e[3]>>3&31;i+="."+wi(t)+"."+wi(r);break}case"vp09":{const e=pi(n,["vpcC"])[0],t=e[4],r=e[5],a=e[6]>>4&15;i+="."+wi(t)+"."+wi(r)+"."+wi(a);break}case"av01":{const e=pi(n,["av1C"])[0],t=e[1]>>>5,r=31&e[1],a=e[2]>>>7?"H":"M",s=(64&e[2])>>6,o=(32&e[2])>>5,l=2===t&&s?o?12:10:s?10:8,u=(16&e[2])>>4,c=(8&e[2])>>3,d=(4&e[2])>>2,h=3&e[2],f=1,p=1,g=1,m=0;i+="."+t+"."+wi(r)+a+"."+wi(l)+"."+u+"."+c+d+h+"."+wi(f)+"."+wi(p)+"."+wi(g)+"."+m;break}}return{codec:i,encrypted:a}}function yi(e,t){const n=t+5;for(;128&e[t++]&&t{const l=o.byteOffset-8;pi(o,["traf"]).map((o=>{const u=pi(o,["tfdt"]).map((e=>{const t=e[0];let n=ci(e,4);return 1===t&&(n*=Math.pow(2,32),n+=ci(e,8)),n/i}))[0];return void 0!==u&&(e=u),pi(o,["tfhd"]).map((u=>{const c=ci(u,4),d=16777215&ci(u,0);let h=0;const f=!!(16&d);let p=0;const g=!!(32&d);let m=8;c===a&&(!!(1&d)&&(m+=8),!!(2&d)&&(m+=4),!!(8&d)&&(h=ci(u,m),m+=4),f&&(p=ci(u,m),m+=4),g&&(m+=4),"video"===t.type&&(s=function(e){if(!e)return!1;const t=e.indexOf("."),n=t<0?e:e.substring(0,t);return"hvc1"===n||"hev1"===n||"dvh1"===n||"dvhe"===n}(t.codec)),pi(o,["trun"]).map((a=>{const o=a[0],u=16777215&ci(a,0),c=!!(1&u);let d=0;const f=!!(4&u),g=!!(256&u);let m=0;const v=!!(512&u);let y=0;const b=!!(1024&u),w=!!(2048&u);let _=0;const E=ci(a,4);let T=8;c&&(d=ci(a,T),T+=4),f&&(T+=4);let S=d+l;for(let l=0;l>1&63;return 39===e||40===e}return 6===(31&t)}function xi(e,t,n,r){const i=Ai(e);let a=0;a+=t;let s=0,o=0,l=0;for(;a=i.length)break;l=i[a++],s+=l}while(255===l);o=0;do{if(a>=i.length)break;l=i[a++],o+=l}while(255===l);const e=i.length-a;let t=a;if(oe){yr.error(`Malformed SEI payload. ${o} is too small, only ${e} bytes left to parse.`);break}if(4===s){if(181===i[t++]){const e=ui(i,t);if(t+=2,49===e){const e=ci(i,t);if(t+=4,1195456820===e){const e=i[t++];if(3===e){const a=i[t++],o=64&a,l=o?2+3*(31&a):0,u=new Uint8Array(l);if(o){u[0]=a;for(let e=1;e16){const e=[];for(let n=0;n<16;n++){const r=i[t++].toString(16);e.push(1==r.length?"0"+r:r),3!==n&&5!==n&&7!==n&&9!==n||e.push("-")}const a=o-16,l=new Uint8Array(a);for(let n=0;n0?(a=new Uint8Array(4),t.length>0&&new DataView(a.buffer).setUint32(0,t.length,!1)):a=new Uint8Array;const s=new Uint8Array(4);return n&&n.byteLength>0&&new DataView(s.buffer).setUint32(0,n.byteLength,!1),function(e,...t){const n=t.length;let r=8,i=n;for(;i--;)r+=t[i].byteLength;const a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=255&r,a.set(e,4),i=0,r=8;i>8*(15-n)&255;return t}(e);return new LevelKey(this.method,this.uri,"identity",this.keyFormatVersions,t)}const t=xr(this.uri);if(t)switch(this.keyFormat){case Ir:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case Pr:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=ki(e,null,t);const n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(n)),i=r.substring(r.indexOf("<"),r.length),a=(new DOMParser).parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(a){const e=a.childNodes[0]?a.childNodes[0].nodeValue:a.getAttribute("VALUE");if(e){const t=Cr(e).subarray(0,16);!function(e){const t=function(e,t,n){const r=e[t];e[t]=e[n],e[n]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Di[this.uri];if(!e){const t=Object.keys(Di).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16);new DataView(e.buffer,12,4).setUint32(0,t),Di[this.uri]=e}this.keyId=e}return this}}const Li=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ri(e){return Li.test(e)}function Pi(e,t,n){if(null!==e.variableList||e.hasVariableRefs)for(let r=n.length;r--;){const i=n[r],a=t[i];a&&(t[i]=Ii(e,a))}}function Ii(e,t){if(null!==e.variableList||e.hasVariableRefs){const n=e.variableList;return t.replace(Li,(t=>{const r=t.substring(2,t.length-1),i=null==n?void 0:n[r];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),t):i}))}return t}function Oi(e,t,n){let r,i,a=e.variableList;if(a||(e.variableList=a={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{const e=new self.URL(n).searchParams;if(!e.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${n}"`);i=e.get(r)}catch(s){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${s.message}`))}}else r=t.NAME,i=t.VALUE;r in a?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):a[r]=i||""}function Mi(e,t,n){const r=t.IMPORT;if(n&&r in n){let t=e.variableList;t||(e.variableList=t={}),t[r]=n[r]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}function Ni(e=!0){if("undefined"==typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}const Fi={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Bi(e,t,n=!0){return!e.split(",").some((e=>!ji(e,t,n)))}function ji(e,t,n=!0){var r;const i=Ni(n);return null!=(r=null==i?void 0:i.isTypeSupported(Ui(e,t)))&&r}function Ui(e,t){return`${t}/mp4;codecs="${e}"`}function $i(e){if(e){const t=e.substring(0,4);return Fi.video[t]}return 2}function Vi(e){return e.split(",").reduce(((e,t)=>{const n=Fi.video[t];return n?(2*n+e)/(e?3:2):(Fi.audio[t]+e)/(e?2:1)}),0)}const Hi={};const zi=/flac|opus/i;function Gi(e,t=!0){return e.replace(zi,(e=>function(e,t=!0){if(Hi[e])return Hi[e];const n={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[e];for(let r=0;r0&&r.length({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:a.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(Yi.lastIndex=0;null!==(r=Yi.exec(e));){const e=new AttrList(r[1]),a=e.TYPE;if(a){const r=s[a],l=i[a]||[];i[a]=l,Pi(n,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const u=e.LANGUAGE,c=e["ASSOC-LANGUAGE"],d=e.CHANNELS,h=e.CHARACTERISTICS,f=e["INSTREAM-ID"],p={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",name:e.NAME||u||"",type:a,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:u,url:e.URI?M3U8Parser.resolve(e.URI,t):""};if(c&&(p.assocLang=c),d&&(p.channels=d),h&&(p.characteristics=h),f&&(p.instreamId=f),null!=r&&r.length){const e=M3U8Parser.findGroup(r,p.groupId)||r[0];ta(p,e,"audioCodec"),ta(p,e,"textCodec")}l.push(p)}}return i}static parseLevelPlaylist(e,t,n,r,i,a){const s=new LevelDetails(t),o=s.fragments;let l,u,c,d=null,h=0,f=0,p=0,g=0,m=null,v=new Fragment(r,t),y=-1,b=!1,w=null;for(Xi.lastIndex=0,s.m3u8=e,s.hasVariableRefs=Ri(e);null!==(l=Xi.exec(e));){b&&(b=!1,v=new Fragment(r,t),v.start=p,v.sn=h,v.cc=g,v.level=n,d&&(v.initSegment=d,v.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null,w&&(v.setByteRange(w),w=null)));const e=l[1];if(e){v.duration=parseFloat(e);const t=(" "+l[2]).slice(1);v.title=t||null,v.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(lr(v.duration)){v.start=p,c&&ia(v,c,s),v.sn=h,v.level=n,v.cc=g,o.push(v);const e=(" "+l[3]).slice(1);v.relurl=Ii(s,e),na(v,m),m=v,p+=v.duration,h++,f=0,b=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);m?v.setByteRange(e,m):v.setByteRange(e)}else if(l[5])v.rawProgramDateTime=(" "+l[5]).slice(1),v.tagList.push(["PROGRAM-DATE-TIME",v.rawProgramDateTime]),-1===y&&(y=o.length);else{if(l=l[0].match(Qi),!l){yr.warn("No matches on slow regex match for level playlist!");continue}for(u=1;u0&&e.bool("CAN-SKIP-DATERANGES"),s.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),s.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new AttrList(i);s.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=s.partList;e||(e=s.partList=[]);const n=f>0?e[e.length-1]:void 0,r=f++,a=new AttrList(i);Pi(s,a,["BYTERANGE","URI"]);const o=new Part(a,v,t,r,n);e.push(o),v.duration+=o.duration;break}case"PRELOAD-HINT":{const e=new AttrList(i);Pi(s,e,["URI"]),s.preloadHint=e;break}case"RENDITION-REPORT":{const e=new AttrList(i);Pi(s,e,["URI"]),s.renditionReports=s.renditionReports||[],s.renditionReports.push(e);break}default:yr.warn(`line parsed but not handled: ${l}`)}}}m&&!m.relurl?(o.pop(),p-=m.duration,s.partList&&(s.fragmentHint=m)):s.partList&&(na(v,m),v.cc=g,s.fragmentHint=v,c&&ia(v,c,s));const _=o.length,E=o[0],T=o[_-1];if(p+=s.skippedSegments*s.targetduration,p>0&&_&&T){s.averagetargetduration=p/_;const e=T.sn;s.endSN="initSegment"!==e?e:0,s.live||(T.endList=!0),E&&(s.startCC=E.cc)}else s.endSN=0,s.startCC=0;return s.fragmentHint&&(p+=s.fragmentHint.duration),s.totalduration=p,s.endCC=g,y>0&&function(e,t){let n=e[t];for(let r=t;r--;){const t=e[r];if(!t)return;t.programDateTime=n.programDateTime-1e3*t.duration,n=t}}(o,y),s}}function Ji(e,t,n){var r,i;const a=new AttrList(e);Pi(n,a,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const s=null!=(r=a.METHOD)?r:"",o=a.URI,l=a.hexadecimalInteger("IV"),u=a.KEYFORMATVERSIONS,c=null!=(i=a.KEYFORMAT)?i:"identity";o&&a.IV&&!l&&yr.error(`Invalid IV: ${a.IV}`);const d=o?M3U8Parser.resolve(o,t):"",h=(u||"1").split("/").map(Number).filter(Number.isFinite);return new LevelKey(s,d,c,h,l)}function Zi(e){const t=new AttrList(e).decimalFloatingPoint("TIME-OFFSET");return lr(t)?t:null}function ea(e,t){let n=(e||"").split(/[ ,]+/).filter((e=>e));["video","audio","text"].forEach((e=>{const r=n.filter((t=>function(e,t){const n=Fi[t];return!!n&&!!n[e.slice(0,4)]}(t,e)));r.length&&(t[`${e}Codec`]=r.join(","),n=n.filter((e=>-1===r.indexOf(e))))})),t.unknownCodecs=n}function ta(e,t,n){const r=t[n];r&&(e[n]=r)}function na(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),lr(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function ra(e,t,n,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function ia(e,t,n){e.levelkeys=t;const{encryptedFragments:r}=n;r.length&&r[r.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||r.push(e)}var aa="manifest",sa="level",oa="audioTrack",la="subtitleTrack",ua="main",ca="audio",da="subtitle";function ha(e){const{type:t}=e;switch(t){case oa:return ca;case la:return da;default:return ua}}function fa(e,t){let n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}class PlaylistLoader{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.LEVEL_LOADING,this.onLevelLoading,this),e.on(dr.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(dr.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.LEVEL_LOADING,this.onLevelLoading,this),e.off(dr.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(dr.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,r=t.loader,i=new(n||r)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:aa,url:n,deliveryDirectives:null})}onLevelLoading(e,t){const{id:n,level:r,pathwayId:i,url:a,deliveryDirectives:s}=t;this.load({id:n,level:r,pathwayId:i,responseType:"text",type:sa,url:a,deliveryDirectives:s})}onAudioTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:a}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:oa,url:i,deliveryDirectives:a})}onSubtitleTrackLoading(e,t){const{id:n,groupId:r,url:i,deliveryDirectives:a}=t;this.load({id:n,groupId:r,level:null,responseType:"text",type:la,url:i,deliveryDirectives:a})}load(e){var t;const n=this.hls.config;let r,i=this.getInternalLoader(e);if(i){const t=i.context;if(t&&t.url===e.url&&t.level===e.level)return void yr.trace("[playlist-loader]: playlist request ongoing");yr.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}if(r=e.type===aa?n.manifestLoadPolicy.default:or({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),lr(null==(t=e.deliveryDirectives)?void 0:t.part)){let t;if(e.type===sa&&null!==e.level?t=this.hls.levels[e.level].details:e.type===oa&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===la&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,n=t.targetduration;if(e&&n){const t=1e3*Math.max(3*e,.8*n);r=or({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}const a=r.errorRetry||r.timeoutRetry||{},s={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},o={onSuccess:(e,t,n,r)=>{const i=this.getInternalLoader(n);this.resetInternalLoader(n.type);const a=e.data;0===a.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),M3U8Parser.isMediaPlaylist(a)?this.handleTrackOrLevelPlaylist(e,t,n,r||null,i):this.handleMasterPlaylist(e,t,n,r)):this.handleManifestParsingError(e,n,new Error("no EXTM3U delimiter"),r||null,t)},onError:(e,t,n,r)=>{this.handleNetworkError(t,n,!1,e,r)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}};i.load(e,s,o)}handleMasterPlaylist(e,t,n,r){const i=this.hls,a=e.data,s=fa(e,n),o=M3U8Parser.parseMasterPlaylist(a,s);if(o.playlistParsingError)return void this.handleManifestParsingError(e,n,o.playlistParsingError,r,t);const{contentSteering:l,levels:u,sessionData:c,sessionKeys:d,startTimeOffset:h,variableList:f}=o;this.variableList=f;const{AUDIO:p=[],SUBTITLES:g,"CLOSED-CAPTIONS":m}=M3U8Parser.parseMasterPlaylistMedia(a,s,o);if(p.length){p.some((e=>!e.url))||!u[0].audioCodec||u[0].attrs.AUDIO||(yr.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new AttrList({}),bitrate:0,url:""}))}i.trigger(dr.MANIFEST_LOADED,{levels:u,audioTracks:p,subtitles:g,captions:m,contentSteering:l,url:s,stats:t,networkDetails:r,sessionData:c,sessionKeys:d,startTimeOffset:h,variableList:f})}handleTrackOrLevelPlaylist(e,t,n,r,i){const a=this.hls,{id:s,level:o,type:l}=n,u=fa(e,n),c=lr(o)?o:lr(s)?s:0,d=ha(n),h=M3U8Parser.parseLevelPlaylist(e.data,u,c,d,0,this.variableList);if(l===aa){const e={attrs:new AttrList({}),bitrate:0,details:h,name:"",url:u};a.trigger(dr.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:u,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=h,this.handlePlaylistLoaded(h,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(dr.ERROR,{type:hr.NETWORK_ERROR,details:fr.MANIFEST_PARSING_ERROR,fatal:t.type===aa,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let a=`A network ${n?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===sa?a+=`: ${e.level} id: ${e.id}`:e.type!==oa&&e.type!==la||(a+=` id: ${e.id} group-id: "${e.groupId}"`);const s=new Error(a);yr.warn(`[playlist-loader]: ${a}`);let o=fr.UNKNOWN,l=!1;const u=this.getInternalLoader(e);switch(e.type){case aa:o=n?fr.MANIFEST_LOAD_TIMEOUT:fr.MANIFEST_LOAD_ERROR,l=!0;break;case sa:o=n?fr.LEVEL_LOAD_TIMEOUT:fr.LEVEL_LOAD_ERROR,l=!1;break;case oa:o=n?fr.AUDIO_TRACK_LOAD_TIMEOUT:fr.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case la:o=n?fr.SUBTITLE_TRACK_LOAD_TIMEOUT:fr.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(e.type);const c={type:hr.NETWORK_ERROR,details:o,fatal:l,url:e.url,loader:u,context:e,error:s,networkDetails:t,stats:i};if(r){const n=(null==t?void 0:t.url)||e.url;c.response=ir({url:n,data:void 0},r)}this.hls.trigger(dr.ERROR,c)}handlePlaylistLoaded(e,t,n,r,i,a){const s=this.hls,{type:o,level:l,id:u,groupId:c,deliveryDirectives:d}=r,h=fa(t,r),f=ha(r),p="number"==typeof r.level&&f===ua?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void s.trigger(dr.ERROR,{type:hr.NETWORK_ERROR,details:fr.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:e,reason:e.message,response:t,context:r,level:p,parent:f,networkDetails:i,stats:n})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const g=e.playlistParsingError;if(g)s.trigger(dr.ERROR,{type:hr.NETWORK_ERROR,details:fr.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:r,level:p,parent:f,networkDetails:i,stats:n});else switch(e.live&&a&&(a.getCacheAge&&(e.ageHeader=a.getCacheAge()||0),a.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case aa:case sa:s.trigger(dr.LEVEL_LOADED,{details:e,level:p||0,id:u||0,stats:n,networkDetails:i,deliveryDirectives:d});break;case oa:s.trigger(dr.AUDIO_TRACK_LOADED,{details:e,id:u||0,groupId:c||"",stats:n,networkDetails:i,deliveryDirectives:d});break;case la:s.trigger(dr.SUBTITLE_TRACK_LOADED,{details:e,id:u||0,groupId:c||"",stats:n,networkDetails:i,deliveryDirectives:d})}}}function pa(e,t){let n;try{n=new Event("addtrack")}catch(r){n=document.createEvent("Event"),n.initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function ga(e,t){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(r){yr.debug(`[texttrack-utils]: ${r}`);try{const n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(i){yr.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}"disabled"===n&&(e.mode=n)}function ma(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let n=e.cues.length;n--;)e.removeCue(e.cues[n]);"disabled"===t&&(e.mode=t)}function va(e,t,n,r){const i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0){const i=function(e,t,n){const r=[],i=function(e,t){if(te[n].endTime)return-1;let r=0,i=n;for(;r<=i;){const a=Math.floor((i+r)/2);if(te[a].startTime&&r-1)for(let a=i,s=e.length;a=t&&i.endTime<=n)r.push(i);else if(i.startTime>n)return r}return r}(e.cues,t,n);for(let t=0;t{const e=Ea();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Ca(e,t){return e.getTime()/1e3-t}class ID3TrackController{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(dr.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(dr.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(ma(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;tSa&&(r=Sa);r-n<=0&&(r=n+.25);for(let i=0;ie.type===ba&&o:"video"===r?e=>e.type===_a&&s:e=>e.type===ba&&o||e.type===_a&&s,va(i,t,n,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:n,id3Track:r}=this,{dateRanges:i}=t,a=Object.keys(i);if(r){const e=Object.keys(n).filter((e=>!a.includes(e)));for(let t=e.length;t--;){const i=e[t];Object.keys(n[i].cues).forEach((e=>{r.removeCue(n[i].cues[e])})),delete n[i]}}const s=t.fragments[t.fragments.length-1];if(0===a.length||!lr(null==s?void 0:s.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=s.programDateTime/1e3-s.start,l=Ea();for(let d=0;d{if(n!==t.id){const r=i[n];if(r.class===t.class&&r.startDate>t.startDate&&(!e||t.startDatethis.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:a,lowLatencyMode:s}=this.config,o=this.hls.userConfig;let l=s&&n||t;(o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==i?i:a*r);const u=r;return l+Math.min(1*this.stallCount,u)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(null===e||null===t||null===n)return null;const r=n.edge,i=e-t-this.edgeStalled,a=r-n.totalduration,s=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(a,i),s)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(dr.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(dr.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(dr.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(dr.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(dr.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(dr.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var n;t.details===fr.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(n=this.levelDetails)&&n.live&&yr.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const n=this.computeLatency();if(null===n)return;this._latency=n;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||1===i||!t.live)return;const a=this.targetLatency;if(null===a)return;const s=n-a;if(s.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,i)),n=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,n))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const xa=["NONE","TYPE-0","TYPE-1",null];const Aa=["SDR","PQ","HLG"];var ka="",Da="YES",La="v2";function Ra(e){const{canSkipUntil:t,canSkipDateRanges:n,age:r}=e;return t&&r!!e)).map((e=>e.substring(0,4))).join(","),this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Pa(this._audioGroups,e)}hasSubtitleGroup(e){return Pa(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t)if("audio"===e){let e=this._audioGroups;e||(e=this._audioGroups=[]),-1===e.indexOf(t)&&e.push(t)}else if("text"===e){let e=this._subtitleGroups;e||(e=this._subtitleGroups=[]),-1===e.indexOf(t)&&e.push(t)}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return null==(e=this.audioGroups)?void 0:e[0]}get textGroupId(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}addFallback(){}}function Pa(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function Ia(e,t){const n=t.startPTS;if(lr(n)){let r,i=0;t.sn>e.sn?(i=n-e.start,r=e):(i=e.start-n,r=t),r.duration!==i&&(r.duration=i)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration}else t.start=Math.max(e.start-t.duration,0)}function Oa(e,t,n,r,i,a){r-n<=0&&(yr.warn("Fragment should have a positive duration",t),r=n+t.duration,a=i+t.duration);let s=n,o=r;const l=t.startPTS,u=t.endPTS;if(lr(l)){const e=Math.abs(l-n);lr(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,s=Math.max(n,l),n=Math.min(n,l),i=Math.min(i,t.startDTS),o=Math.min(r,u),r=Math.max(r,u),a=Math.max(a,t.endDTS)}const c=n-t.start;0!==t.start&&(t.start=n),t.duration=r-t.start,t.startPTS=n,t.maxStartPTS=s,t.startDTS=i,t.endPTS=r,t.minEndPTS=o,t.endDTS=a;const d=t.sn;if(!e||de.endSN)return 0;let h;const f=d-e.startSN,p=e.fragments;for(p[f]=t,h=f;h>0;h--)Ia(p[h],p[h-1]);for(h=f;h=0;l--){const e=r[l].initSegment;if(e){n=e;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let i,a=0;if(function(e,t,n){const r=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,a=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,s=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let u=i;u<=a;u++){const e=l[s+u];let i=o[u];r&&!i&&u{e.relurl&&(a=e.cc-r.cc),lr(e.startPTS)&&lr(e.endPTS)&&(r.start=r.startPTS=e.startPTS,r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.duration=e.endPTS-e.startPTS,r.duration&&(i=r),t.PTSKnown=t.alignedSliding=!0),r.elementaryStreams=e.elementaryStreams,r.loader=e.loader,r.stats=e.stats,e.initSegment&&(r.initSegment=e.initSegment,n=e.initSegment)})),n){(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((e=>{var t;!e||e.initSegment&&e.initSegment.relurl!==(null==(t=n)?void 0:t.relurl)||(e.initSegment=n)}))}if(t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((e=>!e)),t.deltaUpdateFailed){yr.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,n){const r=or({},e);n&&n.forEach((e=>{delete r[e]}));return Object.keys(t).forEach((e=>{const n=new DateRange(t[e].attr,r[e]);n.isValid?r[e]=n:yr.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)})),r}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const s=t.fragments;if(a){yr.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),i?Oa(t,i,i.startPTS,i.endPTS,i.startDTS,i.endDTS):Na(e,t),s.length&&(t.totalduration=t.edge-s[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const e=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=e),t.driftEndTime=o,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function Na(e,t){const n=t.startSN+t.skippedSegments-e.startSN,r=e.fragments;n<0||n>=r.length||Fa(t,r[n].start)}function Fa(e,t){if(t){const n=e.fragments;for(let r=e.skippedSegments;r{const{details:n}=e;null!=n&&n.fragments&&n.fragments.forEach((e=>{e.level=t}))}))}function $a(e){switch(e.details){case fr.FRAG_LOAD_TIMEOUT:case fr.KEY_LOAD_TIMEOUT:case fr.LEVEL_LOAD_TIMEOUT:case fr.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Va(e,t){const n=$a(t);return e.default[(n?"timeout":"error")+"Retry"]}function Ha(e,t){const n="linear"===e.backoff?1:Math.pow(2,t);return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function za(e){return ir(ir({},e),{errorRetry:null,timeoutRetry:null})}function Ga(e,t,n,r){if(!e)return!1;const i=null==r?void 0:r.code,a=t499)}(i)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,r,a):a}const Wa=function(e,t){let n=0,r=e.length-1,i=null,a=null;for(;n<=r;){i=(n+r)/2|0,a=e[i];const s=t(a);if(s>0)n=i+1;else{if(!(s<0))return a;r=i-1}}return null};function qa(e,t,n=0,r=0,i=.005){let a=null;if(e){a=t[e.sn-t[0].sn+1]||null;const r=e.endDTS-n;r>0&&r<15e-7&&(n+=15e-7)}else 0===n&&0===t[0].start&&(a=t[0]);if(a&&((!e||e.level===a.level)&&0===Ya(n,r,a)||function(e,t,n){if(t&&0===t.start&&t.level0){const r=t.tagList.reduce(((e,t)=>("INF"===t[0]&&(e+=parseFloat(t[1])),e)),n);return e.start<=r}return!1}(a,e,Math.min(i,r))))return a;const s=Wa(t,Ya.bind(null,n,r));return!s||s===e&&a?a:s}function Ya(e=0,t=0,n){if(n.start<=e&&n.start+n.duration>e)return 0;const r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=e?1:n.start-r>e&&n.start?-1:0}function Ka(e,t,n){const r=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>e}var Xa=0,Qa=2,Ja=3,Za=5,es=0,ts=1,ns=2;class BasePlaylistController{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=yr.log.bind(yr,`${t}:`),this.warn=yr.warn.bind(yr,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const r=null==t?void 0:t.renditionReports;if(r){let a=-1;for(let n=0;n=0&&e>t.partTarget&&(s+=1)}const o=n&&Ra(n);return new HlsUrlParameters(i,s>=0?s:void 0,o)}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,n){const{details:r,stats:i}=t,a=self.performance.now(),s=i.loading.first?Math.max(0,a-i.loading.first):0;if(r.advancedDateTime=Date.now()-s,r.live||null!=n&&n.live){if(r.reloaded(n),n&&this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),n&&r.fragments.length>0&&Ma(n,r),!this.canLoad||!r.live)return;let s,o,l;if(r.canBlockReload&&r.endSN&&r.advanced){const e=this.hls.config.lowLatencyMode,i=r.lastPartSn,a=r.endSN,u=r.lastPartIndex,c=i===a;-1!==u?(o=c?a+1:i,l=c?e?0:u:u+1):o=a+1;const d=r.age,h=d+r.ageHeader;let f=Math.min(h-r.partTarget,1.5*r.targetduration);if(f>0){if(n&&f>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${f} with playlist age: ${r.age}`),f=0;else{const e=Math.floor(f/r.targetduration);if(o+=e,void 0!==l){l+=Math.round(f%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${d.toFixed(2)}s goal: ${f} skip sn ${e} to part ${l}`)}r.tuneInGoal=f}if(s=this.getDeliveryDirectives(r,t.deliveryDirectives,o,l),e||!c)return void this.loadPlaylist(s)}else(r.canBlockReload||r.canSkipUntil)&&(s=this.getDeliveryDirectives(r,t.deliveryDirectives,o,l));const u=this.hls.mainForwardBufferInfo,c=u?u.end-u.len:0,d=function(e,t=1/0){let n=1e3*e.targetduration;if(e.updated){const r=e.fragments,i=4;if(r.length&&n*i>t){const e=1e3*r[r.length-1].duration;ethis.requestScheduled+d&&(this.requestScheduled=i.loading.start),void 0!==o&&r.canBlockReload?this.requestScheduled=i.loading.first+d-(1e3*r.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+dthis.loadPlaylist(s)),h)}else this.clearTimer()}getDeliveryDirectives(e,t,n,r){let i=Ra(e);return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=ka),new HlsUrlParameters(n,r,i)}checkRetry(e){const t=e.details,n=$a(e),r=e.errorAction,{action:i,retryCount:a=0,retryConfig:s}=r||{},o=!!r&&!!s&&(i===Za||!r.resolved&&i===Qa);if(o){var l;if(this.requestScheduled=-1,a>=s.maxNumRetry)return!1;if(n&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${s.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=Ha(s,a);this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${a+1}/${s.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,r.resolved=!0}return o}}class EWMA{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class EwmaBandWidthEstimator{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new EWMA(e),this.fast_=new EWMA(t),this.defaultTTFB_=r,this.ttfb_=new EWMA(e)}update(e,t){const{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new EWMA(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new EWMA(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new EWMA(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){const n=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/n;this.fast_.sample(n,r),this.slow_.sample(n,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const rs={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},is={};function as(e,t,n,r,i,a){const s=e.audioCodec?e.audioGroups:null,o=null==a?void 0:a.audioCodec,l=null==a?void 0:a.channels,u=l?parseInt(l):o?1/0:2;let c=null;if(null!=s&&s.length)try{c=1===s.length&&s[0]?t.groups[s[0]].channels:s.reduce(((e,n)=>{if(n){const r=t.groups[n];if(!r)throw new Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach((t=>{e[t]=(e[t]||0)+r.channels[t]}))}return e}),{2:0})}catch(d){return!0}return void 0!==e.videoCodec&&(e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||"SDR"!==e.videoRange&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||!!c&&lr(u)&&Object.keys(c).some((e=>parseInt(e)>u))}function ss(e,t,n){const r=e.videoCodec,i=e.audioCodec;if(!r||!i||!n)return Promise.resolve(rs);const a={width:e.width,height:e.height,bitrate:Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)),framerate:e.frameRate||30},s=e.videoRange;"SDR"!==s&&(a.transferFunction=s.toLowerCase());const o=r.split(",").map((e=>({type:"media-source",video:ir(ir({},a),{},{contentType:Ui(e,"video")})})));return i&&e.audioGroups&&e.audioGroups.forEach((e=>{var n;e&&(null==(n=t.groups[e])||n.tracks.forEach((t=>{if(t.groupId===e){const e=t.channels||"",n=parseFloat(e);lr(n)&&n>2&&o.push.apply(o,i.split(",").map((e=>({type:"media-source",audio:{contentType:Ui(e,"audio"),channels:""+n}}))))}})))})),Promise.all(o.map((e=>{const t=function(e){const{audio:t,video:n}=e,r=n||t;if(r){const e=r.contentType.split('"')[1];if(n)return`r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${e}_${Math.ceil(n.bitrate/1e5)}`;if(t)return`c${t.channels}${t.spatialRendering?"s":"n"}_${e}`}return""}(e);return is[t]||(is[t]=n.decodingInfo(e))}))).then((e=>({supported:!e.some((e=>!e.supported)),configurations:o,decodingInfoResults:e}))).catch((e=>({supported:!1,configurations:o,decodingInfoResults:[],error:e})))}function os(e,t){let n=!1,r=[];return e&&(n="SDR"!==e,r=[e]),t&&(r=t.allowedVideoRanges||Aa.slice(0),n=void 0!==t.preferHDR?t.preferHDR:function(){if("function"==typeof matchMedia){const e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),r=n?r.filter((e=>"SDR"!==e)):["SDR"]),{preferHDR:n,allowedVideoRanges:r}}function ls(e,t){yr.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function us(e,t,n){if("attrs"in e){const n=t.indexOf(e);if(-1!==n)return n}for(let r=0;r-1===r.indexOf(e)))}(o,t.characteristics))&&(void 0===n||n(e,t))}function ds(e,t){const{audioCodec:n,channels:r}=e;return!(void 0!==n&&(t.audioCodec||"").substring(0,4)!==n.substring(0,4)||void 0!==r&&r!==(t.channels||"2"))}function hs(e,t,n){for(let r=t;r;r--)if(n(e[r]))return r;for(let r=t+1;r1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var fs="NOT_LOADED",ps="APPENDING",gs="PARTIAL",ms="OK";class FragmentTracker{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(dr.BUFFER_APPENDED,this.onBufferAppended,this),e.on(dr.FRAG_BUFFERED,this.onFragBuffered,this),e.on(dr.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(dr.BUFFER_APPENDED,this.onBufferAppended,this),e.off(dr.FRAG_BUFFERED,this.onFragBuffered,this),e.off(dr.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let r=n.length;r--;){const t=n[r];if(!t)break;const i=t.end;if(t.start<=e&&null!==i&&e<=i)return t}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:n}=this,r=Object.keys(n);for(let i=r.length;i--;){const a=n[r[i]];if((null==a?void 0:a.body.type)===t&&a.buffered){const t=a.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,n,r){this.timeRanges&&(this.timeRanges[e]=t);const i=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((r=>{const a=this.fragments[r];if(!a)return;if(i>=a.body.sn)return;if(!a.buffered&&!a.loaded)return void(a.body.type===n&&this.removeFragment(a.body));const s=a.range[e];s&&s.time.some((e=>{const n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(a.body),n}))}))}detectPartialFragments(e){const t=this.timeRanges,{frag:n,part:r}=e;if(!t||"initSegment"===n.sn)return;const i=ys(n),a=this.fragments[i];if(!a||a.buffered&&n.gap)return;const s=!n.relurl;if(Object.keys(t).forEach((e=>{const i=n.elementaryStreams[e];if(!i)return;const o=t[e],l=s||!0===i.partial;a.range[e]=this.getBufferedTimes(n,r,l,o)})),a.loaded=null,Object.keys(a.range).length){a.buffered=!0;(a.body.endList=n.endList||a.body.endList)&&(this.endListFragments[a.body.type]=a),vs(a)||this.removeParts(n.sn-1,n.type)}else this.removeFragment(a.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=n.filter((t=>t.fragment.sn>=e)))}fragBuffered(e,t){const n=ys(e);let r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,n,r){const i={time:[],partial:n},a=e.start,s=e.end,o=e.minEndPTS||s,l=e.maxStartPTS||a;for(let u=0;u=e&&o<=t){i.time.push({startPTS:Math.max(a,r.start(u)),endPTS:Math.min(s,r.end(u))});break}if(ae){const e=Math.max(a,r.start(u)),t=Math.min(s,r.end(u));t>e&&(i.partial=!0,i.time.push({startPTS:e,endPTS:t}))}else if(s<=e)break}return i}getPartialFragment(e){let t,n,r,i=null,a=0;const{bufferPadding:s,fragments:o}=this;return Object.keys(o).forEach((l=>{const u=o[l];u&&vs(u)&&(n=u.body.start-s,r=u.body.end+s,e>=n&&e<=r&&(t=Math.min(e-n,r-e),a<=t&&(i=u.body,a=t)))})),i}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||vs(t))}getState(e){const t=ys(e),n=this.fragments[t];return n?n.buffered?vs(n)?gs:ms:ps:fs}isTimeBuffered(e,t,n){let r,i;for(let a=0;a=r&&t<=i)return!0;if(t<=r)return!1}return!1}onFragLoaded(e,t){const{frag:n,part:r}=t;if("initSegment"===n.sn||n.bitrateTest)return;const i=r?null:t,a=ys(n);this.fragments[a]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:r,timeRanges:i}=t;if("initSegment"===n.sn)return;const a=n.type;if(r){let e=this.activePartLists[a];e||(this.activePartLists[a]=e=[]),e.push(r)}this.timeRanges=i,Object.keys(i).forEach((e=>{const t=i[e];this.detectEvictedFragments(e,t,a,r)}))}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ys(e);return!!this.fragments[t]}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach((a=>{const s=this.fragments[a];if(!s)return;const o=s.body;o.type!==n||r&&!o.gap||o.starte&&(s.buffered||i)&&this.removeFragment(o)}))}removeFragment(e){const t=ys(e);e.stats.loaded=0,e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const t=e.sn;this.activePartLists[e.type]=n.filter((e=>e.fragment.sn!==t))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function vs(e){var t,n,r;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(n=e.range.audio)?void 0:n.partial)||(null==(r=e.range.audiovideo)?void 0:r.partial))}function ys(e){return`${e.type}_${e.level}_${e.sn}`}const bs={length:0,start:()=>0,end:()=>0};class BufferHelper{static isBuffered(e,t){try{if(e){const n=BufferHelper.getBuffered(e);for(let e=0;e=n.start(e)&&t<=n.end(e))return!0}}catch(n){}return!1}static bufferInfo(e,t,n){try{if(e){const r=BufferHelper.getBuffered(e),i=[];let a;for(a=0;ai&&(r[t-1].end=e[l].end):r.push(e[l])}else r.push(e[l])}else r=e;let i,a=0,s=t,o=t;for(let l=0;l=e&&tn.startCC||e&&e.cc{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some((e=>"GAP"===e[0])))return void o(As(e));e.gap=!1}const l=this.loader=e.loader=i?new i(r):new a(r),u=xs(e),c=za(r.fragLoadPolicy.default),d={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:Cs};e.stats=l.stats,l.load(u,d,{onSuccess:(t,n,r,i)=>{this.resetLoader(e,l);let a=t.data;r.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(a.slice(0,16)),a=a.slice(16)),s({frag:e,part:null,payload:a,networkDetails:i})},onError:(t,r,i,a)=>{this.resetLoader(e,l),o(new LoadError({type:hr.NETWORK_ERROR,details:fr.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:ir({url:n,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:i,stats:a}))},onAbort:(t,n,r)=>{this.resetLoader(e,l),o(new LoadError({type:hr.NETWORK_ERROR,details:fr.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:r,stats:t}))},onTimeout:(t,n,r)=>{this.resetLoader(e,l),o(new LoadError({type:hr.NETWORK_ERROR,details:fr.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:r,stats:t}))},onProgress:(n,r,i,a)=>{t&&t({frag:e,part:null,payload:i,networkDetails:a})}})}))}loadPart(e,t,n){this.abort();const r=this.config,i=r.fLoader,a=r.loader;return new Promise(((s,o)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void o(As(e,t));const l=this.loader=e.loader=i?new i(r):new a(r),u=xs(e,t),c=za(r.fragLoadPolicy.default),d={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Cs};t.stats=l.stats,l.load(u,d,{onSuccess:(r,i,a,o)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const u={frag:e,part:t,payload:r.data,networkDetails:o};n(u),s(u)},onError:(n,r,i,a)=>{this.resetLoader(e,l),o(new LoadError({type:hr.NETWORK_ERROR,details:fr.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:ir({url:u.url,data:void 0},n),error:new Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:i,stats:a}))},onAbort:(n,r,i)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),o(new LoadError({type:hr.NETWORK_ERROR,details:fr.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:i,stats:n}))},onTimeout:(n,r,i)=>{this.resetLoader(e,l),o(new LoadError({type:hr.NETWORK_ERROR,details:fr.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:i,stats:n}))}})}))}updateStatsFromPart(e,t){const n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){const r=Math.round(e.duration/t.duration),a=Math.min(Math.round(n.loaded/i),r),s=(r-a)*Math.round(n.loaded/a);n.total=n.loaded+s}else n.total=Math.max(n.loaded,n.total);const a=n.loading,s=r.loading;a.start?a.first+=s.first-s.start:(a.start=s.start,a.first=s.first),a.end=s.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function xs(e,t=null){const n=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},i=n.byteRangeStartOffset,a=n.byteRangeEndOffset;if(lr(i)&&lr(a)){var s;let t=i,n=a;if("initSegment"===e.sn&&"AES-128"===(null==(s=e.decryptdata)?void 0:s.method)){const e=a-i;e%16&&(n=a+(16-e%16)),0!==i&&(r.resetIV=!0,t=i-16)}r.rangeStart=t,r.rangeEnd=n}return r}function As(e,t){const n=new Error(`GAP ${e.gap?"tag":"attribute"} found`),r={type:hr.MEDIA_ERROR,details:fr.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new LoadError(r)}class LoadError extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class AESCrypto{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class FastAESKey{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}class AESDecryptor{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let r=0;r<4;r++)n[r]=t.getUint32(4*r);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],a=n[2],s=n[3],o=this.invSubMix,l=o[0],u=o[1],c=o[2],d=o[3],h=new Uint32Array(256);let f=0,p=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){let n=p^p<<1^p<<2^p<<3^p<<4;n=n>>>8^255&n^99,e[f]=n,t[n]=f;const o=h[f],g=h[o],m=h[g];let v=257*h[n]^16843008*n;r[f]=v<<24|v>>>8,i[f]=v<<16|v>>>16,a[f]=v<<8|v>>>24,s[f]=v,v=16843009*m^65537*g^257*o^16843008*f,l[n]=v<<24|v>>>8,u[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,d[n]=v,f?(f=o^h[h[h[m^o]]],p^=h[h[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,r=0;for(;r{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new AESCrypto(this.subtle,new Uint8Array(n)).decrypt(e.buffer,t)})).catch((r=>(yr.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n))))}onWebCryptoError(e,t,n){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%16;return n!==e.length&&(t=Ur(e,0,n),this.remainderData=Ur(e,n)),t}logOnce(e){this.logEnabled&&(yr.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const ks=function(e){let t="";const n=e.length;for(let r=0;rs.end){const e=a>i;(a{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)})).then((t=>{if(!t)return;const n=this.state;this.fragContextChanged(e)?(n===Ps||!this.fragCurrent&&n===Ms)&&(this.fragmentTracker.removeFragment(e),this.state=Ls):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(dr.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))})).catch((t=>{this.state!==Ds&&this.state!==Bs&&(this.warn(`Frag error: ${(null==t?void 0:t.message)||t}`),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===ps){const t=e.type,r=this.getFwdBufferInfo(this.mediaBuffer,t),i=Math.max(e.duration,r?r.len:this.config.maxBufferLength),a=this.backtrackFragment;(1===(a?e.sn-a.sn:0)||this.reduceMaxBufferLength(i))&&n.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===gs&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:n};this.hls.trigger(dr.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t})).then((t=>{const{hls:n}=this,{payload:r}=t,i=e.decryptdata;if(r&&r.byteLength>0&&null!=i&&i.key&&i.iv&&"AES-128"===i.method){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).catch((t=>{throw n.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((r=>{const i=self.performance.now();return n.trigger(dr.FRAG_DECRYPTED,{frag:e,payload:r,stats:{tstart:a,tdecrypt:i}}),t.payload=r,this.completeInitSegmentLoad(t)}))}return this.completeInitSegmentLoad(t)})).catch((t=>{this.state!==Ds&&this.state!==Bs&&(this.warn(t),this.resetFragmentLoading(e))}))}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state=Ls,e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){var n,r,i,a;const s=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.playlistType===ua?"level":"track"} ${e.level} (frag:[${(null!=(n=e.startPTS)?n:NaN).toFixed(3)}-${(null!=(r=e.endPTS)?r:NaN).toFixed(3)}] > buffer:${s?ks(BufferHelper.getBuffered(s)):"(detached)"})`),"initSegment"!==e.sn){var o;if(e.type!==da){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return void(this.state=Ls)}const t=null==(o=this.levels)?void 0:o[e.level];null!=t&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=Ls,s&&(!this.loadedmetadata&&e.type==ua&&s.buffered.length&&(null==(i=this.fragCurrent)?void 0:i.sn)===(null==(a=this.fragPrevious)?void 0:a.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:r,partsLoaded:i}=e,a=!i||0===i.length||i.some((e=>!e)),s=new ChunkMetadata(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!a);t.flush(s)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;const a=null==t?void 0:t.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let s=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&a.encryptedFragments.length&&this.keyLoader.loadClear(e,a.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${a.startSN}-${a.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=Rs,this.fragCurrent=e,s=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(dr.KEY_LOADED,e),this.state===Rs&&(this.state=Ls),e})),this.hls.trigger(dr.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(s=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),n=Math.max(e.start,n||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){const i=a.partList;if(i&&r){n>e.end&&a.fragmentHint&&(e=a.fragmentHint);const o=this.getNextPart(i,e,n);if(o>-1){const l=i[o];let u;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${a.startSN}-${a.endSN}] parts [0-${o}-${i.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Ps,u=s?s.then((n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(e,l,t,r))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,l,t,r).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(dr.FRAG_LOADING,{frag:e,part:l,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(i,n))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${a?"of ["+a.startSN+"-"+a.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(n.toFixed(3))}`),lr(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ps;const o=this.config.progressive;let l;return l=o&&s?s.then((t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,r))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,o?r:void 0),s]).then((([e])=>(!o&&e&&r&&r(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(dr.FRAG_LOADING,{frag:e,targetBufferTime:n}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,n,r){return new Promise(((i,a)=>{var s;const o=[],l=null==(s=n.details)?void 0:s.partList,u=t=>{this.fragmentLoader.loadPart(e,t,r).then((r=>{o[t.index]=r;const a=r.part;this.hls.trigger(dr.FRAG_LOADED,r);const s=Ba(n,e.sn,t.index+1)||ja(l,e.sn,t.index+1);if(!s)return i({frag:e,part:a,partsLoaded:o});u(s)})).catch(a)};u(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===fr.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(dr.ERROR,t)}else this.hls.trigger(dr.ERROR,{type:hr.OTHER_ERROR,details:fr.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Ms)return void(this.fragCurrent||this.state===Ds||this.state===Bs||(this.state=Ls));const{frag:n,part:r,level:i}=t,a=self.performance.now();n.stats.parsing.end=a,r&&(r.stats.parsing.end=a),this.updateLevelTiming(n,r,i,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:a}=e;if(null==t||!t[r])return this.warn(`Levels object was unset while buffering fragment ${i} of level ${r}. The current chunk will not be buffered.`),null;const s=t[r],o=a>-1?Ba(s,i,a):null,l=o?o.fragment:function(e,t,n){if(null==e||!e.details)return null;const r=e.details;let i=r.fragments[t-r.startSN];return i||(i=r.fragmentHint,i&&i.sn===t?i:ta&&this.flushMainBuffer(s,e.start)}getFwdBufferInfo(e,t){const n=this.getLoadPosition();return lr(n)?this.getFwdBufferInfoAtPos(e,n,t):null}getFwdBufferInfoAtPos(e,t,n){const{config:{maxBufferHole:r}}=this,i=BufferHelper.bufferInfo(e,t,r);if(0===i.len&&void 0!==i.nextStart){const a=this.fragmentTracker.getBufferedFrag(t,n);if(a&&i.nextStart=n&&(t.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0)}getAppendedFrag(e,t=ua){const n=this.fragmentTracker.getAppendedFrag(e,ua);return n&&"fragment"in n?n.fragment:n}getNextFragment(e,t){const n=t.fragments,r=n.length;if(!r)return null;const{config:i}=this,a=n[0].start;let s;if(t.live){const o=i.initialLiveManifestSize;if(rt}getNextFragmentLoopLoading(e,t,n,r,i){const a=e.gap,s=this.getNextFragment(this.nextLoadPosition,t);if(null===s)return s;if(e=s,a&&e&&!e.gap&&n.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r);if(null!==t&&n.len+t.len>=i)return this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,n){let r=-1,i=!1,a=!0;for(let s=0,o=e.length;s-1&&nn.start&&n.loaded}getInitialLiveFragment(e,t){const n=this.fragPrevious;let r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=function(e,t,n){if(null===t||!Array.isArray(e)||!e.length||!lr(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;n=n||0;for(let r=0;r=e.startSN&&i<=e.endSN){const a=t[i-e.startSN];n.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=function(e,t){return Wa(e,(e=>e.cct?-1:0))}(t,n.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(r=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){const{config:r}=this;let{fragPrevious:i}=this,{fragments:a,endSN:s}=n;const{fragmentHint:o}=n,{maxFragLookUpTolerance:l}=r,u=n.partList,c=!!(r.lowLatencyMode&&null!=u&&u.length&&o);let d;if(c&&o&&!this.bitrateTest&&(a=a.concat(o),s=o.sn),et-l?0:l)}else d=a[a.length-1];if(d){const e=d.sn-n.startSN,t=this.fragmentTracker.getState(d);if((t===ms||t===gs&&d.gap)&&(i=d),i&&d.sn===i.sn&&(!c||u[0].fragment.sn>d.sn)){if(i&&d.level===i.level){const t=a[e+1];d=d.sn=a-t.maxFragLookUpTolerance&&i<=s;if(null!==r&&n.duration>r&&(i${e.startSN} prev-sn: ${i?i.sn:"na"} fragments: ${r}`),a}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let n=this.startPosition;if(n ${null==(r=this.fragCurrent)?void 0:r.url}`);const i=t.details===fr.FRAG_GAP;i&&this.fragmentTracker.fragBuffered(n,!0);const a=t.errorAction,{action:s,retryCount:o=0,retryConfig:l}=a||{};if(a&&s===Za&&l){this.resetStartWhenNotLoaded(this.levelLastLoaded);const r=Ha(l,o);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${o+1}/${l.maxNumRetry} in ${r}ms`),a.resolved=!0,this.retryDate=self.performance.now()+r,this.state=Is}else if(l&&a){if(this.resetFragmentErrors(e),!(o.5;r&&this.reduceMaxBufferLength(n.len);const i=!r;return i&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),i}return!1}resetFragmentErrors(e){e===ca&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Ds&&(this.state=Ls)}afterBufferFlushed(e,t,n){if(!e)return;const r=BufferHelper.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===Fs&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Ls}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=e?e.details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){var i;const a=n.details;if(!a)return void this.warn("level.details undefined");if(!Object.keys(e.elementaryStreams).reduce(((t,i)=>{const s=e.elementaryStreams[i];if(s){const o=s.endPTS-s.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${i} duration reliably (${o})`),t||!1;const l=r?0:Oa(a,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return this.hls.trigger(dr.LEVEL_PTS_UPDATED,{details:a,level:n,drift:l,type:i,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}),!1)&&null===(null==(i=this.transmuxer)?void 0:i.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${e.level} resetting transmuxer to fallback to playlist timing`);if(0===n.fragmentError&&(n.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(t.message),this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Ns,this.hls.trigger(dr.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}class ChunkCache{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;return e.length?(n=1===e.length?e[0]:function(e,t){const n=new Uint8Array(t);let r=0;for(let i=0;i0&&s.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:ba,duration:Number.POSITIVE_INFINITY});i{if(lr(e))return 90*e;return 9e4*t+(n?9e4*n.baseTime/n.timescale:0)};function Hs(e,t){return 255===e[t]&&240==(246&e[t+1])}function zs(e,t){return 1&e[t+1]?7:9}function Gs(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Ws(e,t){return t+1=e.length)return!1;const r=Gs(e,t);if(r<=n)return!1;const i=t+r;return i===e.length||Ws(e,i)}return!1}function Ys(e,t,n,r,i){if(!e.samplerate){const a=function(e,t,n,r){let i,a,s,o;const l=navigator.userAgent.toLowerCase(),u=r,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];i=1+((192&t[n+2])>>>6);const d=(60&t[n+2])>>>2;if(!(d>c.length-1))return s=(1&t[n+2])<<2,s|=(192&t[n+3])>>>6,yr.log(`manifest codec:${r}, ADTS type:${i}, samplingIndex:${d}`),/firefox/i.test(l)?d>=6?(i=5,o=new Array(4),a=d-3):(i=2,o=new Array(2),a=d):-1!==l.indexOf("android")?(i=2,o=new Array(2),a=d):(i=5,o=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&d>=6?a=d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(d>=6&&1===s||/vivaldi/i.test(l))||!r&&1===s)&&(i=2,o=new Array(2)),a=d)),o[0]=i<<3,o[0]|=(14&d)>>1,o[1]|=(1&d)<<7,o[1]|=s<<3,5===i&&(o[1]|=(14&a)>>1,o[2]=(1&a)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:c[d],channelCount:s,codec:"mp4a.40."+i,manifestCodec:u};{const t=new Error(`invalid ADTS sampling index:${d}`);e.emit(dr.ERROR,dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message})}}(t,n,r,i);if(!a)return;e.config=a.config,e.samplerate=a.samplerate,e.channelCount=a.channelCount,e.codec=a.codec,e.manifestCodec=a.manifestCodec,yr.log(`parsed codec:${e.codec}, rate:${a.samplerate}, channels:${a.channelCount}`)}}function Ks(e){return 9216e4/e}function Xs(e,t,n,r,i){const a=r+i*Ks(e.samplerate),s=function(e,t){const n=zs(e,t);if(t+n<=e.length){const r=Gs(e,t)-n;if(r>0)return{headerLength:n,frameLength:r}}}(t,n);let o;if(s){const{frameLength:r,headerLength:i}=s,l=i+r,u=Math.max(0,n+l-t.length);u?(o=new Uint8Array(l-i),o.set(t.subarray(n+i,t.length),0)):o=t.subarray(n+i,n+l);const c={unit:o,pts:a};return u||e.samples.push(c),{sample:c,length:l,missing:u}}const l=t.length-n;o=new Uint8Array(l),o.set(t.subarray(n,t.length),0);return{sample:{unit:o,pts:a},length:l,missing:-1}}let Qs=null;const Js=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Zs=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],eo=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],to=[0,1,1,4];function no(e,t,n,r,i){if(n+24>t.length)return;const a=ro(t,n);if(a&&n+a.frameLength<=t.length){const s=r+i*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:t.subarray(n,n+a.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}function ro(e,t){const n=e[t+1]>>3&3,r=e[t+1]>>1&3,i=e[t+2]>>4&15,a=e[t+2]>>2&3;if(1!==n&&0!==i&&15!==i&&3!==a){const s=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*Js[14*(3===n?3-r:3===r?3:4)+i-1],u=Zs[3*(3===n?0:2===n?1:2)+a],c=3===o?1:2,d=eo[n][r],h=to[r],f=8*d*h,p=Math.floor(d*l/u+s)*h;if(null===Qs){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Qs=e?parseInt(e[1]):0}return!!Qs&&Qs<=87&&2===r&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:u,channelCount:c,frameLength:p,samplesPerFrame:f}}}function io(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function ao(e,t){return t+1{let n=0,r=5;t+=r;const i=new Uint32Array(1),a=new Uint32Array(1),s=new Uint8Array(1);for(;r>0;){s[0]=e[t];const o=Math.min(r,8),l=8-o;a[0]=4278190080>>>24+l<>l,n=n?n<t.length)return-1;if(11!==t[n]||119!==t[n+1])return-1;const a=t[n+4]>>6;if(a>=3)return-1;const s=[48e3,44100,32e3][a],o=63&t[n+4],l=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*o+a];if(n+l>t.length)return-1;const u=t[n+6]>>5;let c=0;2===u?c+=2:(1&u&&1!==u&&(c+=2),4&u&&(c+=2));const d=(t[n+6]<<8|t[n+7])>>12-c&1,h=[2,1,2,3,3,4,4,5][u]+d,f=t[n+5]>>3,p=7&t[n+5],g=new Uint8Array([a<<6|f<<1|p>>2,(3&p)<<6|u<<3|d<<2|o>>4,o<<4&224]),m=r+i*(1536/s*9e4),v=t.subarray(n,n+l);return e.config=g,e.channelCount=h,e.samplerate=s,e.samples.push({unit:v,pts:m}),l}class BaseVideoParser{constructor(){this.VideoSample=null}createVideoSample(e,t,n,r){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:r,length:0}}getLastNalUnit(e){var t;let n,r=this.VideoSample;if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){const e=r.units;n=e[e.length-1]}return n}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const n=t.samples,r=n.length;if(!r)return void t.dropped++;{const t=n[r-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&yr.log(e.pts+"/"+e.dts+":"+e.debug)}}class ExpGolomb{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&yr.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?n<>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,n=8,r=8;for(let i=0;i{var a;switch(r.type){case 1:{let t=!1;s=!0;const i=r.data;if(l&&i.length>4){const e=new ExpGolomb(i).readSliceType();2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var u;if(t)null!=(u=o)&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null);o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),o.frame=!0,o.key=t;break}case 5:s=!0,null!=(a=o)&&a.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts,"")),o.key=!0,o.frame=!0;break;case 6:s=!0,xi(r.data,1,n.pts,t.samples);break;case 7:{var c,d;s=!0,l=!0;const t=r.data,n=new ExpGolomb(t).readSPS();if(!e.sps||e.width!==n.width||e.height!==n.height||(null==(c=e.pixelRatio)?void 0:c[0])!==n.pixelRatio[0]||(null==(d=e.pixelRatio)?void 0:d[1])!==n.pixelRatio[1]){e.width=n.width,e.height=n.height,e.pixelRatio=n.pixelRatio,e.sps=[t],e.duration=i;const r=t.subarray(1,4);let a="avc1.";for(let e=0;e<3;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),a+=t}e.codec=a}break}case 8:s=!0,e.pps=[r.data];break;case 9:s=!0,e.audFound=!0,o&&this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts,"");break;case 12:s=!0;break;default:s=!1,o&&(o.debug+="unknown NAL "+r.type+" ")}if(o&&s){o.units.push(r)}})),r&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}parseAVCNALu(e,t){const n=t.byteLength;let r=e.naluState||0;const i=r,a=[];let s,o,l,u=0,c=-1,d=0;for(-1===r&&(c=0,d=31&t[0],r=0,u=1);u=0){const e={data:t.subarray(c,o),type:d};a.push(e)}else{const n=this.getLastNalUnit(e.samples);n&&(i&&u<=4-i&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-i)),o>0&&(n.data=Ti(n.data,t.subarray(0,o)),n.state=0))}u=0&&r>=0){const e={data:t.subarray(c,n),type:d,state:r};a.push(e)}if(0===a.length){const n=this.getLastNalUnit(e.samples);n&&(n.data=Ti(n.data,t))}return e.naluState=r,a}}class SampleAesDecrypter{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new Decrypter(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,n){const r=e[t].unit;if(r.length<=16)return;const i=r.subarray(16,r.length-r.length%16),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(a).then((i=>{const a=new Uint8Array(i);r.set(a,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}))}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t);let r=0;for(let i=32;i{i.data=this.getAvcDecryptedUnit(a,s),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)}))}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void r();const i=e[t].units;for(;!(n>=i.length);n++){const a=i[n];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(e,t,n,r,a),this.decrypter.isSync())))return}}}}const co=188;class TSDemuxer{constructor(e,t,n){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.videoParser=new AvcVideoParser}static probe(e){const t=TSDemuxer.syncOffset(e);return t>0&&yr.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),-1!==t}static syncOffset(e){const t=e.length;let n=Math.min(940,t-co)+1,r=0;for(;r1&&(0===a&&s>2||o+co>n))return a}r++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:oi[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=TSDemuxer.createTrack("video"),this._audioTrack=TSDemuxer.createTrack("audio",r),this._id3Track=TSDemuxer.createTrack("id3"),this._txtTrack=TSDemuxer.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,r=!1){let i;n||(this.sampleAes=null);const a=this._videoTrack,s=this._audioTrack,o=this._id3Track,l=this._txtTrack;let u=a.pid,c=a.pesData,d=s.pid,h=o.pid,f=s.pesData,p=o.pesData,g=null,m=this.pmtParsed,v=this._pmtId,y=e.length;if(this.remainderData&&(y=(e=Ti(this.remainderData,e)).length,this.remainderData=null),y>4>1){if(y=E+5+e[E+4],y===E+co)continue}else y=E+4;switch(r){case u:t&&(c&&(i=vo(c))&&this.videoParser.parseAVCPES(a,l,i,!1,this._duration),c={data:[],size:0}),c&&(c.data.push(e.subarray(y,E+co)),c.size+=E+co-y);break;case d:if(t){if(f&&(i=vo(f)))switch(s.segmentCodec){case"aac":this.parseAACPES(s,i);break;case"mp3":this.parseMPEGPES(s,i);break;case"ac3":this.parseAC3PES(s,i)}f={data:[],size:0}}f&&(f.data.push(e.subarray(y,E+co)),f.size+=E+co-y);break;case h:t&&(p&&(i=vo(p))&&this.parseID3PES(o,i),p={data:[],size:0}),p&&(p.data.push(e.subarray(y,E+co)),p.size+=E+co-y);break;case 0:t&&(y+=e[y]+1),v=this._pmtId=fo(e,y);break;case v:{t&&(y+=e[y]+1);const r=po(e,y,this.typeSupported,n,this.observer);u=r.videoPid,u>0&&(a.pid=u,a.segmentCodec=r.segmentVideoCodec),d=r.audioPid,d>0&&(s.pid=d,s.segmentCodec=r.segmentAudioCodec),h=r.id3Pid,h>0&&(o.pid=h),null===g||m||(yr.warn(`MPEG-TS PMT found at ${E} after unknown PID '${g}'. Backtracking to sync byte @${b} to parse all TS packets.`),g=null,E=b-188),m=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=r}}else w++;w>0&&go(this.observer,new Error(`Found ${w} TS packet/s that do not start with 0x47`)),a.pesData=c,s.pesData=f,o.pesData=p;const _={audioTrack:s,videoTrack:a,id3Track:o,textTrack:l};return r&&this.extractRemainingSamples(_),_}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:r,textTrack:i}=e,a=n.pesData,s=t.pesData,o=r.pesData;let l;if(a&&(l=vo(a))?(this.videoParser.parseAVCPES(n,i,l,!0,this._duration),n.pesData=null):n.pesData=a,s&&(l=vo(s))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l)}t.pesData=null}else null!=s&&s.size&&yr.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=s;o&&(l=vo(o))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=o}demuxSampleAes(e,t,n){const r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new SampleAesDecrypter(this.observer,this.config,t);return this.decrypt(r,i)}decrypt(e,t){return new Promise((n=>{const{audioTrack:r,videoTrack:i}=e;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,(()=>{n(e)})):n(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(()=>{n(e)}))}))}destroy(){this._duration=0}parseAACPES(e,t){let n=0;const r=this.aacOverFlow;let i,a,s,o=t.data;if(r){this.aacOverFlow=null;const t=r.missing,i=r.sample.unit.byteLength;if(-1===t)o=Ti(r.sample.unit,o);else{const a=i-t;r.sample.unit.set(o.subarray(0,t),a),e.samples.push(r.sample),n=r.missing}}for(i=n,a=o.length;i0;)o+=a}}parseID3PES(e,t){if(void 0===t.pts)return void yr.warn("[tsdemuxer]: ID3 PES unknown PTS");const n=or({},t,{type:this._videoTrack?_a:ba,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function ho(e,t){return((31&e[t+1])<<8)+e[t+2]}function fo(e,t){return(31&e[t+10])<<8|e[t+11]}function po(e,t,n,r,i){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t0){let r=t+5,i=o;for(;i>2;){if(106===e[r])!0!==n.ac3?yr.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=s,a.segmentAudioCodec="ac3");const t=e[r+1]+2;r+=t,i-=t}}break;case 194:case 135:return go(i,new Error("Unsupported EC-3 in M2TS found")),a;case 36:return go(i,new Error("Unsupported HEVC in M2TS found")),a}t+=o+5}return a}function go(e,t,n){yr.warn(`parsing error: ${t.message}`),e.emit(dr.ERROR,dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:t,reason:t.message})}function mo(e){yr.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function vo(e){let t,n,r,i,a,s=0;const o=e.data;if(!e||0===e.size)return null;for(;o[0].length<19&&o.length>1;)o[0]=Ti(o[0],o[1]),o.splice(1,1);t=o[0];if(1===(t[0]<<16)+(t[1]<<8)+t[2]){if(n=(t[4]<<8)+t[5],n&&n>e.size-6)return null;const l=t[7];192&l&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(a=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,i-a>54e5&&(yr.warn(`${Math.round((i-a)/9e4)}s delta between PTS and DTS, align them`),i=a)):a=i),r=t[8];let u=r+9;if(e.size<=u)return null;e.size-=u;const c=new Uint8Array(e.size);for(let e=0,n=o.length;en){u-=n;continue}t=t.subarray(u),n-=u,u=0}c.set(t,s),s+=n}return n&&(n-=r+3),{data:c,pts:i,dts:a,len:n}}return null}class AAC{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const yo=Math.pow(2,32)-1;class MP4{static init(){let e;for(e in MP4.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},MP4.types)MP4.types.hasOwnProperty(e)&&(MP4.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);MP4.HDLR_TYPES={video:t,audio:n};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);MP4.STTS=MP4.STSC=MP4.STCO=i,MP4.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),MP4.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),MP4.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),MP4.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);MP4.FTYP=MP4.box(MP4.types.ftyp,a,o,a,s),MP4.DINF=MP4.box(MP4.types.dinf,MP4.box(MP4.types.dref,r))}static box(e,...t){let n=8,r=t.length;const i=r;for(;r--;)n+=t[r].byteLength;const a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=255&n,a.set(e,4),r=0,n=8;r>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(e){return MP4.box(MP4.types.mdia,MP4.mdhd(e.timescale,e.duration),MP4.hdlr(e.type),MP4.minf(e))}static mfhd(e){return MP4.box(MP4.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?MP4.box(MP4.types.minf,MP4.box(MP4.types.smhd,MP4.SMHD),MP4.DINF,MP4.stbl(e)):MP4.box(MP4.types.minf,MP4.box(MP4.types.vmhd,MP4.VMHD),MP4.DINF,MP4.stbl(e))}static moof(e,t,n){return MP4.box(MP4.types.moof,MP4.mfhd(e),MP4.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=MP4.trak(e[t]);return MP4.box.apply(null,[MP4.types.moov,MP4.mvhd(e[0].timescale,e[0].duration)].concat(n).concat(MP4.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=MP4.trex(e[t]);return MP4.box.apply(null,[MP4.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(yo+1)),r=Math.floor(t%(yo+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24,n>>16&255,n>>8&255,255&n,r>>24,r>>16&255,r>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return MP4.box(MP4.types.mvhd,i)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let r,i;for(r=0;r>>8&255),i.push(255&r),i=i.concat(Array.prototype.slice.call(n));for(t=0;t>>8&255),a.push(255&r),a=a.concat(Array.prototype.slice.call(n));const s=MP4.box(MP4.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(a))),o=e.width,l=e.height,u=e.pixelRatio[0],c=e.pixelRatio[1];return MP4.box(MP4.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,MP4.box(MP4.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),MP4.box(MP4.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,c>>24,c>>16&255,c>>8&255,255&c])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static audioStsd(e){const t=e.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0])}static mp4a(e){return MP4.box(MP4.types.mp4a,MP4.audioStsd(e),MP4.box(MP4.types.esds,MP4.esds(e)))}static mp3(e){return MP4.box(MP4.types[".mp3"],MP4.audioStsd(e))}static ac3(e){return MP4.box(MP4.types["ac-3"],MP4.audioStsd(e),MP4.box(MP4.types.dac3,e.config))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp3(e)):"ac3"===e.segmentCodec?MP4.box(MP4.types.stsd,MP4.STSD,MP4.ac3(e)):MP4.box(MP4.types.stsd,MP4.STSD,MP4.mp4a(e)):MP4.box(MP4.types.stsd,MP4.STSD,MP4.avc1(e))}static tkhd(e){const t=e.id,n=e.duration*e.timescale,r=e.width,i=e.height,a=Math.floor(n/(yo+1)),s=Math.floor(n%(yo+1));return MP4.box(MP4.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,255&r,0,0,i>>8&255,255&i,0,0]))}static traf(e,t){const n=MP4.sdtp(e),r=e.id,i=Math.floor(t/(yo+1)),a=Math.floor(t%(yo+1));return MP4.box(MP4.types.traf,MP4.box(MP4.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),MP4.box(MP4.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a])),MP4.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,MP4.box(MP4.types.trak,MP4.tkhd(e),MP4.mdia(e))}static trex(e){const t=e.id;return MP4.box(MP4.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],r=n.length,i=12+16*r,a=new Uint8Array(i);let s,o,l,u,c,d;for(t+=8+i,a.set(["video"===e.type?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),s=0;s>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*s);return MP4.box(MP4.types.trun,a)}static initSegment(e){MP4.types||MP4.init();const t=MP4.moov(e);return Ti(MP4.FTYP,t)}}MP4.types=void 0,MP4.HDLR_TYPES=void 0,MP4.STTS=void 0,MP4.STSC=void 0,MP4.STCO=void 0,MP4.STSZ=void 0,MP4.VMHD=void 0,MP4.SMHD=void 0,MP4.STSD=void 0,MP4.FTYP=void 0,MP4.DINF=void 0;const bo=9e4;function wo(e,t,n=1,r=!1){const i=e*t*n;return r?Math.round(i):i}function _o(e,t=!1){return wo(e,1e3,1/bo,t)}let Eo,To=null,So=null;class MP4Remuxer{constructor(e,t,n,r=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,null===To){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);To=e?parseInt(e[1]):0}if(null===So){const e=navigator.userAgent.match(/Safari\/(\d+)/i);So=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){yr.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){yr.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){yr.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e.reduce(((e,n)=>{const r=n.pts-e;return r<-4294967296?(t=!0,Co(e,n.pts)):r>0?e:n.pts}),e[0].pts);return t&&yr.debug("PTS rollover detected"),n}remux(e,t,n,r,i,a,s,o){let l,u,c,d,h,f,p=i,g=i;const m=e.pid>-1,v=t.pid>-1,y=t.samples.length,b=e.samples.length>0,w=s&&y>0||y>1;if((!m||b)&&(!v||w)||this.ISGenerated||s){if(this.ISGenerated){var _,E,T,S;const e=this.videoTrackConfig;!e||t.width===e.width&&t.height===e.height&&(null==(_=t.pixelRatio)?void 0:_[0])===(null==(E=e.pixelRatio)?void 0:E[0])&&(null==(T=t.pixelRatio)?void 0:T[1])===(null==(S=e.pixelRatio)?void 0:S[1])||this.resetInitSegment()}else c=this.generateIS(e,t,i,a);const n=this.isVideoContiguous;let r,s=-1;if(w&&(s=function(e){for(let t=0;t0){yr.warn(`[mp4-remuxer]: Dropped ${s} out of ${y} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(s),t.dropped+=s,g+=(t.samples[0].pts-e)/t.inputTimeScale,r=g}else-1===s&&(yr.warn(`[mp4-remuxer]: No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(b&&w){const n=this.getVideoStartPts(t.samples),r=(Co(e.samples[0].pts,n)-n)/t.inputTimeScale;p+=Math.max(0,r),g+=Math.max(0,-r)}if(b){if(e.samplerate||(yr.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(e,t,i,a)),u=this.remuxAudio(e,p,this.isAudioContiguous,a,v||w||o===ca?g:void 0),w){const r=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(yr.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(e,t,i,a)),l=this.remuxVideo(t,g,n,r)}}else w&&(l=this.remuxVideo(t,g,n,0));l&&(l.firstKeyFrame=s,l.independent=-1!==s,l.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=xo(n,i,this._initPTS,this._initDTS)),r.samples.length&&(d=Ao(r,i,this._initPTS))),{audio:u,video:l,initSegment:c,independent:f,text:d,id3:h}}generateIS(e,t,n,r){const i=e.samples,a=t.samples,s=this.typeSupported,o={},l=this._initPTS;let u,c,d,h=!l||r,f="audio/mp4";if(h&&(u=c=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":s.mpeg?(f="audio/mpeg",e.codec=""):s.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&s.mpeg?new Uint8Array(0):MP4.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(d=e.inputTimeScale,l&&d===l.timescale?h=!1:u=c=i[0].pts-Math.round(d*n))}if(t.sps&&t.pps&&a.length){if(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:MP4.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(d=t.inputTimeScale,l&&d===l.timescale)h=!1;else{const e=this.getVideoStartPts(a),t=Math.round(d*n);c=Math.min(c,Co(a[0].dts,e)-t),u=Math.min(u,e-t)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:u,timescale:d},this._initDTS={baseTime:c,timescale:d}):u=d=void 0,{tracks:o,initPTS:u,timescale:d}}remuxVideo(e,t,n,r){const i=e.inputTimeScale,a=e.samples,s=[],o=a.length,l=this._initPTS;let u,c,d=this.nextAvcDts,h=8,f=this.videoSampleDuration,p=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=!1;if(!n||null===d){const e=t*i,r=a[0].pts-Co(a[0].dts,a[0].pts);To&&null!==d&&Math.abs(e-r-d)<15e3?n=!0:d=e-r}const v=l.baseTime*i/l.timescale;for(let I=0;I0?I-1:I].dts&&(m=!0)}m&&a.sort((function(e,t){const n=e.dts-t.dts,r=e.pts-t.pts;return n||r})),u=a[0].dts,c=a[a.length-1].dts;const y=c-u,b=y?Math.round(y/(o-1)):f||e.inputTimeScale/30;if(n){const e=u-d,n=e>b,r=e<-1;if((n||r)&&(n?yr.warn(`AVC: ${_o(e,!0)} ms (${e}dts) hole between fragments detected at ${t.toFixed(3)}`):yr.warn(`AVC: ${_o(-e,!0)} ms (${e}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!r||d>=a[0].pts||To)){u=d;const t=a[0].pts-e;if(n)a[0].dts=u,a[0].pts=t;else for(let n=0;nt);n++)a[n].dts-=e,a[n].pts-=e;yr.log(`Video: Initial PTS/DTS adjusted: ${_o(t,!0)}/${_o(u,!0)}, delta: ${_o(e,!0)} ms`)}}u=Math.max(0,u);let w=0,_=0,E=u;for(let I=0;I0?e.dts-a[I-1].dts:b;if(n=I>0?e.pts-a[I-1].pts:b,t.stretchShortVideoTrack&&null!==this.nextAudioPts){const n=Math.floor(t.maxBufferHole*i),a=(r?p+r*i:this.nextAudioPts)-e.pts;a>n?(f=a-s,f<0?f=s:x=!0,yr.log(`[mp4-remuxer]: It is approximately ${a/90} ms to the next segment; using duration ${f/90} ms for the last video frame.`)):f=s}else f=s}const u=Math.round(e.pts-e.dts);A=Math.min(A,f),D=Math.max(D,f),k=Math.min(k,n),L=Math.max(L,n),s.push(new Mp4Sample(e.key,f,l,u))}if(s.length)if(To){if(To<70){const e=s[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(So&&L-k0&&(r&&Math.abs(m-g)<9e3||Math.abs(Co(f[0].pts-v,m)-g)<20*l),f.forEach((function(e){e.pts=Co(e.pts-v,m)})),!n||g<0){if(f=f.filter((e=>e.pts>=0)),!f.length)return;g=0===i?0:r&&!h?Math.max(0,m):f[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let n=0,r=g;n=t*l&&u<1e4&&h){let t=Math.round(o/l);r=s-t*l,r<0&&(t--,r+=l),0===n&&(this.nextAudioPts=g=r),yr.warn(`[mp4-remuxer]: Injecting ${t} audio frame @ ${(r/a).toFixed(3)}s due to ${Math.round(1e3*o/a)} ms gap.`);for(let a=0;a0))return;_+=p;try{y=new Uint8Array(_)}catch(D){return void this.observer.emit(dr.ERROR,dr.ERROR,{type:hr.MUX_ERROR,details:fr.REMUX_ALLOC_ERROR,fatal:!1,error:D,bytes:_,reason:`fail allocating audio mdat ${_}`})}if(!c){new DataView(y.buffer).setUint32(0,_),y.set(MP4.types.mdat,4)}}y.set(r,p);const a=r.byteLength;p+=a,d.push(new Mp4Sample(!0,o,a,0)),w=i}const T=d.length;if(!T)return;const S=d[d.length-1];this.nextAudioPts=g=w+s*S.duration;const C=c?new Uint8Array(0):MP4.moof(e.sequenceNumber++,b/s,or({},e,{samples:d}));e.samples=[];const x=b/a,A=g/a,k={data1:C,data2:y,startPTS:x,endPTS:A,startDTS:x,endDTS:A,type:"audio",hasAudio:!0,hasVideo:!1,nb:T};return this.isAudioContiguous=!0,k}remuxEmptyAudio(e,t,n,r){const i=e.inputTimeScale,a=i/(e.samplerate?e.samplerate:i),s=this.nextAudioPts,o=this._initDTS,l=9e4*o.baseTime/o.timescale,u=(null!==s?s:r.startDTS*i)+l,c=r.endDTS*i+l,d=1024*a,h=Math.ceil((c-u)/d),f=AAC.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(yr.warn("[mp4-remuxer]: remux empty Audio"),!f)return void yr.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const p=[];for(let g=0;g4294967296;)e+=n;return e}function xo(e,t,n,r){const i=e.samples.length;if(!i)return;const a=e.inputTimeScale;for(let o=0;oe.pts-t.pts));const a=e.samples;return e.samples=[],{samples:a}}class Mp4Sample{constructor(e,t,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=r,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}function ko(e,t){const n=null==e?void 0:e.codec;if(n&&n.length>4)return n;if(t===Er){if("ec-3"===n||"ac-3"===n||"alac"===n)return n;if("fLaC"===n||"Opus"===n){return Gi(n,!1)}const e="mp4a.40.5";return yr.info(`Parsed audio codec "${n}" or audio object type not handled. Using "${e}"`),e}return yr.warn(`Unhandled video codec "${n}"`),"hvc1"===n||"hev1"===n?"hvc1.1.6.L120.90":"av01"===n?"av01.0.04M.08":"avc1.42e01e"}try{Eo=self.performance.now.bind(self.performance)}catch(Su){yr.debug("Unable to use Performance API on this environment"),Eo=null==kr?void 0:kr.Date.now}const Do=[{demux:class MP4Demuxer{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){const i=this.videoTrack=$s("video",1),a=this.audioTrack=$s("audio",1),s=this.txtTrack=$s("text",1);if(this.id3Track=$s("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=mi(e);if(o.video){const{id:e,timescale:t,codec:n}=o.video;i.id=e,i.timescale=s.timescale=t,i.codec=n}if(o.audio){const{id:e,timescale:t,codec:n}=o.audio;a.id=e,a.timescale=t,a.codec=n}s.id=oi.text,i.sampleDuration=0,i.duration=a.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return function(e){const t=e.byteLength;for(let n=0;n8&&109===e[n+4]&&111===e[n+5]&&111===e[n+6]&&102===e[n+7])return!0;n=r>1?n+r:t}return!1}(e)}demux(e,t){this.timeOffset=t;let n=e;const r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ti(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},n=pi(e,["moof"]);if(n.length<2)return t.remainder=e,t;const r=n[n.length-1];return t.valid=Ur(e,0,r.byteOffset-8),t.remainder=Ur(e,r.byteOffset-8),t}(n);this.remainderData=t.remainder,r.samples=t.valid||new Uint8Array}else r.samples=n;const a=this.extractID3Track(r,t);return i.samples=Si(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:a,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return n.samples=Si(e,t),{videoTrack:t,audioTrack:$s(),id3Track:r,textTrack:$s()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const r=pi(e.samples,["emsg"]);r&&r.forEach((e=>{const r=function(e){const t=e[0];let n="",r="",i=0,a=0,s=0,o=0,l=0,u=0;if(0===t){for(;"\0"!==li(e.subarray(u,u+1));)n+=li(e.subarray(u,u+1)),u+=1;for(n+=li(e.subarray(u,u+1)),u+=1;"\0"!==li(e.subarray(u,u+1));)r+=li(e.subarray(u,u+1)),u+=1;r+=li(e.subarray(u,u+1)),u+=1,i=ci(e,12),a=ci(e,16),o=ci(e,20),l=ci(e,24),u=28}else if(1===t){u+=4,i=ci(e,u),u+=4;const t=ci(e,u);u+=4;const a=ci(e,u);for(u+=4,s=2**32*t+a,ur(s)||(s=Number.MAX_SAFE_INTEGER,yr.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=ci(e,u),u+=4,l=ci(e,u),u+=4;"\0"!==li(e.subarray(u,u+1));)n+=li(e.subarray(u,u+1)),u+=1;for(n+=li(e.subarray(u,u+1)),u+=1;"\0"!==li(e.subarray(u,u+1));)r+=li(e.subarray(u,u+1)),u+=1;r+=li(e.subarray(u,u+1)),u+=1}return{schemeIdUri:n,value:r,timeScale:i,presentationTime:s,presentationTimeDelta:a,eventDuration:o,id:l,payload:e.subarray(u,e.byteLength)}}(e);if(oo.test(r.schemeIdUri)){const e=lr(r.presentationTime)?r.presentationTime/r.timeScale:t+r.presentationTimeDelta/r.timeScale;let i=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;i<=.001&&(i=Number.POSITIVE_INFINITY);const a=r.payload;n.samples.push({data:a,len:a.byteLength,dts:e,pts:e,type:_a,duration:i})}}))}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}},remux:class PassThroughRemuxer{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(function(e,t){if(!e||!t)return e;const n=t.keyId;n&&t.isCommonEncryption&&pi(e,["moov","trak"]).forEach((e=>{const t=pi(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let r=pi(t,["enca"]);const i=r.length>0;i||(r=pi(t,["encv"])),r.forEach((e=>{pi(i?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=_i(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(yr.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${ii(e)} -> ${ii(n)}`),t.set(n,8))}}))}))}));return e}(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const r=this.initData=mi(e);r.audio&&(t=ko(r.audio,Er)),r.video&&(n=ko(r.video,Tr));const i={};r.audio&&r.video?i.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:r.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?i.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:yr.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i}remux(e,t,n,r,i,a){var s,o;let{initPTS:l,lastEndTime:u}=this;const c={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};lr(u)||(u=this.lastEndTime=i||0);const d=t.samples;if(null==d||!d.length)return c;const h={initPTS:void 0,timescale:1};let f=this.initData;if(null!=(s=f)&&s.length||(this.generateInitSegment(d),f=this.initData),null==(o=f)||!o.length)return yr.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),c;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const p=function(e,t){let n=0,r=0,i=0;const a=pi(e,["moof","traf"]);for(let s=0;se+t.info.duration||0),0);n=Math.max(n,e+a.earliestPresentationTime/a.timescale),r=n-t}}if(r&&lr(r))return r}return r||i}(d,f),g=function(e,t){return pi(t,["moof","traf"]).reduce(((t,n)=>{const r=pi(n,["tfdt"])[0],i=r[0],a=pi(n,["tfhd"]).reduce(((t,n)=>{const a=ci(n,4),s=e[a];if(s){let e=ci(r,4);if(1===i){if(e===ai)return yr.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;e*=ai+1,e+=ci(r,8)}const n=e/(s.timescale||9e4);if(lr(n)&&(null===t||ni}(l,m,i,p)||h.timescale!==l.timescale&&a)&&(h.initPTS=m-i,l&&1===l.timescale&&yr.warn("Adjusting initPTS by "+(h.initPTS-l.baseTime)),this.initPTS=l={baseTime:h.initPTS,timescale:1});const v=e?m-l.baseTime/l.timescale:u,y=v+p;!function(e,t,n){pi(t,["moof","traf"]).forEach((t=>{pi(t,["tfhd"]).forEach((r=>{const i=ci(r,4),a=e[i];if(!a)return;const s=a.timescale||9e4;pi(t,["tfdt"]).forEach((e=>{const t=e[0],r=n*s;if(r){let n=ci(e,4);if(0===t)n-=r,n=Math.max(n,0),fi(e,4,n);else{n*=Math.pow(2,32),n+=ci(e,8),n-=r,n=Math.max(n,0);const t=Math.floor(n/(ai+1)),i=Math.floor(n%(ai+1));fi(e,4,t),fi(e,8,i)}}}))}))}))}(f,d,l.baseTime/l.timescale),p>0?this.lastEndTime=y:(yr.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const b=!!f.audio,w=!!f.video;let _="";b&&(_+="audio"),w&&(_+="video");const E={data1:d,startPTS:v,startDTS:v,endPTS:y,endDTS:y,type:_,hasAudio:b,hasVideo:w,nb:1,dropped:0};return c.audio="audio"===E.type?E:void 0,c.video="audio"!==E.type?E:void 0,c.initSegment=h,c.id3=xo(n,i,l,l),r.samples.length&&(c.text=Ao(r,i,l)),c}}},{demux:TSDemuxer,remux:MP4Remuxer},{demux:class AACDemuxer extends BaseAudioDemuxer{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Hr(e,0);let n=(null==t?void 0:t.length)||0;if(so(e,n))return!1;for(let r=e.length;n0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(n=t);return n}(a,t);if(b&&"AES-128"===b.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(a,b.key.buffer,b.iv.buffer).then((e=>{const t=this.push(e,null,n);return this.decryptionPromise=null,t})),this.decryptionPromise;{let t=e.softwareDecrypt(a,b.key.buffer,b.iv.buffer);if(n.part>-1&&(t=e.flush()),!t)return i.executeEnd=Eo(),Lo(n);a=new Uint8Array(t)}}const w=this.needsProbing(u,c);if(w){const e=this.configureTransmuxer(a);if(e)return yr.warn(`[transmuxer] ${e.message}`),this.observer.emit(dr.ERROR,dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),i.executeEnd=Eo(),Lo(n)}(u||c||f||w)&&this.resetInitSegment(y,p,g,v,t),(u||f||w)&&this.resetInitialTimestamp(m),l||this.resetContiguity();const _=this.transmux(a,b,h,d,n),E=this.currentTransmuxState;return E.contiguous=!0,E.discontinuity=!1,E.trackSwitch=!1,i.executeEnd=Eo(),_}flush(e){const t=e.transmuxing;t.executeStart=Eo();const{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return i.then((()=>this.flush(e)));const a=[],{timeOffset:s}=r;if(n){const t=n.flush();t&&a.push(this.push(t,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l)return t.executeEnd=Eo(),[Lo(e)];const u=o.flush(s);return Ro(u)?u.then((t=>(this.flushRemux(a,t,e),a))):(this.flushRemux(a,u,e),a)}flushRemux(e,t,n){const{audioTrack:r,videoTrack:i,id3Track:a,textTrack:s}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;yr.log(`[transmuxer.ts]: Flushed fragment ${n.sn}${n.part>-1?" p: "+n.part:""} of level ${n.level}`);const u=this.remuxer.remux(r,i,a,s,l,o,!0,this.id);e.push({remuxResult:u,chunkMeta:n}),n.transmuxing.executeEnd=Eo()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,i){const{demuxer:a,remuxer:s}=this;a&&s&&(a.resetInitSegment(e,t,n,r),s.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,r,i){let a;return a=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,r,i):this.transmuxUnencrypted(e,n,r,i),a}transmuxUnencrypted(e,t,n,r){const{audioTrack:i,videoTrack:a,id3Track:s,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,a,s,o,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,this.id),chunkMeta:i})))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:r,vendor:i}=this;let a;for(let d=0,h=Do.length;d({remuxResult:{},chunkMeta:e});function Ro(e){return"then"in e&&e.then instanceof Function}class TransmuxConfig{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}}class TransmuxState{constructor(e,t,n,r,i,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=a}}var Po={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new i(r,a||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);i{(t=t||{}).frag=this.frag,t.id=this.id,e===dr.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new Io,this.observer.on(dr.FRAG_DECRYPTED,a),this.observer.on(dr.ERROR,a);const s=Ni(i.preferManagedMediaSource)||{isTypeSupported:()=>!1},o={mpeg:s.isTypeSupported("audio/mpeg"),mp3:s.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:s.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&"undefined"!=typeof Worker){if(i.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{i.workerPath?(yr.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=function(e){const t=new self.URL(e,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}(i.workerPath)):(yr.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e);return{worker:new self.Worker(t),objectURL:t}}()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const n=new Error(`${e.message} (${e.filename}:${e.lineno})`);i.enableWorker=!1,yr.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(dr.ERROR,{type:hr.OTHER_ERROR,details:fr.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:n})},e.postMessage({cmd:"init",typeSupported:o,vendor:"",id:t,config:JSON.stringify(i)})}catch(Su){yr.warn(`Error setting up "${t}" Web Worker, fallback to inline`,Su),this.resetWorker(),this.error=null,this.transmuxer=new Transmuxer(this.observer,o,i,"",t)}return}}this.transmuxer=new Transmuxer(this.observer,o,i,"",t)}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,n,r,i,a,s,o,l,u){var c,d;l.transmuxing.start=self.performance.now();const{transmuxer:h}=this,f=a?a.start:i.start,p=i.decryptdata,g=this.frag,m=!(g&&i.cc===g.cc),v=!(g&&l.level===g.level),y=g?l.sn-g.sn:-1,b=this.part?l.part-this.part.index:-1,w=0===y&&l.id>1&&l.id===(null==g?void 0:g.stats.chunkCount),_=!v&&(1===y||0===y&&(1===b||w&&b<=0)),E=self.performance.now();(v||y||0===i.stats.parsing.start)&&(i.stats.parsing.start=E),!a||!b&&_||(a.stats.parsing.start=E);const T=!(g&&(null==(c=i.initSegment)?void 0:c.url)===(null==(d=g.initSegment)?void 0:d.url)),S=new TransmuxState(m,_,o,v,f,T);if(!_||m||T){yr.log(`[transmuxer-interface, ${i.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${m}\n trackSwitch: ${v}\n contiguous: ${_}\n accurateTimeOffset: ${o}\n timeOffset: ${f}\n initSegmentChange: ${T}`);const e=new TransmuxConfig(n,r,t,s,u);this.configureTransmuxer(e)}if(this.frag=i,this.part=a,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:p,chunkMeta:l,state:S},e instanceof ArrayBuffer?[e]:[]);else if(h){const t=h.push(e,p,l,S);Ro(t)?(h.async=!0,t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")}))):(h.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let n=t.flush(e);Ro(n)||t.async?(Ro(n)||(n=Promise.resolve(n)),n.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")}))):this.handleFlushResult(n,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}onWorkerMessage(e){const t=e.data;if(null==t||!t.event)return void yr.warn("worker message received with no "+(t?"event name":"data"));const n=this.hls;if(this.hls)switch(t.event){case"init":{var r;const e=null==(r=this.workerContext)?void 0:r.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":yr[t.data.logType]&&yr[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data)}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}function Oo(e,t){if(e.length!==t.length)return!1;for(let n=0;ne[n]!==t[n]))}function No(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}class BufferableInstance{constructor(e){this.buffered=void 0;const t=(t,n,r)=>{if((n>>>=0)>r-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${r})`);return e[n][t]};this.buffered={get length(){return e.length},end:n=>t("end",n,e.length),start:n=>t("start",n,e.length)}}}class BufferOperationQueue{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t,n){const r=this.queues[t];r.push(e),1!==r.length||n||this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const n=new Promise((e=>{t=e})),r={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,e),n}executeNext(e){const t=this.queues[e];if(t.length){const r=t[0];try{r.execute()}catch(n){yr.warn(`[buffer-operation-queue]: Exception executing "${e}" SourceBuffer operation: ${n}`),r.onError(n);const t=this.buffers[e];null!=t&&t.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const Fo=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;function Bo(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach((t=>{e.removeChild(t)}))}const jo={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Uo=e=>String.fromCharCode(jo[e]||e),$o=15,Vo=100,Ho={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},zo={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Go={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Wo={25:2,26:4,29:6,30:8,31:10,27:13,28:15},qo=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class CaptionsLogger{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n="function"==typeof t?t():t;yr.log(`${this.time} [${e}] ${n}`)}}}const Yo=function(e){const t=[];for(let n=0;nVo&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Vo)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n=144&&this.backSpace();const t=Uo(e);this.pos>=Vo?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t"pacData = "+JSON.stringify(e)));let t=e.row-1;if(this.nrRollUpRows&&t"bkgData = "+JSON.stringify(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",r=-1;for(let i=0;i<$o;i++){const n=this.rows[i].getTextString();n&&(r=i+1,e?t.push("Row "+r+": '"+n+"'"):t.push(n.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n}getTextAndFormat(){return this.rows}}class Cea608Channel{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new CaptionScreen(n),this.nonDisplayedMemory=new CaptionScreen(n),this.lastOutputScreen=new CaptionScreen(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;nt+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[n]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Cea608Parser{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const r=this.logger=new CaptionsLogger;this.channels=[null,new Cea608Channel(e,t,r),new Cea608Channel(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n"["+Yo([t[n],t[n+1]])+"] -> ("+Yo([e,r])+")"));const s=this.cmdHistory;if(e>=16&&e<=31){if(Xo(e,r,s)){Ko(null,null,s),this.logger.log(3,(()=>"Repeated command ("+Yo([e,r])+") is dropped"));continue}Ko(e,r,this.cmdHistory),i=this.parseCmd(e,r),i||(i=this.parseMidrow(e,r)),i||(i=this.parsePAC(e,r)),i||(i=this.parseBackgroundAttributes(e,r))}else Ko(null,null,s);if(!i&&(a=this.parseChars(e,r),a)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(a)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||a||this.logger.log(2,(()=>"Couldn't parse cleaned data "+Yo([e,r])+" orig: "+Yo([t[n],t[n+1]])))}}parseCmd(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;const n=20===e||21===e||23===e?1:2,r=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3):39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((17===e||25===e)&&t>=32&&t<=47){if(n=17===e?1:2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[n];return!!r&&(r.ccMIDROW(t),this.logger.log(3,(()=>"MIDROW ("+Yo([e,t])+")")),!0)}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;const r=e<=23?1:2;n=t>=64&&t<=95?1===r?Ho[e]:Go[e]:1===r?zo[e]:Wo[e];const i=this.channels[r];return!!i&&(i.setPAC(this.interpretPAC(n,t)),this.currentChannel=r,!0)}interpretPAC(e,t){let n;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=!(1&~n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let e;e=17===i?t+80:18===i?t+112:t+144,this.logger.log(2,(()=>"Special char '"+Uo(e)+"' in channel "+n)),r=[e]}else e>=32&&e<=127&&(r=0===t?[e]:[e,t]);return r&&this.logger.log(3,(()=>"Char codes = "+Yo(r).join(","))),r}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let n;const r={};16===e||24===e?(n=Math.floor((t-32)/2),r.background=qo[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));const i=e<=23?1:2;return this.channels[i].setBkgData(r),!0}reset(){for(let e=0;ee)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Qo=function(){if(null!=kr&&kr.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function n(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const n=t.toLowerCase();return!!~e.indexOf(n)&&n}function r(e){return n(t,e)}function i(e,...t){let n=1;for(;n100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",i({},l,{get:function(){return w},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",i({},l,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",i({},l,{get:function(){return E},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class StringDecoder{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Jo(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(r||0)}const n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}class Settings{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r=0&&n<=100)return this.set(e,n),!0}return!1}}function Zo(e,t,n,r){const i=r?e.split(r):[e];for(const a in i){if("string"!=typeof i[a])continue;const e=i[a].split(n);if(2!==e.length)continue;t(e[0],e[1])}}const el=new Qo(0,0,""),tl="middle"===el.align?"middle":"center";function nl(e,t,n){const r=e;function i(){const t=Jo(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=i(),a(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.slice(3),a(),t.endTime=i(),a(),function(e,t){const r=new Settings;Zo(e,(function(e,t){let i;switch(e){case"region":for(let i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),r.integer(e,i[0]),r.percent(e,i[0])&&r.set("snapToLines",!1),r.alt(e,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",tl,"end"]);break;case"position":i=t.split(","),r.percent(e,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start",tl,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",tl,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");let i=r.get("line","auto");"auto"===i&&-1===el.line&&(i=-1),t.line=i,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",tl);let a=r.get("position","auto");"auto"===a&&50===el.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}(e,t)}function rl(e){return e.replace(//gi,"\n")}class VTTParser{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new StringDecoder,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function n(){let e=t.buffer,n=0;for(e=rl(e);n>>0).toString()};function ol(e,t,n){return sl(e.toString())+sl(t.toString())+sl(n)}function ll(e,t,n,r,i,a,s){const o=new VTTParser,l=ti(new Uint8Array(e)).trim().replace(il,"\n").split("\n"),u=[],c=t?function(e,t=1){return wo(e,bo,1/t)}(t.baseTime,t.timescale):0;let d,h="00:00.000",f=0,p=0,g=!0;o.oncue=function(e){const a=n[r];let s=n.ccOffset;const o=(f-c)/9e4;if(null!=a&&a.new&&(void 0!==p?s=n.ccOffset=a.start:function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!=(a=i)&&a.new;){var a;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n}(n,r,o)),o){if(!t)return void(d=new Error("Missing initPTS for VTT MPEGTS"));s=o-n.presentationOffset}const l=e.endTime-e.startTime,h=Co(9e4*(e.startTime+s-p),9e4*i)/9e4;e.startTime=Math.max(h,0),e.endTime=Math.max(h+l,0);const g=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(g)),e.id||(e.id=ol(e.startTime,e.endTime,g)),e.endTime>0&&u.push(e)},o.onparsingerror=function(e){d=e},o.onflush=function(){d?s(d):a(u)},l.forEach((e=>{if(g){if(al(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach((e=>{al(e,"LOCAL:")?h=e.slice(6):al(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))}));try{p=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(lr(t)&&lr(n)&&lr(r)&&lr(i)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=6e4*r,t+=36e5*i,t}(h)/1e3}catch(t){d=t}return}""===e&&(g=!1)}o.parse(e+"\n")})),o.flush()}const ul="stpp.ttml.im1t",cl=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,dl=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,hl={left:"start",center:"center",right:"end",start:"start",end:"end"};function fl(e,t,n,r){const i=pi(new Uint8Array(e),["mdat"]);if(0===i.length)return void r(new Error("Could not parse IMSC1 mdat"));const a=i.map((e=>ti(e))),s=function(e,t,n=1,r=!1){return wo(e,t,1/n,r)}(t.baseTime,1,t.timescale);try{a.forEach((e=>n(function(e,t){const n=(new DOMParser).parseFromString(e,"text/xml"),r=n.getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(i).reduce(((e,t)=>(e[t]=r.getAttribute(`ttp:${t}`)||i[t],e)),{}),s="preserve"!==r.getAttribute("xml:space"),o=gl(pl(r,"styling","style")),l=gl(pl(r,"layout","region")),u=pl(r,"body","[begin]");return[].map.call(u,(e=>{const n=ml(e,s);if(!n||!e.hasAttribute("begin"))return null;const r=bl(e.getAttribute("begin"),a),i=bl(e.getAttribute("dur"),a);let u=bl(e.getAttribute("end"),a);if(null===r)throw yl(e);if(null===u){if(null===i)throw yl(e);u=r+i}const c=new Qo(r-t,u-t,n);c.id=ol(c.startTime,c.endTime,c.text);const d=function(e,t,n){const r="http://www.w3.org/ns/ttml#styling";let i=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;s&&n.hasOwnProperty(s)&&(i=n[s]);return a.reduce(((n,a)=>{const s=vl(t,r,a)||vl(e,r,a)||vl(i,r,a);return s&&(n[a]=s),n}),{})}(l[e.getAttribute("region")],o[e.getAttribute("style")],o),{textAlign:h}=d;if(h){const e=hl[h];e&&(c.lineAlign=e),c.align=h}return or(c,d),c})).filter((e=>null!==e))}(e,s))))}catch(o){r(o)}}function pl(e,t,n){const r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function gl(e){return e.reduce(((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function ml(e,t){return[].slice.call(e.childNodes).reduce(((e,n,r)=>{var i;return"br"===n.nodeName&&r?e+"\n":null!=(i=n.childNodes)&&i.length?ml(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent}),"")}function vl(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function yl(e){return new Error(`Could not parse ttml timestamp ${e}`)}function bl(e,t){if(!e)return null;let n=Jo(e);return null===n&&(cl.test(e)?n=function(e,t){const n=cl.exec(e),r=(0|n[4])+(0|n[5])/t.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/t.frameRate}(e,t):dl.test(e)&&(n=function(e,t){const n=dl.exec(e),r=Number(n[1]);switch(n[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),n}function wl(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function _l(e,t){return!!e&&e.kind===wl(t)&&No(t,e)}class CapLevelController{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(dr.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(dr.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.on(dr.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(dr.BUFFER_CODECS,this.onBufferCodecs,this),e.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(dr.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(dr.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.off(dr.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(dr.BUFFER_CODECS,this.onBufferCodecs,this),e.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&lr(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&yr.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter(((t,n)=>this.isLevelAllowed(t)&&n<=e));return this.clientRect=null,CapLevelController.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,n){if(null==e||!e.length)return-1;let r=e.length-1;const i=Math.max(t,n);for(let o=0;o=i||t.height>=i)&&(a=t,!(s=e[o+1])||a.width!==s.width||a.height!==s.height)){r=o;break}}var a,s;return r}}const El="[eme]";class EMEController{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=EMEController.CDMCleanupPromise?[EMEController.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=yr.debug.bind(yr,El),this.log=yr.log.bind(yr,El),this.warn=yr.warn.bind(yr,El),this.error=yr.error.bind(yr,El),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(dr.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(dr.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(dr.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(dr.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(dr.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(dr.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Dr.WIDEVINE&&n)return n;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(e,t,n)=>!!e&&n.indexOf(e)===t,r=t.map((e=>e.audioCodec)).filter(n),i=t.map((e=>e.videoCodec)).filter(n);return r.length+i.length===0&&i.push("avc1.42e01e"),new Promise(((t,n)=>{const a=e=>{const s=e.shift();this.getMediaKeysPromise(s,r,i).then((e=>t({keySystem:s,mediaKeys:e}))).catch((t=>{e.length?a(e):n(t instanceof EMEKeyError?t:new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};a(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if("function"!=typeof n){let e=`Configured requestMediaKeySystemAccess is not a function ${n}`;return null===Br&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return n(e,t)}getMediaKeysPromise(e,t,n){const r=function(e,t,n,r){let i;switch(e){case Dr.FAIRPLAY:i=["cenc","sinf"];break;case Dr.WIDEVINE:case Dr.PLAYREADY:i=["cenc"];break;case Dr.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,n,r){return[{initDataTypes:e,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs="${e}"`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:n.map((e=>({contentType:`video/mp4; codecs="${e}"`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(i,t,n,r)}(e,t,n,this.config.drmSystemOptions),i=this.keySystemAccessPromises[e];let a=null==i?void 0:i.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(r)}`),a=this.requestMediaKeySystemAccess(e,r);const t=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),a.then((n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);const r=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=n.createMediaKeys().then((t=>(this.log(`Media-keys created for "${e}"`),r.then((n=>n?this.setMediaKeysServerCertificate(t,e,n):t))))),t.mediaKeys.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),t.mediaKeys}))}return a.then((()=>i.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${ii(e.keyId||[])}`);const r=n.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),i="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,i,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return ii(e.keyId)}updateKeySession(e,t){var n;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${ii((null==(n=e.decryptdata)?void 0:n.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise(((t,n)=>{const r=Fr(this.config),i=e.map(Or).filter((e=>!!e&&-1!==r.indexOf(e)));return this.getKeySystemSelectionPromise(i).then((({keySystem:e})=>{const r=Nr(e);r?t(r):n(new Error(`Unable to find format for key-system "${e}"`))})).catch(n)}))}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),r=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let i=this.keyIdToKeySessionPromise[n];return i||(i=this.keyIdToKeySessionPromise[n]=this.getKeySystemForKeyPromise(t).then((({keySystem:n,mediaKeys:i})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(n,i).then((()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:n,mediaKeys:i,decryptdata:t});return this.generateRequestWithPreferredKeySession(e,"cenc",t.pssh,"playlist-key")}))))),i.catch((e=>this.handleError(e)))),i}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof EMEKeyError?this.hls.trigger(dr.ERROR,e.data):this.hls.trigger(dr.ERROR,{type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const t=Or(e.keyFormat),n=t?[t]:Fr(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=Fr(this.config)),0===e.length)throw new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:n}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===n)return;let r,i;if("sinf"===t&&this.config.drmSystems[Dr.FAIRPLAY]){const e=li(new Uint8Array(n));try{const t=Cr(JSON.parse(e).sinf),n=_i(new Uint8Array(t));if(!n)return;r=n.subarray(8,24),i=Dr.FAIRPLAY}catch(u){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},n=new DataView(e),r=n.getUint32(0);if(e.byteLength!==r&&r>44)return null;if(1886614376!==n.getUint32(4))return null;if(t.version=n.getUint32(8)>>>24,t.version>1)return null;t.systemId=ii(new Uint8Array(e,12,16));const i=n.getUint32(28);if(0===t.version){if(r-32this.generateRequestWithPreferredKeySession(e,t,n,"encrypted-event-key-match")));break}}l||(l=s[a]=this.getKeySystemSelectionPromise([i]).then((({keySystem:e,mediaKeys:i})=>{var s;this.throwIfDestroyed();const o=new LevelKey("ISO-23001-7",a,null!=(s=Nr(e))?s:"");return o.pssh=new Uint8Array(n),o.keyId=r,this.attemptSetMediaKeys(e,i).then((()=>{this.throwIfDestroyed();const r=this.createMediaKeySessionContext({decryptdata:o,keySystem:e,mediaKeys:i});return this.generateRequestWithPreferredKeySession(r,t,n,"encrypted-event-no-match")}))}))),l.catch((e=>this.handleError(e)))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(n).then((()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===n.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,n,r){var i,a;const s=null==(i=this.config.drmSystems)||null==(a=i[e.keySystem])?void 0:a.generateRequest;if(s)try{const r=s.call(this.hls,t,n,e);if(!r)throw new Error("Invalid response from configured generateRequest filter");t=r.initDataType,n=e.decryptdata.pssh=r.initData?new Uint8Array(r.initData):null}catch(f){var o;if(this.warn(f.message),null!=(o=this.hls)&&o.config.debug)throw f}if(null===n)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${l} (init data type: ${t} length: ${n?n.byteLength:null})`);const u=new Io,c=e._onmessage=t=>{const n=e.mediaKeysSession;if(!n)return void u.emit("error",new Error("invalid state"));const{messageType:r,message:i}=t;this.log(`"${r}" message event for session "${n.sessionId}" message size: ${i.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(e,i).catch((e=>{this.handleError(e),u.emit("error",e)})):"license-release"===r?e.keySystem===Dr.FAIRPLAY&&(this.updateKeySession(e,Ar("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${r}"`)},d=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void u.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const n=e.keyStatus;u.emit("keyStatus",n),"expired"===n&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};e.mediaKeysSession.addEventListener("message",c),e.mediaKeysSession.addEventListener("keystatuseschange",d);const h=new Promise(((e,t)=>{u.on("error",t),u.on("keyStatus",(n=>{n.startsWith("usable")?e():"output-restricted"===n?t(new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===n?t(new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${n}"`)):"expired"===n?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${n}"`)}))}));return e.mediaKeysSession.generateRequest(t,n).then((()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)})).catch((e=>{throw new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>h)).catch((t=>{throw u.removeAllListeners(),this.removeSession(e),t})).then((()=>(u.removeAllListeners(),e)))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach(((t,n)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${ii("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${ii(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t}))}fetchServerCertificate(e){const t=this.config,n=new(0,t.loader)(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise(((i,a)=>{const s={responseType:"arraybuffer",url:r},o=t.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,n,r)=>{i(e.data)},onError:(t,n,i,o)=>{a(new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:ir({url:s.url,data:void 0},t)},`"${e}" certificate request failed (${r}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,i)=>{a(new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:s.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(e,t,n)=>{a(new Error("aborted"))}};n.load(s,l,u)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise(((r,i)=>{e.setServerCertificate(n).then((i=>{this.log(`setServerCertificate ${i?"success":"not supported by CDM"} (${null==n?void 0:n.byteLength}) on "${t}"`),r(e)})).catch((e=>{i(new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((e=>{throw new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const r=(new DOMParser).parseFromString(n,"application/xml"),i=r.querySelectorAll("HttpHeader");if(i.length>0){let t;for(let n=0,r=i.length;n in key message");return Ar(atob(l))}setupLicenseXHR(e,t,n,r){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then((()=>{if(!n.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,n,r)})).catch((a=>{if(!n.decryptdata)throw a;return e.open("POST",t,!0),i.call(this.hls,e,t,n,r)})).then((n=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:n||r}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise(((r,i)=>{const a=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${a}`);const s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(4===s.readyState)if(200===s.status){this._requestLicenseFailureCount=0;let t=s.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const n=this.config.licenseResponseCallback;if(n)try{t=n.call(this.hls,s,a,e)}catch(o){this.error(o)}r(t)}else{const o=n.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||s.status>=400&&s.status<500)i(new EMEKeyError({type:hr.KEY_SYSTEM_ERROR,details:fr.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:{url:a,data:void 0,code:s.status,text:s.statusText}},`License Request XHR failed (${a}). Status: ${s.status} (${s.statusText})`));else{const n=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=s,this.setupLicenseXHR(s,a,e,t).then((({xhr:t,licenseChallenge:n})=>{e.keySystem==Dr.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(t,n)),t.send(n)}))}))}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,n.addEventListener("encrypted",this.onMediaEncrypted),n.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},LevelKey.clearKeyUriToKeyIdMap();const n=t.length;EMEController.CDMCleanupPromise=Promise.all(t.map((e=>this.removeSession(e))).concat(null==e?void 0:e.setMediaKeys(null).catch((e=>{this.log(`Could not clear media keys: ${e}`)})))).then((()=>{n&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)})).catch((e=>{this.log(`Could not close sessions and clear media keys: ${e}`)}))}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);return r>-1&&this.mediaKeySessions.splice(r,1),t.remove().catch((e=>{this.log(`Could not remove session: ${e}`)})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`)}))}}}EMEController.CDMCleanupPromise=void 0;class EMEKeyError extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var Tl,Sl,Cl;!function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"}(Tl||(Tl={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(Sl||(Sl={})),function(e){e.OBJECT="CMCD-Object",e.REQUEST="CMCD-Request",e.SESSION="CMCD-Session",e.STATUS="CMCD-Status"}(Cl||(Cl={}));const xl={[Cl.OBJECT]:["br","d","ot","tb"],[Cl.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[Cl.SESSION]:["cid","pr","sf","sid","st","v"],[Cl.STATUS]:["bs","rtp"]};class SfItem{constructor(e,t){this.value=void 0,this.params=void 0,Array.isArray(e)&&(e=e.map((e=>e instanceof SfItem?e:new SfItem(e)))),this.value=e,this.params=t}}class SfToken{constructor(e){this.description=void 0,this.description=e}}const Al="Dict";function kl(e,t,n,r){return new Error(`failed to ${e} "${i=t,Array.isArray(i)?JSON.stringify(i):i instanceof Map?"Map{}":i instanceof Set?"Set{}":"object"==typeof i?JSON.stringify(i):String(i)}" as ${n}`,{cause:r});var i}const Dl="Bare Item",Ll="Boolean",Rl="Byte Sequence",Pl="Decimal",Il="Integer";const Ol=/[\x00-\x1f\x7f]+/,Ml="Token",Nl="Key";function Fl(e,t,n){return kl("serialize",e,t,n)}function Bl(e){if(!1===ArrayBuffer.isView(e))throw Fl(e,Rl);return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function jl(e){if(function(e){return e<-999999999999999||99999999999999912)throw Fl(e,Pl);const n=t.toString();return n.includes(".")?n:`${n}.0`}const Vl="String";function Hl(e){const t=(n=e).description||n.toString().slice(7,-1);var n;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw Fl(t,Ml);return t}function zl(e){switch(typeof e){case"number":if(!lr(e))throw Fl(e,Dl);return Number.isInteger(e)?jl(e):$l(e);case"string":return function(e){if(Ol.test(e))throw Fl(e,Vl);return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return Hl(e);case"boolean":return function(e){if("boolean"!=typeof e)throw Fl(e,Ll);return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${jl(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return Bl(e);if(e instanceof SfToken)return Hl(e);default:throw Fl(e,Dl)}}function Gl(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw Fl(e,Nl);return e}function Wl(e){return null==e?"":Object.entries(e).map((([e,t])=>!0===t?`;${Gl(e)}`:`;${Gl(e)}=${zl(t)}`)).join("")}function ql(e){return e instanceof SfItem?`${zl(e.value)}${Wl(e.params)}`:zl(e)}function Yl(e,t={whitespace:!0}){if("object"!=typeof e)throw Fl(e,Al);const n=e instanceof Map?e.entries():Object.entries(e),r=null!=t&&t.whitespace?" ":"";return Array.from(n).map((([e,t])=>{t instanceof SfItem==!1&&(t=new SfItem(t));let n=Gl(e);var r;return!0===t.value?n+=Wl(t.params):(n+="=",Array.isArray(t.value)?n+=`(${(r=t).value.map(ql).join(" ")})${Wl(r.params)}`:n+=ql(t)),n})).join(`,${r}`)}const Kl=e=>"ot"===e||"sf"===e||"st"===e,Xl=e=>"number"==typeof e?lr(e):null!=e&&""!==e&&!1!==e;const Ql=e=>Math.round(e),Jl=e=>100*Ql(e/100),Zl={br:Ql,d:Ql,bl:Jl,dl:Jl,mtp:Jl,nor:(e,t)=>(null!=t&&t.baseUrl&&(e=function(e,t){const n=new URL(e),r=new URL(t);if(n.origin!==r.origin)return e;const i=n.pathname.split("/").slice(1),a=r.pathname.split("/").slice(1,-1);for(;i[0]===a[0];)i.shift(),a.shift();for(;a.length;)a.shift(),i.unshift("..");return i.join("/")}(e,t.baseUrl)),encodeURIComponent(e)),rtp:Jl,tb:Ql};function eu(e,t={}){return e?function(e,t){return Yl(e,t)}(function(e,t){const n={};if(null==e||"object"!=typeof e)return n;const r=Object.keys(e).sort(),i=or({},Zl,null==t?void 0:t.formatters),a=null==t?void 0:t.filter;return r.forEach((r=>{if(null!=a&&a(r))return;let s=e[r];const o=i[r];o&&(s=o(s,t)),"v"===r&&1===s||"pr"==r&&1===s||Xl(s)&&(Kl(r)&&"string"==typeof s&&(s=new SfToken(s)),n[r]=s)})),n}(e,t),or({whitespace:!1},t)):""}function tu(e,t,n){return or(e,function(e,t={}){if(!e)return{};const n=Object.entries(e),r=Object.entries(xl).concat(Object.entries((null==t?void 0:t.customHeaderMap)||{})),i=n.reduce(((e,t)=>{var n;const[i,a]=t,s=(null==(n=r.find((e=>e[1].includes(i))))?void 0:n[0])||Cl.REQUEST;return null!=e[s]||(e[s]={}),e[s][i]=a,e}),{});return Object.entries(i).reduce(((e,[n,r])=>(e[n]=eu(r,t),e)),{})}(t,n))}const nu="CMCD";const ru=/CMCD=[^&#]+/;function iu(e,t,n){const r=function(e,t={}){if(!e)return"";const n=eu(e,t);return`${nu}=${encodeURIComponent(n)}`}(t,n);if(!r)return e;if(ru.test(e))return e.replace(ru,r);const i=e.includes("?")?"&":"?";return`${e}${i}${r}`}function au(e,t,n,r){e&&Object.keys(t).forEach((i=>{const a=e.filter((e=>e.groupId===i)).map((e=>{const a=or({},e);return a.details=void 0,a.attrs=new AttrList(a.attrs),a.url=a.attrs.URI=su(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",n),a.groupId=a.attrs["GROUP-ID"]=t[i],a.attrs["PATHWAY-ID"]=r,a}));e.push(...a)}))}function su(e,t,n,r){const{HOST:i,PARAMS:a,[n]:s}=r;let o;t&&(o=null==s?void 0:s[t],o&&(e=o));const l=new self.URL(e);return i&&!o&&(l.host=i),a&&Object.keys(a).sort().forEach((e=>{e&&l.searchParams.set(e,a[e])})),l.href}const ou=/^age:\s*[\d.]+\s*$/im;class XhrLoader{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new LoadStats,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then((()=>{if(this.loader===n&&!this.stats.aborted)return i(n,t.url)})).catch((e=>{if(this.loader===n&&!this.stats.aborted)return n.open("GET",t.url,!0),i(n,t.url)})).then((()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)})).catch((e=>{this.callbacks.onError({code:n.status,text:e.message},t,n,r)})):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:a}=n.loadPolicy;if(r)for(const s in r)e.setRequestHeader(s,r[s]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&lr(i)?i:a,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const r=t.status,a="text"!==t.responseType;if(r>=200&&r<300&&(a&&t.response||null!==t.responseText)){n.loading.end=Math.max(self.performance.now(),n.loading.first);const i=a?t.response:t.responseText,s="arraybuffer"===t.responseType?i.byteLength:i.length;if(n.loaded=n.total=s,n.bwEstimate=8e3*n.total/(n.loading.end-n.loading.first),!this.callbacks)return;const o=this.callbacks.onProgress;if(o&&o(n,e,i,t),!this.callbacks)return;const l={url:t.responseURL,data:i,code:r};this.callbacks.onSuccess(l,n,e,t)}else{const a=i.loadPolicy.errorRetry;Ga(a,n.retry,!1,{url:e.url,data:void 0,code:r})?this.retry(a):(yr.error(`${r} while loading ${e.url}`),this.callbacks.onError({code:r,text:t.statusText},e,t,n))}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry;if(Ga(e,this.stats.retry,!0))this.retry(e);else{var t;yr.warn(`timeout while loading ${null==(t=this.context)?void 0:t.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=Ha(e,n.retry),n.retry++,yr.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==t?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&ou.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const lu=/(\d+)-(\d+)\/(\d+)/;class FetchLoader{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||uu,this.controller=new self.AbortController,this.stats=new LoadStats}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const i=function(e,t){const n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(or({},e.headers))};e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return n}(e,this.controller.signal),a=n.onProgress,s="arraybuffer"===e.responseType,o=s?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=l&&lr(l)?l:u,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),n.onTimeout(r,e,this.response)}),t.timeout),self.fetch(this.request).then((i=>{this.response=this.loader=i;const o=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),n.onTimeout(r,e,this.response)}),u-(o-r.loading.start)),!i.ok){const{status:e,statusText:t}=i;throw new FetchError(t||"fetch, bad network response",e,i)}return r.loading.first=o,r.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=lu.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(lr(e))return e}const n=e.get("Content-Length");if(n)return parseInt(n)}(i.headers)||r.total,a&&lr(t.highWaterMark)?this.loadProgressively(i,r,e,t.highWaterMark,a):s?i.arrayBuffer():"json"===e.responseType?i.json():i.text()})).then((i=>{const s=this.response;if(!s)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const l=i[o];l&&(r.loaded=r.total=l);const u={url:s.url,data:i,code:s.status};a&&!lr(t.highWaterMark)&&a(r,e,i,s),n.onSuccess(u,r,e,s)})).catch((t=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const i=t&&t.code||0,a=t?t.message:null;n.onError({code:i,text:a},e,t?t.details:null,r)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){const a=new ChunkCache,s=e.body.getReader(),o=()=>s.read().then((s=>{if(s.done)return a.dataLength&&i(t,n,a.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=s.value,u=l.length;return t.loaded+=u,u=r&&i(t,n,a.flush(),e)):i(t,n,l,e),o()})).catch((()=>Promise.reject()));return o()}}function uu(e,t){return new self.Request(e.url,t)}class FetchError extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const cu=/\s/,du={newCue(e,t,n,r){const i=[];let a,s,o,l,u;const c=self.VTTCue||self.TextTrackCue;for(let h=0;h=16?l--:l++;const r=rl(u.trim()),f=ol(t,n,r);null!=e&&null!=(d=e.cues)&&d.getCueById(f)||(s=new c(t,n,r),s.id=f,s.line=h+1,s.align="left",s.position=10+Math.min(80,10*Math.floor(8*l/32)),i.push(s))}return e&&i.length&&(i.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),i.forEach((t=>ga(e,t)))),i}},hu=ir(ir({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:XhrLoader,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class AbrController{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:e,partCurrent:t,hls:n}=this,{autoLevelEnabled:r,media:i}=n;if(!e||!i)return;const a=performance.now(),s=t?t.stats:e.stats,o=t?t.duration:e.duration,l=a-s.loading.start,u=n.minAutoLevel;if(s.aborted||s.loaded&&s.loaded===s.total||e.level<=u)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!r||i.paused||!i.playbackRate||!i.readyState)return;const c=n.mainForwardBufferInfo;if(null===c)return;const d=this.bwEstimator.getEstimateTTFB(),h=Math.abs(i.playbackRate);if(l<=Math.max(d,o/(2*h)*1e3))return;const f=c.len/h,p=s.loading.first?s.loading.first-s.loading.start:-1,g=s.loaded&&p>-1,m=this.getBwEstimate(),v=n.levels,y=v[e.level],b=s.total||Math.max(s.loaded,Math.round(o*y.averageBitrate/8));let w=g?l-p:l;w<1&&g&&(w=Math.min(l,8*s.loaded/m));const _=g?1e3*s.loaded/w:0,E=_?(b-s.loaded)/_:8*b/m+d/1e3;if(E<=f)return;const T=_?8*_:m;let S,C=Number.POSITIVE_INFINITY;for(S=e.level-1;S>u;S--){const e=v[S].maxBitrate;if(C=this.getTimeToLoadFrag(d/1e3,T,o*e,!v[S].details),C=E)return;if(C>10*o)return;n.nextLoadLevel=n.nextAutoLevel=S,g?this.bwEstimator.sample(l-Math.min(d,p),s.loaded):this.bwEstimator.sampleTTFB(l);const x=v[S].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>x&&this.resetEstimator(x),this.clearTimer(),yr.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${f.toFixed(3)} s\n Estimated load time for current fragment: ${E.toFixed(3)} s\n Estimated load time for down switch fragment: ${C.toFixed(3)} s\n TTFB estimate: ${0|p} ms\n Current BW estimate: ${lr(m)?0|m:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${S} @ ${0|x} bps`),n.trigger(dr.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:s})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(yr.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new EwmaBandWidthEstimator(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.FRAG_LOADING,this.onFragLoading,this),e.on(dr.FRAG_LOADED,this.onFragLoaded,this),e.on(dr.FRAG_BUFFERED,this.onFragBuffered,this),e.on(dr.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(dr.LEVEL_LOADED,this.onLevelLoaded,this),e.on(dr.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(dr.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(dr.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.FRAG_LOADING,this.onFragLoading,this),e.off(dr.FRAG_LOADED,this.onFragLoaded,this),e.off(dr.FRAG_BUFFERED,this.onFragBuffered,this),e.off(dr.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(dr.LEVEL_LOADED,this.onLevelLoaded,this),e.off(dr.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(dr.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(dr.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){var r;if(!n.bitrateTest)this.fragCurrent=n,this.partCurrent=null!=(r=t.part)?r:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case fr.BUFFER_ADD_CODEC_ERROR:case fr.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case fr.FRAG_LOAD_TIMEOUT:{const e=t.frag,{fragCurrent:n,partCurrent:r}=this;if(e&&n&&e.sn===n.sn&&e.level===n.level){const t=performance.now(),n=r?r.stats:e.stats,i=t-n.loading.start,a=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&a>-1){const e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(i-Math.min(e,a),n.loaded)}else this.bwEstimator.sampleTTFB(i)}break}}}getTimeToLoadFrag(e,t,n,r){return e+n/t+(r?this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const n=this.hls.config,{loading:r}=t.stats,i=r.end-r.start;lr(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)}onFragLoaded(e,{frag:t,part:n}){const r=n?n.stats:t.stats;if(t.type===ua&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const e=n?n.duration:t.duration,i=this.hls.levels[t.level],a=(i.loaded?i.loaded.bytes:0)+r.loaded,s=(i.loaded?i.loaded.duration:0)+e;i.loaded={bytes:a,duration:s},i.realBitrate=Math.round(8*a/s)}if(t.bitrateTest){const e={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(dr.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:r}=t,i=null!=r&&r.stats.loaded?r.stats:n.stats;if(i.aborted)return;if(this.ignoreFragment(n))return;const a=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==ua||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;const a=this.hls.firstLevel,s=Math.min(Math.max(a,t),e);return yr.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${a} clamped to ${s}`),s}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&n&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e;const r=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this,{maxAutoLevel:r,config:i,minAutoLevel:a}=n,s=t?t.duration:e?e.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let u=i.abrBandWidthFactor,c=i.abrBandWidthUpFactor;if(l){const e=this.findBestLevel(o,a,r,l,0,u,c);if(e>=0)return e}let d=s?Math.min(s,i.maxStarvationDelay):i.maxStarvationDelay;if(!l){const e=this.bitrateTestDelay;if(e){d=(s?Math.min(s,i.maxLoadingDelay):i.maxLoadingDelay)-e,yr.info(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),u=c=1}}const h=this.findBestLevel(o,a,r,l,d,u,c);if(yr.info(`[abr] ${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`),h>-1)return h;const f=n.levels[a],p=n.levels[n.loadLevel];return(null==f?void 0:f.bitrate)<(null==p?void 0:p.bitrate)?a:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,a,s){var o;const l=r+i,u=this.lastLoadedFragLevel,c=-1===u?this.hls.firstLevel:u,{fragCurrent:d,partCurrent:h}=this,{levels:f,allAudioTracks:p,loadLevel:g,config:m}=this.hls;if(1===f.length)return 0;const v=f[c],y=!(null==v||null==(o=v.details)||!o.live),b=-1===g||-1===u;let w,_="SDR",E=(null==v?void 0:v.frameRate)||0;const{audioPreference:T,videoPreference:S}=m,C=this.audioTracksByGroup||(this.audioTracksByGroup=function(e){return e.reduce(((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const r=t.channels||"2";return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}(p));if(b){if(-1!==this.firstSelection)return this.firstSelection;const r=this.codecTiers||(this.codecTiers=function(e,t,n,r){return e.slice(n,r+1).reduce(((e,n)=>{if(!n.codecSet)return e;const r=n.audioGroups;let i=e[n.codecSet];i||(e[n.codecSet]=i={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),i.minBitrate=Math.min(i.minBitrate,n.bitrate);const a=Math.min(n.height,n.width);return i.minHeight=Math.min(i.minHeight,a),i.minFramerate=Math.min(i.minFramerate,n.frameRate),i.maxScore=Math.max(i.maxScore,n.score),i.fragmentError+=n.fragmentError,i.videoRanges[n.videoRange]=(i.videoRanges[n.videoRange]||0)+1,r&&r.forEach((e=>{if(!e)return;const n=t.groups[e];n&&(i.hasDefaultAudio=i.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach((e=>{i.channels[e]=(i.channels[e]||0)+n.channels[e]})))})),e}),{})}(f,C,t,n)),i=function(e,t,n,r,i){const a=Object.keys(e),s=null==r?void 0:r.channels,o=null==r?void 0:r.audioCodec,l=s&&2===parseInt(s);let u=!0,c=!1,d=1/0,h=1/0,f=1/0,p=0,g=[];const{preferHDR:m,allowedVideoRanges:v}=os(t,i);for(let w=a.length;w--;){const t=e[a[w]];u=t.channels[2]>0,d=Math.min(d,t.minHeight),h=Math.min(h,t.minFramerate),f=Math.min(f,t.minBitrate);const n=v.filter((e=>t.videoRanges[e]>0));n.length>0&&(c=!0,g=n)}d=lr(d)?d:0,h=lr(h)?h:0;const y=Math.max(1080,d),b=Math.max(30,h);return f=lr(f)?f:n,n=Math.max(f,n),c||(t=void 0,g=[]),{codecSet:a.reduce(((t,r)=>{const i=e[r];if(r===t)return t;if(i.minBitrate>n)return ls(r,`min bitrate of ${i.minBitrate} > current estimate of ${n}`),t;if(!i.hasDefaultAudio)return ls(r,"no renditions with default or auto-select sound found"),t;if(o&&r.indexOf(o.substring(0,4))%5!=0)return ls(r,`audio codec preference "${o}" not found`),t;if(s&&!l){if(!i.channels[s])return ls(r,`no renditions with ${s} channel sound found (channels options: ${Object.keys(i.channels)})`),t}else if((!o||l)&&u&&0===i.channels[2])return ls(r,"no renditions with stereo sound found"),t;return i.minHeight>y?(ls(r,`min resolution of ${i.minHeight} > maximum of ${y}`),t):i.minFramerate>b?(ls(r,`min framerate of ${i.minFramerate} > maximum of ${b}`),t):g.some((e=>i.videoRanges[e]>0))?i.maxScore=Vi(t)||i.fragmentError>e[t].fragmentError)?t:(p=i.maxScore,r):(ls(r,`no variants with VIDEO-RANGE of ${JSON.stringify(g)} found`),t)}),void 0),videoRanges:g,preferHDR:m,minFramerate:h,minBitrate:f}}(r,_,e,T,S),{codecSet:a,videoRanges:s,minFramerate:o,minBitrate:l,preferHDR:u}=i;w=a,_=u?s[s.length-1]:s[0],E=o,e=Math.max(e,l),yr.log(`[abr] picked start tier ${JSON.stringify(i)}`)}else w=null==v?void 0:v.codecSet,_=null==v?void 0:v.videoRange;const x=h?h.duration:d?d.duration:0,A=this.bwEstimator.getEstimateTTFB()/1e3,k=[];for(let L=n;L>=t;L--){var D;const t=f[L],o=L>c;if(!t)continue;if(m.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const n=navigator.mediaCapabilities;"function"==typeof(null==n?void 0:n.decodingInfo)&&as(t,C,_,E,e,T)?(t.supportedPromise=ss(t,C,n),t.supportedPromise.then((e=>{if(!this.hls)return;t.supportedResult=e;const n=this.hls.levels,r=n.indexOf(t);e.error?yr.warn(`[abr] MediaCapabilities decodingInfo error: "${e.error}" for level ${r} ${JSON.stringify(e)}`):e.supported||(yr.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${r} ${JSON.stringify(e)}`),r>-1&&n.length>1&&(yr.log(`[abr] Removing unsupported level ${r}`),this.hls.removeLevel(r)))}))):t.supportedResult=rs}if(w&&t.codecSet!==w||_&&t.videoRange!==_||o&&E>t.frameRate||!o&&E>0&&E=2*x&&0===i?f[L].averageBitrate:f[L].maxBitrate,P=this.getTimeToLoadFrag(A,S,R*p,void 0===d);if(S>=R&&(L===u||0===t.loadError&&0===t.fragmentError)&&(P<=A||!lr(P)||y&&!this.bitrateTestDelay||P${L} adjustedbw(${Math.round(S)})-bitrate=${Math.round(S-R)} ttfb:${A.toFixed(1)} avgDuration:${p.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${P.toFixed(1)} firstSelection:${b} codecSet:${w} videoRange:${_} hls.loadLevel:${g}`)),b&&(this.firstSelection=L),L}}return-1}set nextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls,r=Math.min(Math.max(e,n),t);this._nextAutoLevel!==r&&(this.nextAutoLevelKey="",this._nextAutoLevel=r)}},bufferController:class BufferController{constructor(e){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=e=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;this.log("Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(dr.MEDIA_ATTACHED,{media:e,mediaSource:t})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:e,_objectUrl:t}=this;e!==t&&yr.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e;const t="[buffer-controller]";var n;this.appendSource=(n=Ni(e.config.preferManagedMediaSource),"undefined"!=typeof self&&n===self.ManagedMediaSource),this.log=yr.log.bind(yr,t),this.warn=yr.warn.bind(yr,t),this.error=yr.error.bind(yr,t),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:e}=this;e.on(dr.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.on(dr.BUFFER_RESET,this.onBufferReset,this),e.on(dr.BUFFER_APPENDING,this.onBufferAppending,this),e.on(dr.BUFFER_CODECS,this.onBufferCodecs,this),e.on(dr.BUFFER_EOS,this.onBufferEos,this),e.on(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(dr.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(dr.FRAG_PARSED,this.onFragParsed,this),e.on(dr.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(dr.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.off(dr.BUFFER_RESET,this.onBufferReset,this),e.off(dr.BUFFER_APPENDING,this.onBufferAppending,this),e.off(dr.BUFFER_CODECS,this.onBufferCodecs,this),e.off(dr.BUFFER_EOS,this.onBufferEos,this),e.off(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(dr.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(dr.FRAG_PARSED,this.onFragParsed,this),e.off(dr.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new BufferOperationQueue(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const n=this.media=t.media,r=Ni(this.appendSource);if(n&&r){var i;const e=this.mediaSource=new r;this.log(`created media source: ${null==(i=e.constructor)?void 0:i.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming));const t=this._objectUrl=self.URL.createObjectURL(e);if(this.appendSource)try{n.removeAttribute("src");const r=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||r&&e instanceof r,Bo(n),function(e,t){const n=self.document.createElement("source");n.type="video/mp4",n.src=t,e.appendChild(n)}(n,t),n.load()}catch(a){n.src=t}else n.src=t;n.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:n}=this;if(t){if(this.log("media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(Su){this.warn(`onMediaDetaching: ${Su.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.removeEventListener("startstreaming",this._onStartStreaming),t.removeEventListener("endstreaming",this._onEndStreaming)),e&&(e.removeEventListener("emptied",this._onMediaEmptied),n&&self.URL.revokeObjectURL(n),this.mediaSrc===n?(e.removeAttribute("src"),this.appendSource&&Bo(e),e.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(dr.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach((e=>{this.resetBuffer(e)})),this._initSourceBuffer()}resetBuffer(e){const t=this.sourceBuffer[e];try{var n;if(t)this.removeBufferListeners(e),this.sourceBuffer[e]=void 0,null!=(n=this.mediaSource)&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}catch(Su){this.warn(`onBufferReset ${e}`,Su)}}onBufferCodecs(e,t){const n=this.getSourceBufferTypes().length,r=Object.keys(t);if(r.forEach((e=>{if(n){const n=this.tracks[e];if(n&&"function"==typeof n.buffer.changeType){var r;const{id:i,codec:a,levelCodec:s,container:o,metadata:l}=t[e],u=Wi(n.codec,n.levelCodec),c=null==u?void 0:u.replace(Fo,"$1");let d=Wi(a,s);const h=null==(r=d)?void 0:r.replace(Fo,"$1");if(d&&c!==h){"audio"===e.slice(0,5)&&(d=Gi(d,this.appendSource));const t=`${o};codecs=${d}`;this.appendChangeType(e,t),this.log(`switching codec ${u} to ${d}`),this.tracks[e]={buffer:n.buffer,codec:a,container:o,levelCodec:s,metadata:l,id:i}}}}else this.pendingTracks[e]=t[e]})),n)return;const i=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==i&&(this.log(`${i} bufferCodec event(s) expected ${r.join(",")}`),this.bufferCodecEventsExpected=i),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks()}appendChangeType(e,t){const{operationQueue:n}=this,r={execute:()=>{const r=this.sourceBuffer[e];r&&(this.log(`changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),n.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};n.append(r,e,!!this.pendingTracks[e])}onBufferAppending(e,t){const{hls:n,operationQueue:r,tracks:i}=this,{data:a,type:s,frag:o,part:l,chunkMeta:u}=t,c=u.buffering[s],d=self.performance.now();c.start=d;const h=o.stats.buffering,f=l?l.stats.buffering:null;0===h.start&&(h.start=d),f&&0===f.start&&(f.start=d);const p=i.audio;let g=!1;"audio"===s&&"audio/mpeg"===(null==p?void 0:p.container)&&(g=!this.lastMpegAudioChunk||1===u.id||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);const m=o.start,v={execute:()=>{if(c.executeStart=self.performance.now(),g){const e=this.sourceBuffer[s];if(e){const t=m-e.timestampOffset;Math.abs(t)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${m} (delta: ${t}) sn: ${o.sn})`),e.timestampOffset=m)}}this.appendExecutor(a,s)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();c.executeEnd=c.end=e,0===h.first&&(h.first=e),f&&0===f.first&&(f.first=e);const{sourceBuffer:t}=this,n={};for(const r in t)n[r]=BufferHelper.getBuffered(t[r]);this.appendErrors[s]=0,"audio"===s||"video"===s?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(dr.BUFFER_APPENDED,{type:s,frag:o,part:l,chunkMeta:u,parent:o.type,timeRanges:n})},onError:e=>{const t={type:hr.MEDIA_ERROR,parent:o.type,details:fr.BUFFER_APPEND_ERROR,sourceBufferName:s,frag:o,part:l,chunkMeta:u,error:e,err:e,fatal:!1};if(e.code===DOMException.QUOTA_EXCEEDED_ERR)t.details=fr.BUFFER_FULL_ERROR;else{const e=++this.appendErrors[s];t.details=fr.BUFFER_APPEND_ERROR,this.warn(`Failed ${e}/${n.config.appendErrorMaxRetry} times to append segment in "${s}" sourceBuffer`),e>=n.config.appendErrorMaxRetry&&(t.fatal=!0)}n.trigger(dr.ERROR,t)}};r.append(v,s,!!this.pendingTracks[s])}onBufferFlushing(e,t){const{operationQueue:n}=this,r=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(dr.BUFFER_FLUSHED,{type:e})},onError:t=>{this.warn(`Failed to remove from ${e} SourceBuffer`,t)}});t.type?n.append(r(t.type),t.type):this.getSourceBufferTypes().forEach((e=>{n.append(r(e),e)}))}onFragParsed(e,t){const{frag:n,part:r}=t,i=[],a=r?r.elementaryStreams:n.elementaryStreams;a[Sr]?i.push("audiovideo"):(a[Er]&&i.push("audio"),a[Tr]&&i.push("video"));0===i.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers((()=>{const e=self.performance.now();n.stats.buffering.end=e,r&&(r.stats.buffering.end=e);const t=r?r.stats:n.stats;this.hls.trigger(dr.FRAG_BUFFERED,{frag:n,part:r,stats:t,id:n.type})}),i)}onFragChanged(e,t){this.trimBuffers()}onBufferEos(e,t){this.getSourceBufferTypes().reduce(((e,n)=>{const r=this.sourceBuffer[n];return!r||t.type&&t.type!==n||(r.ending=!0,r.ended||(r.ended=!0,this.log(`${n} sourceBuffer now EOS`))),e&&!(r&&!r.ended)}),!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers((()=>{this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)}));const{mediaSource:e}=this;e&&"open"===e.readyState?(this.log("Calling mediaSource.endOfStream()"),e.endOfStream()):e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)})))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||null===t)return;if(!this.getSourceBufferTypes().length)return;const r=e.config,i=n.currentTime,a=t.levelTargetDuration,s=t.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(lr(s)&&s>0){const e=Math.max(s,a),t=Math.floor(i/a)*a-e;this.flushBackBuffer(i,a,t)}if(lr(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const e=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),t=Math.max(e,a),n=Math.floor(i/a)*a+t;this.flushFrontBuffer(i,a,n)}}flushBackBuffer(e,t,n){const{details:r,sourceBuffer:i}=this;this.getSourceBufferTypes().forEach((a=>{const s=i[a];if(s){const i=BufferHelper.getBuffered(s);if(i.length>0&&n>i.start(0)){if(this.hls.trigger(dr.BACK_BUFFER_REACHED,{bufferEnd:n}),null!=r&&r.live)this.hls.trigger(dr.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(s.ended&&i.end(i.length-1)-e<2*t)return void this.log(`Cannot flush ${a} back buffer while SourceBuffer is in ended state`);this.hls.trigger(dr.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:a})}}}))}flushFrontBuffer(e,t,n){const{sourceBuffer:r}=this;this.getSourceBufferTypes().forEach((i=>{const a=r[i];if(a){const r=BufferHelper.getBuffered(a),s=r.length;if(s<2)return;const o=r.start(s-1),l=r.end(s-1);if(n>o||e>=o&&e<=l)return;if(a.ended&&e-l<2*t)return void this.log(`Cannot flush ${i} front buffer while SourceBuffer is in ended state`);this.hls.trigger(dr.BUFFER_FLUSHING,{startOffset:o,endOffset:1/0,type:i})}}))}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:n,mediaSource:r}=this,i=e.fragments[0].start+e.totalduration,a=n.duration,s=lr(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(r.duration=1/0,this.updateSeekableRange(e)):(i>s&&i>a||!lr(a))&&(this.log(`Updating Media Source duration to ${i.toFixed(3)}`),r.duration=i)}updateSeekableRange(e){const t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&null!=t&&t.setLiveSeekableRange){const r=Math.max(0,n[0].start),i=Math.max(r,r+e.totalduration);this.log(`Media Source duration is set to ${t.duration}. Setting seekable range to ${r}-${i}.`),t.setLiveSeekableRange(r,i)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:n}=this,r=Object.keys(n).length;if(r&&(!e||2===r||"audiovideo"in n)){this.createSourceBuffers(n),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(dr.BUFFER_CREATED,{tracks:this.tracks}),e.forEach((e=>{t.executeNext(e)}));else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:n}=this;if(!n)throw Error("createSourceBuffers called when mediaSource was null");for(const i in e)if(!t[i]){var r;const a=e[i];if(!a)throw Error(`source buffer exists for track ${i}, however track does not`);let s=-1===(null==(r=a.levelCodec)?void 0:r.indexOf(","))?a.levelCodec:a.codec;s&&"audio"===i.slice(0,5)&&(s=Gi(s,this.appendSource));const o=`${a.container};codecs=${s}`;this.log(`creating sourceBuffer(${o})`);try{const e=t[i]=n.addSourceBuffer(o),r=i;this.addBufferListener(r,"updatestart",this._onSBUpdateStart),this.addBufferListener(r,"updateend",this._onSBUpdateEnd),this.addBufferListener(r,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(r,"bufferedchange",((e,t)=>{const n=t.removedRanges;null!=n&&n.length&&this.hls.trigger(dr.BUFFER_FLUSHED,{type:i})})),this.tracks[i]={buffer:e,codec:s,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id}}catch(Su){this.error(`error while trying to add sourceBuffer: ${Su.message}`),this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:Su,sourceBufferName:i,mimeType:o})}}}get mediaSrc(){var e;const t=(null==(e=this.media)?void 0:e.firstChild)||this.media;return null==t?void 0:t.src}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){var t;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const{operationQueue:n}=this;n.current(e).onComplete(),n.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){var n;const r=new Error(`${e} SourceBuffer error. MediaSource readyState: ${null==(n=this.mediaSource)?void 0:n.readyState}`);this.error(`${r}`,t),this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:r,fatal:!1});const i=this.operationQueue.current(e);i&&i.onError(r)}removeExecutor(e,t,n){const{media:r,mediaSource:i,operationQueue:a,sourceBuffer:s}=this,o=s[e];if(!r||!i||!o)return this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void a.shiftAndExecuteNext(e);const l=lr(r.duration)?r.duration:1/0,u=lr(i.duration)?i.duration:1/0,c=Math.max(0,t),d=Math.min(n,l,u);d>c&&(!o.ending||o.ended)?(o.ended=!1,this.log(`Removing [${c},${d}] from the ${e} SourceBuffer`),o.remove(c,d)):a.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.sourceBuffer[t];if(n)n.ended=!1,n.appendBuffer(e);else if(!this.pendingTracks[t])throw new Error(`Attempting to append to the ${t} SourceBuffer, but it does not exist`)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:n}=this,r=t.map((e=>n.appendBlocker(e)));Promise.all(r).then((()=>{e(),t.forEach((e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||n.shiftAndExecuteNext(e)}))}))}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,n){const r=this.sourceBuffer[e];if(!r)return;const i=n.bind(this,e);this.listeners[e].push({event:t,listener:i}),r.addEventListener(t,i)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach((e=>{t.removeEventListener(e.event,e.listener)}))}},capLevelController:CapLevelController,errorController:class ErrorController{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=yr.log.bind(yr,"[info]:"),this.warn=yr.warn.bind(yr,"[warning]:"),this.error=yr.error.bind(yr,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(dr.ERROR,this.onError,this),e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(dr.ERROR,this.onError,this),e.off(dr.ERROR,this.onErrorOut,this),e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(null==e?void 0:e.type)===ua?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n,r;if(t.fatal)return;const i=this.hls,a=t.context;switch(t.details){case fr.FRAG_LOAD_ERROR:case fr.FRAG_LOAD_TIMEOUT:case fr.KEY_LOAD_ERROR:case fr.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case fr.FRAG_PARSING_ERROR:if(null!=(n=t.frag)&&n.gap)return void(t.errorAction={action:Xa,flags:es});case fr.FRAG_GAP:case fr.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Qa);case fr.LEVEL_EMPTY_ERROR:case fr.LEVEL_PARSING_ERROR:{var s,o;const e=t.parent===ua?t.level:i.loadLevel;t.details===fr.LEVEL_EMPTY_ERROR&&null!=(s=t.context)&&null!=(o=s.levelDetails)&&o.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case fr.LEVEL_LOAD_ERROR:case fr.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==a?void 0:a.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,a.level)));case fr.AUDIO_TRACK_LOAD_ERROR:case fr.AUDIO_TRACK_LOAD_TIMEOUT:case fr.SUBTITLE_LOAD_ERROR:case fr.SUBTITLE_TRACK_LOAD_TIMEOUT:if(a){const e=i.levels[i.loadLevel];if(e&&(a.type===oa&&e.hasAudioGroup(a.groupId)||a.type===la&&e.hasSubtitleGroup(a.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Qa,void(t.errorAction.flags=ts)}return;case fr.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=i.levels[i.loadLevel],n=null==e?void 0:e.attrs["HDCP-LEVEL"];n?t.errorAction={action:Qa,flags:ns,hdcpLevel:n}:this.keySystemError(t)}return;case fr.BUFFER_ADD_CODEC_ERROR:case fr.REMUX_ALLOC_ERROR:case fr.BUFFER_APPEND_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(r=t.level)?r:i.loadLevel));case fr.INTERNAL_EXCEPTION:case fr.BUFFER_APPENDING_ERROR:case fr.BUFFER_FULL_ERROR:case fr.LEVEL_SWITCH_ERROR:case fr.BUFFER_STALLED_ERROR:case fr.BUFFER_SEEK_OVER_HOLE:case fr.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:Xa,flags:es})}t.type===hr.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=Va(this.hls.config.playlistLoadPolicy,e),r=this.playlistError++;if(Ga(n,r,$a(e),e.response))return{action:Za,flags:es,retryConfig:n,retryCount:r};const i=this.getLevelSwitchAction(e,t);return n&&(i.retryConfig=n,i.retryCount=r),i}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:a}=t.config,s=Va(e.details.startsWith("key")?a:i,e),o=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(r){e.details!==fr.FRAG_GAP&&r.fragmentError++;if(Ga(s,o,$a(e),e.response))return{action:Za,flags:es,retryConfig:s,retryCount:o}}const l=this.getLevelSwitchAction(e,n);return s&&(l.retryConfig=s,l.retryCount=o),l}getLevelSwitchAction(e,t){const n=this.hls;null==t&&(t=n.loadLevel);const r=this.hls.levels[t];if(r){var i,a;const t=e.details;r.loadError++,t===fr.BUFFER_APPEND_ERROR&&r.fragmentError++;let l=-1;const{levels:u,loadLevel:c,minAutoLevel:d,maxAutoLevel:h}=n;n.autoLevelEnabled||(n.loadLevel=-1);const f=null==(i=e.frag)?void 0:i.type,p=(f===ca&&t===fr.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(t===fr.BUFFER_ADD_CODEC_ERROR||t===fr.BUFFER_APPEND_ERROR))&&u.some((({audioCodec:e})=>r.audioCodec!==e)),g="video"===e.sourceBufferName&&(t===fr.BUFFER_ADD_CODEC_ERROR||t===fr.BUFFER_APPEND_ERROR)&&u.some((({codecSet:e,audioCodec:t})=>r.codecSet!==e&&r.audioCodec===t)),{type:m,groupId:v}=null!=(a=e.context)?a:{};for(let n=u.length;n--;){const i=(n+c)%u.length;if(i!==c&&i>=d&&i<=h&&0===u[i].loadError){var s,o;const n=u[i];if(t===fr.FRAG_GAP&&f===ua&&e.frag){const t=u[i].details;if(t){const n=qa(e.frag,t.fragments,e.frag.start);if(null!=n&&n.gap)continue}}else{if(m===oa&&n.hasAudioGroup(v)||m===la&&n.hasSubtitleGroup(v))continue;if(f===ca&&null!=(s=r.audioGroups)&&s.some((e=>n.hasAudioGroup(e)))||f===da&&null!=(o=r.subtitleGroups)&&o.some((e=>n.hasSubtitleGroup(e)))||p&&r.audioCodec===n.audioCodec||!p&&r.audioCodec!==n.audioCodec||g&&r.codecSet===n.codecSet)continue}l=i;break}}if(l>-1&&n.loadLevel!==l)return e.levelRetry=!0,this.playlistError=0,{action:Qa,flags:es,nextAutoLevel:l}}return{action:Qa,flags:ts}}onErrorOut(e,t){var n;switch(null==(n=t.errorAction)?void 0:n.action){case Xa:break;case Qa:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===fr.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:r,hdcpLevel:i,nextAutoLevel:a}=n;switch(r){case es:this.switchLevel(e,a);break;case ns:i&&(t.maxHdcpLevel=xa[xa.indexOf(i)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)}n.resolved||this.switchLevel(e,a)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}},fpsController:class FPSController{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(dr.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(dr.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,n){const r=performance.now();if(t){if(this.lastTime){const e=r-this.lastTime,i=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,s=1e3*i/e,o=this.hls;if(o.trigger(dr.FPS_DROP,{currentDropped:i,currentDecoded:a,totalDroppedFrames:n}),s>0&&i>o.config.fpsDroppedMonitoringThreshold*a){let e=o.currentLevel;yr.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(dr.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Br,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:du,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class SubtitleStreamController extends BaseStreamController{constructor(e,t,n){super(e,t,n,"[subtitle-stream-controller]",da),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.LEVEL_LOADED,this.onLevelLoaded,this),e.on(dr.ERROR,this.onError,this),e.on(dr.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(dr.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(dr.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(dr.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(dr.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.LEVEL_LOADED,this.onLevelLoaded,this),e.off(dr.ERROR,this.onError,this),e.off(dr.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(dr.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(dr.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(dr.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(dr.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Ls,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:r}=t;if(this.fragPrevious=n,this.state=Ls,!r)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let a;const s=n.start;for(let l=0;l=i[l].start&&s<=i[l].end){a=i[l];break}const o=n.start+n.duration;a?a.end=o:(a={start:s,end:o},i.push(a)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null)}onBufferFlushing(e,t){const{startOffset:n,endOffset:r}=t;if(0===n&&r!==Number.POSITIVE_INFINITY){const e=r-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach((t=>{for(let n=0;nnew Level(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Level(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,da),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,null==(n=this.levels)||!n.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:r,levels:i}=this,{details:a,id:s}=t;if(!i)return void this.warn(`Subtitle tracks were reset while loading level ${s}`);const o=i[s];if(s>=i.length||!o)return;this.log(`Subtitle track ${s} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(a.live||null!=(n=o.details)&&n.live){const e=this.mainDetails;if(a.deltaUpdateFailed||!e)return;const t=e.fragments[0];var u;if(o.details)l=this.alignPlaylists(a,o.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===l&&t&&(l=t.start,Fa(a,l));else a.hasProgramDateTime&&e.hasProgramDateTime?(Ss(a,e),l=a.fragments[0].start):t&&(l=t.start,Fa(a,l))}if(o.details=a,this.levelLastLoaded=o,s===r&&(this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(this.mainDetails||a,l),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===Ls)){qa(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&null!=r&&r.key&&r.iv&&"AES-128"===r.method){const e=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer).catch((e=>{throw i.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((n=>{const r=performance.now();i.trigger(dr.FRAG_DECRYPTED,{frag:t,payload:n,stats:{tstart:e,tdecrypt:r}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=Ls}))}}doTick(){if(this.media){if(this.state===Ls){const{currentTrackId:e,levels:t}=this,n=null==t?void 0:t[e];if(!n||!t.length||!n.details)return;const{config:r}=this,i=this.getLoadPosition(),a=BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),{end:s,len:o}=a,l=this.getFwdBufferInfo(this.media,ua),u=n.details;if(o>this.getMaxBufferLength(null==l?void 0:l.len)+u.levelTargetDuration)return;const c=u.fragments,d=c.length,h=u.edge;let f=null;const p=this.fragPrevious;if(sh-e?0:e;f=qa(p,c,Math.max(c[0].start,s),t),!f&&p&&p.startthis.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const t=ya(this.media.textTracks);for(let r=0;r-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.on(dr.LEVEL_LOADING,this.onLevelLoading,this),e.on(dr.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(dr.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(dr.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.off(dr.LEVEL_LOADING,this.onLevelLoading,this),e.off(dr.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(dr.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(dr.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);ya(this.media.textTracks).forEach((e=>{ma(e)})),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==r)return void this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${null==a?void 0:a.groupId}`);const s=a.details;a.details=t.details,this.log(`Subtitle track ${n} "${a.name}" lang:${a.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,s)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==r?void 0:r.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.subtitlePreference;if(!i&&t){this.selectDefaultTrack=!1;const n=us(t,e);if(n>-1)i=e[n];else{const e=us(t,this.tracks);i=this.tracks[e]}}let r=this.findTrackId(i);-1===r&&i&&(r=this.findTrackId(null));const a={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${null==n?void 0:n.join(",")}" group-id`),this.hls.trigger(dr.SUBTITLE_TRACKS_UPDATED,a),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}else this.shouldReloadPlaylist(i)&&this.setSubtitleTrack(this.trackId)}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r-1){const e=this.tracksInGroup[r];return this.setSubtitleTrack(r),e}if(n)return null;{const n=us(e,t);if(n>-1)return t[n]}}}return null}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;if(this.shouldLoadPlaylist(t)&&t){const r=t.id,i=t.groupId;let a=t.url;if(e)try{a=e.addDirectives(a)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}this.log(`Loading subtitle playlist for id ${r}`),this.hls.trigger(dr.SUBTITLE_TRACK_LOADING,{url:a,id:r,groupId:i,deliveryDirectives:e||null})}}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ya(e.textTracks),n=this.currentTrack;let r;if(n&&(r=t.filter((e=>No(n,e)))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach((e=>{"disabled"!==e.mode&&e!==r&&(e.mode="disabled")})),r){const e=this.subtitleDisplay?"showing":"hidden";r.mode!==e&&(r.mode=e)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(e<-1||e>=t.length||!lr(e))return void this.warn(`Invalid subtitle track id: ${e}`);this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r)return void this.hls.trigger(dr.SUBTITLE_TRACK_SWITCH,{id:e});const i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:a,groupId:s="",name:o,type:l,url:u}=r;this.hls.trigger(dr.SUBTITLE_TRACK_SWITCH,{id:a,groupId:s,name:o,type:l,url:u});const c=this.switchParams(r.url,null==n?void 0:n.details,r.details);this.loadPlaylist(c)}},timelineController:class TimelineController{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(dr.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(dr.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(dr.FRAG_LOADING,this.onFragLoading,this),e.on(dr.FRAG_LOADED,this.onFragLoaded,this),e.on(dr.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(dr.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(dr.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(dr.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(dr.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(dr.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(dr.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(dr.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(dr.FRAG_LOADING,this.onFragLoading,this),e.off(dr.FRAG_LOADED,this.onFragLoaded,this),e.off(dr.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(dr.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(dr.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(dr.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(dr.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const e=new OutputFilter(this,"textTrack1"),t=new OutputFilter(this,"textTrack2"),n=new OutputFilter(this,"textTrack3"),r=new OutputFilter(this,"textTrack4");this.cea608Parser1=new Cea608Parser(1,e,t),this.cea608Parser2=new Cea608Parser(3,n,r)}}addCues(e,t,n,r,i){let a=!1;for(let c=i.length;c--;){const e=i[c],r=(s=e[0],o=e[1],l=t,u=n,Math.min(o,u)-Math.max(s,l));if(r>=0&&(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],n),a=!0,r/(n-t)>.5))return}var s,o,l,u;if(a||i.push([t,n]),this.config.renderTextTracksNatively){const i=this.captionsTracks[e];this.Cues.newCue(i,t,n,r)}else{const i=this.Cues.newCue(null,t,n,r);this.hls.trigger(dr.CUES_PARSED,{type:"captions",cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i}){const{unparsedVttFrags:a}=this;"main"===n&&(this.initPTS[t.cc]={baseTime:r,timescale:i}),a.length&&(this.unparsedVttFrags=[],a.forEach((e=>{this.onFragLoaded(dr.FRAG_LOADED,e)})))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let r=0;r{ma(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;ne.textCodec===ul));if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(Oo(this.tracks,n))return void(this.tracks=n);if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const e=this.media,t=e?ya(e.textTracks):null;if(this.tracks.forEach(((e,n)=>{let r;if(t){let n=null;for(let r=0;rnull!==e)).map((e=>e.label));e.length&&yr.warn(`Media element contains unused subtitle tracks: ${e.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(dr.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const n=`textTrack${t[1]}`,r=this.captionsProperties[n];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===ua){var n,r;const{cea608Parser1:e,cea608Parser2:i,lastSn:a}=this,{cc:s,sn:o}=t.frag,l=null!=(n=null==(r=t.part)?void 0:r.index)?n:-1;e&&i&&(o!==a+1||o===a&&l!==this.lastPartIndex+1||s!==this.lastCc)&&(e.reset(),i.reset()),this.lastCc=s,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:n,payload:r}=t;if(n.type===da)if(r.byteLength){const e=n.decryptdata,i="stats"in t;if(null==e||!e.encrypted||i){const e=this.tracks[n.level],i=this.vttCCs;i[n.cc]||(i[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===ul?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(dr.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;fl(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),n.trigger(dr.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{yr.log(`Failed to parse IMSC1: ${t}`),n.trigger(dr.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e){var t;const{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:a}=this,s=i.length-1;if(!i[n.cc]&&-1===s)return void a.push(e);const o=this.hls;ll(null!=(t=n.initSegment)&&t.data?Ti(n.initSegment.data,new Uint8Array(r)):r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,(e=>{this._appendCues(e,n.level),o.trigger(dr.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})}),(t=>{const i="Missing initPTS for VTT MPEGTS"===t.message;i?a.push(e):this._fallbackToIMSC1(n,r),yr.log(`Failed to parse VTT cue: ${t}`),i&&s>n.cc||o.trigger(dr.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})}))}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||fl(t,this.initPTS[e.cc],(()=>{n.textCodec=ul,this._parseIMSC1(e,t)}),(()=>{n.textCodec="wvtt"}))}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach((e=>ga(n,e)))}else{const r=this.tracks[t];if(!r)return;const i=r.default?"default":"subtitles"+t;n.trigger(dr.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===da&&this.onFragLoaded(dr.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){this.initCea608Parsers();const{cea608Parser1:n,cea608Parser2:r}=this;if(!this.enabled||!n||!r)return;const{frag:i,samples:a}=t;if(i.type!==ua||"NONE"!==this.closedCaptionsForLevel(i))for(let s=0;sva(e[r],t,n)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==r){const{textTracks:e}=this;Object.keys(e).forEach((n=>va(e[n],t,r)))}}}extractCea608Data(e){const t=[[],[]],n=31&e[0];let r=2;for(let i=0;i0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=Ls):(this.loadedmetadata=!1,this.state=Os),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Ls:this.doTickIdle();break;case Os:{var e;const{levels:t,trackId:n}=this,r=null==t||null==(e=t[n])?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=js}break}case Is:{var t;const e=performance.now(),n=this.retryDate;if(!n||e>=n||null!=(t=this.media)&&t.seeking){const{levels:e,trackId:t}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((null==e?void 0:e[t])||null),this.state=Ls}break}case js:{const e=this.waitingData;if(e){const{frag:t,part:n,cache:r,complete:i}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Ps;const e={frag:t,part:n,payload:r.flush(),networkDetails:null};this._handleFragmentLoadProgress(e),i&&super._handleFragmentLoadComplete(e)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),n=BufferHelper.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole);Ya(n.end,this.config.maxFragLookUpTolerance,t)<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${n.end} is needed`),this.clearWaitingFragment())}}else this.state=Ls}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Ls)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:n,trackId:r}=this,i=e.config;if(!n&&(this.startFragRequested||!i.startFragPrefetch)||null==t||!t[r])return;const a=t[r],s=a.details;if(!s||s.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(s))return void(this.state=Os);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,Er,ca));const l=this.getFwdBufferInfo(o,ca);if(null===l)return;const{bufferedTrack:u,switchingTrack:c}=this;if(!c&&this._streamEnded(l,s))return e.trigger(dr.BUFFER_EOS,{type:"audio"}),void(this.state=Fs);const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,ua),h=l.len,f=this.getMaxBufferLength(null==d?void 0:d.len),p=s.fragments,g=p[0].start;let m=this.flushing?this.getLoadPosition():l.end;if(c&&n){const e=this.getLoadPosition();u&&!Mo(c.attrs,u.attrs)&&(m=e),s.PTSKnown&&eg||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=g+.05)}if(h>=f&&!c&&md.end+s.targetduration;if(b||(null==d||!d.len)&&l.len){const e=this.getAppendedFrag(v.start,ua);if(null===e)return;if(y||(y=!!e.gap||!!b&&0===d.len),b&&!y||y&&l.nextStart&&l.nextStartnew Level(e)))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?this.setInterval(100):this.resetTransmuxer(),n?(this.switchingTrack=t,this.state=Ls,this.flushAudioIfNeeded(t)):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Ds),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(dr.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var n;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:r}=this,{details:i,id:a}=t;if(!r)return void this.warn(`Audio tracks were reset while loading level ${a}`);this.log(`Audio track ${a} loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const s=r[a];let o=0;if(i.live||null!=(n=s.details)&&n.live){this.checkLiveUpdate(i);const e=this.mainDetails;if(i.deltaUpdateFailed||!e)return;var l;if(!s.details&&i.hasProgramDateTime&&e.hasProgramDateTime)Ss(i,e),o=i.fragments[0].start;else o=this.alignPlaylists(i,s.details,null==(l=this.levelLastLoaded)?void 0:l.details)}s.details=i,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(this.mainDetails||i,o),this.state!==Os||this.waitForCdnTuneIn(i)||(this.state=Ls),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:r,payload:i}=e,{config:a,trackId:s,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const l=o[s];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const u=l.details;if(!u)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(n.start);const c=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new TransmuxerInterface(this.hls,ca,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],f=null==(t=n.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=r?r.index:-1,a=-1!==t,s=new ChunkMetadata(n.level,n.sn,n.stats.chunkCount,i.byteLength,t,a);d.push(i,f,c,"",n,r,u.totalduration,e,s,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${u.startSN} ,${u.endSN}],track ${s}`);const{cache:e}=this.waitingData=this.waitingData||{frag:n,part:r,cache:new ChunkCache,complete:!1};e.push(new Uint8Array(i)),this.waitingVideoCC=this.videoTrackCC,this.state=js}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n.type===ca)if(this.fragContextChanged(n))this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==n.sn){this.fragPrevious=n;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(dr.AUDIO_TRACK_SWITCHED,ir({},e)))}this.fragBufferedComplete(n,r)}else if(!this.loadedmetadata&&n.type===ua){const e=this.videoBuffer||this.media;if(e){BufferHelper.getBuffered(e).length&&(this.loadedmetadata=!0)}}}onError(e,t){var n;if(t.fatal)this.state=Bs;else switch(t.details){case fr.FRAG_GAP:case fr.FRAG_PARSING_ERROR:case fr.FRAG_DECRYPT_ERROR:case fr.FRAG_LOAD_ERROR:case fr.FRAG_LOAD_TIMEOUT:case fr.KEY_LOAD_ERROR:case fr.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ca,t);break;case fr.AUDIO_TRACK_LOAD_ERROR:case fr.AUDIO_TRACK_LOAD_TIMEOUT:case fr.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Os||(null==(n=t.context)?void 0:n.type)!==oa||(this.state=Ls);break;case fr.BUFFER_APPEND_ERROR:case fr.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;if(t.details===fr.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case fr.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushing(e,{type:t}){t!==Tr&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==Tr){this.flushing=!1,this.bufferFlushed=!0,this.state===Fs&&(this.state=Ls);const e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,ca),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:r}=this,{remuxResult:i,chunkMeta:a}=e,s=this.getCurrentContext(a);if(!s)return void this.resetWhenMissingContext(a);const{frag:o,part:l,level:u}=s,{details:c}=u,{audio:d,text:h,id3:f,initSegment:p}=i;if(!this.fragContextChanged(o)&&c){if(this.state=Ms,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=p&&p.tracks){const e=o.initSegment||o;this._bufferInitSegment(u,p.tracks,e,a),r.trigger(dr.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:p.tracks})}if(d){const{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=d;l&&(l.elementaryStreams[Er]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(Er,e,t,n,r),this.bufferFragmentData(d,o,l,a)}if(null!=f&&null!=(t=f.samples)&&t.length){const e=or({id:n,frag:o,details:c},f);r.trigger(dr.FRAG_PARSING_METADATA,e)}if(h){const e=or({id:n,frag:o,details:c},h);r.trigger(dr.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,n,r){if(this.state!==Ms)return;t.video&&delete t.video;const i=t.audio;if(!i)return;i.id="audio";const a=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${a}/${i.codec}]`),a&&1===a.split(",").length&&(i.levelCodec=a),this.hls.trigger(dr.BUFFER_CODECS,t);const s=i.initSegment;if(null!=s&&s.byteLength){const e={type:"audio",frag:n,part:null,chunkMeta:r,parent:n.type,data:s};this.hls.trigger(dr.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);var i;if(this.fragCurrent=e,this.switchingTrack||r===fs||r===gs)if("initSegment"===e.sn)this._loadInitSegment(e,t);else if(null!=(i=t.details)&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=js;const n=this.mainDetails;n&&n.fragments[0].start!==t.details.fragments[0].start&&Ss(t.details,n)}else this.startFragRequested=!0,super.loadFragment(e,t,n);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){const{media:t,bufferedTrack:n}=this,r=null==n?void 0:n.attrs,i=e.attrs;t&&r&&(r.CHANNELS!==i.CHANNELS||n.name!==e.name||n.lang!==e.lang)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(dr.AUDIO_TRACK_SWITCHED,ir({},e))}},audioTrackController:class AudioTrackController extends BasePlaylistController{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.on(dr.LEVEL_LOADING,this.onLevelLoading,this),e.on(dr.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(dr.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(dr.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.off(dr.LEVEL_LOADING,this.onLevelLoading,this),e.off(dr.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(dr.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(dr.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:r,details:i}=t,a=this.tracksInGroup[n];if(!a||a.groupId!==r)return void this.warn(`Audio track with id:${n} and group:${r} not found in active group ${null==a?void 0:a.groupId}`);const s=a.details;a.details=t.details,this.log(`Audio track ${n} "${a.name}" lang:${a.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,s)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,r=this.groupIds;let i=this.currentTrack;if(!n||(null==r?void 0:r.length)!==(null==n?void 0:n.length)||null!=n&&n.some((e=>-1===(null==r?void 0:r.indexOf(e))))){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter((e=>!n||-1!==n.indexOf(e.groupId)));if(e.length)this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),e.forEach(((e,t)=>{e.id=t}));else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.audioPreference;if(!i&&t){const n=us(t,e,ds);if(n>-1)i=e[n];else{const e=us(t,this.tracks);i=this.tracks[e]}}let r=this.findTrackId(i);-1===r&&i&&(r=this.findTrackId(null));const s={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${null==n?void 0:n.join(",")}`),this.hls.trigger(dr.AUDIO_TRACKS_UPDATED,s);const o=this.trackId;if(-1!==r&&-1===o)this.setAudioTrack(r);else if(e.length&&-1===o){var a;const t=new Error(`No audio track selected for current audio group-ID(s): ${null==(a=this.groupIds)?void 0:a.join(",")} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}else this.shouldReloadPlaylist(i)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&(t.context.type!==oa||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||(this.requestScheduled=-1,this.checkRetry(t)))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const r=this.currentTrack;if(r&&cs(e,r,ds))return r;const i=us(e,this.tracksInGroup,ds);if(i>-1){const e=this.tracksInGroup[i];return this.setAudioTrack(i),e}if(r){let r=t.loadLevel;-1===r&&(r=t.firstAutoLevel);const i=function(e,t,n,r,i){const a=t[r],s=t.reduce(((e,t,n)=>{const r=t.uri;return(e[r]||(e[r]=[])).push(n),e}),{})[a.uri];s.length>1&&(r=Math.max.apply(Math,s));const o=a.videoRange,l=a.frameRate,u=a.codecSet.substring(0,4),c=hs(t,r,(t=>{if(t.videoRange!==o||t.frameRate!==l||t.codecSet.substring(0,4)!==u)return!1;const r=t.audioGroups,a=n.filter((e=>!r||-1!==r.indexOf(e.groupId)));return us(e,a,i)>-1}));return c>-1?c:hs(t,r,(t=>{const r=t.audioGroups,a=n.filter((e=>!r||-1!==r.indexOf(e.groupId)));return us(e,a,i)>-1}))}(e,t.levels,n,r,ds);if(-1===i)return null;t.nextLoadLevel=i}if(e.channels||e.audioCodec){const t=us(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn(`Invalid audio track id: ${e}`);this.clearTimer(),this.selectDefaultTrack=!1;const n=this.currentTrack,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;if(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(dr.AUDIO_TRACK_SWITCHING,ir({},r)),i)return;const a=this.switchParams(r.url,null==n?void 0:n.details,r.details);this.loadPlaylist(a)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:Tl.MANIFEST,su:!this.initialized})}catch(t){yr.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=e=>{try{const t=e.frag,n=this.hls.levels[t.level],r=this.getObjectType(t),i={d:1e3*t.duration,ot:r};r!==Tl.VIDEO&&r!==Tl.AUDIO&&r!=Tl.MUXED||(i.br=n.bitrate/1e3,i.tb=this.getTopBandwidth(r)/1e3,i.bl=this.getBufferLength(r)),this.apply(e,i)}catch(t){yr.warn("Could not generate segment CMCD data.",t)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;null!=n&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||function(){try{return crypto.randomUUID()}catch(e){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}}}(),this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(dr.MEDIA_DETACHED,this.onMediaDetached,this),e.on(dr.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(dr.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(dr.MEDIA_DETACHED,this.onMediaDetached,this),e.off(dr.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,r;this.audioBuffer=null==(n=t.tracks.audio)?void 0:n.buffer,this.videoBuffer=null==(r=t.tracks.video)?void 0:r.buffer}createData(){var e;return{v:1,sf:Sl.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){or(t,this.createData());const n=t.ot===Tl.INIT||t.ot===Tl.VIDEO||t.ot===Tl.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const{includeKeys:r}=this;r&&(t=Object.keys(t).reduce(((e,n)=>(r.includes(n)&&(e[n]=t[n]),e)),{})),this.useHeaders?(e.headers||(e.headers={}),tu(e.headers,t)):e.url=iu(e.url,t)}getObjectType(e){const{type:t}=e;return"subtitle"===t?Tl.TIMED_TEXT:"initSegment"===e.sn?Tl.INIT:"audio"===t?Tl.AUDIO:"main"===t?this.hls.audioTracks.length?Tl.VIDEO:Tl.MUXED:void 0}getTopBandwidth(e){let t,n=0;const r=this.hls;if(e===Tl.AUDIO)t=r.audioTracks;else{const e=r.maxAutoLevel,n=e>-1?e+1:r.levels.length;t=r.levels.slice(0,n)}for(const i of t)i.bitrate>n&&(n=i.bitrate);return n>0?n:NaN}getBufferLength(e){const t=this.hls.media,n=e===Tl.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!t)return NaN;return 1e3*BufferHelper.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class CmcdPlaylistLoader{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class CmcdFragmentLoader{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}},contentSteeringController:class ContentSteeringController{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=yr.log.bind(yr,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.on(dr.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(dr.MANIFEST_PARSED,this.onManifestParsed,this),e.off(dr.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;null!==n&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((null==n?void 0:n.action)===Qa&&n.flags===ts){const e=this.levels;let r=this.pathwayPriority,i=this.pathwayId;if(t.context){const{groupId:n,pathwayId:r,type:a}=t.context;n&&e?i=this.getPathwayForGroupId(n,a,i):r&&(i=r)}i in this.penalizedPathways||(this.penalizedPathways[i]=performance.now()),!r&&e&&(r=e.reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==i),n.resolved||yr.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${i} levels: ${e?e.length:e} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this.pathwayPriority=e;const n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach((e=>{r-n[e]>3e5&&delete n[e]}));for(let i=0;i0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,Ua(t),this.hls.trigger(dr.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[a];s&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==s.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==s.bitrate&&this.log(`Unstable Pathways change from bitrate ${s.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let i=0;i{const{ID:i,"BASE-ID":a,"URI-REPLACEMENT":s}=e;if(t.some((e=>e.pathwayId===i)))return;const o=this.getLevelsForPathway(a).map((e=>{const t=new AttrList(e.attrs);t["PATHWAY-ID"]=i;const a=t.AUDIO&&`${t.AUDIO}_clone_${i}`,o=t.SUBTITLES&&`${t.SUBTITLES}_clone_${i}`;a&&(n[t.AUDIO]=a,t.AUDIO=a),o&&(r[t.SUBTITLES]=o,t.SUBTITLES=o);const l=su(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",s),u=new Level({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:l,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let n=1;n{this.log(`Loaded steering manifest: "${r}"`);const a=e.data;if(1!==a.VERSION)return void this.log(`Steering VERSION ${a.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=a.TTL;const{"RELOAD-URI":s,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=a;if(s)try{this.uri=new self.URL(s,r).href}catch(u){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${s}`)}this.scheduleRefresh(this.uri||n.url),o&&this.clonePathways(o);const c={steeringManifest:a,url:r.toString()};this.hls.trigger(dr.STEERING_MANIFEST_LOADED,c),l&&this.updatePathwayPriority(l)},onError:(e,t,n,r)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let i=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,i);else{const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(i=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var t;const n=null==(t=this.hls)?void 0:t.media;!n||n.ended?this.scheduleRefresh(e,1e3*this.timeToLoad):this.loadSteeringManifest(e)}),t)}}});function fu(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(fu):Object.keys(e).reduce(((t,n)=>(t[n]=fu(e[n]),t)),{}):e}function pu(e){const t=e.loader;if(t!==FetchLoader&&t!==XhrLoader)yr.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1})()&&(e.loader=FetchLoader,e.progressive=!0,e.enableSoftwareAES=!0,yr.log("[config]: Progressive streaming enabled, using FetchLoader"))}}let gu;class LevelController extends BasePlaylistController{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.on(dr.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(dr.LEVEL_LOADED,this.onLevelLoaded,this),e.on(dr.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(dr.FRAG_BUFFERED,this.onFragBuffered,this),e.on(dr.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(dr.MANIFEST_LOADING,this.onManifestLoading,this),e.off(dr.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(dr.LEVEL_LOADED,this.onLevelLoaded,this),e.off(dr.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(dr.FRAG_BUFFERED,this.onFragBuffered,this),e.off(dr.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,r=[],i={},a={};let s=!1,o=!1,l=!1;t.levels.forEach((e=>{var t,u;const c=e.attrs;let{audioCodec:d,videoCodec:h}=e;-1!==(null==(t=d)?void 0:t.indexOf("mp4a.40.34"))&&(gu||(gu=/chrome|firefox/i.test(navigator.userAgent)),gu&&(e.audioCodec=d=void 0)),d&&(e.audioCodec=d=Gi(d,n)),0===(null==(u=h)?void 0:u.indexOf("avc1"))&&(h=e.videoCodec=function(e){const t=e.split(".");if(t.length>2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}(h));const{width:f,height:p,unknownCodecs:g}=e;if(s||(s=!(!f||!p)),o||(o=!!h),l||(l=!!d),null!=g&&g.length||d&&!Bi(d,"audio",n)||h&&!Bi(h,"video",n))return;const{CODECS:m,"FRAME-RATE":v,"HDCP-LEVEL":y,"PATHWAY-ID":b,RESOLUTION:w,"VIDEO-RANGE":_}=c,E=`${`${b||"."}-`}${e.bitrate}-${w}-${v}-${m}-${_}-${y}`;if(i[E])if(i[E].uri===e.url||e.attrs["PATHWAY-ID"])i[E].addGroupId("audio",c.AUDIO),i[E].addGroupId("text",c.SUBTITLES);else{const t=a[E]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const n=new Level(e);i[E]=n,r.push(n)}else{const t=new Level(e);i[E]=t,a[E]=1,r.push(t)}})),this.filterAndSortMediaOptions(r,t,s,o,l)}filterAndSortMediaOptions(e,t,n,r,i){let a=[],s=[],o=e;if((n||r)&&i&&(o=o.filter((({videoCodec:e,videoRange:t,width:n,height:r})=>{return(!!e||!(!n||!r))&&(!!(i=t)&&Aa.indexOf(i)>-1);var i}))),0===o.length)return void Promise.resolve().then((()=>{if(this.hls){t.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(t.levels[0].attrs)}`);const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}));if(t.audioTracks){const{preferManagedMediaSource:e}=this.hls.config;a=t.audioTracks.filter((t=>!t.audioCodec||Bi(t.audioCodec,"audio",e))),mu(a)}t.subtitles&&(s=t.subtitles,mu(s));const l=o.slice(0);o.sort(((e,t)=>{if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return Aa.indexOf(e.videoRange)-Aa.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const n=$i(e.videoCodec),r=$i(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const n=Vi(e.codecSet),r=Vi(t.codecSet);if(n!==r)return r-n}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0}));let u=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let f=0;ft&&t===hu.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=n)}break}const d=i&&!r,h={levels:o,audioTracks:a,subtitleTracks:s,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:!d&&a.some((e=>!!e.url))};this.hls.trigger(dr.MANIFEST_PARSED,h),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const n=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(dr.ERROR,{type:hr.OTHER_ERROR,details:fr.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs["PATHWAY-ID"]:void 0,a=t[e],s=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=a,n===e&&a.details&&r&&i===s)return;this.log(`Switching to level ${e} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${s?" with Pathway "+s:""} from level ${n}${i?" with Pathway "+i:""}`);const o={level:e,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(dr.LEVEL_SWITCHING,o);const l=a.details;if(!l||l.live){const e=this.switchParams(a.uri,null==r?void 0:r.details,l);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===sa&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(void 0!==t&&t.type===ua){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return;const n=this._levels[t.level];null!=n&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;const{level:r,details:i}=t,a=this._levels[r];var s;if(!a)return this.warn(`Invalid level index ${r}`),void(null!=(s=t.deliveryDirectives)&&s.skip&&(i.deltaUpdateFailed=!0));r===this.currentLevelIndex?(0===a.fragmentError&&(a.loadError=0),this.playlistLoaded(r,t,a.details)):null!=(n=t.deliveryDirectives)&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,n=this.currentLevel;if(n&&this.shouldLoadPlaylist(n)){let i=n.uri;if(e)try{i=e.addDirectives(i)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}const a=n.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""} with${a?" Pathway "+a:""} ${i}`),this.clearTimer(),this.hls.trigger(dr.LEVEL_LOADING,{url:i,level:t,pathwayId:n.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;const n=this._levels.filter(((t,n)=>n!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach((e=>e.level=-1))),!1)));Ua(n),this._levels=n,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(dr.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(dr.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function mu(e){const t={};e.forEach((e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}class KeyLoader{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[n].loader;if(r){var t;if(e&&e!==(null==(t=r.context)?void 0:t.frag.type))return;r.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=fr.KEY_LOAD_ERROR,n,r,i){return new LoadError({type:hr.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:n,cc:r}=e;for(let e=0;e{i.setKeyFormat(e)}));break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const n=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,fr.KEY_LOAD_ERROR,n))}const a=i.uri;if(!a)return Promise.reject(this.createKeyLoadError(e,fr.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let s=this.keyUriToKeyInfo[a];if(null!=(n=s)&&n.decryptdata.key)return i.key=s.decryptdata.key,Promise.resolve({frag:e,keyInfo:s});var o;if(null!=(r=s)&&r.keyLoadPromise)switch(null==(o=s.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return s.keyLoadPromise.then((t=>(i.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:s})))}switch(s=this.keyUriToKeyInfo[a]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===i.keyFormat?this.loadKeyHTTP(s,e):this.loadKeyEME(s,e);case"AES-128":return this.loadKeyHTTP(s,e);default:return Promise.reject(this.createKeyLoadError(e,fr.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(n);if(t)return(e.keyLoadPromise=t.then((t=>(e.mediaKeySessionContext=t,n)))).catch((t=>{throw e.keyLoadPromise=null,t}))}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,r=new(0,n.loader)(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise(((i,a)=>{const s={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},o=n.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,n,r)=>{const{frag:s,keyInfo:o,url:l}=n;if(!s.decryptdata||o!==this.keyUriToKeyInfo[l])return a(this.createKeyLoadError(s,fr.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));o.decryptdata.key=s.decryptdata.key=new Uint8Array(e.data),s.keyLoader=null,o.loader=null,i({frag:s,keyInfo:o})},onError:(e,n,r,i)=>{this.resetLoader(n),a(this.createKeyLoadError(t,fr.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),r,ir({url:s.url,data:void 0},e)))},onTimeout:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,fr.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(e,n,r)=>{this.resetLoader(n),a(this.createKeyLoadError(t,fr.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(s,l,u)}))}resetLoader(e){const{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[r],i&&i.destroy()}}function vu(){return self.SourceBuffer||self.WebKitSourceBuffer}function yu(){if(!Ni())return!1;const e=vu();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove}class GapController{constructor(e,t,n,r){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=n,this.hls=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:n,media:r,stalled:i}=this;if(null===r)return;const{currentTime:a,seeking:s}=r,o=this.seeking&&!s,l=!this.seeking&&s;if(this.seeking=s,a!==e){if(this.moved=!0,s||(this.nudgeRetry=0),null!==i){if(this.stallReported){const e=self.performance.now()-i;yr.warn(`playback not stuck anymore @${a}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null}return}if(l||o)return void(this.stalled=null);if(r.paused&&!s||r.ended||0===r.playbackRate||!BufferHelper.getBuffered(r).length)return void(this.nudgeRetry=0);const u=BufferHelper.bufferInfo(r,a,0),c=u.nextStart||0;if(s){const e=u.len>2,n=!c||t&&t.start<=a||c-a>2&&!this.fragmentTracker.getPartialFragment(a);if(e||n)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var d;if(!(u.len>0)&&!c)return;const e=Math.max(c,u.start||0)-a,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,n=(null==t||null==(d=t.details)?void 0:d.live)?2*t.details.targetduration:2,i=this.fragmentTracker.getPartialFragment(a);if(e>0&&(e<=n||i))return void(r.paused||this._trySkipBufferHole(i))}const h=self.performance.now();if(null===i)return void(this.stalled=h);const f=h-i;if(!s&&f>=250&&(this._reportStall(u),!this.media))return;const p=BufferHelper.bufferInfo(r,a,n.maxBufferHole);this._tryFixBufferStall(p,f)}_tryFixBufferStall(e,t){const{config:n,fragmentTracker:r,media:i}=this;if(null===i)return;const a=i.currentTime,s=r.getPartialFragment(a);if(s){if(this._trySkipBufferHole(s)||!this.media)return}(e.len>n.maxBufferHole||e.nextStart&&e.nextStart-a1e3*n.highBufferWatchdogPeriod&&(yr.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:n,stallReported:r}=this;if(!r&&n){this.stallReported=!0;const r=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${JSON.stringify(e)})`);yr.warn(r.message),t.trigger(dr.ERROR,{type:hr.MEDIA_ERROR,details:fr.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:n,media:r}=this;if(null===r)return 0;const i=r.currentTime,a=BufferHelper.bufferInfo(r,i,0),s=i0&&a.len<1&&r.readyState<3,u=s-i;if(u>0&&(o||l)){if(u>t.maxBufferHole){const{fragmentTracker:t}=this;let n=!1;if(0===i){const e=t.getAppendedFrag(0,ua);e&&s1?(e=0,this.bitrateTest=!0):e=n.firstAutoLevel),n.nextLoadLevel=e,this.level=n.loadLevel,this.loadedmetadata=!1}t>0&&-1===e&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=Ls,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Ds}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Us:{const{levels:e,level:t}=this,n=null==e?void 0:e[t],r=null==n?void 0:n.details;if(r&&(!r.live||this.levelLastLoaded===n)){if(this.waitForCdnTuneIn(r))break;this.state=Ls;break}if(this.hls.nextLoadLevel!==this.level){this.state=Ls;break}break}case Is:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||null!=(e=this.media)&&e.seeking){const{levels:e,level:t}=this,n=null==e?void 0:e[t];this.resetStartWhenNotLoaded(n||null),this.state=Ls}}}this.state===Ls&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(null===t||!r&&(this.startFragRequested||!e.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const i=e.nextLoadLevel;if(null==n||!n[i])return;const a=n[i],s=this.getMainFwdBufferInfo();if(null===s)return;const o=this.getLevelDetails();if(o&&this._streamEnded(s,o)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(dr.BUFFER_EOS,e),void(this.state=Fs)}e.loadLevel!==i&&-1===e.manualLevel&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const l=a.details;if(!l||this.state===Us||l.live&&this.levelLastLoaded!==a)return this.level=i,void(this.state=Us);const u=s.len,c=this.getMaxBufferLength(a.maxBitrate);if(u>=c)return;this.backtrackFragment&&this.backtrackFragment.start>s.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:s.end;let h=this.getNextFragment(d,l);if(this.couldBacktrack&&!this.fragPrevious&&h&&"initSegment"!==h.sn&&this.fragmentTracker.getState(h)!==ms){var f;const e=(null!=(f=this.backtrackFragment)?f:h).sn-l.startSN,t=l.fragments[e-1];t&&h.cc===t.cc&&(h=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&s.len&&(this.backtrackFragment=null);if(h&&this.isLoopLoading(h,d)){if(!h.gap){const e=this.audioOnly&&!this.altAudio?Er:Tr,t=(e===Tr?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,ua)}h=this.getNextFragmentLoopLoading(h,l,s,ua,c)}h&&(!h.initSegment||h.initSegment.data||this.bitrateTest||(h=h.initSegment),this.loadFragment(h,a,d))}loadFragment(e,t,n){const r=this.fragmentTracker.getState(e);this.fragCurrent=e,r===fs||r===gs?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,n)):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,ua)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let n;const r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const i=this.getLevelDetails();if(null!=i&&i.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*i.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else n=0;const a=this.getBufferedFrag(t.currentTime+n);if(a){const e=this.followingBufferedFrag(a);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,r=Math.max(a.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Rs:case Ps:case Is:case Ms:case Ns:this.state=Ls}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new GapController(this.config,n,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;lr(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const n=this.getMainFwdBufferInfo();null!==n&&0!==n.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${n?n.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(dr.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(e,t){let n=!1,r=!1;t.levels.forEach((e=>{const t=e.audioCodec;t&&(n=n||-1!==t.indexOf("mp4a.40.2"),r=r||-1!==t.indexOf("mp4a.40.5"))})),this.audioCodecSwitch=n&&r&&!function(){var e;const t=vu();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==Ls)return;const r=n[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(r.details))&&(this.state=Us)}onLevelLoaded(e,t){var n;const{levels:r}=this,i=t.level,a=t.details,s=a.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${i}`);this.log(`Level ${i} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${s}`);const o=r[i],l=this.fragCurrent;!l||this.state!==Ps&&this.state!==Is||l.level!==t.level&&l.loader&&this.abortCurrentFrag();let u=0;if(a.live||null!=(n=o.details)&&n.live){var c;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;u=this.alignPlaylists(a,o.details,null==(c=this.levelLastLoaded)?void 0:c.details)}if(o.details=a,this.levelLastLoaded=o,this.hls.trigger(dr.LEVEL_UPDATED,{details:a,level:i}),this.state===Us){if(this.waitForCdnTuneIn(a))return;this.state=Ls}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,u),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:n,part:r,payload:i}=e,{levels:a}=this;if(!a)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);const s=a[n.level],o=s.details;if(!o)return this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),void this.fragmentTracker.removeFragment(n);const l=s.videoCodec,u=o.PTSKnown||!o.live,c=null==(t=n.initSegment)?void 0:t.data,d=this._getAudioCodec(s),h=this.transmuxer=this.transmuxer||new TransmuxerInterface(this.hls,ua,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,p=-1!==f,g=new ChunkMetadata(n.level,n.sn,n.stats.chunkCount,i.byteLength,f,p),m=this.initPTS[n.cc];h.push(i,c,d,l,n,r,o.totalduration,u,g,m)}onAudioTrackSwitching(e,t){const n=this.altAudio;if(!!!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;n&&(e.trigger(dr.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(dr.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=t.id,r=!!this.hls.audioTracks[n].url;if(r){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=r,this.tick()}onBufferCreated(e,t){const n=t.tracks;let r,i,a=!1;for(const s in n){const e=n[s];if("main"===e.id){if(i=s,r=e,"video"===s){const e=n[s];e&&(this.videoBuffer=e.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:r}=t;if(n&&n.type!==ua)return;if(this.fragContextChanged(n))return this.warn(`Fragment ${n.sn}${r?" p: "+r.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Ns&&(this.state=Ls));const i=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),"initSegment"!==n.sn&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}onError(e,t){var n;if(t.fatal)this.state=Bs;else switch(t.details){case fr.FRAG_GAP:case fr.FRAG_PARSING_ERROR:case fr.FRAG_DECRYPT_ERROR:case fr.FRAG_LOAD_ERROR:case fr.FRAG_LOAD_TIMEOUT:case fr.KEY_LOAD_ERROR:case fr.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(ua,t);break;case fr.LEVEL_LOAD_ERROR:case fr.LEVEL_LOAD_TIMEOUT:case fr.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Us||(null==(n=t.context)?void 0:n.type)!==sa||(this.state=Ls);break;case fr.BUFFER_APPEND_ERROR:case fr.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;if(t.details===fr.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case fr.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!BufferHelper.getBuffered(e).length){const e=this.state!==Ls?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Ls,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Er||this.audioOnly&&!this.altAudio){const e=(t===Tr?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,ua),this.tick()}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t0&&(i{const{hls:r}=this;if(!n||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Ls,this.startFragRequested=!1,this.bitrateTest=!1;const i=e.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),r.trigger(dr.FRAG_LOADED,n),e.bitrateTest=!1}))}_handleTransmuxComplete(e){var t;const n="main",{hls:r}=this,{remuxResult:i,chunkMeta:a}=e,s=this.getCurrentContext(a);if(!s)return void this.resetWhenMissingContext(a);const{frag:o,part:l,level:u}=s,{video:c,text:d,id3:h,initSegment:f}=i,{details:p}=u,g=this.altAudio?void 0:i.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Ms,f){if(null!=f&&f.tracks){const e=o.initSegment||o;this._bufferInitSegment(u,f.tracks,e,a),r.trigger(dr.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:f.tracks})}const e=f.initPTS,t=f.timescale;lr(e)&&(this.initPTS[o.cc]={baseTime:e,timescale:t},r.trigger(dr.INIT_PTS_FOUND,{frag:o,id:n,initPTS:e,timescale:t}))}if(c&&p&&"initSegment"!==o.sn){const e=p.fragments[o.sn-1-p.startSN],t=o.sn===p.startSN,n=!e||o.cc>e.cc;if(!1!==i.independent){const{startPTS:e,endPTS:r,startDTS:i,endDTS:s}=c;if(l)l.elementaryStreams[c.type]={startPTS:e,endPTS:r,startDTS:i,endDTS:s};else if(c.firstKeyFrame&&c.independent&&1===a.id&&!n&&(this.couldBacktrack=!0),c.dropped&&c.independent){const i=this.getMainFwdBufferInfo(),a=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,l=c.firstKeyFramePTS?c.firstKeyFramePTS:e;if(!t&&a2&&(o.gap=!0);o.setElementaryStreamInfo(c.type,e,r,i,s),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(c,o,l,a,t||n)}else{if(!t&&!n)return void this.backtrack(o);o.gap=!0}}if(g){const{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=g;l&&(l.elementaryStreams[Er]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),o.setElementaryStreamInfo(Er,e,t,n,r),this.bufferFragmentData(g,o,l,a)}if(p&&null!=h&&null!=(t=h.samples)&&t.length){const e={id:n,frag:o,details:p,samples:h.samples};r.trigger(dr.FRAG_PARSING_METADATA,e)}if(p&&d){const e={id:n,frag:o,details:p,samples:d.samples};r.trigger(dr.FRAG_PARSING_USERDATA,e)}}}_bufferInitSegment(e,t,n,r){if(this.state!==Ms)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:i,video:a,audiovideo:s}=t;if(i){let t=e.audioCodec;const n=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const e=i.metadata;e&&"channelCount"in e&&1!==(e.channelCount||1)&&-1===n.indexOf("firefox")&&(t="mp4a.40.5")}t&&-1!==t.indexOf("mp4a.40.5")&&-1!==n.indexOf("android")&&"audio/mpeg"!==i.container&&(t="mp4a.40.2",this.log(`Android: force audio codec to ${t}`)),e.audioCodec&&e.audioCodec!==t&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${t}"`),i.levelCodec=t,i.id="main",this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${t||""}/${e.audioCodec||""}/${i.codec}]`)}a&&(a.levelCodec=e.videoCodec,a.id="main",this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${e.videoCodec||""}/${a.codec}]`)),s&&this.log(`Init audiovideo buffer, container:${s.container}, codecs[level/parsed]=[${e.codecs}/${s.codec}]`),this.hls.trigger(dr.BUFFER_CODECS,t),Object.keys(t).forEach((e=>{const i=t[e].initSegment;null!=i&&i.byteLength&&this.hls.trigger(dr.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,ua)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Ls}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const n=e.currentTime;if(BufferHelper.isBuffered(e,n)?t=this.getAppendedFrag(n):BufferHelper.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,n=t.level;e&&t.sn===e.sn&&e.level===n||(this.fragPlaying=t,this.hls.trigger(dr.FRAG_CHANGED,{frag:t}),e&&e.level===n||this.hls.trigger(dr.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,n=this.currentFrag;if(n&&lr(t)&&lr(n.programDateTime)){const e=n.programDateTime+1e3*(t-n.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Hls{static get version(){return"1.5.11"}static isMSESupported(){return yu()}static isSupported(){return function(){if(!yu())return!1;const e=Ni();return"function"==typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((t=>e.isTypeSupported(Ui(t,"video"))))||["mp4a.40.2","fLaC"].some((t=>e.isTypeSupported(Ui(t,"audio")))))}()}static getMediaSource(){return Ni()}static get Events(){return dr}static get ErrorTypes(){return hr}static get ErrorDetails(){return fr}static get DefaultConfig(){return Hls.defaultConfig?Hls.defaultConfig:hu}static set DefaultConfig(e){Hls.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Io,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,function(e,t){if("object"==typeof console&&!0===e||"object"==typeof e){vr(e,"debug","log","info","warn","error");try{mr.log(`Debug logs enabled for "${t}" in hls.js version 1.5.11`)}catch(n){mr=gr}}else mr=gr}(e.debug||!1,"Hls instance");const t=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=fu(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const i=`${"level"===e?"playlist":e}LoadPolicy`,a=void 0===t[i],s=[];r.forEach((r=>{const o=`${e}Loading${r}`,l=t[o];if(void 0!==l&&a){s.push(o);const e=n[i].default;switch(t[i]={default:e},r){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),s.length&&yr.warn(`hls.js config: "${s.join('", "')}" setting(s) are deprecated, use "${i}": ${JSON.stringify(t[i])}`)})),ir(ir({},n),t)}(Hls.DefaultConfig,e);this.userConfig=e,t.progressive&&pu(t);const{abrController:n,bufferController:r,capLevelController:i,errorController:a,fpsController:s}=t,o=new a(this),l=this.abrController=new n(this),u=this.bufferController=new r(this),c=this.capLevelController=new i(this),d=new s(this),h=new PlaylistLoader(this),f=new ID3TrackController(this),p=t.contentSteeringController,g=p?new p(this):null,m=this.levelController=new LevelController(this,g),v=new FragmentTracker(this),y=new KeyLoader(this.config),b=this.streamController=new StreamController(this,v,y);c.setStreamController(b),d.setStreamController(b);const w=[h,m,b];g&&w.splice(1,0,g),this.networkControllers=w;const _=[l,u,c,d,f,v];this.audioTrackController=this.createController(t.audioTrackController,w);const E=t.audioStreamController;E&&w.push(new E(this,v,y)),this.subtitleTrackController=this.createController(t.subtitleTrackController,w);const T=t.subtitleStreamController;T&&w.push(new T(this,v,y)),this.createController(t.timelineController,_),y.emeController=this.emeController=this.createController(t.emeController,_),this.cmcdController=this.createController(t.cmcdController,_),this.latencyController=this.createController(LatencyController,_),this.coreComponents=_,w.push(o);const S=o.onErrorOut;"function"==typeof S&&this.on(dr.ERROR,S,o)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(yr.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const t=e===dr.ERROR;this.trigger(dr.ERROR,{type:hr.OTHER_ERROR,details:fr.INTERNAL_EXCEPTION,fatal:t,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){yr.log("destroy"),this.trigger(dr.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){yr.log("attachMedia"),this._media=e,this.trigger(dr.MEDIA_ATTACHING,{media:e})}detachMedia(){yr.log("detachMedia"),this.trigger(dr.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,n=this.url,r=this.url=nr.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,yr.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(dr.MANIFEST_LOADING,{url:e})}startLoad(e=-1){yr.log(`startLoad(${e})`),this.started=!0,this.networkControllers.forEach((t=>{t.startLoad(e)}))}stopLoad(){yr.log("stopLoad"),this.started=!1,this.networkControllers.forEach((e=>{e.stopLoad()}))}resumeBuffering(){this.started&&this.networkControllers.forEach((e=>{"fragmentLoader"in e&&e.startLoad(-1)}))}pauseBuffering(){this.networkControllers.forEach((e=>{"fragmentLoader"in e&&e.stopLoad()}))}swapAudioCodec(){yr.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){yr.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e){this.levelController.removeLevel(e)}get levels(){const e=this.levelController.levels;return e||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){yr.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){yr.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){yr.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){yr.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){yr.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(yr.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){(function(e){return xa.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let r=0;r=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let r;if(r=-1===t&&null!=e&&e.length?e.length-1:t,n)for(let i=r;i--;){const t=e[i].attrs["HDCP-LEVEL"];if(t&&t<=n)return i}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(e){var t;return null==(t=this.audioTrackController)?void 0:t.setAudioOption(e)}setSubtitleOption(e){var t;return null==(t=this.subtitleTrackController)||t.setSubtitleOption(e),null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}Hls.defaultConfig=void 0;Object.create;function bu(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s}Object.create;"function"==typeof SuppressedError&&SuppressedError;const wu={any:0,all:1};function _u(e,t,{root:n,margin:r,amount:i="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const a=function(e,t){var n;return"string"==typeof e?t?(null!==(n=t[e])&&void 0!==n||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}(e),s=new WeakMap,o=new IntersectionObserver((e=>{e.forEach((e=>{const n=s.get(e.target);if(e.isIntersecting!==Boolean(n))if(e.isIntersecting){const n=t(e);"function"==typeof n?s.set(e.target,n):o.unobserve(e.target)}else n&&(n(e),s.delete(e.target))}))}),{root:n,rootMargin:r,threshold:"number"==typeof i?i:wu[i]});return a.forEach((e=>o.observe(e))),()=>o.disconnect()}const Eu=({noAnimation:e,onClick:t})=>{const n=(0,r.useRef)(null),i=(0,r.useRef)(null),a=(0,r.useRef)(!1),[o,l]=(0,r.useState)(null),[u,c]=(0,r.useState)(!1),d=function(e,t){var n=void 0===t?{}:t,i=n.root,a=n.margin,s=n.amount,o=n.once,l=void 0!==o&&o,u=bu((0,r.useState)(!1),2),c=u[0],d=u[1];return(0,r.useEffect)((function(){var t;if(!(!e.current||l&&c)){var n={root:null!==(t=null==i?void 0:i.current)&&void 0!==t?t:void 0,margin:a,amount:"some"===s?"any":s};return _u(e.current,(function(){return d(!0),l?void 0:function(){return d(!1)}}),n)}}),[i,e,a,l]),c}(i,{once:!1,amount:"some"}),{ardPlayerMediaCollection:h,currentAv:f}=s(),p=()=>{var e,t,n,r;const a=i.current.closest(".box"),s="noVideoPreview";return!(null!=(e=a.closest("body"))&&e.classList.contains(s)||a.classList.contains(s)||null!=(t=a.closest(".con"))&&t.classList.contains(s)||null!=(n=a.closest(".con"))&&n.classList.contains("hasPortraitVideo")||null!=(r=a.closest(".sectionWrapper"))&&r.classList.contains(s))};(0,r.useEffect)((()=>{const e="audio"===(null==f?void 0:f.type.toLowerCase()),t=i.current.closest(".box").closest(".con").classList.contains("hasPortraitVideo");if(p()&&d&&null!=n&&n.current&&!1===a.current){var r;if(!e&&!t)null==(r=h.streams[0])||r.media.forEach(((e,t)=>{if(-1!==e.url.indexOf(".m3u8")){const t=`${e.url}?b=0-1500&start=0&end=6`;if(l(t),a.current=!0,(0,b.TU)()||c(!0),Hls.isSupported()){const e=new Hls({debug:!1,liveSyncDurationCount:2,capLevelToPlayerSize:!0});e.attachMedia(n.current),e.on(Hls.Events.MEDIA_ATTACHED,(async()=>{e.loadSource(t),(0,b.TU)()||await n.current.play()}))}}}));const s=i.current.closest(".box");s&&s.classList.add("react-ardplayer-preview")}}),[d]);const g=()=>"video"===(null==f?void 0:f.type.toLowerCase())?"Video abspielen":"Audio abspielen";return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(y,{title:(()=>{if("audio"===(null==f?void 0:f.type.toLowerCase())){var e;const t=null==(e=i.current)?void 0:e.closest(".box"),n=null==t?void 0:t.querySelector(".img");return null==n?void 0:n.title}})(),onClick:e=>{const n=i.current.closest(".box"),r=n.classList.contains("cssArticle"),a=n.classList.contains("boxImage")||n.classList.contains("boxImageSquare")||n.classList.contains("boxBanner")||n.classList.contains("boxPortfolio"),s=n.closest(".conDetailHeader");a||r&&!s?document.location.href=n.querySelector(".linkAll").getAttribute("href"):t(e)},ref:i,onMouseOver:async t=>(i.current.closest(".box").classList.add("ardplayer-focus"),!!p()&&(!e&&void((0,b.TU)()&&(await n.current.play(),c(!0))))),onMouseLeave:()=>{if(e)return!1;(0,b.TU)()&&c(!1)},className:"ardplayer-preview "+(u?"ardplayer-show-preview":""),style:{width:"100%",height:"100%",position:"absolute"},children:!e&&(0,U.jsx)("video",{ref:n,className:"ardplayer-preview-loop",autoPlay:!(0,b.TU)(),muted:!0,playsInline:!0,loop:!0,src:Hls.isSupported()?null:o,disablePictureInPicture:!0})}),(null==f?void 0:f.duration)&&!0!==e&&(0,U.jsx)("button",{"aria-label":g(),onClick:e=>{t(e)},title:g(),style:{position:"absolute"},className:"avDetails",children:f.duration})]})},Tu=({variant:e,theme:t,config:n,ardPlayerConfig:a,onPlayerStateHandler:s,onTeaserPlusLinkClicked:o,client:l,detailPageUrl:u})=>{const[c,d]=(0,r.useState)(),[h,f]=(0,r.useState)(),{isLoading:g,data:m,mediaCollection:v,playerConfiguration:y}=(0,Yn.V)(c||n.dataRef||n.jsonUrl||n.playerXml,a,n,h),[w,_]=(0,r.useState)(!0===(null==n?void 0:n.autoplay)||!0!==n.preview),E=()=>m.multimediagallery&&"podcast"===e?"podcast":n.isLightbox?"lightbox":"radiolivestream"===e?"radiolivestream":"audio"===m.avDocument.type?"inline-audio":m.avPlusInfos?"avplus":"inline";return g?"podcast"===e?(0,U.jsx)(p.NP,{theme:t,children:(0,U.jsx)(de.az,{width:"100%",position:"relative",xsStyle:{paddingTop:"200%"},sStyle:{paddingTop:"100%"},mStyle:{paddingTop:"37.5%",marginBottom:"56px"},children:(0,U.jsx)(Z.ps,{position:"absolute",width:"6rem",height:"6rem",bgColor:"#fff",top:"50%",right:"50%",margin:"-3rem -3rem 0 0"})})}):null:(0,U.jsx)(p.NP,{theme:t,children:(0,U.jsx)(i.Provider,{value:{ardPlayerMediaCollection:v,currentAv:m.avDocument,allAvData:m,jumpmarks:(()=>{const e=[];return m.galleryInfos&&m.galleryInfos.images.map((t=>{e.push({chapterTime:(0,b.Pn)(t.avCueIn),chapterTitle:t.title,urlScheme:t.urlScheme,variants:t.variants,chapterImg:"",chapterTitleText:t.titleText,chapterAltText:t.altText,rights:t.rights})})),{chapterArray:e}})(),client:l,ardPlayerConfig:y,config:n,onPlayerUrlUpdate:e=>{var t;d(e),f((new Date).getTime()),a.web.mediaContainer=(0,Wn.Cr)((null==m||null==(t=m.avDocument)?void 0:t.type)||"video",n.id)},onTeaserPlusLinkClicked:o},children:w?"detailPage"===n.forceView&&u?(document.location.href=u,null):"lightbox"===E()?(0,ve.createPortal)((0,U.jsx)(qn,{onPlayerStateHandlerExt:s,variant:"lightbox",onClose:()=>{_(!1)}}),document.getElementsByClassName("react-lightbox")[0]):(0,U.jsx)(qn,{onPlayerStateHandlerExt:s,variant:E(),onClose:()=>{_(!1)}}):(0,U.jsx)(Eu,{noAnimation:(null==m?void 0:m.multimediagallery)&&(null==n?void 0:n.isLightbox),onClick:async e=>{var t;a.web.mediaContainer=(0,Wn.Cr)((null==m||null==(t=m.avDocument)?void 0:t.type)||"video",n.id),_(!0)}})})})}},133:(e,t,n)=>{"use strict";n.d(t,{Cr:()=>w,hi:()=>E,oX:()=>b,DG:()=>y});var r=n(4022),i=n(5286),a=n(1092);function s(e){return(0,a.A)(1,arguments),Math.floor(function(e){return(0,a.A)(1,arguments),(0,i.A)(e).getTime()}(e)/1e3)}var o=n(4086),l=n(3733);function u(e,t){(0,a.A)(2,arguments);var n=(0,i.A)(e),r=(0,l.A)(t),s=n.getFullYear(),o=n.getDate(),u=new Date(0);u.setFullYear(s,r,15),u.setHours(0,0,0,0);var c=function(e){(0,a.A)(1,arguments);var t=(0,i.A)(e),n=t.getFullYear(),r=t.getMonth(),s=new Date(0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}(u);return n.setMonth(r,Math.min(o,c)),n}function c(e,t){if((0,a.A)(2,arguments),"object"!==(0,o.A)(t)||null===t)throw new RangeError("values parameter must be an object");var n=(0,i.A)(e);return isNaN(n.getTime())?new Date(NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=u(n,t.month)),null!=t.date&&n.setDate((0,l.A)(t.date)),null!=t.hours&&n.setHours((0,l.A)(t.hours)),null!=t.minutes&&n.setMinutes((0,l.A)(t.minutes)),null!=t.seconds&&n.setSeconds((0,l.A)(t.seconds)),null!=t.milliseconds&&n.setMilliseconds((0,l.A)(t.milliseconds)),n)}var d=n(5655);let h=function(e){return e.MAIN="main",e.SIGN_LANGUAGE="sign-language",e.CC_BURN_IN="subtitle-burn-in",e}({}),f=function(e){return e.STANDARD="standard",e.AUDIO_DESCRIPTION="audio-description",e.SIMPLE_LANGUAGE="simple-language",e.SPEECH_OPTIMIZED="speech-optimized",e}({}),p=function(e){return e.NORMAL="normal",e.SIMPLE_LANGUAGE="simple-language",e}({}),g=function(e){return e.EBU_TT="ebutt",e.EMBEDDED="embedded",e.WEB_VTT="webvtt",e}({}),m=function(e){return e.FSK="fsk",e.OTHER="other",e}({}),v=function(e){return e.PREVIEW="preview",e.AUDIO="audio",e.MATURITY_BLOCKED="maturityContentBlocked",e}({});const y=e=>!(null==e||!e.transmissionType||-1===e.transmissionType.indexOf("live")),b=(e,t,n)=>{const r=t.avDocument||null,i={pluginData:Object.assign({},e.pluginData),generic:e.generic||{isAutoplay:!0,isMuted:!1},web:e.web||{baseUrl:"/ardplayer/",isForcedAutoplay:!1,isAudioSticky:!1,enablePostMessage:!1}};i.pluginData=Object.assign({},e.pluginData),"download"!==r.transmissionType&&!0!==r.downloadAvailable||(i.pluginData["download@web"]={isEnabled:!0});try{"audio"!==r.type&&r["agf-tracking"]&&"true"!==localStorage.getItem("optOutNielsen")&&(i.pluginData["trackingAgf@web"]=_(r.sophoraId,r,e))}catch(o){console.error("PlayerConfiguration, error accessing localStorage")}"kika"!==n&&(i.pluginData["trackingSAND@all"]="www.mdr.de"===document.location.host?{SANDEnabled:!0,SANDDebug:!0,mcdnType:"DNS",reporting:[{limiter:{endpoint:"https://sand.ard.de/auth/sand-token.json?apiKey=mdr"},endpoints:["https://sand-hub.ard.de/v1/projects/deo-mpm-prod-359708/topics/sand-topic:publish"],metrics:["RepSwitch","BufferLevel","Playback","Misc","LiveEdgeDelay","ErrorMetric","StartupTime"],schemeIdUri:"urn:mpeg:dash:sand:channel:gcp:xhr:2021",token:null},{limiter:{endpoint:"https://sand.ard.de/auth/sand-token.json?apiKey=mdr"},endpoints:["https://sand-hub.ard.de/v1/projects/deo-mpm-prod-359708/topics/sand-beacon:publish"],metrics:["Beacon"],schemeIdUri:"urn:mpeg:dash:sand:channel:gcp:xhr:2021",token:null}],configuration:{customerID:"mdr",enableHeaderReporting:!0,payloadTypeEnums:["text/xml","text/json"],payloadType:"text/json",defaults:{metricInterval:15e3,reportingInterval:15e3,beaconInterval:3e4,miscInterval:6e4,headInterval:3e4,errorTimeout:6e4},adaptiveInterval:{init:6e4,metricInterval:3e4,reportingInterval:3e4,threshold:{bufferLevelFactor:.66,liveEdgeDelayFactor:.66,memoryUsageFactor:.66}}}}:{SANDEnabled:!0,SANDDebug:!0,mcdnType:"DNS",reporting:[{limiter:{endpoint:"https://sand-test.ard.de/auth/sand-token.json?apiKey=mdr"},endpoints:["https://sand-hub-test.ard.de/v1/projects/deo-mpm-dev-357814/topics/sand-topic:publish"],metrics:["RepSwitch","BufferLevel","Playback","Misc","LiveEdgeDelay","ErrorMetric","StartupTime"],schemeIdUri:"urn:mpeg:dash:sand:channel:gcp:xhr:2021",token:null},{limiter:{endpoint:"https://sand-test.ard.de/auth/sand-token.json?apiKey=mdr"},endpoints:["https://sand-hub-test.ard.de/v1/projects/deo-mpm-dev-357814/topics/sand-beacon:publish"],metrics:["Beacon"],schemeIdUri:"urn:mpeg:dash:sand:channel:gcp:xhr:2021",token:null}],configuration:{customerID:"mdr",enableHeaderReporting:!0,payloadTypeEnums:["text/xml","text/json"],payloadType:"text/json",defaults:{metricInterval:15e3,reportingInterval:15e3,beaconInterval:3e4,miscInterval:6e4,headInterval:3e4,errorTimeout:6e4},adaptiveInterval:{init:6e4,metricInterval:3e4,reportingInterval:3e4,threshold:{bufferLevelFactor:.66,liveEdgeDelayFactor:.66,memoryUsageFactor:.66}}}}),y(t.avDocument)&&"audio"!==t.avDocument.type&&"kika"===n&&(i.pluginData["jumpmarks@all"]={publishEPGInfos:!0,url:t.avDocument.liveProgramUrl||"https://programm-api.ard.de/nownext/api/channel?channel=Y3JpZDovL2tpa2EuZGUvTGl2ZXN0cmVhbS1LaUth&pastHours=5&futureEvents=1",refreshSeconds:10});const a="kika"===n?"KIKA.de":"MDR.de";let s=["url",{id:"whatsapp",title:"Auf Whatsapp wirklich teilen",class:"whatsappSpecial",target:"https://api.whatsapp.com/send?text=$text$",targetParams:{text:`Schau dir ${null!=r&&r.title?null==r?void 0:r.title.toLowerCase():""} auf ${a} an: $link$`}},"fb-messenger","facebook","threema","telegram","twitter"];return"kika"===n&&(s=["url"]),i.pluginData["sharing@web"]={link:r.htmlUrl,params:"?start=$start$&ende=$ende$",legal:"",title:r.title||r.headline,body:`Unbedingt anschauen! Mein Tipp auf ${a}: ${r.title||r.headline} $link$`,subject:`Empfehlung von ${a}`,services:s},i},w=(e,t)=>{const n="audio"===e?"audio":"video",r=`${n}-${t}--${String((new Date).getTime())}`,i="audio"===n?document.createElement("audio"):document.createElement("video");i.setAttribute("id",r),document.querySelector("body").appendChild(i);const a=null==i?void 0:i.play();return void 0!==a&&a.then((function(e){return!1})).catch((function(e){return!1})),r},_=(e,t,n)=>{if("audio"===t.type)return null;const r=t.channelOrRegionName||"MDR+";let i=y(t)?"Livestream":t.title,a="";const s=t.broadcast&&t.broadcast.broadcastName?i=t.broadcast.broadcastName:null,o=t.webTime?t.webTime:null,l=t.broadcast&&t.broadcast.broadcastStartDate?t.broadcast.broadcastStartDate:null,u=t.datetimeOfBroadcasting||null;let c=t.broadcast&&t.broadcast.broadcastSeriesName?t.broadcast.broadcastSeriesName:"MDR sonstiges";if(a=null===l?u:l,a&&""!==a||(a=o),a){const e=a.substr(0,2),t=a.substr(3,2),n=a.substr(6,4),r=a.substr(11,5);a=n+"-"+t+"-"+e+"T"+r+":00"}if(y(t)){a=(new Date).toISOString().split(".")[0]}const h="MDR Fernsehen"===r?"N":"Y",f=t.htmlUrl||"",p=a,g=t.broadcast&&t.broadcast.formatId?t.broadcast.formatId:"";let m=t.duration&&!y(t)?Number((0,d.Pn)("00:"+t.duration)):86400;const v=t.contributionNumber||null,b=y(t)?"":"_"+a,w={nol_c0:"p0,0",nol_c2:"p2,"+h,nol_c5:"p5,"+f,nol_c10:"p10,"+r,nol_c12:"p12,Content",nol_c14:"p14,"+p,nol_c15:"p15,"+g,nol_c16:"p16,ARD_Sonstiges"};w.nol_c9="0"===v?w.nol_c9+b:s+"_"+i+b;const _=t["agf-tracking"];for(const d in _)"c14"!==d&&"c"===d.substring(0,1)&&"clientId"!==d&&"vcid"!==d&&(w[-1===d.indexOf("nol")?"nol_"+d:d]=`p${d.split("c").join("")},${_[d]}`);_.program&&(c=_.program),_.length&&(m=_.length),_.c14&&"kika"===n.client&&(w.nol_c14=`p14,${_.c14}`),y(t)&&(w.nol_c8="p8,86400",c="Livestream");let E="P3D9A6264-5D0D-4FCA-9C87-C9197B844BED";n&&"kika"===n.client&&(E="P945EA7D9-6619-4B5A-A454-33069A153141");const T=_.appId;"P"!==(null==T?void 0:T.substring(0,1))&&"T"!==(null==T?void 0:T.substring(0,1))||(E=T);return{tracker:"AGFdebug",appId:E,playerID:e,permLive:y(t),clipData:Object.assign({type:"content",assetid:e||_.assetid||_.assetId||"",program:c,title:_.title?_.title:_.c10+"_"+_.c9,length:m},w)}},E=(e,t)=>{var n,i,a,o,l,u;const b=t||"16x9",w=e.avDocument,_=w.type||"video",E={assets:w.assets.asset,isLive:y(w),type:_,geoData:e.geoData};let S="";null!=(n=w.broadcast)&&n.productPlacementTitle&&(S=`\n\n ${w.broadcast.productPlacementTitle}: ${w.broadcast.productPlacementDescription}`),w.hasProductPlacement&&(S="\n\n Diese Sendung enth\xe4lt Produktplatzierungen.");const C={isGeoBlocked:!1,live:null,meta:{images:[{kind:v.PREVIEW,url:(0,d.bG)((null==w||null==(i=w.teaserimages)||null==(i=i.teaserimageResponsive)?void 0:i.url)||(null==w||null==(a=w.teaserimages)||null==(a=a.teaserimage)?void 0:a.url)||(null==w||null==(o=w.teaserImage)?void 0:o.urlScheme)||(null==w||null==(l=w.image)?void 0:l.urlScheme)||"",b,768,null==w||null==(u=w.teaserImage)?void 0:u.variants)}],maturityContentRating:null,title:w.title,synopsis:`${w.teaserText} ${S}`},subtitles:[],pluginData:{},streams:[{media:T(E),isAudioOnly:!(!w||!w.type||-1===w.type.indexOf("audio")),kind:h.MAIN}]};if(e.adAvDocument){const t={assets:e.adAvDocument.assets.asset,isLive:y(e.adAvDocument),type:_,geoData:e.geoData,audioKind:f.AUDIO_DESCRIPTION};C.streams.push({media:T(t),isAudioOnly:!1,kind:h.MAIN})}if(e.dgsAvDocument){var x;const t={assets:null==(x=e.dgsAvDocument)||null==(x=x.assets)?void 0:x.asset,isLive:y(null==e?void 0:e.dgsAvDocument),geoData:null==e?void 0:e.geoData,type:_};C.streams.push({media:T(t),isAudioOnly:!1,kind:h.SIGN_LANGUAGE})}if(null!=w&&w.fsk&&Number(w.fsk)>12){const e=Number(w.fsk);let t=20;const n=6;let i=!0;16===e&&(t=22),18===e&&(t=23);const a=s(new Date((null==r.A?void 0:r.A.SERVER_TIME)||Date.now())),o=s(c(new Date((null==r.A?void 0:r.A.SERVER_TIME)||Date.now()),{hours:t})),l=s(c(new Date((null==r.A?void 0:r.A.SERVER_TIME)||Date.now()),{hours:n}));(a>=o||a<=l)&&(i=!1),C.meta.maturityContentRating={kind:m.FSK,age:e,isBlocked:i}}if(C.isGeoBlocked=e.geoData&&"de"!==e.geoData,"audio"===_&&(C.pluginData["plugin-hls@web"]={maxBufferSize:1e7}),y(w)){C.live={dvrWindowSeconds:7200};const e={kind:p.NORMAL,languageCode:"de",sources:[{kind:g.WEB_VTT,url:""}]};C.subtitles.push(e)}else delete C.live;if(w.videoSubtitleUrl||w.webvttUrl){const e={kind:p.NORMAL,languageCode:"de",sources:[]};w.videoSubtitleUrl&&e.sources.push({kind:g.EBU_TT,url:w.videoSubtitleUrl}),w.webvttUrl&&e.sources.push({kind:g.WEB_VTT,url:w.webvttUrl}),C.subtitles.push(e)}return C},T=e=>{const t=[];let n="csmilHlsStreamingRedirectorUrl";const r="adaptiveHttpStreamingRedirectorUrl";let i=!1;const a=e.isLive&&"audio"===e.type;a&&(n="icecastHttpStreamUrl");const s=void 0!==(o=e.assets).length?o:null;var o;const l=(e=>void 0===e.length?e:null)(e.assets);if(!l&&s.length&&s.length>0){const o=s.filter((e=>e[n]&&-1!==e[n].indexOf(".m3u8"))).length>0;s.map(((s,l)=>{if(s.url){const n={data:s,url:s.url,target:t,mediaType:e.type,audioKind:e.audioKind,geoData:e.geoData};S(n)}else{let l=null;if(s[n]&&(l=s[n]),s[n]||(l=s[r]),!1===i&&l){const n={data:s,url:l,target:t,mediaType:e.type,audioKind:e.audioKind,geoData:e.geoData};if(a&&l&&o&&-1===l.indexOf(".m3u8"))return!1;null!==S(n)&&(i=!0)}if(s.progressiveDownloadUrl&&!s.downloadUrl){const n={data:s,url:s.progressiveDownloadUrl,target:t,mediaType:e.type,geoData:e.geoData,audioKind:e.audioKind};S(n)}}}))}else{const i={data:l,url:l[n]||l[r]||l.progressiveDownloadUrl,target:t,mediaType:e.type,geoData:e.geoData,audioKind:e.audioKind};S(i)}return t},S=e=>{var t;let n="application/vnd.apple.mpegurl";const{url:r,data:i,mediaType:a,target:s,audioKind:o}=e;let l=i.bitrateVideo;l&&-1!==l||(l=i.frameWidth);const u=((e,t)=>{let n=null;return(45e4===e||t&&e>480&&e<=640)&&(n="niedrige Qualit\xe4t"),(18e5===e||115e4===e||t&&e>640)&&(n="mittlere Qualit\xe4t"),(3584e3===e||225e4===e||t&&e>=1280)&&(n="hohe Qualit\xe4t"),n})(l,!i.bitrateVideo||-1===i.bitrateVideo);return-1!==r.indexOf(".mp4")&&-1===r.indexOf(".m3u8")&&(n="video/mp4"),-1===r.indexOf(".mp3")&&-1===r.indexOf("/mp3/")||-1!==r.indexOf(".m3u8")||(n="audio/mpeg"),-1===n.indexOf("mpegurl")&&null===u&&"audio"!==a||-1!==r.indexOf(".m3u")&&-1===r.indexOf(".m3u8")&&"audio"===a||e.geoData&&e.data.geoZone&&e.data.geoZone.toLowerCase()!==e.geoData||!e.geoData&&e.data.geoZone&&"ww"===e.data.geoZone.toLowerCase()||null!=(t=e.data)&&t.icecastHttpStreamUrl&&e.data.bitrateAudio<6e4?null:void s.push({url:r,mimeType:n,isAdaptiveQualitySelectable:!0,maxHResolutionPx:-1!==n.indexOf("mpegurl")?void 0:i.frameWidth,audios:[{kind:o||f.STANDARD,languageCode:"deu"}]})}},7999:(e,t,n)=>{"use strict";n.d(t,{$P:()=>u,LA:()=>o,Pr:()=>d,Tz:()=>g,ZY:()=>h,Zv:()=>m,f$:()=>p,hh:()=>l,mO:()=>s,qz:()=>f,wi:()=>c});var r=n(6225),i=n(1238),a=n(5655);const s=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__Wrapper",componentId:"sc-fn1zqp-0"})(["width:100%;position:relative;display:flex;align-items:center;flex-direction:column;background:",";border-radius:0.125rem;@media (min-width:","){width:",";}"],(({bgColor:e})=>e||"#e9e4d9"),(({breakpoints:e})=>null!=e&&e.m?`${e.m}px`:`${r.A.breakpoints.m}px`),(({hasTeaserPlusLinksBox:e})=>e?"66%":"100%")),o=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__LightboxInnerWrapper",componentId:"sc-fn1zqp-1"})(["position:relative;display:flex;transition:transform 0.3s ease-out;transform:translate3d(0,0,0);",""],(({open:e})=>e&&(0,i.AH)(["transform:translate3d(-100%,0,0);"]))),l=i.Ay.span.withConfig({displayName:"PodcastPlayerStyle__IconWrapper",componentId:"sc-fn1zqp-3"})(["position:relative;margin-right:1rem;display:flex;",";"],(({variant:e})=>"detail"===e&&(0,i.AH)(["width:50%;margin-top:1rem;margin-bottom:1rem;margin-right:0;align-items:center;justify-content:center;"]))),u=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__TextWrapper",componentId:"sc-fn1zqp-4"})(["display:flex;justify-content:center;flex-direction:column;order:",";padding:",";"," ",""],(e=>e.order?e.order:null),(e=>e.padding?e.padding:null),(({isSmall:e})=>!1===e&&(0,i.AH)(["justify-content:flex-start;padding-top:1rem;padding-right:1rem;"])),(({isSmall:e})=>e&&(0,i.AH)(["padding-right:1rem;"]))),c=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__Footer",componentId:"sc-fn1zqp-6"})(["display:flex;background-color:",";flex-direction:row;width:100%;position:relative;align-items:center;padding:0.5rem;"],(({bgColor:e})=>e||"rgba(0,0,0,0.05)")),d=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__InfosWrapper",componentId:"sc-fn1zqp-7"})(["display:flex;flex-direction:",";flex-wrap:",";width:100%;padding:",";position:relative;"],(({colMode:e})=>e?"column":"row"),(({isBigView:e})=>e?"wrap":""),(({padding:e})=>e||null)),h=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__SkipWrapper",componentId:"sc-fn1zqp-8"})(["width:",";height:",";position:relative;display:flex;align-items:center;justify-content:center;border-radius:50%;margin-top:1rem;cursor:pointer;transition:all 0.3s ease-out;",""],(e=>e.width?e.width:"4rem"),(e=>e.height?e.height:"4rem"),(e=>e.hoverColor&&!(0,a.CN)()&&(0,i.AH)(["&:hover{background-color:",";}"],e.hoverColor?e.hoverColor:"rgba(35, 92, 122, 0.1)"))),f=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__PlayerControls",componentId:"sc-fn1zqp-9"})(["width:100%;position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:0 1rem 0.5rem 1rem;"]),p=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__PlayerControlsTop",componentId:"sc-fn1zqp-10"})(["width:100%;position:relative;display:flex;margin:0.5rem 0 0.5rem 0;align-items:center;justify-content:center;"]),g=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__PlayerControlsBottom",componentId:"sc-fn1zqp-11"})(["width:100%;margin-top:0.25rem;position:relative;display:flex;align-items:center;justify-content:center;"]),m=i.Ay.div.withConfig({displayName:"PodcastPlayerStyle__LightboxWrapper",componentId:"sc-fn1zqp-12"})(["min-width:100%;position:relative;display:flex;align-items:center;justify-content:flex-start;flex-direction:column;padding:1rem;height:auto !important;"])},8380:(e,t,n)=>{"use strict";n.d(t,{A:()=>T});var r=n(4041),i=n(3789),a=n(8649),s=n(1238),o=n(1085);const l=s.Ay.li.withConfig({displayName:"ListItem__Wrapper",componentId:"sc-175ykvg-0"})(["line-height:1;padding:",";display:flex;width:100%;align-items:center;margin-bottom:0.5rem;border-bottom:1px solid rgba(0,0,0,0.05);> *{display:flex;align-items:center;width:100%;}"],(e=>e.padding?e.padding:"0")),u=e=>(0,o.jsx)(l,Object.assign({},e,{children:e.children})),c=s.Ay.ul.withConfig({displayName:"List__Wrapper",componentId:"sc-12iba5y-0"})(["margin:0;padding:0;display:flex;flex-direction:column;width:100%;"]),d=e=>(0,o.jsx)(c,Object.assign({},e,{children:e.children}));var h=n(8621),f=n(2586),p=n(2968),g=n(8014),m=n(483),v=n(5750),y=n.n(v),b=n(3034),w=n(7999),_=n(8090),E=n(8400);const T=e=>{let t=null,n=(0,r.useContext)(s.Dx);e.theme&&!n&&(n=e.theme);const l=n.podcastPlayer,[c,v]=(0,r.useState)(null),[T,S]=(0,r.useState)("Nochmal versuchen"),[C,x]=(0,r.useState)(!1);if(e.config&&!0!==e.subMode){const n=(0,b.V)(e.config.playerXml,e.ardPlayerConfig,e.config);if(n.isLoading)return(0,o.jsx)(_.az,{width:"44px",height:"44px",position:"relative",children:(0,o.jsx)(E.ps,{})});n.data&&(t=n.data)}const A=()=>{x(!C)},k=()=>e.data||t,D=e=>{N(e)||window.open(e.url),v(e),S(N(e)?"Kopieren":"Nochmal versuchen")},L=()=>{v(!1)},R=(e,t)=>(0,o.jsx)(u,{children:(0,o.jsxs)(h.A,{display:"flex",width:"100%",padding:"0.5rem 0",color:"#313131",onClick:()=>{D(e)},children:[(0,o.jsx)(w.hh,{children:(0,o.jsx)(g.I,{width:"2.5rem",fontSize:"2.5rem",height:"2.5rem",color:"#235c7a",code:p.FI.podcast[e.icon]||p.FI.podcast.rss})}),(0,o.jsx)("span",{children:e.title}),(0,o.jsx)(g.I,{width:"2.5rem",height:"2.5rem",margin:"0 0 0 auto",code:p.FI.arrowRight})]})},"pods"+t),P=()=>(0,o.jsxs)(w.Zv,{children:[(0,o.jsxs)(a.$,{color:l.btnColor,activeColor:l.btnColor,bgColor:"transparent",variant:"playerStandard",margin:"0 auto 0 0",onClick:L,width:"auto",minWidth:"0",padding:null,children:[(0,o.jsx)(g.I,Object.assign({margin:"0 0.5rem 0 0",fontSize:"1.25rem"},e,{color:"#000000",code:p.FI.arrowLeft})),(0,o.jsx)(m.A,{fontWeight:"bold",children:"Zur\xfcck"})]}),(0,o.jsx)(w.hh,{variant:"detail",children:(0,o.jsx)(g.I,{width:"9rem",height:"9rem",fontSize:"9rem",color:"#235c7a",code:p.FI.podcast[c.icon]})}),M(),N()?I():O()]}),I=()=>(0,o.jsx)(y(),{text:c.url,onCopy:()=>S("Kopiert!"),children:(0,o.jsx)(a.$,{color:l.btnColor,activeColor:l.btnColor,variant:"playerStandard",margin:"0 auto",width:"auto",minWidth:"160px",children:(0,o.jsx)(m.A,{fontWeight:"bold",children:T})})}),O=()=>(0,o.jsx)(a.$,{color:l.btnColor,activeColor:l.btnColor,variant:"playerStandard",margin:"0 auto",width:"auto",minWidth:"160px",onClick:()=>{D(c)},children:(0,o.jsx)(m.A,{fontWeight:"bold",children:T})}),M=()=>{let e="Kopieren sie hier die URL und f\xfcgen Sie diese Ihrer Podcast oder RSS-App hinzu.";return N()||(e="\xd6ffne "+c.title+". Ging etwas schief?"),(0,o.jsx)(m.A,{textAlign:"center",margin:"1rem 0 1rem 0",children:e})},N=e=>-1!==(e||c).title.indexOf("RSS");if(!e.data&&!t)return null;const F=null!=l&&l.subscribeBtn?l.subscribeBtn:null;return(0,o.jsxs)(r.Fragment,{children:[(0,o.jsxs)(a.$,{color:null==F?void 0:F.textColor,activeColor:null==F?void 0:F.activeColor,activeBgColor:null==F?void 0:F.hoverBgColor,bgColor:null==F?void 0:F.bgColor,variant:"playerStandard",margin:!0!==e.subMode?"1rem auto 0 0":"0 0 0 auto",onClick:A,width:"",fontSize:"0.875rem",minWidth:"0",children:[(0,o.jsx)(g.I,{width:"1.25rem",height:"1.25rem",margin:"0 0.25rem 0 0",color:null==F?void 0:F.textColor,code:p.FI.subscribe}),"Abonnieren"]}),(0,o.jsx)(i.A,{onOpened:()=>{e.onLightboxOpened&&e.onLightboxOpened()},maxWidth:"360px",maxHeight:"500px",title:"Abonnieren",onClicked:A,active:C,children:(()=>{var e;const t=[];let n=0;const r=null==(e=k().multimediagallery)?void 0:e.podcasts;if(!r)return null;r.map((e=>{t.push(R(e,n)),n++}));let i="";var a;k().multimediagallery&&(i=null==(a=k().multimediagallery.podcast)?void 0:a.itunesLogoUrl.split("http://").join("https://"));return(0,o.jsxs)(w.LA,{open:c,children:[(0,o.jsxs)(w.Zv,{children:[(0,o.jsx)(f.h,{borderRadius:"0",imageVariant:"1x1",minWidth:"75%",url:i,margin:"0 0 1rem 0"}),(0,o.jsx)(d,{children:t})]}),c?P():null]})})()})]})}},7958:(e,t,n)=>{"use strict";n.d(t,{$U:()=>s,nm:()=>i});var r=n(3968);const i={xs:0,s:480,m:768,l:1008,xl:1480},a=(0,r.H)({breakpoints:i}),{Media:s,MediaContextProvider:o}=(i.xs,i.s,i.s,i.m,i.m,i.l,i.l,i.xl,i.xl,i.xs,i.m,i.xs,i.l,i.m,i.l,a.createMediaStyle(),a)},2968:(e,t,n)=>{"use strict";n.d(t,{FI:()=>i,Jy:()=>a,RA:()=>l,VP:()=>s,fI:()=>o});var r=n(1238);const i={video:"",internalLink:"",audio:"",audioTeaser:"",share:"",shareBoxOutline:"",popout:"",info:"",menu:"",close:"",play:"",stop:"",home:"",pause:"",image:"",imageGallery:"",skipRew:"",skipFwd:"",playlist:"",arrowLeft:"",arrowRight:"",arrowRightFull:"➔",arrowUp:"",arrowDown:"",chevronLeftScroll:"",chevronRightScroll:"",chevronLeft:"",chevronRight:"",subscribe:"",search:"",minus:"",plus:"",burger:"",refresh:"",volume:"",volumeMuted:"",checked:"",fullscreen:"",fullscreenExit:"",facebook:"",twitter:"",pinterest:"",instagram:"",google:"",mail:"",whatsapp:"",mdr:"",print:"",commentOutline:"",podcast:{rss:"",apple:"",audiothek:"",google:"",overCast:"",pocketCast:"",antennaPod:"",spotify:""}},a={playerBgGrey:"#e8ebec",playerGrey:"#626262",lightBg:"rgba(0,0,0,.2)",grey:"#827e7c",darkGrey:"#ccc",blue:"#0682d1;",white:"#fff;",red:"#ef412f",default:"#313131",mdrDarkBlue:"#004e8b",mdrLightBlue:"#1a72b6",cdu:"#000000",spd:"#e4000f",linke:"#e80099",gruene:"#65a12d",afd:"#019de0",fdp:"#feed00",electionTooldefault:"#0062ae",electionToolBeige:"#f9f9f9"},s=((0,r.i7)(["0%{transform:translate3d(0,-100%,0);}100%{transform:translate3d(0,0,0);}"]),(0,r.i7)(["0%{opacity:0;}100%{opacity:1;}"]),(0,r.i7)(["0%{opacity:1;}100%{opacity:0;}"]),r.Ay.div.withConfig({displayName:"default__Column",componentId:"sc-nhqoli-0"})(["width:",";align-items:",";margin:",";margin-bottom:",";margin-left:",";margin-top:",";justify-content:",";position:relative;padding:",";background-color:",";height:",";overflow:hidden;display:flex;flex-direction:column;flex:1 1 auto;"],(e=>e.width?e.width:"100%"),(e=>e.align?e.align:""),(e=>e.margin?e.margin:null),(e=>e.marginBottom?e.marginBottom:null),(e=>e.marginLeft?e.marginLeft:null),(e=>e.marginTop?e.marginTop:null),(e=>e.justify?e.justify:"flex-start"),(e=>e.innerPadding?e.innerPadding:"0"),(e=>e.bgColor?e.bgColor:"transparent"),(e=>e.height?e.height:"100%")));const o=r.Ay.div.withConfig({displayName:"default__Row",componentId:"sc-nhqoli-2"})(["display:flex;position:relative;padding:",";flex-direction:row;align-items:",";margin-bottom:",";margin-top:",";z-index:",";background-color:",";width:100%;flex-wrap:",";height:",";transition:",";",";"],(e=>e.innerPadding?e.innerPadding:"0"),(e=>e.align?e.align:"center"),(e=>e.marginBottom?e.marginBottom:"0"),(e=>e.marginTop?e.marginTop:"0"),(e=>e.zIndex?e.zIndex:null),(e=>e.bgColor?e.bgColor:null),(e=>!0===e.canWrap?"wrap":null),(e=>e.height?e.height:null),(e=>e.animate?"all .3s ease-out":null),(e=>e.shadowColor&&(0,r.AH)(["&:after{position:absolute;bottom:0;pointer-events:none;left:0;width:100%;height:100%;content:'';background:",";}"],(e=>e.shadowColor)))),l=r.Ay.div.withConfig({displayName:"default__OneLiner",componentId:"sc-nhqoli-3"})(["color:",";overflow:hidden;font-size:0.75rem;white-space:nowrap;text-overflow:ellipsis;line-height:1.21;margin-top:",";"],(e=>e.fontColor?e.fontColor:"#fff"),(e=>e.marginTop?e.marginTop:"0"))},6225:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={breakpoints:{xs:320,s:480,m:768,l:1008,xl:1480},global:{mainColor:"#0062ae",client:"mdr",blue:"#0062ae",channelNavigation:{color:"#313131",bgColor:"#f3f3f3",borderColor:"rgba(0,0,0,.1)",borderSubMenuColor:"rgba(49,49,49,.33)",activeColor:"#0062ae",subTextColor:"#313131",subTextActiveColor:"#313131",subTextActiveLineColor:"rgba(49,49,49,.33)",subTextHoverColor:"#313131",subTextHoverLineColor:"#313131",bgLevel1Color:"#fff"},topLevelNavigation:{color:"#fff",bgColor:"#0062ae",lineColor:"#80b0d6",shadowColor:"linear-gradient(0deg, rgba(6, 6, 30, 0.25) 0%, rgba(6, 6, 30, 0) 6px)",activeLineColor:"#fff",activeSubLineColor:"#fff",searchBtnColor:"#fff"},search:{bgColor:"#0062ae",teaserHoverBgColor:"rgba(255,255,255,.2)",teaserBgColor:"rgba(255,255,255,.1)",inputBgColor:"#fff",headlineColor:"#fff",textColor:"#fff",teaserSecondColor:"#fff",scrollbarColor:"rgba(255,255,255,0.25)",submitBtn:{textColor:"rgba(255,255,255,.5)",activeTextColor:"#fff"},pagingBtn:{bgColor:"transparent",textColor:"#fff",hoverBgColor:"rgba(255,255,255,.1)"}}},player:{mainColor:"#fff",playerBgColor:"#0062ae",hoverColor:"#0062ae",bgColor:"rgba(0,0,0,.5)"},mapStyle:{fillColor:"#0062AD",fillOpacity:1,color:"#024F8A",weight:4},radioLivestreamPlayer:{mainColor:"#fff",playerBgColor:"#0062ae",hoverColor:"#0062ae",bgColor:"#008ecf"},programList:{mainColor:"#235c7a",bgColor:"#e9e4d9",activeColor:"#d7d2c6"},podcastPlayer:{subscribeBtn:{bgColor:"#ebebeb",textColor:"#313131",hoverBgColor:"#ebebeb"},playlistBtn:{bgColor:"#ebebeb",textColor:"#313131",hoverBgColor:"#ebebeb"},teaserPlusLinks:{bgImage:"/resources/mdrde/channel/digitaleinformation/img/headphones.png",bgColor:"#0062ae",textColor:"#fff",borderColor:"rgba(255,255,255,.15)",linkBgColor:"rgba(255,255,255,.15)",linkBgColorHover:"#4089c2",btnColor:"#fff",btnBgColor:"#004e8b"},bgColor:"#E9E4D9",mainColor:"#235C7A",secondColor:"#921136",btnColor:"#98948A",btnColorText:"#e9e4d9",btnColorLight:"#fff",btnColorLightText:"#98948a",activeColor:"#235C7A"},imageGallery:{teaser:{stageTeaser:{containerBackground:"#313131",imageBackdrop:"#000000",textColor:"#fff",iconColor:"#fff",scrollbar:{backgroundColor:"rgba(255, 255, 255, 0.15)",dragColor:"rgba(255, 255, 255, 0.5)"},button:{iconColor:"#fff",iconColorHover:"#fff",iconColorFocus:"#fff",backgroundColor:"transparent",backgroundColorHover:"rgba(0, 0, 0, 0.8)",backgroundColorFocus:"rgba(0, 0, 0, 0.8)"},highlightFont:{fontFamily:"Open Sans",fontWeight:"700"}}},detail:{overview:{borderBottom:"1px solid #fff",backgroundColor:"#313131",textColorPrimary:"#fff",textColorSecondary:"#827E7C",button:{iconColor:"#fff",iconColorHover:"#313131",iconColorFocus:"#313131",backgroundColor:"rgba(0,0,0,.8)",backgroundColorHover:"#fff",backgroundColorFocus:"#fff"}},lightbox:{stage:{backgroundColor:"#000",button:{iconColor:"#fff",iconColorHover:"#313131",iconColorFocus:"#313131",backgroundColor:"rgba(0,0,0,.8)",backgroundColorHover:"#fff",backgroundColorFocus:"#fff"}},footer:{backgroundColor:"#1a1a1a",textColor:"#827E7C",button:{iconColor:"#fff",iconColorHover:"#fff",iconColorFocus:"#313131",backgroundColor:"transparent",backgroundColorHover:"rgba(0, 0, 0, 0.8)",backgroundColorFocus:"#fff"}}},highlightFont:{fontFamily:"Open Sans",fontWeight:"700"}}},sharingMenu:{trigger:{dividerColor:"#E9E4D9",button:{textColor:"#313131",iconColor:"#313131",backgroundColor:"transparent",backgroundColorHover:"#f8f6f3"}},menu:{backgroundColor:"rgba(255, 255, 255, 0.75)",dividerColor:"#E9E4D9",button:{textColor:"#313131",iconColor:"#313131",backgroundColor:"transparent",backgroundColorHover:"#f8f6f3"}}}}},1291:()=>{var e=window.jQuery;function t(e){this.controller={},this.currentKeys={},this.currentView="",this.currentFocus=null,this.initialized=!1,this.listener={},this.garbageCollector=null}window.Application=t,t.CONTROLLERS=[],t.TEMPLATES=[],t.EVENT_WINDOW_LOADED="windowLoaded",t.EVENT_FOCUS_UPDATED="focusUpdated",t.EVENT_FOCUS_DIED="focusDied",t.EVENT_CONTENT_LOADED="contentLoaded",t.EVENT_CONTENT_ADDED="contentAdded",t.EVENT_VIEW_UPDATED="viewUpdated",t.EVENT_VIEW_DIED="viewDied",t.EVENT_MOUSE_CLICKED="mouseClick",t.EVENT_MOUSE_DOWN="mouseDown",t.EVENT_MOUSE_UP="mouseUp",t.EVENT_TOUCH_START="touchStart",t.EVENT_TOUCH_MOVE="touchMove",t.EVENT_TOUCH_END="touchEnd",t.EVENT_KEY_PRESS="keyPress",t.EVENT_KEY_DOWN="keyDown",t.EVENT_KEY_UP="keyUp",t.EVENT_SEND_PIXEL="sendPixel",t.EVENT_RESIZE="resizeApp",t.HASH_CHANGE="hashChange",t.EVENT_SCROLL="scrollEvent",t.LOAD_IMAGES="loadLazyImages",t.IMAGE_LOADED="imageHasLoaded",t.EVENT_UPDATE_LIGHTBOX="EVENT_UPDATE_LIGHTBOX",t.EVENT_CLOSE_LIGHTBOX="EVENT_CLOSE_LIGHTBOX",t.SEARCH_LAYER_OPEN="EVENT_SEARCHLAYER_OPEN",t.SEARCH_LAYER_FOCUS="EVENT_SEARCHLAYER_FOCUS",t.EVENT_TRACKING="trackingEvt",t.EVENT_TRACKING_PI="trackingEvtPI",t.EVENT_TRACKING_IVW="trackingEvtIVWOnly",t.ON_RENDER_LOOP="ON_RENDER_LOOP",t.TIME_UPDATE="ON_TIMEUPDATE",t.FRAME_UPDATE="ON_FRAMEUPDATE",t.HISTORY_UPDATE="ON_POPSTATE",t.LIVESTREAM_START="LIVESTREAM_START",t.LIVESTREAM_END="LIVESTREAM_END",t.DEBOUNCE_RATE=200,t.LIGHTBOX_PLAYER_ID="lbPlayer",t.BUFFER_CONFIG={lines:13,length:1,width:8,radius:20,corners:1,rotate:0,direction:1,color:"#fff",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2e9,top:"50%",left:"50%",hwaccel:!0},t.prototype={lastScroll:-1,renderTimer:0,ticking:!0,fps:30,now:null,then:Date.now(),interval:1e3/30,delta:null,firstLoad:!1,buffer:null,init:function(){this.jq=e,this.initControllers(this.jq("html")),this.registerEvents(),this.initialized=!0,this.firstLoad=!1,""!==this.currentView&&this.dispatchEvent(t.EVENT_VIEW_UPDATED,this.currentView),e("body").hasClass("analysis")&&this.addEventListener(t.FRAME_UPDATE,this,"stickyElectionParties")},stickyElectionParties:function(){e(".votingtool.topic li").each((function(t){var n=e(this),r=n[0].getBoundingClientRect(),i=r.top,a=r.top+r.height;i<=16?(n.addClass("fixed"),a<100?n.addClass("fixed-out"):n.removeClass("fixed-out")):(n.removeClass("fixed"),n.removeClass("fixed-out"))}))},showBuffer:function(t){this.buffer=e('
'),t.append(this.buffer)},hideBuffer:function(e){e.find(".ui-pulse-loader").remove()},initControllers:function(e){for(var n=0;n2){var r=t.decodeHash(n).replace(/"$/g,""),i=e("body").find("a[name="+r+"]");void 0!==i.offset()&&setTimeout((function(){window.scrollTo({top:i.offset().top-50,behavior:"smooth"})}),0)}t.firstLoad=!0},onLightboxOpended:function(){this.lightboxOpened=!0},onLightboxClosed:function(){this.lightboxOpened=!1},onResized:function(){this.manualResize=!1},timeUpdate:function(){var e=this;setTimeout((function(){requestAnimationFrame((function(){e.timeUpdate()})),e.dispatchEvent(t.TIME_UPDATE,{})}),1e3)},frameUpdate:function(){var e=this;requestAnimationFrame((function(){e.frameUpdate()})),e.now=Date.now(),e.delta=e.now-e.then,e.delta>e.interval&&(e.then=e.now-e.delta%e.interval,e.dispatchEvent(t.FRAME_UPDATE,{}))},registerControllers:function(t,n){var r=this;e("[data-ctrl-"+t.NODE_TYPE+"]",n).each((function(){!function(e,t,n){e.registerController(t,n)}(r,t,this)}))},registerController:function(e,t){!function(e,t,n){void 0===e.controller[t.NODE_TYPE]&&(e.controller[t.NODE_TYPE]=[]);var r=new t;r.init(window.app,n,t.NODE_TYPE);var i=!1,a=r.getCtrlId();for(var s in e.controller[t.NODE_TYPE]){a===e.controller[t.NODE_TYPE][s].getCtrlId()&&(i=!0)}i||(r.preCreate(),r.createObject(),e.initialized&&""!==e.currentView&&r.handleViewUpdatedEvent(e.currentView),e.controller[t.NODE_TYPE].push(r))}(this,e,t)},findRelatedController:function(e,t){var n=[];for(var r in this.controller[t])this.controller[t][r].isRelatedTo(e)&&n.push(this.controller[t][r]);return n},getControllerById:function(e,t){var n=null;for(var r in this.controller[e])this.controller[e][r].rootConfig.id===t&&(n=this.controller[e][r]);return n},getControllerInNode:function(t,n){var r=[],i="[data-ctrl-"+n+"]";return t.find(i).each((function(t){var i=e(this),a={};try{a=JSON.parse(i.attr("data-ctrl-"+n).replace(/'/g,'"'))}catch(s){}r.push(a.id)})),r},addEventListener:function(e,t,n){if(void 0===this.listener[e]&&(this.listener[e]=[]),this.listener[e])for(var r in this.listener[e])if(this.listener[e][r].controller===t&&this.listener[e][r].functionName===n)return;this.listener[e].push({controller:t,functionName:n})},removeEventListener:function(e,t,n){if(this.listener[e]){for(var r=[],i=this.listener[e].length-1;i>=0;i--)this.listener[e][i].controller!==t||this.listener[e][i].functionName!==n&&"all"!==n||r.push(i);for(var i in r)this.listener[e].splice(r[i],1)}},removeAllEventListenerFromCtrl:function(e){for(var t in this.listener)this.removeEventListener(t,e,"all")},dispatchEvent:function(e,n){if(e==t.EVENT_VIEW_UPDATED&&(this.currentView=n,this.manualResize=!1),e==t.EVENT_FOCUS_UPDATED&&(this.currentFocus=n.target),e==t.EVENT_CONTENT_ADDED&&(this.runGarbageCollector(),this.initControllers(n)),this.initialized&&this.listener[e])for(var r in this.listener[e])this.listener[e][r].controller[this.listener[e][r].functionName](n)},runGarbageCollector:function(){var e=this,t=function(){null!==e.garbageCollector&&(window.clearTimeout(e.garbageCollector),e.garbageCollector=null)};for(var n in t(),e.controller)e.collectGarbageController(n);t()},collectGarbageController:function(e){for(var t=[],n=this.controller[e].length-1;n>=0;n--)!1===this.controller[e][n].isInDom()&&!1!==this.controller[e][n].destroyObject()&&t.push(n);for(var n in t)this.removeAllEventListenerFromCtrl(this.controller[e][t[n]]),this.controller[e].splice(t[n],1);return t},isDetailpage:function(){return e("body").hasClass("avdetailseite")},isInViewport:function(e,t){return!(this.isBelowTheFold(e,t)||this.isAboveTheTop(e,t)||this.isRightOfFold(e,t)||this.isLeftOfBegin(e,t))},isBelowTheFold:function(t,n){return e(window).height()+e(window).scrollTop()<=t.offset().top-n},isAboveTheTop:function(t,n){return e(window).scrollTop()>=t.offset().top+n+t.height()},checkViewPos:function(e){},isRightOfFold:function(e,t){var n=e.parents(".wrapper");return!(!n||!n.offset())&&e.offset().left+50>n.offset().left+n.width()},isLeftOfBegin:function(e,t){return e.offset().left<0},changeViewportClass:function(e){null!==document.documentElement.className.match(/(view-\w*)/)?document.documentElement.className=document.documentElement.className.replace(/(view-\w*)/,e):document.documentElement.className+=" "+e}}},8786:()=>{function e(){}window.AutoSlide=e;var t=window.jQuery,n=window.Application;e.prototype={view:null,visible:!1,reference:null,referenceController:null,renderSlideIndicator:!1,interval:null,callback:null,timer:0,pauseIcon:null,playIcon:null,circle:null,size:34,strokeWidth:4,TITLE_START:"Diashow starten",TITLE_STOP:"Diashow stoppen",onState:null,init:function(e){void 0!==e.interval&&(this.interval=e.interval),void 0!==e.callback&&(this.callback=e.callback),void 0!==e.onState&&(this.onState=e.onState),void 0!==e.size&&(this.size=e.size),void 0!==e.referenceController&&(this.referenceController=e.referenceController),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.onSecondUpdate&&(this.onSecondUpdate=e.onSecondUpdate),this.view=t(' '),this.renderSlideIndicator=!0,this.circle=this.view.find("path").eq(0)[0],this.pauseIcon=this.view.find(".ui-pieProgress-pause"),this.playIcon=this.view.find(".ui-pieProgress-start"),this.drawCircle(),this.referenceController.app.addEventListener(n.FRAME_UPDATE,this,"onFrameUpdate"),this.renderSlideIndicator=!0},drawCircle:function(){this.i=0;var e=this;e.angle=-90,e.radius=this.size/2-this.strokeWidth,e.realSeconds=0,e.isStarted=!0},onFrameUpdate:function(){var e=this;if(!1===e.isStarted)return!1;if(!1===e.renderSlideIndicator)return!1;var t=1/e.interval*360/30;e.angle+=t,e.angle%=360;var n=e.angle/180*Math.PI,r=e.size/2+Math.cos(n)*e.radius,i=e.size/2+Math.sin(n)*e.radius,a=e.circle.getAttribute("d");if(0==this.i)var s=a+" M "+r+" "+i;else s=a+" L "+r+" "+i;e.circle.setAttribute("d",s),this.i+=1,this.i%Math.floor(30)==0&&(e.realSeconds++,e.onSecUpdate()),this.i===30*this.interval&&(e.callback(),this.i=0,e.circle.setAttribute("d","M10 10"))},update:function(e,n){var r=this,i=t('
');e.find(".ui-pieProgressWrapper").length>0&&e.find(".ui-pieProgressWrapper").remove(),i.append(r.view),!0!==n&&e.prepend(i),r.view.off(),r.view.on("click keypress",(function(e){var n=!0;if(13!==e.which&&"keypress"===e.type&&(n=!1),!0===n)return!0===t(this).hasClass("paused")?r.play():r.pause(),!1}))},pause:function(){this.view.addClass("paused"),this.autoSlidePaused=!0,this.renderSlideIndicator=!1,this.view.attr("aria-label",this.TITLE_START),this.view.attr("title",this.TITLE_START),null!==this.onState&&this.onState("pause")},play:function(){this.view.attr("aria-label",this.TITLE_STOP),this.view.attr("title",this.TITLE_STOP),this.view.removeClass("paused"),this.autoSlidePaused=!1,this.renderSlideIndicator=!0,null!==this.onState&&this.onState("start")},onSecUpdate:function(){void 0!==this.onSecondUpdate&&this.onSecondUpdate(this.realSeconds)},reset:function(){this.circle.setAttribute("d","M0 0"),this.drawCircle()},show:function(e){if(this.visible)return!1;this.visible=!0},kill:function(){this.pause(),this.referenceController.app.removeEventListener(n.FRAME_UPDATE,this,"onFrameUpdate")},hide:function(){},toggle:function(){!0===this.renderSlideIndicator?this.renderSlideIndicator=!1:this.renderSlideIndicator=!0}}},7091:()=>{},7641:()=>{function e(){}var t=window.jQuery,n=window.Application,r=(window.app,window.Utils);window.LivestreamProgress=e,e.prototype={createObject:function(){},init:function(e){this.root=null,this.state=null,this.liveInterval=null,this.start=0,this.id=0,this.end=0,this.counter=0,this.isLoaded=null,this.url=null,this.view=null,this.teasers=null,this.channel=!1,this.startFired=!1,this.livestreamProgress=t('
'),this.livestreamProgress.hide(),this.start=e.start,this.end=e.end,this.view=e.view,this.view.append(this.livestreamProgress),this.isLoaded=!0,this.updateState(!0),"finished"!==this.state?this.startInterval():this.updateState(),!0!==e.externalControl&&this.app.addEventListener(n.TIME_UPDATE,this,"onTimeUpdate")},onTimeUpdate:function(){!0===this.isLoaded&&this.updateState()},startInterval:function(){},updateState:function(e){var t;return void 0===e&&(e=!1),this.checkState(),this.view.hasClass("now")&&this.view.addClass("active"),"upcoming"===this.state||"soon"===this.state?Math.ceil((this.broadcastStartDateSeconds-this.dateCurrentSeconds)/60):"now"!==this.state&&"finished"!==this.state||(Math.ceil((this.broadcastEndDateSeconds-this.dateCurrentSeconds)/60)>0?(t=(this.dateCurrentSeconds-this.broadcastStartDateSeconds)/(this.broadcastEndDateSeconds-this.broadcastStartDateSeconds)*100,this.livestreamProgress.find("div").css({width:t+"%"})):(this.livestreamProgress.find("div").css({width:"100%"}),this.checkState("finished"))),this.setUI(this.state),!0},checkState:function(e){this.dateCurrentSeconds=r.getDateCurrent(this.start).getTime()/1e3,this.broadcastStartDateSeconds=this.getBroadcastStartDate().getTime()/1e3,this.broadcastEndDateSeconds=this.getBroadcastEndDate().getTime()/1e3;var t="";this.broadcastStartDateSeconds-this.dateCurrentSeconds>600||this.dateCurrentSeconds{function e(){}window.Polyfills=e;var t=window.jQuery,n=window.Application;e.prototype={init:function(){var e=this;window.app.addEventListener(n.EVENT_RESIZE,this,"onResize"),window.app.addEventListener(n.EVENT_CONTENT_ADDED,this,"onResize"),window.app.addEventListener(n.HASH_CHANGE,this,"onHashChange"),t(".webzeitRelativ").each((function(n){var r=t(this);if(0===r.find(".box").length)return e.setRelativeWebtime(r),!1;r.find(".box").each((function(n){e.setRelativeWebtime(t(this))}))})),t(".webzeitAlsDachzeile").each((function(n){var r=t(this);if(0===r.find(".box").length)return e.moveWebtime(r),!1;r.find(".box").each((function(n){e.moveWebtime(t(this))}))})),t(".spio-headline-time").each((function(e){const n=t(this),r=n.attr("data-timestamp"),i=n.find(".match-date");if(r&&i&&i[0]){const e=new Date(r),t=new Date,n=new Date;n.setDate(n.getDate()+1),t.toDateString()===e.toDateString()?i.text("heute"):n.toDateString()===e.toDateString()&&i.text("morgen")}})),this.onResize()},moveWebtime:function(e){var n=e.find(".webtime");if(!n||0===n.length)return!1;var r=n.clone().html(),i=e.find("h4.shortHeadline");if(i.find(".dachzeile").length>0)i.find(".dachzeile").html(r);else{var a=t(''+r+"");i.prepend(a)}n.remove()},setRelativeWebtime:function(e){var t=e.find(".webtime");if(t&&t.length>0){var n=Utils.relativeDate(Utils.getWebtimeDate(t.text()));n&&t.html(n)}},onHashChange:function(e){e.preventDefault();var n=document.location.hash.substring(1);if(-1!==n.indexOf("sprung")){var r=t("body").find('a[name="'+n+'"]');window.scrollTo({top:r.offset().top-60,behavior:"smooth"})}},equalHeight:function(e){var n=e.container,r=t(e.items),i=e.offsetY||0,a=[],s=0;if(null===n)return!1;function o(e){var t=0;for(var n in e)e[n].attr("style","height: auto;"),e[n].height()>t&&(t=e[n].height());for(var n in e)e[n].height(t+i)}n.find(r).each((function(e){var r=t(this),i=r.offset(),l=n.offset();if(null===l)return!1;if(l.top===i.top)return!1;var u=Math.round(i.top);u!==s&&0!=s&&(o(a),a=[],i=(r=t(this)).offset(),u=Math.round(i.top)),s=u,a.push(r)})),o(a)},onResize:function(){var e=this;!1===t("html").hasClass("flexbox")&&this.equalHeight({container:t("html:not(.flexbox) .con:not(.conPinboard) .mod:not(.modA)"),items:".box"}),t("#content select").not("[multiple=multiple]").each((function(){e.styleSelectbox(t(this))}))},styleSelectbox:function(e){if(!e.hasClass("ui-skinned")&&!e.hasClass("the-datepicker__select")){var n=t('
'),r=t('');n.append(e.prev());var i=e.parent();e.addClass("ui-skinned"),n.append(e),n.find(".label").remove(),n.append(r),i.append(n),n.find("button").remove(),r.html(e.find(":selected").text()),e.change((function(t){r.html(e.find(":selected").text())})),e.on("focus",(function(t){e.parent().addClass("focus")})),e.on("blur",(function(t){e.parent().removeClass("focus")}))}return n}}},6217:()=>{function e(){}window.ReloadButton=e;var t=window.jQuery;window.Application,window.app;e.BASE_URL="/api/v1/sophora/updateInfo/documentBySophoraId/",e.prototype={view:null,intv:0,lastModTime:0,lastEntryPos:0,lastChecksum:null,btn:null,needsReload:!1,pingInterval:6e4,maxDateDiff:432e5,init:function(e){this.view=e.view,this.start()},start:function(){var e=this;this.btn=t(''),e.view.append(e.btn),this.btn.on("click",(function(n){t(this).hasClass("scrollToLastEntry")?window.scrollTo({top:e.lastEntryPos,behavior:"smooth"}):document.location.reload()})),this.intv=setInterval((function(){e.ping(e.view.data().id)}),e.pingInterval),e.ping(e.view.data().id)},ping:function(t){var n=this;$.ajax({url:e.BASE_URL+t,async:!0,error:function(e){log(e)}}).done((function(e,t,r){if(e&&e.result&&e.modificationTime){var i=(new Date).getTime();if(r.getResponseHeader("Date"))i=new Date(r.getResponseHeader("Date")).getTime();var a=new Date(e.modificationTime).getTime(),s=new Date(n.lastModTime).getTime();i-a>n.maxDateDiff&&clearInterval(n.intv),(0!==s&&a!==s||n.needsReload)&&(n.btn.html("Diese Seite wurde aktualisiert. Klicken Sie hier, um sie neu zu laden."),n.needsReload=!0,clearInterval(n.intv),n.btn.addClass("active")),n.btn.addClass("ready"),n.lastModTime=e.modificationTime}}))}}},9038:()=>{function e(){}var t=window.jQuery;window.Application,window.app;window.TickerArticle=e,e.prototype={view:null,init:function(e){this.view=e.view,this.view.addClass("ui-tickerArticle");var n=!1,r=!1;this.view.find(".sectionDetailPage .con").each((function(e){var i=t(this);i.find("h3.subtitle").each((function(){var e=t(this);if(-1!==e.text().indexOf("|")){n=!0;var r=e.clone();r.addClass("ui-tickerArticle-title"),r.html(""+e[0].innerHTML.split("|")[0]+""),e.html(e[0].innerHTML.split("|")[1]),r.insertBefore(e)}})),!0!==n||r||i.addClass("ui-tickerArticle-con"),!0!==r&&(r=i.find(".endTickerMode").length>0)&&i.addClass("endTickerMode")})),this.view.find(".con.ui-tickerArticle-con").last().addClass("ui-tickerArticle-con-last")}}},6477:()=>{function e(){}var t=window.jQuery,n=window.Application;window.app;window.Tracking=e;var r=window.Utils;e.prototype={lightboxTracked:!1,lightboxOpened:!1,firststart:!0,atiTag:null,atiOptOut:!1,originAtiPage:null,originAtiCustom:null,settings:{agf:!0,ati:!0},init:function(){var e=this;this.getSettings(),window.app.addEventListener(n.EVENT_TRACKING,this,"track"),window.app.addEventListener(n.EVENT_TRACKING_PI,this,"trackStandardPixel"),window.app.addEventListener(n.EVENT_CLOSE_LIGHTBOX,this,"onLightboxClosed"),t("body").on("click","#footer a,#breadcrumb a, .cssLinkArd a,.mod:not(.modSearch) .box a.linkAll, .mod:not(.modSearch) .mediaCon a, .linklist li a, h2.pageAreaTitle a, h3.conHeadline a, #jumpHeader .channelLogo a, .teaser.special .multiGroupNavi.multiGroupNaviTags .pageItem, .cssIpgLink.livestreamLink, .spio-page-nav a",(function(n){var r=t(this)[0],i=t(this),a="action",s="unbekannt";t(this).parents(".cssLinkArd").length>0&&(a="exit",s="ARD Extern"),(t(this).parents("#breadcrumb").length>0||t(this).parents("#footer").length>0||t(this).parents("#jumpHeader").length>0||t(this).parents(".tagList").length>0||t(this).parents(".multiGroupNavi.multiGroupNaviTags").length>0)&&(a="navigation",s="Top-Navigation",t(this).parents("#breadcrumb").length>0&&(s="Breadcrumb-Navigation"),t(this).parents("#footer").length>0&&(s="Footer-Navigation"),(t(this).parents(".tagList").length>0||t(this).parents(".multiGroupNavi.multiGroupNaviTags").length>0)&&(s="Tags-Navigation")),t(this).parents(".boxIpgTeaser").length>0&&(s="livestreamlink"),t(this).parents(".spio-page-con").length>0&&(s="navigation");var o={elem:r.target?void 0:r,name:"unbekannt"===s?e.getAtiNameBasedOnItem(i):s,type:a};window.pianoMdr.track(o.type,o)}))},onLightboxShow:function(){this.lightboxOpened=!0},onLightboxOpended:function(){this.lightboxOpened=!0},onLightboxClosed:function(){this.lightboxOpened=!1},deactivateAllTracking:function(){this.settings={ivw:!1,ati:!1,agf:!1}},getSettings:function(){window.navigator&&!1===window.navigator.cookieEnabled&&this.deactivateAllTracking();try{if(window.localStorage){var e=window.localStorage.getItem("mdrSettings");null!==e&&(this.settings=JSON.parse(e).tracking,this.settings.ivw&&(this.settings.ivw=!1))}}catch(t){this.deactivateAllTracking()}},trackStandardPixel:function(e){this.settings&&!0===this.settings.ati&&!0===this.firststart&&window.pianoMdr.track("view"),this.firststart=!1},getSearchWord:function(){var e=null;return r.getDocumentUrlVars()[0]&&"q"===r.getDocumentUrlVars()[0].searchWord&&(e=r.getDocumentUrlVars()[0].value),e},formatAtiParam:function(e){return encodeURIComponent(e).replace(/-/g,"%2D").replace(/_/g,"%5F")},getAtiNameBasedOnItem:function(e,n){var r,i=(e=t(e)).parents(".con").eq(0).find(">h3.conHeadline:not(.hidden)").text();return 0===i.length&&(i=e.parents(".section").find("h3.conHeadline:not(.hidden)").text()),0===i.length&&(i=e.parents(".sectionWrapper").find(".sectionTitle:not(.hidden) h2").text()),0===i.length&&(i=e.parents(".sectionDetailPage").find("h1").text()),0===i.length&&(i="unbekannt"),this.getSearchWord()&&(i=this.getSearchWord()),r=i,this.formatAtiParam(r)},getTitleForAtiItem:function(e,n){var r="unbekannt",i=(e=t(e)).parents(".box").eq(0);r=e.attr("title")||e.find("a").first().attr("title")||e.find(".linktext").first().text()||e.find(".linkText").first().text()||e.text(),1===e.length&&"A"===e[0].nodeName&&0===e[0].childElementCount&&(r=e.text());var a=i.find(".shortHeadline").text()||e.find(".shortHeadline").text();return a&&(r=a),this.formatAtiParam(r)},trackClicks:function(e,t){window.pianoMdr.track(e.type,e)},fireIVW:function(e){},getCookie:function(e){for(var t=e+"=",n=decodeURIComponent(document.cookie).split(";"),r=0;r{function e(){}var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.AVPlusController=e,e.NODE_TYPE="avplus",e.TEMPLATE_SLIDER=null,e.prototype=t.extend(new r,{created:!1,data:null,cont:null,galleryComp:null,loaded:!1,index:0,mode:"inline",nextImage:null,cues:[],activeCues:[],themeNode:null,contNode:null,chapters:[],contents:null,target:null,player:null,firstSeek:null,lbImageEntries:null,createObject:function(){this.activeCues=[],("layer"===this.rootConfig.forceMode||this.isDetail())&&this.view.find(".mediaCon").addClass("avActivePlay"),this.rootNode.className.includes("boxSpecial")||this.addListener()},addListener:function(){var e=this;this.view.on("click.avplus",(function(t){return e.startAvPlusPlayer(0),!1}))},isDetail:function(){return t("body").hasClass("cssAvPlus")},startAvPlusPlayer:function(e){if(void 0===e&&(e=0),this.view.off("click.avplus"),"layer"===this.rootConfig.forceMode||this.isDetail()){var t=this;t.mode;t.rootConfig.plusContent=t.rootConfig.jsonUrl,window.renderARDPlayer(this,"layer"===this.rootConfig.forceMode)}else document.location.href=this.view.find(".linkAll").eq(0).attr("href")}}),n.CONTROLLERS.push(e)},9046:()=>{function e(){}var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.AudioSlideshowController=e,e.NODE_TYPE="audioslideshow",e.TEMPLATE_SLIDER=null,e.prototype=t.extend(new r,{created:!1,data:null,cont:null,galleryComp:null,loaded:!1,index:0,mode:"inline",nextImage:null,cues:[],activeCues:[],themeNode:null,contNode:null,chapters:[],contents:null,target:null,player:null,inViewport:!1,firstSeek:null,lbImageEntries:null,createObject:function(){this.activeCues=[],("layer"===this.rootConfig.forceMode||this.isDetail())&&this.view.find(".mediaCon").addClass("avActivePlay"),0===this.view.parents(".linklist").length&&this.addListener()},testScrolling:function(){!0===this.app.isInViewport(this.view,2)&&(this.inViewport=!0),this.inViewport&&(this.app.removeEventListener(n.FRAME_UPDATE,this,"testScrolling"),this.start(0))},isDetail:function(){return t("body").hasClass("cssAudioSlideShow")},addListener:function(){this.target=this.view,this.app.addEventListener(n.FRAME_UPDATE,this,"testScrolling")},start:function(e){void 0===e&&(e=0);this.rootConfig.galleryContent=this.rootConfig.jsonUrl,this.isDetail()&&this.view.off("click.audioslideshow"),window.renderARDPlayer(this,!1,!0)}}),n.CONTROLLERS.push(e)},4505:()=>{function e(){}e.NODE_TYPE="data-ctrl",e.CLASS_ACTIVE="active";var t=window.jQuery,n=window.Application;window.BaseController=e,e.prototype={init:function(e,n,r){this.app=e,this.rootNode=n,this.nodeType=r,this.view=t(this.rootNode),this.rootConfig=this.getConfig(this.rootNode,r)},preCreate:function(){this.addBaseEventListener()},createObject:function(){},destroyObject:function(){},addBaseEventListener:function(){if(!1===this.view.is(":visible"))return!1;this.app.addEventListener(n.EVENT_VIEW_UPDATED,this,"handleViewUpdatedEvent"),this.app.addEventListener(n.EVENT_VIEW_DIED,this,"handleViewDiedEvent"),this.app.addEventListener(n.EVENT_WINDOW_LOADED,this,"handleWindowLoadedEvent"),this.app.addEventListener(n.EVENT_RESIZE,this,"onResize")},onResize:function(){},handleViewUpdatedEvent:function(e){},handleViewDiedEvent:function(e){},getTapEvent:function(){var e="click";return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(e="touchstart"),e},handleWindowLoadedEvent:function(e){},load:function(e){void 0===e&&(e={}),void 0===e.url&&(e.url=""),void 0===e.method&&(e.method="GET"),void 0===e.data&&(e.data={}),void 0===e.type&&(e.type="html"),void 0===e.async&&(e.async=!0);var n=t.Deferred();return"undefined"!=typeof Pace&&!0!==e.nopace&&Pace.restart(),t.ajax({url:e.url,dataType:e.type,type:e.method,async:e.async,data:e.data,error:function(t){void 0!==e.onError&&e.onError(t)},success:function(e){}}).done((function(t){void 0!==e.onComplete&&e.onComplete(t),n.resolve(t)})),n.promise()},isInDom:function(){return t.contains(document.documentElement,this.rootNode)},isChildNode:function(e,n){return!!t(n).has(t(e)).length},makeActive:function(n){t(n).addClass(e.CLASS_ACTIVE)},isActive:function(n){return t(n).hasClass(e.CLASS_ACTIVE)},makeInactive:function(n){t(n).removeClass(e.CLASS_ACTIVE)},getActive:function(n){return t("."+e.CLASS_ACTIVE,n)},getConfig:function(n,r){var i=""!=this.getCtrlId()?"-"+this.getCtrlId():"",a={id:"",action:{}},s=t(n).attr(e.NODE_TYPE+i+"-"+r);if(""!=s&&"{}"!=s)try{a=JSON.parse(s.replace(/'/g,'"'))}catch(o){}return a},getCtrlId:function(){return this.rootConfig&&this.rootConfig.id?this.rootConfig.id:""},getCtrlRelatedNodes:function(n,r){var i=""!=this.getCtrlId()?"-"+this.getCtrlId():"",a="";if(n instanceof Array)for(var s in n)a+=""===a?n[s]:"-"+n[s];else a=n;return t("["+e.NODE_TYPE+i+"-"+a+"]",r)},getCtrlRelatedObjects:function(e,n){var r=[],i=this,a="";if(e instanceof Array)for(var s in e)a+=""===a?e[s]:"-"+e[s];else a=e;return this.getCtrlRelatedNodes(a).each((function(){var e={};e.config=i.getConfig(this,a),e.node=t(this),r.push(e)})),r},bindEventToObjects:function(e,t,n){for(var r in e)!function(e,r){r[e].node.on(t,(function(){return n(r[e],e)}))}(r,e)},isRelatedTo:function(e){if(""!=e.getCtrlId()&&this.rootConfig.related)for(var t in this.rootConfig.related)if(this.rootConfig.related[t]===e.getCtrlId())return!0;return!1},getActiveAction:function(e,t){var n=e&&e.default?e.default:[];return n=e&&e[t]?e[t]:n},getPageName:function(){return t("body").attr("class")},getContext:function(e){return this.app.jq(e).attr("id").match(/ardbox\-[0-9_]+\-(.+)/)&&RegExp.$1||""},getDocumentID:function(e){return this.app.jq(e).attr("id").match(/ardbox\-([0-9_]+)\-/)&&RegExp.$1||""}}},9762:()=>{function e(){}e.NODE_TYPE="collapsible",e.NODE_TYPE_ENTRY="entry",e.NODE_TYPE_ENTRY_TRIGGER="trigger",e.NODE_TYPE_ENTRY_BODY="body",e.CLASS_COLLAPSED="collapsed",e.CLASS_ARROW="collapseArrow",e.CLASS_HAS_ARROW="hasArrow",e.EVENT_CHANGED="collapse-hasChanged";var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.CollapsibleController=e,e.prototype=t.extend(new r,{built:!1,type:"akkordion",isForceTabbed:!1,onOpen:function(){},createObject:function(){this.buildController()},buildController:function(n){if(!0===this.built)return!1;if(!1===this.view.is(":visible")&&!0!==n)return!1;this.built=!0;var r=this;if(this.currentEntry=0,this.buffer={lines:10,length:3,width:2,radius:4,color:"#000",speed:1,trail:60,shadow:!1},this.firststart=!0,this.preventAutosetCollapseClass=!1,this.disabled=!1,this.touchMoved=!1,this.closeEntriesOnVanish=!1,this.refreshOnAdded=!1,this.isReady=!1,this.isIPG=!1,this.rootConfig.refreshOnAdded&&(this.refreshOnAdded=!0),void 0!==this.rootConfig.preventAutosetCollapseClass&&(this.preventAutosetCollapseClass=!0),this.entries=this.getCtrlRelatedObjects(e.NODE_TYPE_ENTRY,this.rootNode),!0===t("body").hasClass("cssArticle")&&r.view.addClass("paragraphsCollapsible"),this.view.parents(".box.votingtool").length>0&&(this.isForceTabbed=!0),!0===t("body").hasClass("cssIpgDay cssIpg")&&(this.isIPG=!0),0===this.entries.length&&r.view.find(".ui-collapsible-entry").each((function(e){var n=t(this),i={node:n,config:Utils.parseParamsStringToObject(n.attr("data-ctrl-collapsible-entry"))};r.entries.push(i)})),0===this.entries.length)return!1;for(var i in this.entries){if(this.entries[i].trigger=this.getCtrlRelatedObjects([this.entries[i].config.id,e.NODE_TYPE_ENTRY_TRIGGER],this.rootNode)[0],void 0===this.entries[i].trigger){var a=this.entries[i].node.find(".ui-collapsible-trigger").eq(0);this.entries[i].trigger={node:a,config:Utils.parseParamsStringToObject(a.attr("data-ctrl-collapsible-trigger"))}}this.entries[i].trigger.justClicked=!1,this.entries[i].trigger.justClickedTimer=null,this.entries[i].disabled=!1,this.entries[i].trigger.node.attr("tabindex",0),this.appendArrowNode(this.entries[i].trigger),function(e,t){t.entries[e].trigger.node.on("click keypress",(function(n){if(!t.disabled){var r=!0;return 13!==n.which&&"keypress"===n.type&&(r=!1),!0===r&&t.handleTriggerAction(t.entries[e],e),!1}}))}(i,this)}this.handleArrows(),"true"!==this.rootConfig.startOnClick&&this.setup()},onResize:function(){this.isForceTabbed&&this.setContainerHeight()},handleAccKeyboardFocus:function(e){var t=document.querySelectorAll("[data-ctrl-acc-entry]"),n=Array.prototype.slice.call(t),r=e.target.parentNode,i=n.indexOf(r);r.classList.add("has-key-focus"),9===e.keyCode&&(this.closeEntries(),this.openBody(this.entries[i]))},setup:function(){var t,n=this;for(var r in this.entries){if(t=this.entries[r],document.querySelectorAll("[data-ctrl-acc-entry]").length>0&&t.node[0].childNodes[1].addEventListener("keyup",this.handleAccKeyboardFocus.bind(this)),t.body=this.getCtrlRelatedObjects([t.config.id,e.NODE_TYPE_ENTRY_BODY],this.rootNode)[0],void 0===t.body){var i=t.node.find(".ui-collapsible-body").eq(0);t.body={node:i,config:Utils.parseParamsStringToObject(i.attr("data-ctrl-collapsible-body"))}}t.collapsed=t.body.node.is(":visible"),function(e,t){t.entries[e].body.node.find("a:last").blur((function(){t.handleBlurAction(t.entries[e],e)}))}(r,this)}if(this.isReady=!0,this.handleRootAction("init"),this.handleEntryAction("init"),this.isForceTabbed){this.setContainerHeight(this.entries[0]);new MutationObserver((function(e,t){n.setContainerHeight()})).observe(this.view[0],{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})}},setContainerHeight:function(e){e||(e=this.currentEntry),e&&!0!==e.collapsed||(e=this.entries[0]),e.body.node.show().css({height:"auto",opacity:"1"}),this.view.css("min-height","");var t=this.view[0].getBoundingClientRect().height,n=e.body.node[0].getBoundingClientRect().height;this.view.css("min-height",t+n)},handleEventListener:function(){!0===this.disabled?(this.app.removeEventListener(n.EVENT_CONTENT_ADDED,this,"handleContentAddedEvent"),this.app.removeEventListener(n.EVENT_MOUSE_CLICKED,this,"handleMouseClickedEvent"),this.app.removeEventListener(n.EVENT_TOUCH_MOVE,this,"handleTouchMoveEvent"),this.app.removeEventListener(n.EVENT_TOUCH_END,this,"handleTouchEndEvent")):(!0===this.closeEntriesOnVanish?(this.app.addEventListener(n.EVENT_MOUSE_CLICKED,this,"handleMouseClickedEvent"),this.app.addEventListener(n.EVENT_TOUCH_MOVE,this,"handleTouchMoveEvent"),this.app.addEventListener(n.EVENT_TOUCH_END,this,"handleTouchEndEvent")):(this.app.removeEventListener(n.EVENT_MOUSE_CLICKED,this,"handleMouseClickedEvent"),this.app.removeEventListener(n.EVENT_TOUCH_MOVE,this,"handleTouchMoveEvent"),this.app.removeEventListener(n.EVENT_TOUCH_END,this,"handleTouchEndEvent")),!0===this.refreshOnAdded?this.app.addEventListener(n.EVENT_CONTENT_ADDED,this,"handleContentAddedEvent"):this.app.removeEventListener(n.EVENT_CONTENT_ADDED,this,"handleContentAddedEvent"))},handleContentAddedEvent:function(e){if(!0===this.refreshOnAdded&&this.isChildNode(e,this.rootNode)){for(var t in this.entries)if(this.isChildNode(e,this.entries[t].body.node)||e===this.rootNode)return;this.createObject(),this.handleViewUpdatedEvent(this.app.currentView)}},handleViewUpdatedEvent:function(e){!1===this.built&&this.buildController(),this.isReady&&(this.handleRootAction(e),this.handleEntryAction(e))},handleMouseClickedEvent:function(e){this.closeAllOnVanish(e)},handleTouchMoveEvent:function(e){this.disabled||!0===this.touchMoved||(this.touchMoved=!0)},handleTouchEndEvent:function(e){this.disabled||(this.touchMoved||this.closeAllOnVanish(e),this.touchMoved=!1)},handleBlurAction:function(e,t){if(!this.disabled){window.setTimeout((function(){}),150)}},closeAllOnVanish:function(e){!this.disabled&&this.closeEntriesOnVanish&&(0!==this.getOpenEntries().length&&(this.isChildNode(e.target,this.rootNode)||(this.closeEntries(),e.preventDefault())))},getOpenEntries:function(){var e=[];for(var t in this.entries)this.entries[t].collapsed||e.push(this.entries[t]);return e},triggerClicked:function(e){e.justClicked=!0;var t=function(){null!==e.justClickedTimer&&(window.clearTimeout(e.justClickedTimer),e.justClickedTimer=null)};t(),e.justClickedTimer=window.setTimeout((function(){e.justClicked=!1,t()}),300)},handleRootAction:function(e){if(!1===this.built&&this.buildController(),this.isReady){var t=this.getActiveAction(this.rootConfig.action,e);if(this.closeEntriesOnVanish=!1,this.preventAutosetCollapseClass)for(var n in this.entries)this.entries[n].collapsed=!0,this.updateClasses(this.entries[n]);for(var n in t)switch(t[n]){case"enable":this.enable();break;case"disable":this.disable();break;case"openEntries":this.openEntries();break;case"closeEntries":this.closeEntries();break;case"closeEntriesOnVanish":this.closeEntriesOnVanish=!0}this.handleEventListener()}},handleEntryAction:function(e){if(!this.disabled)for(var t in this.entries){var n=this.getActiveAction(this.entries[t].config.action,e);for(var r in this.enableEntry(this.entries[t]),n)switch(n[r]){case"disable":this.disableEntry(this.entries[t]);break;case"openBody":this.openBody(this.entries[t])}}},handleTriggerAction:function(e,t){if(this.isReady||this.setup(),!this.disabled){var r=this.getActiveAction(e.trigger.config.action,this.app.currentView),i=e.trigger.config.reloadUrl,a=!1;if(void 0!==e.loaded?a=!1:void 0!==i&&(a=!0),!1===a){for(var s in r)switch(r[s]){case"toggleBody":this.toggleBody(e);break;case"openBody":this.openBody(e);break;case"closeOtherEntries":this.isIPG||this.closeOtherEntries(t)}this.app.dispatchEvent(n.EVENT_CONTENT_LOADED,e.body.node[0])}else this.reload(i,e)}},reload:function(e,r){var i=this;this.disabled=!0,r.trigger.node.addClass("loading"),window.app.showBuffer(r.trigger.node),t.ajax({url:e,dataType:"html",method:"GET",error:function(e){},success:function(e){t(r.body.node).html(e),t((function(){i.app.dispatchEvent(n.EVENT_CONTENT_ADDED,r.node)})),i.toggleBody(r),r.trigger.node.removeClass("loading"),window.app.hideBuffer(r.trigger.node),r.loaded=!0,i.disabled=!1}})},enable:function(){this.disabled=!1,this.handleArrows()},disable:function(){this.disabled=!0,this.handleArrows()},enableEntry:function(e){this.showArrowNode(e.trigger),e.disabled=!1},disableEntry:function(e){this.hideArrowNode(e.trigger),e.disabled=!0},openEntries:function(e){var t=this;for(var r in this.entries)this.entries[r].body.node.show().css({opacity:1,height:"auto"}).addClass("open"),this.entries[r].collapsed=!1,this.preventAutosetCollapseClass||this.updateClasses(this.entries[r]);setTimeout((function(){t.app.dispatchEvent(n.EVENT_CONTENT_ADDED,t.view)}),50)},closeEntries:function(){for(var e in this.entries)this.entries[e].body.node.hide().removeClass("open"),this.entries[e].body.node.css({opacity:0,height:0}),this.entries[e].collapsed=!0,this.preventAutosetCollapseClass||this.updateClasses(this.entries[e])},closeOtherEntries:function(e){for(var t in this.entries)t!==e&&(this.entries[t].body.node.hide(),this.entries[t].collapsed=!0,this.updateClasses(this.entries[t]))},openBody:function(e){if(void 0===e)return!1;if(!1!==e.collapsed){var t=this;t.view.removeClass("collapsible-open"),e.collapsed=!1,e.body.node.slideDown(0,(function(){t.updateClasses(e)})),e.body.node.css({opacity:1,height:"auto"}),e.body.node.addClass("open"),t.currentEntry=e,t.onOpen(e),e.trigger.node.attr("aria-expanded","true").attr("aria-label","Navigation aufgeklappt"),setTimeout((function(){t.app.dispatchEvent(n.EVENT_CONTENT_ADDED,t.view),t.view.addClass("collapsible-open")}),50)}},closeBody:function(e){if(!0!==e.collapsed){var t=this;e.collapsed=!0,e.body.node.slideUp(0,(function(){t.updateClasses(e)})),e.body.node.css({opacity:0,height:0}),e.body.node.removeClass("open"),t.view.removeClass("collapsible-open"),e.trigger.node.attr("aria-expanded","false").attr("aria-label","Navigation zugeklappt"),e.trigger.node.blur()}},toggleBody:function(e){var t=this;e.body.node.is(":visible")?t.closeBody(e):(t.openBody(e),window.app.dispatchEvent(n.EVENT_TRACKING,{type:"view",name:t.type,view:"view",action:"view",item:e.trigger.node}))},appendArrowNode:function(n){n.arrowNode=t(''),n.node.append(n.arrowNode).addClass(e.CLASS_HAS_ARROW),n.node.attr("aria-expanded","false")},hideArrowNode:function(t){t.arrowNode.hide(),t.node.removeClass(e.CLASS_HAS_ARROW)},showArrowNode:function(t){t.arrowNode.show(),t.node.addClass(e.CLASS_HAS_ARROW)},handleArrows:function(){for(var e in this.entries)!0!==this.disabled?(this.entries[e].trigger.arrowNode.show(),this.entries[e].trigger.node.css({position:"relative",cursor:"pointer"}),this.entries[e].node.removeClass("disabled")):(this.entries[e].trigger.arrowNode.attr("style","").hide(),this.entries[e].trigger.node.css({position:"static",cursor:"default"}),this.entries[e].node.addClass("disabled"))},updateClasses:function(n){n.collapsed||(n.trigger.node.removeClass(e.CLASS_COLLAPSED),t(n.node).removeClass(e.CLASS_COLLAPSED)),n.collapsed&&(n.trigger.node.addClass(e.CLASS_COLLAPSED),t(n.node).addClass(e.CLASS_COLLAPSED))}}),n.CONTROLLERS.push(e)},330:()=>{function e(){}e.NODE_TYPE="filtering",e.NODE_TYPE_TRIGGER="trigger",e.NODE_TYPE_SORT="sort",e.NODE_TYPE_TARGET="target",e.NODE_TYPE_FILTER_RELOAD="filterReload",e.NODE_TYPE_FLEXLOAD="flexloadtrigger";var t=window.jQuery,n=window.Application;window.BaseController,window.app;window.FilterController=e,e.prototype=t.extend(new FormularController,{target:null,selectedFilters:[],filterReloadTarget:null,sortFilters:[],changeFilters:[],isLoading:!1,endlessStopped:!1,endlessPage:0,numItems:11,createObject:function(){var t=this;this.inputs=this.getCtrlRelatedObjects(e.NODE_TYPE_INPUT,this.rootNode),this.target=this.getCtrlRelatedObjects(e.NODE_TYPE_TARGET,this.rootNode)[0],this.addFlexloadTrigger(),void 0!==this.rootConfig.numItems&&(this.numItems=this.rootConfig.numItems),this.bindEventToObjects(this.inputs,"focus",(function(e,n){return t.handleInputFocusAction(e,n)})),this.bindEventToObjects(this.inputs,"blur",(function(e,n){return t.handleInputBlurAction(e,n)}));var n=this.target.node.data().params;void 0!==n&&(t.checkFlexLoaderVisible(this.target.node),t.endlessParams=Utils.parseData(n)),this.bindDynamicFilterListener(),this.checkSortTrigger(this.getActiveTrigger(),this.sortTriggers)},bindDynamicFilterListener:function(){var r=this;this.triggers=this.getCtrlRelatedObjects(e.NODE_TYPE_TRIGGER,this.rootNode),this.sortTriggers=this.getCtrlRelatedObjects(e.NODE_TYPE_SORT,this.rootNode),this.filterReloadTarget=this.getCtrlRelatedObjects(e.NODE_TYPE_FILTER_RELOAD,this.rootNode)[0],this.bindEventToObjects(this.sortTriggers,"click",(function(e,t){return r.handleTriggerAction(e,t)})),t(this.triggers).each((function(e){var t=r.triggers[e];"select"!==t.node[0].tagName.toLowerCase()?t.node.on("click",(function(n){return r.handleTriggerAction(t,e),!1})):(t.isSelectbox=!0,t.node.on("change",(function(n){return t.lastSelectValue=t.selectValue,t.selectValue=t.node.val(),r.handleTriggerAction(t,e),!1})))})),r.target.node.find(".teaser").each((function(){const e=t(this),i=e.find(".headline").text(),a=e.find(".linkAll").attr("href");e.on("click",(t=>{r.app.dispatchEvent(n.EVENT_TRACKING,{name:r.endlessParams.q,type:"action",chapter2:i,chapter3:a,action:"searchResults",internalSearch:{keyword:r.endlessParams.q,resultPageNumber:Number(r.endlessParams.page)+1,ise_click_rank:e.index()}})}))}))},addFlexloadTrigger:function(){this.flexloadtrigger=this.getCtrlRelatedObjects(e.NODE_TYPE_FLEXLOAD,this.rootNode)[0];var t=this;void 0!==this.flexloadtrigger&&(this.flexloadtrigger.node.removeAttr("href"),this.flexloadtrigger.node.on("click",(function(){return t.handleFlexload(),!1})))},getActiveTrigger:function(){var e=this,n=null;return t(this.sortTriggers).each((function(t){var r=e.sortTriggers[t];r.node.hasClass("active")&&(n=r)})),n},toggleTrigger:function(e){var n=this;t(this.triggers).each((function(e){n.triggers[e].node.removeClass("active")})),e.node.hasClass("active")?(e.active=!1,e.node.removeClass("hover active"),e.node.parent().blur(),e.node.blur(),this.selectedFilters=[e.config.id]):(e.active=!0,e.node.addClass("active").focus(),e.node.blur(),this.selectedFilters=[void 0!==e.selectValue?e.selectValue:e.config.id])},onChangeTrigger:function(e){this.changeFilters.splice(t.inArray(e.lastSelectValue,this.selectedFilters),1),e.selectValue.length>0&&this.changeFilters.push(e.selectValue)},checkSortTrigger:function(e,n){t(n).each((function(t){n[t].node.removeClass("active"),e===n[t]&&e.node.addClass("active")})),this.sortFilter=e},handleViewUpdatedEvent:function(e){},handleViewDiedEvent:function(e){},handleTriggerAction:function(e,t){var n=this.getActiveAction(e.config.action,this.app.currentView);for(var r in n)switch(n[r]){case"submit":this.reload(e.config);break;case"filter":!1===e.node.hasClass("disabled")&&(!0!==e.isSelectbox?this.toggleTrigger(e):this.onChangeTrigger(e),this.loadFragment(e,!1,!0));break;case"sort":!1===e.node.hasClass("disabled")&&(this.checkSortTrigger(e,this.sortTriggers),this.loadFragment(e,!1,!0))}return!1},handleFlexload:function(){this.isLoading=!1,this.loadFragment(this.flexloadtrigger,!0)},bindEndlessScroller:function(){var e=this;e.scrollId=requestAnimFrame((function(){e.endlessScrolling()}))},endlessScrolling:function(){this.app.isAboveTheTop(this.flexloadtrigger.node,-t(window).height())&&(this.endlessStopped||!1!==this.isLoading||this.loadFragment(this.flexloadtrigger,!0)),this.bindEndlessScroller()},loadFragment:function(r,i,a){var s=this;if(!0===s.isLoading)return!1;if(s.isLoading=!0,s.target.node.find(".blocker").remove(),s.target.node.prepend(t('
')),void 0!==s.flexloadtrigger&&null!==s.flexloadtrigger&&s.flexloadtrigger.node.remove(),void 0!==r.config.url){var o=s.endlessParams;null!==this.sortFilter&&(o.sort=this.sortFilter.config.id),o.filter=this.selectedFilters.toString(),o.changefilter=this.changeFilters.toString(),o.numItems=this.numItems.toString(),void 0!==this.filterReloadTarget&&this.load({url:this.filterReloadTarget.config.url,data:o,onComplete:function(e){s.filterReloadTarget.node.replaceWith(t(e)),s.bindDynamicFilterListener()},onError:function(e){}}),this.load({url:r.config.url,data:o,onComplete:function(r){setTimeout((function(){s.view.find(".controls.reload").remove(),!0!==a?!0!==i?s.target.node.html(r):s.target.node.append(t(r).children()):s.target.node.replaceWith(r),s.target=s.getCtrlRelatedObjects(e.NODE_TYPE_TARGET,s.rootNode)[0],t(r).each((function(e){if(void 0!==t(this).data())return void 0!==t(this).data().params&&(s.endlessParams=Utils.parseData(t(this).data().params)),s.target.node.attr("data-params",t(this).attr("data-params")),s.app.dispatchEvent(n.EVENT_TRACKING,{name:"nachladen",type:"view",id:s.rootConfig.id,item:s.flexloadtrigger&&s.flexloadtrigger.node?s.flexloadtrigger.node:void 0,view:"view"}),s.addFlexloadTrigger(),s.isLoading=!1,t(document).ready((function(){s.app.dispatchEvent(n.EVENT_CONTENT_ADDED,s.target.node),s.target.node.find(".blocker").hide()})),!1}))}),250)},onError:function(e){s.target.node.find(".blocker").hide(),s.isLoading=!1,r===s.flexloadtrigger&&(s.endlessStopped=!0)}})}},removeFlexLoadTrigger:function(){var n=this.getCtrlRelatedObjects(e.NODE_TYPE_FLEXLOAD,this.rootNode);t(n).each((function(e){n[e].node.remove()}))},checkFlexLoaderVisible:function(e){var t=this;e.hasClass("last")?(void 0!==t.flexloadtrigger&&t.flexloadtrigger.node.parent().hide(),t.endlessStopped=!0):(void 0!==t.flexloadtrigger&&t.flexloadtrigger.node.parent().show(),t.endlessStopped=!1)},hideAllEntries:function(){for(var e in this.entries)t(this.entries[e].node).hide()},showItem:function(e){e.show()},reload:function(e){t(this.rootNode).find("form").submit()}}),n.CONTROLLERS.push(e)},7591:()=>{function e(){}e.NODE_TYPE="flexload";var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.FlexLoadController=e,e.prototype=t.extend(new r,{minInitial:5,minReload:5,startIndex:0,content:null,initCall:!0,firstLoad:!0,currentIds:[],reloadBtn:null,maxReload:null,mode:"standard",groupResponse:"false",createObject:function(){this.content=this.rootConfig.content.split(","),this.minInitial=Number(this.rootConfig.minInitial),this.minReload=Number(this.rootConfig.minReload),this.maxReload=Number(this.rootConfig.maxReload),this.section=this.view.parent(),this.mod=this.view.find(".mod"),void 0!==this.rootConfig.mode&&(this.mode=this.rootConfig.mode),void 0!==this.rootConfig.groupResponse&&(this.groupResponse=this.rootConfig.groupResponse),this.addListener()},addListener:function(){var e=this;e.reloadBtn=e.view.find(".controls.reload a"),e.reloadBtn.prepend(t('')),e.reloadBtn.click((function(t){return e.reloadTeaser(),!1}))},onResize:function(){!0===this.initCall&&(this.reloadTeaser(),this.initCall=!1)},calcTeaser:function(){this.view.find(".box");var e=1;this.mod.hasClass("modB")&&(e=2),this.mod.hasClass("modC")&&(e=3),this.mod.hasClass("modD")&&(e=4),this.mod.hasClass("modE")&&(e=5),(this.section.hasClass("sectionC")||"s"===this.app.currentView||"xs"===this.app.currentView)&&(e=1),this.minInitial=e,0!==this.maxReload&&void 0!==this.maxReload&&null!==this.maxReload&&this.minReload>this.maxReload&&(this.minReload=this.maxReload),this.minReload=this.minInitial*Math.ceil(this.minReload/e);Math.round(this.minReload/e);this.checkButton()},checkButton:function(){this.reloadBtn.parent().show(),this.startIndex>=this.content.length&&(this.minReload=this.content.length-this.startIndex,this.reloadBtn.parent().hide())},reloadTeaser:function(){var e=this;this.calcTeaser();var t=this.startIndex,r=this.startIndex+this.minReload;this.getIds(t,r);var i={min:t,currentIds:this.currentIds.toString(),max:r};this.startIndex=this.startIndex+this.minReload,e.checkButton();for(var a="",s=0;s1&&e.find("[data-groupid="+r+"]").eq(0).append(t(this).find(".box"))})),e.find(".calEntriesGroup").each((function(e){0==t(this).find(".box").length&&t(this).remove()}))},getIds:function(e,t){t>this.content.length&&(t=this.content.length),this.currentIds=[];for(var n=e;n{function e(){}e.NODE_TYPE="formular",e.NODE_TYPE_INPUT="input",e.NODE_TYPE_ENTRY="entry",e.NODE_TYPE_TRIGGER="trigger",e.NODE_GLOBAL_MSG="globalmsg",e.MSG_FORM_ERROR_GENERAL="Es ist ein Fehler aufgetreten, bitte \xfcberpr\xfcfen Sie Ihre Eingaben.",e.MSG_FORM_STANDARD="Dieses Feld muss ausgef\xfcllt werden.",e.MSG_FORM_GLOBAL="Achtung! Es m\xfcssen noch einige Felder bearbeitet werden!",e.MSG_FORM_EMAIL="Bitte eine g\xfcltige E-Mail-Adresse eingeben.",e.MSG_FORM_PHONE="Bitte eine g\xfcltige Telefonnummer eingeben.",e.MSG_FORM_MULTISELECT="Bitte w\xe4hle",e.MSG_FORM_VOTING_MULTISELECT="Bitte gebe",e.MSG_FORM_MULTISELECT_MIN_ONE="Bitte mindestens eine M\xf6glichkeit ausw\xe4hlen.",e.MSG_FORM_MULTISELECT_MIN="Bitte mindestens [AMOUNT] M\xf6glichkeiten ausw\xe4hlen.",e.MSG_FORM_MULTISELECT_MAX="Bitte h\xf6chstens [AMOUNT] M\xf6glichkeiten ausw\xe4hlen.",e.MSG_FORM_MULTISELECT_MAX_ONE="Bitte h\xf6chstens eine M\xf6glichkeit ausw\xe4hlen.",e.MSG_FORM_VOTING_MIN_ONE="Bitte mindestens eine Stimme abgeben.",e.MSG_FORM_VOTING_MIN="Bitte mindestens [AMOUNT] Stimmen abgeben.",e.MSG_FORM_VOTING_MAX="Bitte h\xf6chstens [AMOUNT] Stimmen abgeben.",e.MSG_FORM_VOTING_MAX_ONE="Bitte h\xf6chstens eine Stimme abgeben.",e.MSG_FORM_ACCEPT="Bitte das Feld best\xe4tigen.",e.MSG_DSGVO_FORM_ACCEPT="Bitte akzeptieren Sie die Datenschutzbedingungen.",e.MSG_FORM_DIGIT="Bitte eine Zahl eingeben.",e.MSG_FORM_SINGLESELECT="Bitte eine Auswahl treffen.",e.MSG_FORM_SECURITY="Bitte bei der Beantwortung der Sicherheitsfrage eine Zahl eingeben.",e.MSG_FORM_DATE="Bitte ein g\xfcltiges Datum eingeben. (im Format TT.MM.JJJJ, zum Beispiel 28.01.2014)",e.ERROR_CLASS="error",e.ERROR_MESSAGE_CLASS="form-errormsg",e.HELP_MESSAGE_CLASS="form-helpmsg",e.VALID_CLASS="valid";var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.FormularController=e,e.prototype=t.extend(new r,{formItems:null,sendButton:null,numRequired:0,tracked:!1,dataId:"",externalSubmit:null,onSubmitted:null,createObject:function(){this.setupController(),this.setupTabs(),this.setupSecurityCaptcha()},setupSecurityCaptcha:function(){const e=t(this.rootNode).find(".renderCaptcha.withLoader"),n=e.data("captcha-url"),r=e.data("captcha-labelid");if(n&&r){const e=(new Date).getTime()+Math.random();t("#"+r).load(n+"?x="+e,(()=>{const e=t("#"+r).find("#audioCaptcha");window.Utils.captcha.replaceDefaultCaptchaPlayer(e)}))}else console.log("Probleme beim Laden des Captcha.")},setupTabs:function(){t(".form-tab-header").show(),t("fieldset").find(".form-tab-element:not(:first)").hide(),t(".form-tab-element-label").hide(),t(".form-tab-button").on("click",(function(e){var n=t("#"+e.currentTarget.id);n.parent().find("button").removeClass("active"),n.addClass("active");var r=n.parents("fieldset");r.find(".form-tab-element").hide(),r.find(".form-tab-element[data-parentId="+e.currentTarget.id+"]").show()}))},getCheckedDateString:function(e){var t=new Date(SERVER_TIME).getTime();if(!e)return null;var n=null;if(-1!==e.indexOf(".")){var r=e.split(".");if(3===r.length){var i=Number(r[1]),a=Number(r[0]),s=Number(r[2]);a>0&&a<32&&i>0&&i<13&&4===s.toString().length&&(n=i+"/"+a+"/"+s)}}if(-1!==e.indexOf("+")||-1!==e.indexOf("-")){var o=-1!==e.indexOf("+"),l=e.substring(1).indexOf("d"),u=e.substring(1).indexOf("m"),c=e.substring(1).indexOf("y"),d=null;if(-1!==l){var h=24*(f=e.substr(1,l))*3600*1e3;d=new Date(o?t+h:t-h)}if(-1!==u){var f=e.substr(1,u);d=new Date(t);i=Number(d.getMonth());var p=Number(f);d.setMonth(o?i+p:i-p)}if(-1!==c){h=365*(f=e.substr(1,c))*24*3600*1e3;d=new Date(o?t+h:t-h)}n=String(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear()}return n},setupController:function(){var n=this;for(var r in this.externalSubmit=null,this.formItems=[],this.inputs=this.getCtrlRelatedObjects(e.NODE_TYPE_INPUT,this.rootNode),this.entries=this.getCtrlRelatedObjects(e.NODE_TYPE_ENTRY,this.rootNode),this.triggers=this.getCtrlRelatedObjects(e.NODE_TYPE_TRIGGER,this.rootNode),this.globalmsg=this.getCtrlRelatedObjects(e.NODE_GLOBAL_MSG,this.rootNode)[0],void 0===this.globalmsg&&(this.globalmsg={node:t("
")}),0===this.globalmsg.node.find("p").length&&this.globalmsg.node.hide(),this.dataId=this.view.parents(".box.cssForm").eq(0).attr("data-id"),void 0===this.dataId&&(this.dataId=this.rootConfig.id),this.inputs)this.initInput(this.inputs[r]);for(var r in this.entries){var s=this.entries[r];if(s.inputs=this.getCtrlRelatedObjects([this.entries[r].config.id,e.NODE_TYPE_INPUT],this.rootNode),"true"===s.config.multiple)"true"===s.config.required&&n.numRequired++,s.validation=new a({required:"true"===s.config.required,reference:s.node,htmlElement:s.node,id:r,array:[],multiple:!0,minselect:void 0!==s.config.minselect?Number(s.config.minselect):1,maxselect:void 0!==s.config.maxselect?Number(s.config.maxselect):void 0,voting:this.rootConfig.isVoting}),t(s.inputs).each((function(e){var a=s.inputs[e];if(a.node.data("id",r),"radio"===a.config.type&&"true"===a.config.styledButton){var o=t('');a.node.parent().prepend(o),o.click((function(e){return a.validation.htmlElement.click(),!1}))}a.validation=new i({tabParent:s.config.tabParent,tabTableId:s.config.tabTableId,reference:s.node,htmlElement:a.node,id:r,variant:a.config.variant,type:a.config.type,required:"true"===s.config.required}),s.validation.array.push(a.validation),a.validation.htmlElement.on("click blur",(function(e){n.onValidation(e)}))}));else{var o=s.inputs[0];if(void 0!==o){s.validation=new i({tabParent:s.config.tabParent,tabTableId:s.config.tabTableId,reference:s.node,htmlElement:o.node,id:r,variant:o.config.variant,type:o.config.type,required:"true"===s.config.required}),o.node.data("id",r),o.node.data("model",s),"true"===s.config.required&&n.numRequired++;s.node.find("div.file").eq(0);switch(o.config.type){case"date":var l=new TheDatepicker.Datepicker(s.validation.htmlElement[0]);l.options.setGoBackHtml(""),l.options.setGoForwardHtml(""),l.options.setCloseHtml(""),l.options.setInputFormat("d.m.Y");var u=this.getCheckedDateString(o.config.minDate),c=this.getCheckedDateString(o.config.maxDate),d="",h="",f=null,p=null,g=null;if(u&&(p=new Date(u)),c){g=new Date(c);p&&(g.getTime(),p.getTime());if(p&&g.getTime()')),null!==a&&s.find(".the-datepicker__hint").html(a),"none"===r.find("select").css("display")&&r.addClass("deactivated"),"none"===i.find("select").css("display")&&i.addClass("deactivated")}));break;case"checkbox":s.validation.htmlElement.on("click",(function(e){n.onValidation(e)}));break;case"select":s.validation.htmlElement.on("change",(function(e){n.onValidation(e)}))}s.validation.htmlElement.focus((function(e){t(this).addClass("focused")})),s.validation.htmlElement.on("blur",(function(e){setTimeout((function(){n.onValidation(e)}),0)}))}}void 0!==s.inputs&&s.inputs.length>0&&("true"!==s.config.multiple||"true"===s.config.required)&&this.formItems.push(s.validation)}t(this.triggers).each((function(e){var r=t(n.triggers)[e],i=t(n.triggers)[e].node;if("submit"===i.attr("type")&&void 0===r.config.intermediateResult){n.sendButton=i;var a=n.sendButton.html();n.sendButton.html(""),n.sendButton.prepend(t(''+a+"")),n.sendButton.prepend(t(''))}i.click((function(e){return void 0===r.config.intermediateResult?(t(e.target).focus(),t(e.target).prop("disabled",!1),n.proofFields(e,!0)):n.onSubmit(r.config.intermediateResult),!1}))})),this.bindEventToObjects(this.inputs,"focus",(function(e,t){return n.handleInputFocusAction(e,t)})),this.bindEventToObjects(this.inputs,"blur",(function(e,t){return n.handleInputBlurAction(e,t)}))},onValidation:function(e){var n=this;function r(){n.proofFields(e,!1)}t(e.currentTarget).removeClass("focused"),"click"===e.type?setTimeout(r,400):r()},proofFields:function(r,i){var a=0,s={},o=this;o.app.dispatchEvent(n.EVENT_CONTENT_ADDED,o.rootNode),!1===this.tracked&&o.app.dispatchEvent(n.EVENT_TRACKING,{name:"form",id:this.dataId,type:"start"}),this.tracked=!0;var l=this.formItems.filter((function(e){return void 0!==e.tabParent&&e.tabParent.length>0})).reduce((function(e,t){return(e[t.tabTableId]||(e[t.tabTableId]=[])).push(t),e}),{});for(var u in l){var c=l[u];if(c.length>0){var d=c.reduce((function(e,t){return(e[t.tabParent]||(e[t.tabParent]=[])).push(t),e}),{}),h=!1;for(var u in d){var f=d[u],p=0;for(var g in f){var m=f[g],v={};!1===i||void 0===i?v=t(r.target).data().id===m.id?m.validate(!0):m.validate(!1):(v.valid=!1,v=m.validate(!1),!0===m.required&&(v=m.validate(!0))),!1===v.valid&&p++}0===p&&(h=!0)}h||a++}}var y=this.formItems.filter((function(e){return void 0===e.tabParent||0===e.tabParent.length}));for(var u in y){m=y[u];!1===i||void 0===i?s=t(r.target).data().id===m.id?m.validate(!0):m.validate(!1):(s.valid=!1,s=m.validate(!1),!0===m.required&&(s=m.validate(!0))),!1===s.valid&&a++}if(null!==o.sendButton&&o.sendButton.find(".form-valprogress").width(Number(100-a/o.numRequired*100)+"%"),0===a)null!==o.sendButton&&o.sendButton.addClass("ready"),o.view.removeClass("hasErrors"),o.view.find(".form-errorSkips").attr("tabindex","-1");else{if(o.view.addClass("hasErrors"),o.view.find(".form-errorSkips").removeAttr("tabindex"),0===o.view.find(".form-errorSkips").length)t('').insertBefore(o.view.find("button[type=submit]")).on("click",(function(e){return o.tweenToError(),!1}));null!==o.sendButton&&o.sendButton.removeClass("ready"),!0===i&&o.tweenToError(1)}return 0!==a||!0!==i&&!0!==this.rootConfig.instantResult&&null!==this.sendButton||(o.globalmsg.node.html(e.MSG_FORM_GLOBAL).hide(),o.onSubmit()),!1},tweenToError:function(e){void 0===e&&(e=0);var t=this.view.find(".formElement.error").eq(0);t.length>0&&(window.scrollTo({top:t.offset().top-100,behavior:"smooth"}),t.find("input,select,textarea").focus())},removeListener:function(){for(var e in this.triggers)this.triggers[e].node.off();for(var t in this.inputs)this.triggers[t].node.off()},handleViewUpdatedEvent:function(e){},handleViewDiedEvent:function(e){},handleTriggerAction:function(e,t){var n=this.getActiveAction(e.config.action,this.app.currentView);for(var r in n)if("submit"===n[r])this.rootNode.submit();return!1},onSubmit:function(r){var i=this,a=t(this.rootNode).parent().find("form").serialize();return null!==i.externalSubmit?(i.externalSubmit(a),!1):void 0!==this.rootConfig.reloadUrl?(this.rootConfig.reloadUrl.length>0?(window.app.showBuffer(this.view),this.view.prepend(t('
')),this.load({url:void 0===r?this.rootConfig.reloadUrl:r,method:"post",data:a,onError:function(n){t(i.rootNode).parent().parent();var r=t(i.rootNode).parents(".box").parent().find(".box");t("html,body").animate({scrollTop:r.offset().top},1e3),i.view.find(".blocker").remove(),i.view.prepend('
'+e.MSG_FORM_ERROR_GENERAL+"
"),window.app.hideBuffer(i.view)},onComplete:function(e){i.removeListener();var r=t(i.rootNode).parent().parent(),a=t(i.rootNode).parents(".box").parent(),s=a.find(".box"),o=t(e);!1===s.hasClass("cssSendForm")?r.replaceWith(o):s.replaceWith(o),(r.find(".form-success").length>0||!0===o.hasClass("form-success"))&&!1===o.hasClass("form-success-intermediate")&&s.addClass("form-sent"),"true"!==i.rootConfig.isVoting&&t("html,body").animate({scrollTop:s.offset().top},1e3),null!==i.onSubmitted&&i.onSubmitted(),i.app.dispatchEvent(n.EVENT_CONTENT_ADDED,a),i.app.dispatchEvent(n.EVENT_TRACKING,{name:"form",id:i.dataId,type:"success"})}})):(this.view.append(t('

Vielen Dank, Deine/Ihre Stimme ging in die Wertung ein.\x03(bzw. individueller Text)

')),t(this.triggers).each((function(e){t(i.triggers)[e].node.hide()})),this.view.find("input.radio,input.checkbox").attr("disabled","disabled")),!1):void this.rootNode.submit()},handleInputFocusAction:function(e,t){var n=this.getActiveAction(e.config.action,this.app.currentView);for(var r in n)if("switchValue"===n[r])this.switchInputValue(e,!0);return!1},handleInputBlurAction:function(e,t){var n=this.getActiveAction(e.config.action,this.app.currentView);for(var r in n)if("switchValue"===n[r])this.switchInputValue(e,!1);return!1},switchInputValue:function(e,t){t?-1!==e.node.val().indexOf(e.defaultValue)&&(e.node.val(""),this.makeActive(e.node)):""===objectUtil.stringTrim(e.node.val())&&(e.node.val(e.defaultValue),this.makeInactive(e.node))},initInput:function(e){e.defaultValue=e.node.val()}}),n.CONTROLLERS.push(e);var i=function(e){this.id=e.id,this.reference=e.reference,this.htmlElement=e.htmlElement,this.type=e.type,this.valid=!1,this.required=e.required,this.variant=e.variant,this.tabParent=e.tabParent,this.tabTableId=e.tabTableId},a=function(e){this.id=e.id,this.reference=e.reference,this.array=e.array,this.multiple=e.multiple,this.htmlElement=e.htmlElement,this.minselect=e.minselect,this.maxselect=e.maxselect,this.isVoting=e.voting,this.required=e.required,this.tabParent=e.tabParent,this.tabTableId=e.tabTableId};i.prototype={id:void 0,htmlElement:void 0,type:void 0,valid:void 0,reference:null,errorMessage:"Standard Fehlermeldung",required:void 0,dateMin:void 0,dateMax:void 0,validate:function(e){switch(this.type){case"text":case"textarea":this.textValid(e);break;case"checkbox":case"radio":this.checkboxValid(e);break;case"email":this.emailValid(e);break;case"securityBox":this.securityBoxValid(e);break;case"date":this.dateValid(e);break;case"digits":this.digitsValid(e);break;case"select":this.selectValid(e);break;case"tel":this.phoneValid(e)}return{valid:this.valid,msg:this.errorMessage}},showValidInfo:function(t,n){var r;(r=void 0!==n?n:this.reference).find("."+e.HELP_MESSAGE_CLASS).hide(),!1===this.valid?(r.addClass(e.ERROR_CLASS).removeClass(e.VALID_CLASS),r.find("."+e.ERROR_MESSAGE_CLASS).remove(),r.find(".form-button").length<1?t.insertAfter(this.htmlElement):r.find(".form-button").append(t),!0===this.htmlElement.parent().hasClass("ui-selectbox")&&this.htmlElement.parent().parent().append(t)):(r.removeClass(e.ERROR_CLASS).addClass(e.VALID_CLASS),r.find("."+e.ERROR_MESSAGE_CLASS).remove())},textValid:function(n){var r=e.MSG_FORM_STANDARD;!0===this.required&&0===t.trim(this.htmlElement.val()).length?this.valid=!1:this.valid=!0;var i=t("",{class:"form-errormsg",html:r});!0===n&&this.showValidInfo(i)},securityBoxValid:function(n){this.valid=this.getRegExpNumber(this.htmlElement.val()),this.htmlElement.val().length>10&&(this.valid=!1);var r=t("",{class:"form-errormsg",html:e.MSG_FORM_SECURITY});!0===n&&this.showValidInfo(r)},selectValid:function(n){if(!0===this.required){if("string"==typeof this.htmlElement.val())""===this.htmlElement.val()||"unselected"===this.htmlElement.val()?(this.reference.addClass(e.ERROR_CLASS).removeClass(e.VALID_CLASS),this.errorMessage=e.MSG_FORM_STANDARD,this.valid=!1):(this.reference.removeClass(e.ERROR_CLASS).addClass(e.VALID_CLASS),this.valid=!0);else if("object"==typeof this.htmlElement.val()){var r=this.htmlElement.val();null!==r&&(0===r.length||-1!==r.toString().indexOf("unselected")?(this.reference.addClass(e.ERROR_CLASS).removeClass(e.VALID_CLASS),this.errorMessage=e.MSG_FORM_STANDARD,this.valid=!1):(this.reference.removeClass(e.ERROR_CLASS).addClass(e.VALID_CLASS),this.valid=!0))}}else this.valid=!0;var i=t("",{class:"form-errormsg",html:e.MSG_FORM_SINGLESELECT});!0===n&&this.showValidInfo(i)},dateValid:function(n){var r=e.MSG_FORM_DATE;if(void 0!==this.dateMin&&void 0!==this.dateMax){var i=Utils.getDateObj(this.dateMin),a=Utils.getDateObj(this.dateMax);r="Bitte geben Sie ein g\xfcltiges Datum im Bereich vom "+this.dateMin+" bis "+this.dateMax+" an."}if(!1===/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/.test(this.htmlElement.val()))this.valid=!1;else{var s=Utils.getDateObj(this.htmlElement.val()).days,o=Utils.getDateObj(this.htmlElement.val()).months,l=Utils.getDateObj(this.htmlElement.val()).year;if(void 0!==a&&void 0!==i){var u=new Date(i.year,i.months-1,i.days),c=new Date(a.year,a.months-1,a.days),d=new Date(l,o-1,s);this.valid=d.getTime()>=u.getTime()&&d.getTime()<=c.getTime()}else this.valid=Number(l)>1900&&Number(s)<32&&Number(o)<13}!1!==this.htmlElement.hasClass("noEmptyCheck")&&""===this.htmlElement.val()&&(this.valid=!0),!1===this.required&&""===this.htmlElement.val()&&(this.valid=!0);var h=t("",{class:"form-errormsg",html:r});!0===n&&this.showValidInfo(h)},getRegExpEmail:function(e){return/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(t.trim(e))},getRegExpNumber:function(e){return/^-?[0123456789]+$/i.test(t.trim(e))},emailValid:function(n){var r=this.getRegExpEmail(this.htmlElement.val());!0===this.required?this.valid=r:!0===r||""===this.htmlElement.val()?this.valid=!0:this.valid=!1;var i=t("",{class:e.ERROR_MESSAGE_CLASS,html:e.MSG_FORM_EMAIL});!0===n&&this.showValidInfo(i)},getRegExpPhone:function(e){return/^[+]?[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/i.test(t.trim(e))},phoneValid:function(n){var r=this.getRegExpPhone(this.htmlElement.val());!0===this.required?this.valid=r:!0===r||""===this.htmlElement.val()?this.valid=!0:this.valid=!1;var i=t("",{class:e.ERROR_MESSAGE_CLASS,html:e.MSG_FORM_PHONE});!0===n&&this.showValidInfo(i)},checkboxValid:function(n){0==this.htmlElement.prop("checked")?this.valid=!1:this.valid=!0,!1===this.required&&(this.valid=!0);var r=e.MSG_FORM_SINGLESELECT;"agbBox"===this.variant?r=e.MSG_FORM_ACCEPT:"dsgvoBox"===this.variant&&(r=e.MSG_DSGVO_FORM_ACCEPT);var i=t("",{class:e.ERROR_MESSAGE_CLASS,html:r});!0===n&&this.showValidInfo(i)},digitsValid:function(n){var r=this.getRegExpNumber(this.htmlElement.val());!0===this.required?this.valid=r:!0===r||""===this.htmlElement.val()?this.valid=!0:this.valid=!1;var i=t("",{class:e.ERROR_MESSAGE_CLASS,html:e.MSG_FORM_DIGIT});!0===n&&this.showValidInfo(i)}},a.prototype={id:void 0,array:void 0,valid:void 0,multiple:void 0,htmlElement:void 0,minselect:void 0,maxselect:void 0,errorMessage:e.MSG_FORM_STANDARD,isVoting:void 0,reference:null,showValidInfo:function(t){this.reference.find("."+e.HELP_MESSAGE_CLASS).hide(),!1===this.valid?(this.reference.addClass(e.ERROR_CLASS).removeClass(e.VALID_CLASS),this.reference.find("."+e.ERROR_MESSAGE_CLASS).remove(),t.insertAfter(this.reference.find("input:last").parent())):(this.reference.removeClass(e.ERROR_CLASS).addClass(e.VALID_CLASS),this.reference.find("."+e.ERROR_MESSAGE_CLASS).remove())},validate:function(n){var r=0;(void 0===this.minselect||null===this.minselect)&&(this.minselect=1),(void 0===this.maxselect||null===this.minselect)&&(this.maxselect=this.array.length);var i=this;if(t(this.array).each((function(e){!0===i.array[e].validate(!1).valid&&r++})),r>=this.minselect&&r<=this.maxselect)this.valid=!0;else switch(this.valid=!1,this.isVoting){case void 0:case"false":case!1:case null:1===this.minselect?this.errorMessage=e.MSG_FORM_MULTISELECT_MIN_ONE:this.errorMessage=e.MSG_FORM_MULTISELECT_MIN.split("[AMOUNT]").join(this.minselect.toString()),r>this.minselect&&r>this.maxselect&&(1===this.maxselect?this.errorMessage=e.MSG_FORM_MULTISELECT_MAX_ONE:this.errorMessage=e.MSG_FORM_MULTISELECT_MAX.split("[AMOUNT]").join(this.maxselect.toString()));break;case"true":case!0:1===this.minselect?this.errorMessage=e.MSG_FORM_VOTING_MIN_ONE:this.errorMessage=e.MSG_FORM_VOTING_MIN.split("[AMOUNT]").join(this.minselect.toString()),r>this.minselect&&r>this.maxselect&&(1===this.maxselect?this.errorMessage=e.MSG_FORM_VOTING_MAX_ONE:this.errorMessage=e.MSG_FORM_VOTING_MAX.split("[AMOUNT]").join(this.maxselect.toString()))}this.htmlElement.hasClass("acceptBox")&&(this.errorMessage=e.MSG_FORM_ACCEPT);var a=t("",{class:e.ERROR_MESSAGE_CLASS,html:this.errorMessage});return!0===n&&this.showValidInfo(a),{valid:this.valid,msg:this.errorMessage}}}},1944:()=>{function e(){return null}e.NODE_TYPE="gallery",e.GALLERY_TYPE_SLIDER="galleryTeaserSlider",e.GALLERY_TYPE_GRID="galleryTeaserGrid",e.GALLERY_TYPE_BIG="galleryTeaserBig",e.GALLERY_TYPE_STANDARD="galleryTeaserStandard",e.GALLERY_TYPE_BEFORE_AFTER="galleryTeaserBeforeAfter",e.GALLERY_TYPE_DETAIL="galleryDetail";const t=window.jQuery,n=window.Application,r=window.BaseController,i=window.OwlController;window.GalleryController=e,e.prototype=t.extend(new r,{created:!1,data:null,galleryComp:null,loaded:!1,index:0,imageId:"",templateImage:null,loadedBeforeAfterImages:0,isStateUpdate:!1,layerOpen:!1,totalNumberOfImages:null,numOfImagesShownInTeaser:16,numOfImagesLoaded:0,createTotalImagesIndicator(){const e=document.createElement("div"),t=document.createElement("span"),n=document.createElement("span");return e.classList.add("total-images"),t.classList.add("total-images__gallery-icon"),t.innerHTML="\uf64a",n.classList.add("total-images__counter"),n.innerText=`${this.totalNumberOfImages} Bilder`,e.appendChild(t),e.appendChild(n),e},appendTotalImagesIndicator(t){switch(t){case e.GALLERY_TYPE_STANDARD:{const e=Array.from(this.rootNode.classList);if(e.includes("boxBig")||e.includes("boxBigSolid")||e.includes("boxNormal")||e.includes("boxNormalSolid")||e.includes("boxSmall")||e.includes("boxSmallExtended")){var n;const e=this.createTotalImagesIndicator();null==(n=this.rootNode.querySelector(".mediaCon .media"))||n.append(e)}else if(e.includes("boxImage")||e.includes("boxImageSquare")){var r;const e=this.createTotalImagesIndicator();null==(r=this.rootNode.querySelector(".teaserInfoWrapper"))||r.prepend(e)}break}case e.GALLERY_TYPE_SLIDER:case e.GALLERY_TYPE_GRID:{const e=this.createTotalImagesIndicator();this.rootNode.querySelector(".controls.sliding").prepend(e);break}}},createObject(){this.app.addEventListener(n.EVENT_CONTENT_ADDED,this,"onResize"),this.loadData((n=>{var r;this.totalNumberOfImages=null==n||null==(r=n.images)?void 0:r.length,this.appendTotalImagesIndicator(this.rootConfig.variant),this.rootConfig.variant!==e.GALLERY_TYPE_SLIDER&&this.rootConfig.variant!==e.GALLERY_TYPE_GRID||(this.numOfImagesShownInTeaser=this.rootNode.querySelectorAll(".ui-thumbSlider .mediaCon").length,this.totalNumberOfImages>this.numOfImagesShownInTeaser&&this.thumbsController&&this.thumbsController.view.find(".thumbSliderContainer").append(t(``)))})),this.rootConfig.variant===e.GALLERY_TYPE_GRID&&this.initGridGallery()},onResize(){if(!this.created){if(this.created=!0,this.rootConfig.variant===e.GALLERY_TYPE_BEFORE_AFTER)return window.toast.all(["/resources/global/js/Vendor/twentytwenty/jquery.event.move.js","/resources/global/js/Vendor/twentytwenty/jquery.twentytwenty.js","/resources/global/js/Vendor/twentytwenty/twentytwenty.css"]).then((()=>{this.loadData((()=>{this.initBeforeAfterGallery()}))})),!1;const t=this.app.getControllerInNode(this.view,i.NODE_TYPE)[0];if(this.thumbsController=this.app.getControllerById(i.NODE_TYPE,t),this.rootConfig.variant!==e.GALLERY_TYPE_GRID&&this.rootConfig.variant!==e.GALLERY_TYPE_SLIDER||null===this.thumbsController||this.thumbsController.disable(),void 0!==this.rootConfig.index){const e=parseInt(this.rootConfig.index,10);Number.isInteger(e)?this.index=e:this.imageId=this.rootConfig.index}this.rootConfig.variant!==e.GALLERY_TYPE_BIG&&this.rootConfig.variant!==e.GALLERY_TYPE_DETAIL||(this.view.css("opacity",0),this.testScrolling())}},initGridGallery(){this.rootNode.querySelectorAll(".ui-thumbSlider .mediaCon").forEach((e=>{const t=e.querySelector(".imageWrapper > img");t&&t.addEventListener("load",(e=>{t.naturalWidth,t.naturalHeight;this.numOfImagesLoaded++}),{once:!0})}))},initBeforeAfterGallery(){this.load({nopace:!0,url:"/resources/global/templates/gallery/img.html",type:"text",onComplete:e=>{this.templateImage=e;const r=this.data.images[0],i=this.data.images[1],a=this.mapBeforeAfterImageData("vn"+(new Date).getTime(),r),s=this.mapBeforeAfterImageData("vn"+(new Date).getTime()+1,i),o=t(a),l=t(s);o.addClass("galleryPreAfter"),l.addClass("galleryPreAfter"),this.view.find(".imageWrapper").html(o).append(l),this.view.find(".mediaRights").html(`Bildrechte: ${r.rights} | ${i.rights}`),this.app.addEventListener(n.IMAGE_LOADED,this,"onBeforeAfterImageLoaded"),this.app.dispatchEvent(n.EVENT_CONTENT_ADDED,this.view)}})},onBeforeAfterImageLoaded(e){if(!this.view[0].contains(e))return!1;this.loadedBeforeAfterImages++,2===this.loadedBeforeAfterImages&&setTimeout((()=>{this.view.find(".teaser.special .mediaCon .imageWrapper").twentytwenty()}),0)},mapBeforeAfterImageData(e,t,n){var r=this.templateImage;return r=(r=(r=(r=(r=(r=(r=(r=r.split("**urlScheme**").join(t.urlScheme)).split("**variants**").join(t.variants)).split("**id**").join(e)).split("**title**").join(t.title)).split("**desc**").join(t.desc)).split("**rights**").join(t.rights)).split("**altTitle**").join(t.altText)).split("**titleText**").join(t.titleText),r=!0===n?r.split("**isLightbox**").join("true"):r.split("**isLightbox**").join("false")},show(){},toggleBuffer(){},loadData(e){this.load({url:this.rootConfig.jsonUrl,type:"json",onComplete:t=>{this.data=t,setTimeout((()=>{this.onResize(),e(t)}),0)}})},testScrolling(){this.app.removeEventListener(n.FRAME_UPDATE,this,"testScrolling"),this.loaded=!0,this.view.find(".teaser.special").removeClass("owl-noAutoSlide owl-noSlider").removeAttr("data-ctrl-slidable").removeClass("owl-noSlider"),this.loadData((e=>{this.data=e,this.loadGallery()}))},onUpdateState(){this.isStateUpdate=!0},loadGallery(){this.view.css("opacity",1),window.renderImageGallery(this.rootConfig.jsonUrl,this.index,this.view[0],this.imageId,this.rootConfig.variant)}}),n.CONTROLLERS.push(e)},8680:()=>{function e(){}e.NODE_TYPE="ipg";var t=window.jQuery,n=window.Application,r=window.BaseController,i=window.CollapsibleController,a=window.PlayerController;window.app;window.IPGController=e,e.prototype=t.extend(new r,{livestreamComp:null,teaserLiveChecker:[],menuController:null,listController:null,sliderController:null,hasPlayer:!1,firststart:!0,cookieId:null,useHashChange:!0,initOpen:0,createObject:function(){var e=this;if(this.menuController=this.app.getControllerById(i.NODE_TYPE,this.rootConfig.controllerMenu),this.listController=this.app.getControllerById(i.NODE_TYPE,this.rootConfig.controllerList),this.sliderController=this.app.getControllerById(OwlController.NODE_TYPE,this.rootConfig.controllerSlider),this.rootConfig.initMode&&this.app.addEventListener(n.LIVESTREAM_START,this,"onLiveStart"),this.cookieId="ipgOpened"+this.rootConfig.id,e.teaserLiveChecker=[],null===this.listController&&!0===this.view.hasClass("con")){var r=this.app.getControllerInNode(this.view,i.NODE_TYPE)[0];this.listController=this.app.getControllerById(i.NODE_TYPE,r)}if(null!==this.listController){this.listController.onOpen=function(n){t.cookie(e.cookieId,n.config.id);n.node},!0===this.useHashChange&&this.app.addEventListener(n.HASH_CHANGE,this,"onHashChange");var s="Alle Sendungen auf einen Blick",o=t(".cssIpgHeadline .headline");o.html(""+t(".cssIpgHeadline .headline").clone().text()+''+s+""),o.on("click",".moreBtn",(function(n){var r=t(this).hasClass("open");return t(e.listController.entries).each((function(t){!1===r?e.listController.openEntries(e.listController.entries[t]):e.listController.closeEntries(e.listController.entries[t])})),t(this).toggleClass("open"),!0===r&&e.openEntry(e.listController,e.listController.entries[e.initOpen]),!0===r?t(this).html(s):t(this).html("Kompakte Ansicht"),!1}))}if(this.app.getControllerInNode(this.view,a.NODE_TYPE).length>0)return!1;this.collectTeaser(),this.app.addEventListener(n.EVENT_CONTENT_ADDED,this,"collectTeaser"),this.onResize()},onLiveStart:function(e){var t=e.view;window.scrollTo({top:t.offset().top-64,behavior:"smooth"})},onHashChange:function(){var e=this.matchHash();if(null!==e){var t=parseInt(e[1]);if(null!==this.listController){var n=this.listController.entries[t].node;window.scrollTo({top:n.offset().top-64,behavior:"smooth"})}}},matchHash:function(){return document.location.href.match(/tabs-([\s\S]*)/)},updateHash:function(e){return!0===this.useHashChange&&(document.location.hash="#tabs-"+e),!1},collectTeaser:function(){var e=this;if(!0===this.hasPlayer)return!1;var n=this.view.find(".cssBroadcast .teaser");!0===this.view.hasClass("cssBroadcast")&&(n=this.view.find(".teaser")),n.each((function(n){var r=t(this);if(void 0!==r.data().broadcastinfos&&void 0===r.data().broadcastVO){r.data("broadcastVO",Utils.evalString(r.data().broadcastinfos)),r.data().broadcastVO.externalControl=!0,r.data().broadcastVO.view=r,r.find(".cssIpgLink").html("Livestream");var i=new LivestreamProgress;i.init(r.data().broadcastVO),i.id=n,r.find(".mediaCon .media").append(i.livestreamProgress),i.livestreamProgress.prepend(''),e.teaserLiveChecker.push(i)}}))},start:function(){var e=this;"xs"!==this.app.currentView&&"s"!==this.app.currentView&&this.app.addEventListener(n.TIME_UPDATE,this,"onCheckAllTeasers"),"search"===this.rootConfig.initMode&&this.menuController.toggleBody(this.menuController.entries[1]),!0===e.view.hasClass("con")&&null!==e.sliderController?(setTimeout((function(){t(e.sliderController.entries).each((function(n){if(!0===t(e.sliderController.entries[n]).hasClass("currentDay"))return e.sliderController.moveToIndex(n-1,250),!1}))}),1e3),e.sliderController.view.css("opacity",1)):!0===this.view.hasClass("ipgSliderWrapper")&&t(e.sliderController.entries).each((function(n){var r=t(e.sliderController.entries[n]),i=r[0].className.match(/cssBroadcastDay(\d*)/),a=t("body")[0].className.match(/cssBroadcastDay(\d*)/),s="",o="";null!==i&&(s=Number(i[1])),null!==a&&(o=Number(a[1])),null!==i&&null!==a&&r.removeClass("currentDay"),o===s&&(r.addClass("currentDay"),setTimeout((function(){e.sliderController.moveToIndex(n-1,1)}),100))}))},onResize:function(){var e=this;null!==this.listController&&!0===this.firststart&&t(this.listController.entries).each((function(t){var n=e.listController.entries[t];n.config.id;!0===n.node.hasClass("preselected")&&e.openEntry(e.listController,e.listController.entries[t])})),!0===this.firststart&&this.start(),this.firststart=!1,this.onCheckAllTeasers(!0)},openEntry:function(e,t){e.openBody(t)},onCheckAllTeasers:function(e){var n=this;t(this.teaserLiveChecker).each((function(t){var r=n.teaserLiveChecker[t];!0!==e&&r.onTimeUpdate();var i=void 0===r.initSlide;!0===e&&(i=!0),"now"===r.state&&!0===i&&(null!==n.sliderController&&setTimeout((function(){!0==!n.view.hasClass("con")&&null!==n.sliderController&&n.sliderController.moveToIndex(r.id,250)}),1e3),r.initSlide=!1)}))}}),n.CONTROLLERS.push(e)},9879:()=>{function e(){}e.NODE_TYPE="image";var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.ImageController=e,e.prototype=t.extend(new r,{node:null,onLoaded:null,forceLoad:!1,currentWidth:0,isLoading:!1,cachedImage:null,createObject:function(){this.isLoading=!1,this.inViewport=!1,this.widthFactor=64,this.urlScheme=null,this.isBackground=!1,this.imageVariant="16x9",this.scrollId=0,this.counter=0,this.loaded=!1,this.lazyLoadInit=!1,this.rootConfig.widthFactor&&(this.widthFactor=parseInt(this.rootConfig.widthFactor)),this.rootConfig.urlScheme&&(this.urlScheme=this.rootConfig.urlScheme),this.rootConfig.isBackground&&"true"===this.rootConfig.isBackground&&(this.isBackground=!0),this.node=t(this.rootNode),this.app.addEventListener(n.EVENT_CONTENT_ADDED,this,"handleContentLoadedEvent"),this.forceLoad=this.view.parents(".mediaTop").length>0,!0==!this.app.forceInstantImageLoad&&!0!==this.forceLoad?this.app.addEventListener(n.FRAME_UPDATE,this,"testScrolling"):this.updateImages(this.app.currentView),this.originalHTML=this.view.clone()},testScrolling:function(){var e=this;!0===e.app.isInViewport(e.view,250)&&(e.inViewport=!0),e.inViewport&&!e.loaded&&(e.loaded=!0,this.app.removeEventListener(n.FRAME_UPDATE,this,"testScrolling"),this.updateImages(this.app.currentView))},onResize:function(){var e=this;setTimeout((function(){!0===e.loaded&&e.updateImages(this.app.currentView)}),0)},handleContentLoadedEvent:function(e){this.updateImages(this.app.currentView)},handleViewUpdatedEvent:function(e){},hide:function(){this.node.css("display","none")},show:function(){this.node.css("display","block")},updateImages:function(e,r,i,a,s){var o=this;!0===this.app.forceInstantImageLoad&&(this.forceLoad=!0);this.round(512/288,2);if(!1===this.loaded&&!0!==s&&!0!==this.forceLoad)return!1;if(!this.node.is(":visible")&&!0!==this.forceLoad)return!1;if(!0===this.isLoading&&!0!==s)return!1;this.counter++;var l=this.node.width(),u=Utils.getDeviceRatio();!0===this.forceLoad&&!0!==this.app.forceInstantImageLoad&&(l=t(window).width()>1440?1440:t(window).width()-100,t(window).height()<1024&&t(window).width>1024&&(u=1));var c=parseInt(Math.ceil(l*u/(1*this.widthFactor))*this.widthFactor);if(c>2560&&(c=2560),void 0!==a&&(c=a),0!==c||!0===this.forceLoad){if(void 0!==this.rootConfig.maxWidth){var d=parseInt(this.rootConfig.maxWidth);c>d&&(c=d)}var h=this.urlScheme,f={},p=this.node.parent().width()/this.node.parent().height(),g=l<=235?"Small":"Big";if(1===(u=this.round(p,1))&&1===p&&(f.imageVariant=this.rootConfig.variants["variant"+g+"1x1"]),2.7===u&&(f.imageVariant=this.rootConfig.variants["variant"+g+"24x9"]),1.8===u&&(f.imageVariant=this.rootConfig.variants["variant"+g+"16x9"]),void 0===f.imageVariant||"true"===this.rootConfig.lightbox||!0===this.view.hasClass("galleryPreAfter")||this.view.parents(".media1xN").length>0||this.view.parents('[data-ctrl-gallery*="galleryTeaserGrid"]').length>0){f.imageVariant=this.rootConfig.variants["variant"+g+"1xN"]}if(void 0===f.imageVariant&&(f.imageVariant=this.rootConfig.variants.variantSmall16x9),this.view.parents(".boxBanner").length>0&&(f.imageVariant="variantTeaser"+g+"1xN"),this.currentWidth=c,void 0!==h&&""!==h){if(h=(h=h.replace("**width**",c)).replace("**imageVariant**",f.imageVariant),o.app.removeEventListener(n.ON_RENDER_LOOP,this,"testScrolling"),h===o.node.attr("src"))return void 0!==r&&r(),!1;if(this.isBackground)if(-1!==h.indexOf("undefined"))this.node.css("background-image","none");else{var m="url("+h+")";void 0!==this.rootConfig.gradient?this.node.css("background-image",m):this.node.css({"background-image":m,backgroundSize:"cover"})}else{var v=null;this.isLoading=!0,!0===s?v=new Image:(v=this.view,o.view.attr("src","")),t(v).on("load",(function(e){if(!0!==s||(o.cachedImage=h),o.isLoading=!1,o.loaded=!0,void 0!==r&&r(h),null!==o.onLoaded&&o.onLoaded(),o.app.dispatchEvent(n.IMAGE_LOADED,this),window.innerWidth>768){var i=o.node.parents(".modA .boxImageSquare");if(i.length>0){var a=t('
');i.find(".ui-blur-backdrop").remove(),i.find(".teaser").prepend(a),a.css({backgroundImage:"url("+h+")",backgroundSize:"cover",backgroundPosition:"center center"})}}})),t(v)[0].src=h}}this.node.parents("[data-ctrl-lightbox1-entry]").length>0&&this.node.parents(".mediaCon").addClass("item-delegated-lightbox"),this.node.on("click",(()=>{if(this.node.parents("[data-ctrl-lightbox1-entry]").length>0){var e=t("[data-ctrl-lightbox]");e.css("display","block");const n=this.node.attr("title").split("|"),r=n[0].trim();let i="";if(n.length>1){const e=n[1].indexOf("Bildrechte:");-1!==e&&(i=n[1].substring(e+11).trim())}const a={id:this.rootConfig.id,variants:this.rootConfig.variants,urlScheme:this.rootConfig.urlScheme,title:r,altText:this.node.attr("alt"),rights:i};return window.renderImageLightbox(e[0],a,(()=>window.removeImageLightbox(e[0]))),!1}}))}},round:function(e,t){var n;return n=Math.pow(10,t),Math.round(e*n)/n}}),n.CONTROLLERS.push(e)},5320:()=>{function e(){}e.NODE_TYPE="link",e.POPUP_MSG='

Der Link \xf6ffnet eine Internetseite au\xdferhalb des MDR/der ARD.

Der MDR/Die ARD ist f\xfcr den Inhalt externer Internetseiten nicht verantwortlich. Es kann sich dabei auch um ein Bezahlangebot handeln.

';var t=window.jQuery,n=window.Application,r=window.BaseController,i=(window.CollapsibleController,window.PlayerController,window.ImageController,window.GalleryLayer,window.Multimediagallery,window.InfoLayer);window.app;window.LinkController=e,e.prototype=t.extend(new r,{tooltipWrapper:null,createObject:function(){var e=this,r=this.rootConfig.window,i=this.rootConfig.type;if(this.view=t(this.rootNode),this.view.css({position:"relative",cursor:"pointer"}),this.baseLink=this.view.attr("href"),this.linkTarget=this.view,void 0===this.baseLink&&(this.baseLink=this.view.find("a.linkAll").attr("href"),void 0===this.baseLink&&(this.baseLink=this.view.find("a").attr("href")),this.linkTarget=this.view.find("a")),e.infoLayer=null,this.layerOpen=!1,this.popup=!1,this.tooltip=!1,this.popupConfig={},this.newWindow=!1,void 0!==r&&void 0!==r.type)switch(r.type){case"blank":t(this.rootNode).attr("target","_blank"),t(this.rootNode).find("a").attr("target","_blank"),this.newWindow=!0;break;case"popup":this.popup=!0,void 0!==r.config&&(this.popupConfig=r.config)}if(void 0!==i)switch(i){case"external":this.showInfoLayer=!0;break;case"liveTicker":this.popup=!0;break;case"download":this.view.find("a").on("click",(function(t){e.app.dispatchEvent(n.EVENT_TRACKING,{name:"download",id:e.view.attr("data-id"),url:e.view.find("a").attr("href"),item:e.view.find("a").eq(0)})}));break;case"tooltip":this.tooltip=!0}this.addLinkListener()},addLinkListener:function(){var t=this;if(t.showInfoLayer){t.infoLayer=new i;var n='
'+e.POPUP_MSG+'OKAbbrechenAbbrechen
';t.infoLayer.init({reference:this,html:n}),t.infoLayer.view.addClass("linkLayer");var r=t.infoLayer.view.find(".moreBtn.ok"),a=t.infoLayer.view.find(".moreBtn.cancel");t.infoLayer.view.find(".moreBtn.cancel");this.linkTarget.on("click",(function(e){if(!t.view.hasClass("no-js-onclicks"))return t.infoLayer.show(null,e),t.layerOpen=!0,r.focus(),r.on("click",(function(){return!0===t.newWindow||!0===t.showInfoLayer?t.redirectLink():document.location.href=t.baseLink,t.hideLayer(),!1})),a.on("click",(function(){return t.hideLayer(),t.linkTarget.focus(),!1})),!1}))}!0===t.tooltip&&t.linkTarget.on("click",(function(){return t.loadTooltipData(),!1})),!0===t.popup&&!0!==t.showInfoLayer&&t.linkTarget.on("click",(function(){if(!t.view.hasClass("no-js-onclicks"))return t.redirectLink(),!1}))},hideLayer:function(){var e=this;"a"===this.linkTarget[0].tagName.toLowerCase()?setTimeout((function(){e.linkTarget.focus()}),0):this.linkTarget.find("a").eq(0).focus(),this.infoLayer.hide()},loadTooltipData:function(){var e=this;e.removeTooltip(),e.tooltipWrapper=t('
'),e.linkTarget.after(this.tooltipWrapper),e.tooltipWrapper.on("click",".closeBtn",(function(){return e.removeTooltip(),!1})),this.load({url:this.baseLink,type:"text",onComplete:function(r){e.tooltipWrapper.removeClass("loading"),e.view.parents(".ui-collapsible").removeClass("link-loading");var i=/]*>((.|[\n\r])*)<\/body>/im.exec(r);e.tooltipWrapper.append(t(i[0]).find(".sectionDetailPage > .con")),e.app.dispatchEvent(n.EVENT_TRACKING,{name:"nachladen",type:"view",id:e.rootConfig.id,view:"view"}),setTimeout((function(){e.app.dispatchEvent(n.EVENT_CONTENT_ADDED,e.tooltipWrapper),e.view.parents(".ui-collapsible").addClass("link-loading")}),250)}})},removeTooltip:function(){null!==this.tooltipWrapper&&this.tooltipWrapper.remove()},redirectLink:function(){if(this.app.dispatchEvent(n.EVENT_TRACKING,{name:"link."+this.rootConfig.id,type:"siteElements",id:this.rootConfig.id,item:this.view,externalLink:!0}),this.popup){var e=this.popupConfig;void 0===e.title&&(e.title=this.rootConfig.id),void 0===e.left&&(e.left="100"),void 0===e.top&&(e.top="100"),void 0===e.width&&(e.width="768"),void 0===e.height&&(e.height="550"),void 0===e.toolbar&&(e.toolbar="0"),void 0===e.scroll&&(e.scroll="1"),void 0===e.status&&(e.status="0"),void 0===e.location&&(e.location="0"),void 0===e.resizable&&(e.resizable="0");var t="top="+e.top+",left="+e.left+",width="+e.width+",height="+e.height+",toolbar="+e.toolbar+",scrollbars="+e.scroll+",status="+e.status+",resizable="+e.resizable+",location="+e.location+",menuBar=0,address=0";window.open(this.baseLink,"Popup"+(new Date).getTime(),t).focus()}else window.open(this.baseLink)},handleViewUpdatedEvent:function(e){},handleViewDiedEvent:function(e){}}),n.CONTROLLERS.push(e)},9577:()=>{function e(){}e.NODE_TYPE="multimediagallery",e.TYPE_SPECIAL="mmgTypeSpecial",e.TYPE_DETAIL="mmgTypeDetail";var t=window.jQuery,n=window.Application,r=window.BaseController;window.MultimediaController=e,e.prototype=t.extend(new r,{created:!1,data:null,galleryComp:null,loaded:!1,playerLoaded:!1,index:0,isStateUpdate:!1,layerOpen:!1,initialized:!1,playerOpened:{},mixedGallery:!1,createObject:function(){var r=this;if(this.mixedGallery=!1,r.rootConfig.forceView||(r.rootConfig.forceView="layer"),this.app.addEventListener(n.EVENT_CONTENT_ADDED,this,"onReloadUpdate"),r.rootConfig.variant===e.TYPE_DETAIL){var i=this.view.find(".box.cssAv");i&&i.each((function(e){t(this).find(".mediaCon").addClass("avActivePlay")}))}},onReloadUpdate:function(n){this.rootConfig.variant===e.TYPE_DETAIL&&n&&(n.hasClass&&n.hasClass("conFlexLoad")||t(n).hasClass("conFlexLoad"))&&!1===this.initialized&&(this.startArdPlayer(0),this.initialized=!0)},onResize:function(){if(this.rootConfig.variant===e.TYPE_DETAIL){var n=this.view.find(".box.cssAv");n&&n.each((function(e){t(this).find(".mediaCon").addClass("avActivePlay")}))}},startArdPlayer:function(e){void 0===e&&(e=0);var n=this,r=n.view.find(".box").eq(e);if(!r||0===r.length)return!1;var i={view:r.find(".mediaCon"),type:r.hasClass("cssAudio")?"audio":"video",rootConfig:{onDataLoaded:e=>{node=this.view.find(".box"),node.each((function(r){var i=t(this),a=i.index();!0!==i.data().playerLoaded&&a>0&&n.startArdPlayerWithData(a,e),i.find(".media a").removeAttr("href"),i.data().playerLoaded=!0}))},index:e,mmgId:this.rootConfig.id,id:r.data().id,playerXml:n.rootConfig.mmgXml}};window.renderARDPlayer(i,!1,!0)},startArdPlayerWithData:function(e,t){const n=JSON.parse(JSON.stringify(t));n.avDocument=n.multimediagallery.avDocuments.avDocument[e];var r=this.view.find(".box").eq(e),i={view:r.find(".mediaCon"),type:r.hasClass("cssAudio")?"audio":"video",rootConfig:{index:e,mmgId:this.rootConfig.id,id:r.data().id,dataRef:n}};window.renderARDPlayer(i,!1,!0)},isDetail:function(){return 0!==this.view.parents(".cssMultimediagallery .sectionDetailPage").length},redirectLink:function(e){var t=this,n=t.view.find(".mmgTeaserList > .moreBtn").length>0?t.view.find(".mmgTeaserList > .moreBtn"):this.view.find("a").last();switch(t.rootConfig.forceView){case"layer":"xs"!==t.app.currentView&&"s"!==t.app.currentView?t.startArdPlayer(0):document.location.href=n.attr("href");break;case void 0:case"":case"detailPage":document.location.href=n.attr("href")}}}),n.CONTROLLERS.push(e)},5685:()=>{function e(){}e.NODE_TYPE="player";var t=window.jQuery,n=window.Application,r=window.BaseController;window.PlayerController=e,e.prototype=t.extend(new r,{playerId:null,initOnClick:null,cachedPlayer:null,cachedPlayerWrapper:null,firstInit:!1,playerRegistered:null,type:"video",mode:"inline",teaserContainer:null,isDeactivated:!1,isBroadcastPage:!1,isSpecial:!1,contentId:null,fallbackLinkAll:!1,originXml:"",isReactArdPlayer:!0,playerLoadedXml:null,previewActive:!1,ratio:"16x9",createObject:function(){if(this.firstInit=!1,this.playerRegistered=null,this.type="video",this.isBroadcastPage=t("body").hasClass("cssBroadcast"),this.originXml=this.rootConfig.playerXml,this.teaserContainer=this.view.parents(".cssVideo,.cssAudio,.cssLivestream,.cssAvPlus").eq(0),this.view.parents(".avRelatedWrapper").length>0)return this.isDeactivated=!0,!1;this.isSpecial=this.teaserContainer.hasClass("boxSpecial"),this.view.attr("id","player-"+this.rootConfig.id),this.handleRootAction("init")},destroyObject:function(e){},getRightPlayerId:function(e,n){return t(e).find(n).length>0},update:function(){this.rootConfig=this.getConfig(this.rootNode,e.NODE_TYPE),this.playerId=this.rootConfig.id},onResize:function(){if(!0===this.isDeactivated)return!1;this.checkInitProcess()},handleRootAction:function(e){this.cachedPlayerWrapper=t(this.rootNode).parent().html(),this.cachedPlayer=t(this.rootNode).clone().html(),this.playerId=this.rootConfig.id,this.resetPlayer(),this.checkInitProcess()},resetPlayer:function(e){this.view.css("height","auto"),this.view.removeAttr("id"),this.view.removeClass("ready playing pause"),!0===e&&(this.view.html(this.cachedPlayer),this.app.dispatchEvent(n.EVENT_CONTENT_ADDED,t("body")))},checkInitProcess:function(){this.bindLayer()},checkForAccessible:function(e,n){var r=this,i=e.find("adVideoUrl").text(),a=e.find("dgsVideoUrl").text();e.find("mainVideoUrl").text();if(i.length>0||a.length>0){var s=t('
');s.insertBefore(this.view),a.length>0&&s.append(t('')),i.length>0&&s.append(t('')),s.on("click","button",(function(e){var i=t(this);s.find("button").removeClass("active"),r.rootConfig.playerXml!==i.data().url?(r.rootConfig.playerXml=i.data().url,i.addClass("active")):r.rootConfig.playerXml=r.originXml,null!==r.playerRegistered?r.playerRegistered.updateData({url:r.rootConfig.playerXml}):n.click()}))}},bindLayer:function(e){var n=this;if(!0===this.firstInit)return!1;if("none"===this.view.parents(".teaser").css("display"))return!1;var r=this.teaserContainer.find(".linkAll").length>0?this.teaserContainer.find(".linkAll,.innerTeaser > .mediaCon"):this.view;if(this.isBroadcastPage&&0!==this.view.parents(".cssBroadcast .sectionDetailPage .con.hasAv").length&&this.load({url:this.rootConfig.playerXml,type:"xml",onComplete:function(e){n.checkForAccessible(t(e),r)}}),("li"===this.view[0].tagName.toLowerCase()||this.view.parents(".form-button").length>0)&&(r=this.view,this.teaserContainer=this.view),void 0!==this.teaserContainer.data()&&void 0!==this.teaserContainer.data().id&&(this.contentId=this.teaserContainer.data().id),!0===this.isDetail()&&(this.contentId=t("body").data().id),this.checkPlayerInitBehaviour(),this.isApp()){var i=this.rootConfig.playerXml.split("/"),a=i[i.length-1].split("-avCustom.xml")[0],s=null,o=this.teaserContainer.hasClass("cssAudioLivestream")||this.view.hasClass("cssAudioLivestream")||this.teaserContainer.hasClass("cssVideoLivestream")||this.view.hasClass("cssVideoLivestream");this.teaserContainer.hasClass("cssArticle")&&this.teaserContainer.data().id&&(s=this.teaserContainer.find(".linkAll").eq(0).attr("href"));var l=app.mdrSpecs.getRedirectAppLink({id:a,type:this.type,forceUrl:s,live:o}),u=this.teaserContainer.find(".linkAll").eq(0);return 0===u.length&&!1===this.fallbackLinkAll?(this.view.append(`
`),this.fallbackLinkAll=!0):u.attr("href",l),!1}r.on("click",(function(e){if(r.blur(),0===t(e.target).parents(".cssProgramHintBox").length)return n.startPlayer(),!1})),(this.teaserContainer.hasClass("avAutostart")&&this.teaserContainer.hasClass("boxSpecial")||t("body").hasClass("avAutostart"))&&(n.rootConfig.autoplay=!0),this.startPreview(),this.firstInit=!0},checkPlayerInitBehaviour:function(){var e=this.teaserContainer.hasClass("cssAudio")?"Audio":"Video";this.teaserContainer.hasClass("boxImage")||this.teaserContainer.hasClass("boxImageSquare");this.teaserContainer.hasClass("cssLivestream")&&(e="Livestream"),!1===this.isReactArdPlayer&&this.view.find(".media").addClass("av-playerContainer").find(".imageWrapper").attr("id",this.rootConfig.id),this.view.find(".media .imageWrapper .icon-font").replaceWith(t('")),(this.view.hasClass("cssAudio")||this.teaserContainer.hasClass("cssAudio")||this.view.parent().hasClass("cssAudio")||this.teaserContainer.hasClass("cssAudioLivestream")||this.view.parent().hasClass("cssAudioLivestream"))&&(this.type="audio"),"inline"===this.rootConfig.forceView||!0===this.app.noLightbox||"audio"===this.type||!0===this.view.parent().parent().hasClass(".special")?this.mode="inline":this.mode="layer",this.view.parents(".cssAvPlus").length>0&&(this.mode="layer"),"detailPage"===this.rootConfig.forceView&&(this.mode="detailPage"),"layer"===this.rootConfig.forceView&&(this.mode="layer"),(this.isDetail()||"detailPage"!==this.mode&&this.isSmallView())&&(this.mode="inline"),this.view.removeClass("avInline avActivePlay"),("inline"===this.mode||this.isDetail())&&(this.view.addClass("avInline"),this.teaserContainer.addClass("avInline")),("layer"===this.mode||"inline"===this.mode||this.isApp())&&(this.view.addClass("avActivePlay"),this.teaserContainer.addClass("avActivePlay"))},isApp:function(){return!0===app.mdrSpecs.isApp},isFullScreenActive:function(){return!!document.webkitCurrentFullScreenElement||!!document.fullscreenElement},callPreviewPlayer:function(e){this.previewActive,this.isFullScreenActive()||(this.startArdPlayer(e,!0),this.teaserContainer.addClass("ardplayer-video-preview"),this.previewActive=!0)},pauseAllPreviews:function(){t(".ardplayer-preview-loop").each((function(){t(this)[0].pause()}))},startPreview:function(){var e=this;t("html").hasClass("no-touch");if(this.isApp())return!1;e.app.checkViewPos(e.view),this.app.addEventListener(n.FRAME_UPDATE,this,"testScrolling"),this.view.on("focus",(function(){e.previewActive||(e.testScrolling(),e.view.off("focus"),e.view.removeAttr("tabIndex"))}))},testScrolling:function(){!0===this.app.isInViewport(this.view,2)&&(this.inViewport=!0),this.inViewport&&!this.previewActive&&(this.app.removeEventListener(n.FRAME_UPDATE,this,"testScrolling"),this.callPreviewPlayer("layer"===this.mode&&!this.isSmallView()))},startPlayer:function(e){var t=this.rootConfig.playerXml.split("/");t[t.length-1].split("-avCustom.xml")[0];this.teaserContainer.hasClass("cssArticle")&&this.teaserContainer.data().id&&this.teaserContainer.find(".linkAll").eq(0).attr("href"),"detailPage"!==this.mode&&this.view.width()>=320?this.registerPlayer():"li"===this.view[0].tagName.toLowerCase()?document.location.href=this.view.find("> a").attr("href"):this.registerPlayer()},isSmallView:function(){return"xs"===this.app.currentView||"s"===this.app.currentView},isDetail:function(){var e=!1;return 0===this.view.parents(".ui-tooltipWrapper").length&&0===this.view.parents(".cssAv .sectionDetailPage").length&&0===this.view.parents(".cssAudio .sectionDetailPage").length&&0===this.view.parents(".cssVideo .sectionDetailPage").length&&0===this.view.parents(".cssBroadcast .sectionDetailPage").length&&0===this.view.parents(".cssAudioLivestream .sectionDetailPage").length&&0===this.view.parents(".cssVideoLivestream .sectionDetailPage").length||(e=!0),e},registerPlayer:function(e){return"li"===this.view[0].tagName.toLowerCase()&&"inline"===this.mode?(document.location.href=this.view.find("> a").attr("href"),!1):!0===this.isReactArdPlayer?(this.startArdPlayer(e),!1):void 0},isSmallPlayer:function(){return this.view.width()<484},startArdPlayer:function(e,n=!1){this.ratio=t("body").hasClass("squareVideo")||this.teaserContainer.hasClass("squareVideo")||this.teaserContainer.hasClass("forceSquareVideo")?"1x1":"16x9",(this.teaserContainer.find(".linkAll").length>0?this.teaserContainer.find(".linkAll,.innerTeaser > .mediaCon"):this.view).off("click"),(this.view.hasClass("cssAudio")||this.teaserContainer.hasClass("cssAudio")||this.view.parent().hasClass("cssAudio")||this.teaserContainer.hasClass("cssAudioLivestream")||this.view.parent().hasClass("cssAudioLivestream"))&&(this.type="audio"),window.renderARDPlayer(this,e,n)}}),n.CONTROLLERS.push(e)},1004:()=>{function e(){}e.NODE_TYPE="retention";var t=window.jQuery,n=window.Application,r=window.BaseController;window.app;window.RetentionController=e,e.prototype=t.extend(new r,{info:null,today:null,createObject:function(){this.info=t('
'),this.today=new Date(Utils.getUrlPreviewDate());var e=this.getFormattedDate(this.rootConfig.dateOffline),n=new Date(e.getFullYear(),e.getMonth(),e.getDate()-Number(this.rootConfig.dateThreshold));if(this.today.getTime()>n.getTime()){var r=this.prettyDate(this.rootConfig.dateOffline);void 0!==r&&(this.info.html(r+'Weitere Infos zur Verweildauer '),this.view.find(".shortInfos").append(this.info))}},handleViewUpdatedEvent:function(e){},handleViewDiedEvent:function(e){},getFormattedDate:function(e){return Utils.convertISO8601ToDate(e)},prettyDate:function(e){var t=(this.getFormattedDate(e).getTime()-this.today.getTime())/1e3,n=Math.floor(t/86400),r="Gerade eben";if(0===n){var i=Math.round(t/60),a=Math.round(t/3600);t<300&&(r="Noch wenige Minuten verf\xfcgbar"),t>300&&(r="Noch "+i+" Minuten verf\xfcgbar"),t>=3600&&(r="Noch eine Stunde verf\xfcgbar"),t>=7200&&(r="Noch "+a+" Stunden verf\xfcgbar"),this.info.addClass("urgent")}return 1===n&&(r="Bis morgen verf\xfcgbar"),n>1&&(r="Noch "+n+" Tage verf\xfcgbar"),n>31&&(r="Noch "+Math.ceil(n/7)+" Wochen verf\xfcgbar"),r}}),n.CONTROLLERS.push(e)},5901:()=>{function e(){}e.NODE_TYPE="rubrik";const t=window.jQuery,n=window.Application,r=window.BaseController;window.RubrikController=e,e.prototype=t.extend(new r,{createObject:function(){t(window).width()>=767||t(document).ready((()=>{t(".Rubrik4er, .Rubrik4erKompakt, .Rubrik3er").each(((e,t)=>{this.changeFirstTeaser(t),this.changeRemainingTeasers(t)}))}))},changeFirstTeaser:function(e){t(e).find(".box").first().attr("class",(function(e,n){var r=n.split(/\s+/);return t.map(r,(function(e){return e.startsWith("box")&&"box"!==e?"boxBigSolid":e})).join(" ")}))},changeRemainingTeasers:function(e){t(e).find(".box").not(":first").each((function(){t(this).attr("class",(function(n,r){var i=r.split(/\s+/);return t.map(i,(function(t){return t.startsWith("box")&&"box"!==t?e.classList.contains("Rubrik4erKompakt")?"boxSmall":"boxNormalSolid":t})).join(" ")}))}))}}),n.CONTROLLERS.push(e)},1869:()=>{function e(){}e.NODE_TYPE="socialmedia",e.FIXED_FOOTER=!1;const t=window.jQuery,n=window.Application,r=window.BaseController;window.SharingMenuController=e,e.prototype=t.extend(new r,{createObject(){this.app.addEventListener(n.EVENT_RESIZE,this,"onResize"),this.renderSharingMenu()},onResize(){},renderSharingMenu(){var e,t,n,r,i,a;if(this.view[0]===document.body)return;const s=this.rootConfig.shareUrl,o=null!=(e=null!=(t=this.rootConfig.title)?t:null==(n=document.querySelector('head [property="og:title"]'))?void 0:n.getAttribute("content"))?e:null==(r=document.querySelector(".conDetailHeader h1 .headline"))?void 0:r.innerText,l=null!=(i=this.rootConfig.teaserText)?i:null==(a=document.querySelector('[name="description"]'))?void 0:a.getAttribute("content");this.view.css("opacity",1),window.renderSharingMenu(this.view[0],this.rootConfig.variant,s,o,l)}}),n.CONTROLLERS.push(e)},1670:()=>{function e(){}e.NODE_TYPE="socialembed",e.STORAGE_ID="mdrde-social-embed",e.EVENT_SOCIAL_LOADED="socialembed:loaded",e.FIXED_FOOTER=!1,e.FB_TEMPLATE='',e.TWITTER_TEMPLATE='',e.TWTTER_SCRIPT='