(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{"+6XX":function(e,t,n){var r=n("y1pI");e.exports=function(e){return r(this.__data__,e)>-1}},"+8km":function(e,t,n){var r=n("ioFA");var i={shouldComponentUpdate:function(e,t){return function(e,t,n){return!r(e.props,t)||!r(e.state,n)}(this,e,t)}};e.exports=i},"+JPL":function(e,t,n){e.exports={default:n("+SFK"),__esModule:!0}},"+JTO":function(e,t,n){"use strict";n("oZKO"),n("qb+d")},"+K+b":function(e,t,n){var r=n("JHRd");e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},"+KcL":function(e,t,n){e.exports=n("UbbE")},"+Kib":function(e,t,n){"use strict";var r,i=n("3mbX"),o=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?Object(i.h)(e):e}),a=function(e){e=Object(i.k)(e);for(var t=[],n=0;e.length>n;){var o=e[n],a=0,s=0,u=e[++s];for(s++;128&u;)a=(127&u)<<7,u=e[s],s++;a+=127&u;for(var l=0;l>>0,l=t.subarray(s+4,s+8);if(0===u)break;var c=s+u;if(c>t.length){if(r)break;c=t.length}var f=t.subarray(s+8,c);Object(i.a)(l,n[0])&&(1===n.length?a.push(f):a.push.apply(a,e(f,n.slice(1),r))),s=c}return a},u={EBML:Object(i.k)([26,69,223,163]),DocType:Object(i.k)([66,130]),Segment:Object(i.k)([24,83,128,103]),SegmentInfo:Object(i.k)([21,73,169,102]),Tracks:Object(i.k)([22,84,174,107]),Track:Object(i.k)([174]),TrackNumber:Object(i.k)([215]),DefaultDuration:Object(i.k)([35,227,131]),TrackEntry:Object(i.k)([174]),TrackType:Object(i.k)([131]),FlagDefault:Object(i.k)([136]),CodecID:Object(i.k)([134]),CodecPrivate:Object(i.k)([99,162]),VideoTrack:Object(i.k)([224]),AudioTrack:Object(i.k)([225]),Cluster:Object(i.k)([31,67,182,117]),Timestamp:Object(i.k)([231]),TimestampScale:Object(i.k)([42,215,177]),BlockGroup:Object(i.k)([160]),BlockDuration:Object(i.k)([155]),Block:Object(i.k)([161]),SimpleBlock:Object(i.k)([163])},l=[128,64,32,16,8,4,2,1],c=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var o=function(e){for(var t=1,n=0;n=n.length)return n.length;var o=c(n,r,!1);if(Object(i.a)(t.bytes,o.bytes))return r;var a=c(n,r+o.length);return e(t,n,r+a.length+a.value+o.length)},p=function e(t,n){n=function(e){return Array.isArray(e)?e.map(function(e){return f(e)}):[f(e)]}(n),t=Object(i.k)(t);var r=[];if(!n.length)return r;for(var o=0;ot.length?t.length:u+s.value,p=t.subarray(u,l);Object(i.a)(n[0],a.bytes)&&(1===n.length?r.push(p):r=r.concat(e(p,n.slice(1)))),o+=a.length+s.length+p.length}return r},h=n("Mh8q"),m=Object(i.k)([0,0,0,1]),g=Object(i.k)([0,0,1]),v=Object(i.k)([0,0,3]),y=function(e){for(var t=[],n=1;n>1&63),-1!==n.indexOf(l)&&(o=a+u),a+=u+("h264"===t?1:2)}else a++}return e.subarray(0,0)};n.d(t,"a",function(){return T}),n.d(t,"b",function(){return C});var _={webm:Object(i.k)([119,101,98,109]),matroska:Object(i.k)([109,97,116,114,111,115,107,97]),flac:Object(i.k)([102,76,97,67]),ogg:Object(i.k)([79,103,103,83]),ac3:Object(i.k)([11,119]),riff:Object(i.k)([82,73,70,70]),avi:Object(i.k)([65,86,73]),wav:Object(i.k)([87,65,86,69]),"3gp":Object(i.k)([102,116,121,112,51,103]),mp4:Object(i.k)([102,116,121,112]),fmp4:Object(i.k)([115,116,121,112]),mov:Object(i.k)([102,116,121,112,113,116]),moov:Object(i.k)([109,111,111,118]),moof:Object(i.k)([109,111,111,102])},w={aac:function(e){var t=Object(h.a)(e);return Object(i.a)(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(h.a)(e);return Object(i.a)(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=p(e,[u.EBML,u.DocType])[0];return Object(i.a)(t,_.webm)},mkv:function(e){var t=p(e,[u.EBML,u.DocType])[0];return Object(i.a)(t,_.matroska)},mp4:function(e){return!w["3gp"](e)&&!w.mov(e)&&(!(!Object(i.a)(e,_.mp4,{offset:4})&&!Object(i.a)(e,_.fmp4,{offset:4}))||(!(!Object(i.a)(e,_.moof,{offset:4})&&!Object(i.a)(e,_.moov,{offset:4}))||void 0))},mov:function(e){return Object(i.a)(e,_.mov,{offset:4})},"3gp":function(e){return Object(i.a)(e,_["3gp"],{offset:4})},ac3:function(e){var t=Object(h.a)(e);return Object(i.a)(e,_.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+1880}},"+LrT":function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,c=l&&l(Object);e.exports=function e(t,n,f){if("string"!==typeof n){if(c){var d=l(n);d&&d!==c&&e(t,d,f)}var p=a(n);s&&(p=p.concat(s(n)));for(var h=0;h=0&&e<=100}e.exports=function(){var e=100,t=3,i=0,o=100,a=0,s=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");o=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");s=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"===typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):u=t}}})}},"+c4W":function(e,t,n){var r=n("711d"),i=n("4/ic"),o=n("9ggG"),a=n("9Nap");e.exports=function(e){return o(e)?r(a(e)):i(e)}},"+iFO":function(e,t,n){var r=n("dTAl"),i=n("LcsW"),o=n("6sVZ");e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},"+iuc":function(e,t,n){n("wgeU"),n("FlQf"),n("bBy9"),n("B9jh"),n("dL40"),n("xvv9"),n("V+O7"),e.exports=n("WEpk").Set},"+jru":function(e,t,n){n("aPfg")("WeakMap")},"+nKL":function(e,t,n){"use strict";var r=n("q1tI"),i=n("TSYQ"),o=n.n(i);function a(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 s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(e){var t=e.height,n=e.offset,i=e.children,u=e.prefixCls,l={},c={display:"flex",flexDirection:"column"};return void 0!==n&&(l={height:t,position:"relative",overflow:"hidden"},c=function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var d="__rc_ghost_item__";function p(e,t){return e<0?0:e>=t?t:e}function h(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;if(n<=r)return 0;var i=n-r;return p(t,i)/i}function m(e){return e?h(e):0}function g(e){var t=function(e){return e instanceof HTMLElement?e:c.a.findDOMNode(e)}(e);return t?t.offsetHeight:0}function v(e,t,n){var r=function(e,t){var n=Math.floor(e*t),r=n/t;return{index:n,offsetPtg:(e-r)/((n+1)/t-r)}}(e,t),i=r.index,o=r.offsetPtg,a=Math.ceil(e*n),s=Math.ceil((1-e)*n);return{itemIndex:i,itemOffsetPtg:o,startIndex:Math.max(0,i-a),endIndex:Math.min(t-1,i+s)}}function y(e){var t=e.itemIndex,n=e.itemOffsetPtg,r=e.itemElementHeights,i=e.scrollPtg*e.clientHeight,o=n*(r[(0,e.getItemKey)(t)]||0);return Math.floor(i-o)}function b(e){var t=e.locatedItemRelativeTop,n=e.locatedItemIndex,r=e.compareItemIndex,i=e.startIndex,o=e.endIndex,a=e.getItemKey,s=e.itemElementHeights,u=t,l=a(r);if(r<=n)for(var c=n;c>=i;c-=1){if(a(c)===l)break;u-=s[a(c-1)]||0}else for(var f=n;f<=o;f+=1){var d=a(f);if(d===l)break;u+=s[d]||0}return u}function _(e,t,n){return"number"===typeof e&&n*t>e}function w(e,t,n,r){var i=n-e,o=t-n;if(r<=2*Math.min(i,o)){var a=Math.floor(r/2);return r%2?n+a+1:n-a}return i>o?n-(r-o):n+(r-i)}function E(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 S(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function O(e){return(O="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})(e)}function x(e,t){for(var n=0;n=p}if(!r){var m=v(w,a.length,f),y=m.itemIndex,b=m.itemOffsetPtg,S=m.startIndex,T=m.endIndex;return void n.setState({scrollTop:_,itemIndex:y,itemOffsetPtg:b,startIndex:S,endIndex:T})}t=ln.listRef.current.scrollTop+p&&(S="bottom")),"top"===S?n.listRef.current.scrollTop=C:"bottom"===S&&(n.listRef.current.scrollTop=C-(p-T))}}}else n.listRef.current.scrollTop=e})},n.renderChildren=function(e,t,i){var o=n.state.status;return e.map(function(e,a){var s=t+a,u=i(e,s,{style:"MEASURE_START"===o?{visibility:"hidden"}:{}}),l=n.getIndexKey(s);return r.cloneElement(u,{key:l,ref:function(e){n.itemElements[l]=e}})})},n.cachedProps=e,n.state={status:"NONE",scrollTop:null,itemIndex:0,itemOffsetPtg:0,startIndex:0,endIndex:0,startItemTop:0,isVirtual:_(e.height,e.itemHeight,e.data.length),itemCount:e.data.length},n}var n,i,a;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&&P(e,t)}(t,r["Component"]),n=t,a=[{key:"getDerivedStateFromProps",value:function(e){return e.disabled?null:{itemCount:e.data.length}}}],(i=[{key:"componentDidMount",value:function(){this.listRef.current&&(this.listRef.current.scrollTop=0,this.onScroll(null))}},{key:"componentDidUpdate",value:function(){var e=this,t=this.state.status,n=this.props,r=n.data,i=n.height,o=n.itemHeight,a=n.disabled,s=n.onSkipRender,u=this.cachedProps.data||[],l=null;if(u.length!==r.length){var c=function(e,t,n){var r,i,o=e.length,a=t.length;if(0===o&&0===a)return null;ou.length){var d=this.state,p=d.startIndex,g=d.endIndex;s&&(null===l||l=S;k-=1)x-=this.itemElementHeights[this.getIndexKey(k)]||0;this.setState({status:"MEASURE_DONE",startItemTop:x})}var D;if("SWITCH_TO_RAW"===t){for(var P=this.state.cacheScroll,A=P.itemIndex,I=P.relativeTop,N=0;N10)break}null!==c&&(this.lockScroll=!0,this.listRef.current.scrollTop=c,this.setState({status:"MEASURE_START",scrollTop:c,itemIndex:f,itemOffsetPtg:d,startIndex:p,endIndex:m}),requestAnimationFrame(function(){requestAnimationFrame(function(){t.lockScroll=!1})}))}},{key:"render",value:function(){var e=this.state,t=e.isVirtual,n=e.itemCount,i=this.props,a=i.prefixCls,s=i.style,l=i.className,c=i.component,f=void 0===c?"div":c,d=i.height,p=i.itemHeight,h=i.fullHeight,m=void 0===h||h,g=i.data,v=i.children,y=(i.itemKey,i.onSkipRender,i.disabled,C(i,["prefixCls","style","className","component","height","itemHeight","fullHeight","data","children","itemKey","onSkipRender","disabled"])),b=o()(a,l);if(!t){var w=_(d,p,g.length);return r.createElement(f,Object.assign({style:d?S({},s,T({},m?"height":"maxHeight",d),A):s,className:b},y,{onScroll:this.onRawScroll,ref:this.listRef}),r.createElement(u,{prefixCls:a,height:d},this.renderChildren(w?g.slice(0,Math.ceil(d/p)):g,0,v)))}var E=S({},s,{height:d},A),O=this.state,x=O.status,k=O.startIndex,D=O.endIndex,P=O.startItemTop,I=n*p*1;return r.createElement(f,Object.assign({style:E,className:b},y,{onScroll:this.onScroll,ref:this.listRef}),r.createElement(u,{prefixCls:a,height:I,offset:"MEASURE_DONE"===x?P:0},this.renderChildren(g.slice(k,D+1),k,v)))}}])&&x(n.prototype,i),a&&x(n,a),t}();I.defaultProps={itemHeight:15,data:[]};var N=I;t.a=N},"+oAO":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}(n("q1tI")),i=a(n("TSYQ")),o=a(n("Mv4v"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return(u=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:.3;e!==r?(e=r,i&&!n.props.noAnimate&&s(n.contentRef.style,"cubic-bezier(0,0,0.2,1.15) ".concat(i,"s")),a(n.contentRef.style,"translate3d(0,".concat(-r,"px,0)")),setTimeout(function(){n.scrollingComplete(),n.contentRef&&s(n.contentRef.style,"")},1e3*+i)):n.scrollingComplete()},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=0,r=0,i=0,o={record:function(o){var a=+new Date;i=(o-r)/(a-n),a-n>=e&&(i=a-n<=t?i:0,r=o,n=a)},getVelocity:function(e){return e!==r&&o.record(e),i}};return o}(),c=function(){o=!1;var t=e,r=(n.props.children.length-1)*n.itemHeight,i=.3,a=4*l.getVelocity(t);a&&(t=40*a+t,i=.1*Math.abs(a)),t%n.itemHeight!==0&&(t=Math.round(t/n.itemHeight)*n.itemHeight),t<0?t=0:t>r&&(t=r),u(0,t,i<.3?.3:i),n.onScrollChange()},f=function(n){i||(o=!0,r=n,t=e)},d=function(s){!i&&o&&(e=t-s+r,l.record(e),n.onScrollChange(),a(n.contentRef.style,"translate3d(0,".concat(-e,"px,0)")))};return{touchstart:function(e){return f(e.touches[0].pageY)},mousedown:function(e){return f(e.pageY)},touchmove:function(e){e.preventDefault(),d(e.touches[0].pageY)},mousemove:function(e){e.preventDefault(),d(e.pageY)},touchend:function(){return c()},touchcancel:function(){return c()},mouseup:function(){return c()},getValue:function(){return e},scrollTo:u,setDisabled:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];i=e}}}(),n.scrollTo=function(e){n.scrollHanders.scrollTo(0,e)},n.scrollToWithoutAnimation=function(e){n.scrollHanders.scrollTo(0,e,0)},n.fireValueChange=function(e){e!==n.state.selectedValue&&("selectedValue"in n.props||n.setState({selectedValue:e}),n.props.onValueChange&&n.props.onValueChange(e))},n.onScrollChange=function(){var e=n.scrollHanders.getValue();if(e>=0){var t=r.Children.toArray(n.props.children),i=n.props.computeChildIndex(e,n.itemHeight,t.length);if(n.scrollValue!==i){n.scrollValue=i;var o=t[i];o&&n.props.onScrollChange?n.props.onScrollChange(o.props.value):!o&&console.warn&&console.warn("child not found",t,i)}}},n.scrollingComplete=function(){var e=n.scrollHanders.getValue();e>=0&&n.props.doScrollingComplete(e,n.itemHeight,n.fireValueChange)};var o=n.props,a=o.selectedValue,s=o.defaultSelectedValue;if(void 0!==a)i=a;else if(void 0!==s)i=s;else{var u=r.Children.toArray(n.props.children);i=u&&u[0]&&u[0].props.value}return n.state={selectedValue:i},n}var n,o,a;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&&d(e,t)}(t,r.Component),n=t,(o=[{key:"componentDidMount",value:function(){var e=this,t=this.contentRef,n=this.indicatorRef,r=this.maskRef,i=this.rootRef,o=i.getBoundingClientRect().height,a=this.itemHeight=n.getBoundingClientRect().height,s=Math.floor(o/a);s%2===0&&s--,s--,s/=2,t.style.padding="".concat(a*s,"px 0"),n.style.top="".concat(a*s,"px"),r.style.backgroundSize="100% ".concat(a*s,"px"),this.scrollHanders.setDisabled(this.props.disabled),this.props.select(this.state.selectedValue,this.itemHeight,this.scrollTo);var u=this.passiveSupported(),l=!!u&&{passive:!1},c=!!u&&{passive:!0};Object.keys(this.scrollHanders).forEach(function(t){if(0===t.indexOf("touch")||0===t.indexOf("mouse")){var n=t.indexOf("move")>=0?l:c;i.addEventListener(t,e.scrollHanders[t],n)}})}},{key:"componentWillUnmount",value:function(){var e=this;Object.keys(this.scrollHanders).forEach(function(t){0!==t.indexOf("touch")&&0!==t.indexOf("mouse")||e.rootRef.removeEventListener(t,e.scrollHanders[t])})}},{key:"passiveSupported",value:function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(n){}return e}},{key:"componentWillReceiveProps",value:function(e){var t=this;"selectedValue"in e&&this.state.selectedValue!==e.selectedValue&&this.setState({selectedValue:e.selectedValue},function(){t.props.select(e.selectedValue,t.itemHeight,e.noAnimate?t.scrollToWithoutAnimation:t.scrollTo)}),this.scrollHanders.setDisabled(e.disabled)}},{key:"shouldComponentUpdate",value:function(e,t){return this.state.selectedValue!==t.selectedValue||this.props.children!==e.children}},{key:"componentDidUpdate",value:function(){this.props.select(this.state.selectedValue,this.itemHeight,this.scrollToWithoutAnimation)}},{key:"getValue",value:function(){if("selectedValue"in this.props)return this.props.selectedValue;var e=r.Children.toArray(this.props.children);return e&&e[0]&&e[0].props.value}},{key:"render",value:function(){var e,t=this,n=this.props,o=n.prefixCls,a=n.itemStyle,l=n.indicatorStyle,c=n.indicatorClassName,f=void 0===c?"":c,d=n.children,p=this.state.selectedValue,h="".concat(o,"-item"),m="".concat(h," ").concat(o,"-item-selected"),g=function(e){var t=e.props,n=t.className,i=void 0===n?"":n,o=t.style,s=t.value;return r.createElement("div",{style:u({},a,o),className:"".concat(p===s?m:h," ").concat(i),key:s},e.children||e.props.children)},v=r.Children?r.Children.map(d,g):[].concat(d).map(g),y=(s(e={},n.className,!!n.className),s(e,o,!0),e);return r.createElement("div",{className:(0,i.default)(y),ref:function(e){return t.rootRef=e},style:this.props.style},r.createElement("div",{className:"".concat(o,"-mask"),ref:function(e){return t.maskRef=e}}),r.createElement("div",{className:"".concat(o,"-indicator ").concat(f),ref:function(e){return t.indicatorRef=e},style:l}),r.createElement("div",{className:"".concat(o,"-content"),ref:function(e){return t.contentRef=e}},v))}}])&&l(n.prototype,o),a&&l(n,a),t}();p.defaultProps={prefixCls:"rmc-picker"};var h=(0,o.default)(p);t.default=h},"+oT+":function(e,t,n){var r=n("eVuF");function i(e,t,n,i,o,a,s){try{var u=e[a](s),l=u.value}catch(c){return void n(c)}u.done?t(l):r.resolve(l).then(i,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new r(function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)})}}},"+plK":function(e,t,n){n("ApPD"),e.exports=n("WEpk").Object.getPrototypeOf},"+wdc":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=null,r=!1,i=3,o=-1,a=-1,s=!1,u=!1;function l(){if(!s){var e=n.expirationTime;u?S():u=!0,E(d,e)}}function c(){var e=n,t=n.next;if(n===t)n=null;else{var r=n.previous;n=r.next=t,t.previous=r}e.next=e.previous=null,r=e.callback,t=e.expirationTime,e=e.priorityLevel;var o=i,s=a;i=e,a=t;try{var u=r()}finally{i=o,a=s}if("function"===typeof u)if(u={callback:u,priorityLevel:e,expirationTime:t,next:null,previous:null},null===n)n=u.next=u.previous=u;else{r=null,e=n;do{if(e.expirationTime>=t){r=e;break}e=e.next}while(e!==n);null===r?r=n:r===n&&(n=u,l()),(t=r.previous).next=r.previous=u,u.next=r,u.previous=t}}function f(){if(-1===o&&null!==n&&1===n.priorityLevel){s=!0;try{do{c()}while(null!==n&&1===n.priorityLevel)}finally{s=!1,null!==n?l():u=!1}}}function d(e){s=!0;var i=r;r=e;try{if(e)for(;null!==n;){var o=t.unstable_now();if(!(n.expirationTime<=o))break;do{c()}while(null!==n&&n.expirationTime<=o)}else if(null!==n)do{c()}while(null!==n&&!T())}finally{s=!1,r=i,null!==n?l():u=!1,f()}}var p,h,m=Date,g="function"===typeof setTimeout?setTimeout:void 0,v="function"===typeof clearTimeout?clearTimeout:void 0,y="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,b="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0;function _(e){p=y(function(t){v(h),e(t)}),h=g(function(){b(p),e(t.unstable_now())},100)}if("object"===typeof performance&&"function"===typeof performance.now){var w=performance;t.unstable_now=function(){return w.now()}}else t.unstable_now=function(){return m.now()};var E,S,T,C=null;if("undefined"!==typeof window?C=window:"undefined"!==typeof e&&(C=e),C&&C._schedMock){var O=C._schedMock;E=O[0],S=O[1],T=O[2],t.unstable_now=O[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var x=null,k=function(e){if(null!==x)try{x(e)}finally{x=null}};E=function(e){null!==x?setTimeout(E,0,e):(x=e,setTimeout(k,0,!1))},S=function(){x=null},T=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof y&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof b&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var D=null,P=!1,A=-1,I=!1,N=!1,M=0,R=33,j=33;T=function(){return M<=t.unstable_now()};var L=new MessageChannel,F=L.port2;L.port1.onmessage=function(){P=!1;var e=D,n=A;D=null,A=-1;var r=t.unstable_now(),i=!1;if(0>=M-r){if(!(-1!==n&&n<=r))return I||(I=!0,_(U)),D=e,void(A=n);i=!0}if(null!==e){N=!0;try{e(i)}finally{N=!1}}};var U=function(e){if(null!==D){_(U);var t=e-M+j;tt&&(t=8),j=tt?F.postMessage(void 0):I||(I=!0,_(U))},S=function(){D=null,P=!1,A=-1}}t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,n){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=i,a=o;i=e,o=t.unstable_now();try{return n()}finally{i=r,o=a,f()}},t.unstable_next=function(e){switch(i){case 1:case 2:case 3:var n=3;break;default:n=i}var r=i,a=o;i=n,o=t.unstable_now();try{return e()}finally{i=r,o=a,f()}},t.unstable_scheduleCallback=function(e,r){var a=-1!==o?o:t.unstable_now();if("object"===typeof r&&null!==r&&"number"===typeof r.timeout)r=a+r.timeout;else switch(i){case 1:r=a+-1;break;case 2:r=a+250;break;case 5:r=a+1073741823;break;case 4:r=a+1e4;break;default:r=a+5e3}if(e={callback:e,priorityLevel:i,expirationTime:r,next:null,previous:null},null===n)n=e.next=e.previous=e,l();else{a=null;var s=n;do{if(s.expirationTime>r){a=s;break}s=s.next}while(s!==n);null===a?a=n:a===n&&(n=e,l()),(r=a.previous).next=a.previous=e,e.next=a,e.previous=r}return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(t===e)n=null;else{e===n&&(n=t);var r=e.previous;r.next=t,t.previous=r}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var n=i;return function(){var r=i,a=o;i=n,o=t.unstable_now();try{return e.apply(this,arguments)}finally{i=r,o=a,f()}}},t.unstable_getCurrentPriorityLevel=function(){return i},t.unstable_shouldYield=function(){return!r&&(null!==n&&n.expirationTime0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,n=void 0!==t&&t,r=e.hybrid,i=void 0!==r&&r,o=e.hasQuery;return n||i&&(void 0!==o&&o)}t.isInAmpMode=s,t.useAmp=function(){return s(o.default.useContext(a.AmpStateContext))}},"/9aa":function(e,t,n){var r=n("NykK"),i=n("ExA7"),o="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||i(e)&&r(e)==o}},"/MKj":function(e,t,n){"use strict";var r=n("s4An");function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object(r.a)(e,t)}var o=n("q1tI"),a=n("17x9"),s=n.n(a),u=s.a.shape({trySubscribe:s.a.func.isRequired,tryUnsubscribe:s.a.func.isRequired,notifyNestedSubs:s.a.func.isRequired,isSubscribed:s.a.func.isRequired}),l=s.a.shape({subscribe:s.a.func.isRequired,dispatch:s.a.func.isRequired,getState:s.a.func.isRequired});var c=function(e){var t;void 0===e&&(e="store");var n=e+"Subscription",r=function(t){i(a,t);var r=a.prototype;function a(n,r){var i;return(i=t.call(this,n,r)||this)[e]=n.store,i}return r.getChildContext=function(){var t;return(t={})[e]=this[e],t[n]=null,t},r.render=function(){return o.Children.only(this.props.children)},a}(o.Component);return r.propTypes={store:l.isRequired,children:s.a.element.isRequired},r.childContextTypes=((t={})[e]=l.isRequired,t[n]=u,t),r}(),f=n("JX7q");function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t, or explicitly pass "'+k+'" as a prop to "'+r+'".'),i.initSelector(),i.initSubscription(),i}i(s,n);var u=s.prototype;return u.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[I]=t||this.context[I],e},u.componentDidMount=function(){O&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},u.componentWillReceiveProps=function(e){this.selector.run(e)},u.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},u.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=T,this.store=null,this.selector.run=T,this.selector.shouldComponentUpdate=!1},u.getWrappedInstance=function(){return v()(P,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+g+"() call."),this.wrappedInstance},u.setWrappedInstance=function(e){this.wrappedInstance=e},u.initSelector=function(){var t=e(this.store.dispatch,a);this.selector=function(e,t){var n={run:function(r){try{var i=e(t.getState(),r);(i!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=i,n.error=null)}catch(o){n.shouldComponentUpdate=!0,n.error=o}}};return n}(t,this.store),this.selector.run(this.props)},u.initSubscription=function(){if(O){var e=(this.propsMode?this.props:this.context)[I];this.subscription=new w(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},u.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(S)):this.notifyNestedSubs()},u.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},u.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},u.addExtraProps=function(e){if(!P&&!_&&(!this.propsMode||!this.subscription))return e;var t=d({},e);return P&&(t.ref=this.setWrappedInstance),_&&(t[_]=this.renderCount++),this.propsMode&&this.subscription&&(t[I]=this.subscription),t},u.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(o.createElement)(t,this.addExtraProps(e.props))},s}(o.Component);return s.WrappedComponent=t,s.displayName=r,s.childContextTypes=R,s.contextTypes=M,s.propTypes=M,m()(s,t)}}var O=Object.prototype.hasOwnProperty;function x(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function k(e,t){if(x(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function H(e,t){return e===t}var V=function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?C:n,i=t.mapStateToPropsFactories,o=void 0===i?M:i,a=t.mapDispatchToPropsFactories,s=void 0===a?N:a,u=t.mergePropsFactories,l=void 0===u?j:u,c=t.selectorFactory,f=void 0===c?U:c;return function(e,t,n,i){void 0===i&&(i={});var a=i,u=a.pure,c=void 0===u||u,h=a.areStatesEqual,m=void 0===h?H:h,g=a.areOwnPropsEqual,v=void 0===g?k:g,y=a.areStatePropsEqual,b=void 0===y?k:y,_=a.areMergedPropsEqual,w=void 0===_?k:_,E=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),S=B(e,o,"mapStateToProps"),T=B(t,s,"mapDispatchToProps"),C=B(n,l,"mergeProps");return r(f,d({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:S,initMapDispatchToProps:T,initMergeProps:C,pure:c,areStatesEqual:m,areOwnPropsEqual:v,areStatePropsEqual:b,areMergedPropsEqual:w},E))}}();n.d(t,"a",function(){return c}),n.d(t,"b",function(){return V})},"/aIJ":function(e,t,n){},"/eQG":function(e,t,n){n("v5Dd");var r=n("WEpk").Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},"/h46":function(e,t,n){n("cHUd")("Map")},"/j8O":function(e,t,n){"use strict";n("8Gnn"),n("YFjQ")},"/jkW":function(e,t,n){"use strict";n("9f0s")(t,"__esModule",{value:!0});var r=/\/\[[^\/]+?\](?=\/|$)/;t.isDynamicRoute=function(e){return r.test(e)}},"03A+":function(e,t,n){var r=n("JTzB"),i=n("ExA7"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},"0602":function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function E(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case d:case a:case u:case s:case h:return e;default:switch(e=e&&e.$$typeof){case c:case p:case v:case g:case l:return e;default:return t}}case o:return t}}}function S(e){return E(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=i,t.ForwardRef=p,t.Fragment=a,t.Lazy=v,t.Memo=g,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return S(e)||E(e)===f},t.isConcurrentMode=S,t.isContextConsumer=function(e){return E(e)===c},t.isContextProvider=function(e){return E(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return E(e)===p},t.isFragment=function(e){return E(e)===a},t.isLazy=function(e){return E(e)===v},t.isMemo=function(e){return E(e)===g},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===u},t.isStrictMode=function(e){return E(e)===s},t.isSuspense=function(e){return E(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===u||e===s||e===h||e===m||"object"===typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===b||e.$$typeof===_||e.$$typeof===w||e.$$typeof===y)},t.typeOf=E},"0Bsm":function(e,t,n){"use strict";var r=n("HDbY");t.__esModule=!0,t.default=function(e){function t(t){return o.default.createElement(e,(0,i.default)({router:(0,a.useRouter)()},t))}t.getInitialProps=e.getInitialProps,t.origGetInitialProps=e.origGetInitialProps,0;return t};var i=r(n("3+Pc")),o=r(n("q1tI")),a=n("nOHt")},"0CxO":function(e,t,n){var r=n("7zRj"),i=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function o(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function s(){this.values=i(null)}function u(e,t,n,r){var i=r?e.split(r):[e];for(var o in i)if("string"===typeof i[o]){var a=i[o].split(n);if(2===a.length)t(a[0].trim(),a[1].trim())}}function l(e,t,n){var r=e;function i(){var t=a(e);if(null===t)throw new o(o.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=i(),l(),"--\x3e"!==e.substr(0,3))throw new o(o.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),l(),t.endTime=i(),l(),function(e,t){var r=new s;u(e,function(e,t){switch(e){case"region":for(var 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":var o=t.split(","),a=o[0];r.integer(e,a),r.percent(e,a)&&r.set("snapToLines",!1),r.alt(e,a,["auto"]),2===o.length&&r.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=t.split(","),r.percent(e,o[0]),2===o.length&&r.alt("positionAlign",o[1],["start","center","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");try{t.line=r.get("line","auto")}catch(i){}t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100);try{t.align=r.get("align","center")}catch(i){t.align=r.get("align","middle")}try{t.position=r.get("position","auto")}catch(i){t.position=r.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}o.prototype=i(Error.prototype),o.prototype.constructor=o,o.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},s.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r=0&&t<=100)&&(this.set(e,t),!0)}};var c=r.createElement&&r.createElement("textarea"),f={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},d={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},p={v:"title",lang:"lang"},h={rt:"ruby"};function m(e,t){function n(){if(!t)return null;var e,n=t.match(/^([^<]*)(<[^>]*>?)?/);return e=n[1]?n[1]:n[2],t=t.substr(e.length),e}function r(e,t){return!h[t.localName]||h[t.localName]===e.localName}function i(t,n){var r=f[t];if(!r)return null;var i=e.document.createElement(r),o=p[t];return o&&n&&(i[o]=n.trim()),i}for(var o,s,u=e.document.createElement("div"),l=u,m=[];null!==(o=n());)if("<"!==o[0])l.appendChild(e.document.createTextNode((s=o,c.innerHTML=s,s=c.textContent,c.textContent="",s)));else{if("/"===o[1]){m.length&&m[m.length-1]===o.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,v=a(o.substr(1,o.length-2));if(v){g=e.document.createProcessingInstruction("timestamp",v),l.appendChild(g);continue}var y=o.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=i(y[1],y[3])))continue;if(!r(l,g))continue;if(y[2]){var b=y[2].split(".");b.forEach(function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(d.hasOwnProperty(n)){var r=t?"background-color":"color",i=d[n];g.style[r]=i}}),g.className=b.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function v(e){for(var t=0;t=n[0]&&e<=n[1])return!0}return!1}function y(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function i(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var o=n.match(/^.*(\n|\r)/);return o?(e.length=0,o[0]):n}return"ruby"===t.tagName?i(e):t.childNodes?(r(e,t),i(e)):void 0}for(r(t,e);n=i(t);)for(var o=0;o=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;if&&(c=c<0?-1:1,c*=Math.ceil(f/l)*l),a<0&&(c+=""===o.vertical?n.height:n.width,s=s.reverse()),i.move(d,c)}else{var p=i.lineHeight/n.height*100;switch(o.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(o.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}s=["+y","-x","+x","-y"],i=new w(t)}var h=function(e,t){for(var i,o=new w(e),a=1,s=0;su&&(i=new w(e),a=u),e=new w(o)}return i||o}(i,s);t.move(h.toCSSCompatValues(n))}function S(){}b.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},b.prototype.formatStyle=function(e,t){return 0===e?0:e+t},_.prototype=i(b.prototype),_.prototype.constructor=_,w.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},w.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},w.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},w.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},w.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},w.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},w.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},S.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},S.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};S.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===r.RFC1738&&(40===c||41===c)?u+=s.charAt(l):c<128?u+=a[c]:c<2048?u+=a[192|c>>6]+a[128|63&c]:c<55296||c>=57344?u+=a[224|c>>12]+a[128|c>>6&63]+a[128|63&c]:(l+=1,c=65536+((1023&c)<<10|1023&s.charCodeAt(l)),u+=a[240|c>>18]+a[128|c>>12&63]+a[128|c>>6&63]+a[128|63&c])}return u},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r1?t-1:0),i=1;i2?r-2:0),o=2;o2?r-2:0),o=2;o2?r-2:0),o=2;o1&&n.triggerEvent("onPinchOut"),a<1&&n.triggerEvent("onPinchIn")),n.triggerCombineEvent.apply(n,[e,t].concat(i))},n.initPressTimer=function(){n.cleanPressTimer(),n.pressTimer=setTimeout(function(){n.setGestureState({press:!0}),n.triggerEvent("onPress")},C.time)},n.cleanPressTimer=function(){n.pressTimer&&clearTimeout(n.pressTimer)},n.setGestureState=function(e){n.gesture||(n.gesture={}),n.gesture.touches&&(n.gesture.preTouches=n.gesture.touches),n.gesture=i()({},n.gesture,e)},n.getGestureState=function(){return n.gesture?i()({},n.gesture):n.gesture},n.cleanGestureState=function(){delete n.gesture},n.getTouches=function(e){return Array.prototype.slice.call(e.touches).map(function(e){return{x:e.screenX,y:e.screenY}})},n.triggerUserCb=function(e,t){var r=A("onTouch",e);r in n.props&&n.props[r](t)},n._handleTouchStart=function(e){n.triggerUserCb("start",e),n.event=e,e.touches.length>1&&e.preventDefault(),n.initGestureStatus(e),n.initPressTimer(),n.checkIfMultiTouchStart()},n.initGestureStatus=function(e){n.cleanGestureState();var t=n.getTouches(e),r=D(),i=P(t);n.setGestureState({startTime:r,startTouches:t,startMutliFingerStatus:i,time:r,touches:t,mutliFingerStatus:i,srcEvent:n.event})},n.checkIfMultiTouchStart=function(){var e=n.props,t=e.enablePinch,r=e.enableRotate,i=n.gesture.touches;if(i.length>1&&(t||r)){if(t){var o=P(i);n.setGestureState({startMutliFingerStatus:o,pinch:!0,scale:1}),n.triggerCombineEvent("onPinch","start")}r&&(n.setGestureState({rotate:!0,rotation:0}),n.triggerCombineEvent("onRotate","start"))}},n._handleTouchMove=function(e){n.triggerUserCb("move",e),n.event=e,n.gesture&&(n.cleanPressTimer(),n.updateGestureStatus(e),n.checkIfSingleTouchMove(),n.checkIfMultiTouchMove())},n.checkIfMultiTouchMove=function(){var e=n.gesture,t=e.pinch,r=e.rotate,i=e.touches,o=e.startMutliFingerStatus,a=e.mutliFingerStatus;if(t||r){if(i.length<2)return n.setGestureState({pinch:!1,rotate:!1}),t&&n.triggerCombineEvent("onPinch","cancel"),void(r&&n.triggerCombineEvent("onRotate","cancel"));if(t){var s=a.z/o.z;n.setGestureState({scale:s}),n.triggerPinchEvent("onPinch","move")}if(r){var u=function(e,t){var n=e.angle;return t.angle-n}(o,a);n.setGestureState({rotation:u}),n.triggerCombineEvent("onRotate","move")}}},n.allowGesture=function(){return e=n.gesture.direction,!!(n.directionSetting&e);var e},n.checkIfSingleTouchMove=function(){var e=n.gesture,t=e.pan,r=e.touches,i=e.moveStatus,o=e.preTouches,a=e.availablePan,s=void 0===a||a;if(r.length>1)return n.setGestureState({pan:!1}),void(t&&n.triggerCombineEvent("onPan","cancel"));if(i&&s){var u=function(e,t){var n=e.x,r=e.y,i=t.x-n,o=t.y-r;return 0===i&&0===o?v:Math.abs(i)>=Math.abs(o)?i<0?y:b:o<0?_:w}(o[0],r[0]);n.setGestureState({direction:u});var l=I(u);if(!n.allowGesture())return void(t||n.setGestureState({availablePan:!1}));t?(n.triggerCombineEvent("onPan",l),n.triggerSubEvent("onPan","move")):(n.triggerCombineEvent("onPan","start"),n.setGestureState({pan:!0,availablePan:!0}))}},n.checkIfMultiTouchEnd=function(e){var t=n.gesture,r=t.pinch,i=t.rotate;r&&n.triggerCombineEvent("onPinch",e),i&&n.triggerCombineEvent("onRotate",e)},n.updateGestureStatus=function(e){var t=D();if(n.setGestureState({time:t}),e.touches&&e.touches.length){var r=n.gesture,i=r.startTime,o=r.startTouches,a=r.pinch,s=r.rotate,u=n.getTouches(e),l=function(e,t,n){var r=e[0],i=r.x,o=r.y,a=t[0],s=a.x-i,u=a.y-o,l=x(s,u);return{x:s,y:u,z:l,time:n,velocity:l/n,angle:k(s,u)}}(o,u,t-i),c=void 0;(a||s)&&(c=P(u)),n.setGestureState({touches:u,mutliFingerStatus:c,moveStatus:l})}},n._handleTouchEnd=function(e){n.triggerUserCb("end",e),n.event=e,n.gesture&&(n.cleanPressTimer(),n.updateGestureStatus(e),n.doSingleTouchEnd("end"),n.checkIfMultiTouchEnd("end"))},n._handleTouchCancel=function(e){n.triggerUserCb("cancel",e),n.event=e,n.gesture&&(n.cleanPressTimer(),n.updateGestureStatus(e),n.doSingleTouchEnd("cancel"),n.checkIfMultiTouchEnd("cancel"))},n.triggerAllowEvent=function(e,t){n.allowGesture()?n.triggerCombineEvent(e,t):n.triggerSubEvent(e,t)},n.doSingleTouchEnd=function(e){var t=n.gesture,r=t.moveStatus,i=t.pinch,o=t.rotate,a=t.press,s=t.pan,u=t.direction;if(!i&&!o){if(r){var l=function(e,t){return Math.abs(e)>=O.threshold&&Math.abs(t)>O.velocity}(r.z,r.velocity);if(n.setGestureState({swipe:l}),s&&n.triggerAllowEvent("onPan",e),l){var c=I(u);return void n.triggerAllowEvent("onSwipe",c)}}a?n.triggerEvent("onPressUp"):n.triggerEvent("onTap")}},n.getTouchAction=function(){var e=n.props,t=e.enablePinch,r=e.enableRotate,i=n.directionSetting;return t||r||i===T?"pan-x pan-y":i===S?"pan-x":i===E?"pan-y":"auto"},n.directionSetting=N[e.direction],n}return h()(t,e),a()(t,[{key:"componentWillUnmount",value:function(){this.cleanPressTimer()}},{key:"render",value:function(){var e=this.props.children,t=g.a.Children.only(e),n=this.getTouchAction(),r={onTouchStart:this._handleTouchStart,onTouchMove:this._handleTouchMove,onTouchCancel:this._handleTouchCancel,onTouchEnd:this._handleTouchEnd};return g.a.cloneElement(t,i()({},r,{style:i()({touchAction:n},t.props.style||{})}))}}]),t}(m.Component),R=M;function j(e){return{transform:e,WebkitTransform:e,MozTransform:e}}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return"translate3d("+(e=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"0px, "+e+t+", 0px":""+e+t+", 0px, 0px")+")"}function F(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"px",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];arguments.length>4&&void 0!==arguments[4]&&arguments[4]?r?e.style.top=""+t+n:e.style.left=""+t+n:U(e.style,L(t,n,r))}function U(e,t){e.transform=t,e.webkitTransform=t,e.mozTransform=t}M.defaultProps={enableRotate:!1,enablePinch:!1,direction:"all"};var B=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&void 0!==arguments[0]?arguments[0]:n.isTabBarVertical(),r=+(""+e).replace("%","");return(""+e).indexOf("%")>=0&&(r/=100,r*=t?n.layout.clientHeight:n.layout.clientWidth),r}()+(i?r.moveStatus.y:r.moveStatus.x),a=i?-n.layout.scrollHeight+n.layout.clientHeight:-n.layout.scrollWidth+n.layout.clientWidth;o=Math.min(o,0),o=Math.max(o,a),F(n.layout,o,"px",i),t=o,n.setState({showPrev:-o>0,showNext:o>a})}},onPanEnd:function(){var r=n.isTabBarVertical();e=t,n.setState({isMoving:!1,transform:L(t,"px",r)})},setCurrentOffset:function(t){return e=t}}}(),n.getTransformByIndex=function(e){var t=e.activeTab,r=e.tabs,i=e.page,o=void 0===i?0:i,a=n.isTabBarVertical(),s=n.getTabSize(o,r.length),u=o/2,l=Math.min(t,r.length-u-.5),c=Math.min(-(l-u+.5)*s,0);return n.onPan.setCurrentOffset(c+"%"),{transform:L(c,"%",a),showPrev:t>u-.5&&r.length>o,showNext:to}},n.onPress=function(e){var t=n.props,r=t.goToTab,i=t.onTabClick,o=t.tabs;i&&i(o[e],e),r&&r(e)},n.isTabBarVertical=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.props.tabBarPosition;return"left"===e||"right"===e},n.renderTab=function(e,t,r,o){var a=n.props,s=a.prefixCls,u=a.renderTab,l=a.activeTab,c=a.tabBarTextStyle,f=a.tabBarActiveTextColor,d=a.tabBarInactiveTextColor,p=a.instanceId,h=i()({},c),m=s+"-tab",v=!1;return l===t?(m+=" "+m+"-active",v=!0,f&&(h.color=f)):d&&(h.color=d),g.a.createElement("div",{key:"t_"+t,style:i()({},h,o?{height:r+"%"}:{width:r+"%"}),id:"m-tabs-"+p+"-"+t,role:"tab","aria-selected":v,className:m,onClick:function(){return n.onPress(t)}},u?u(e):e.title)},n.setContentLayout=function(e){n.layout=e},n.getTabSize=function(e,t){return 100/Math.min(e,t)},n.state=i()({},new W,n.getTransformByIndex(e)),n}return h()(t,e),a()(t,[{key:"componentWillReceiveProps",value:function(e){this.props.activeTab===e.activeTab&&this.props.tabs===e.tabs&&this.props.tabs.length===e.tabs.length||this.setState(i()({},this.getTransformByIndex(e)))}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,r=t.animated,o=t.tabs,a=void 0===o?[]:o,s=t.page,u=void 0===s?0:s,l=t.activeTab,c=void 0===l?0:l,f=t.tabBarBackgroundColor,d=t.tabBarUnderlineStyle,p=t.tabBarPosition,h=t.renderUnderline,m=this.state,v=m.isMoving,y=m.transform,b=m.showNext,_=m.showPrev,w=this.isTabBarVertical(),E=a.length>u,S=this.getTabSize(u,a.length),T=a.map(function(t,n){return e.renderTab(t,n,S,w)}),C=n;r&&!v&&(C+=" "+n+"-animated");var O={backgroundColor:f||""},x=E?i()({},j(y)):{},k=this.onPan,D=(k.setCurrentOffset,V(k,["setCurrentOffset"])),P={style:i()({},w?{height:S+"%"}:{width:S+"%"},w?{top:S*c+"%"}:{left:S*c+"%"},d),className:n+"-underline"};return g.a.createElement("div",{className:C+" "+n+"-"+p,style:O},_&&g.a.createElement("div",{className:n+"-prevpage"}),g.a.createElement(R,i()({},D,{direction:w?"vertical":"horizontal"}),g.a.createElement("div",{role:"tablist",className:n+"-content",style:x,ref:this.setContentLayout},T,h?h(P):g.a.createElement("div",P))),b&&g.a.createElement("div",{className:n+"-nextpage"}))}}]),t}(g.a.PureComponent);q.defaultProps={prefixCls:"rmc-tabs-tab-bar",animated:!0,tabs:[],goToTab:function(){},activeTab:0,page:5,tabBarUnderlineStyle:{},tabBarBackgroundColor:"#fff",tabBarActiveTextColor:"",tabBarInactiveTextColor:"",tabBarTextStyle:{}};var K=0,z=function(e){function t(e){c()(this,t);var n=d()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tabCache={},n.isTabVertical=function(){return"vertical"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.props.tabDirection)},n.shouldRenderTab=function(e){var t=n.props.prerenderingSiblingsNumber,r=void 0===t?0:t,i=n.state.currentTab,o=void 0===i?0:i;return o-r<=e&&e<=o+r},n.getOffsetIndex=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.props.distanceToChangeTab||0,i=Math.abs(e/t),o=i>n.state.currentTab?"<":">",a=Math.floor(i);switch(o){case"<":return i-a>r?a+1:a;case">":return 1-i+a>r?a:a+1;default:return Math.round(i)}},n.getSubElements=function(){var e=n.props.children,t={};return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$i$-",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$ALL$";return Array.isArray(e)?e.forEach(function(e,r){e.key&&(t[e.key]=e),t[""+n+r]=e}):e&&(t[r]=e),t}},n.state={currentTab:n.getTabIndex(e)},n.nextCurrentTab=n.state.currentTab,n.instanceId=K++,n}return h()(t,e),a()(t,[{key:"getTabIndex",value:function(e){var t=e.page,n=e.initialPage,r=e.tabs,i=(void 0!==t?t:n)||0,o=0;return"string"===typeof i?r.forEach(function(e,t){e.key===i&&(o=t)}):o=i||0,o<0?0:o}},{key:"componentWillReceiveProps",value:function(e){this.props.page!==e.page&&void 0!==e.page&&this.goToTab(this.getTabIndex(e),!0,{},e)}},{key:"componentDidMount",value:function(){this.prevCurrentTab=this.state.currentTab}},{key:"componentDidUpdate",value:function(){this.prevCurrentTab=this.state.currentTab}},{key:"goToTab",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.props;if(!t&&this.nextCurrentTab===e)return!1;this.nextCurrentTab=e;var o=r.tabs,a=r.onChange;if(e>=0&&e3&&void 0!==arguments[3]?arguments[3]:"$i$-",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"$ALL$",o=e.key||""+r+t,a=n(r,i),s=a[o]||a[i];return s instanceof Function&&(s=s(e,t)),s||null}}]),t}(g.a.PureComponent);z.defaultProps={tabBarPosition:"top",initialPage:0,swipeable:!0,animated:!0,prerenderingSiblingsNumber:1,tabs:[],destroyInactiveTab:!1,usePaged:!0,tabDirection:"horizontal",distanceToChangeTab:.3};var $=function(e){switch(e){case 2:case 4:return"horizontal";case 8:case 16:return"vertical";default:return"none"}},G=function(e){function t(){c()(this,t);var e=d()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.contentPos="",e.isMoving=!1,e}return h()(t,e),t}(function e(){c()(this,e)}),Y=function(e){function t(e){c()(this,t);var n=d()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onPan=function(){var e=0,t=0,r=void 0;return{onPanStart:function(e){n.props.swipeable&&n.props.animated&&(r=$(e.direction),n.setState({isMoving:!0}))},onPanMove:function(i){var o=n.props,a=o.swipeable,s=o.animated,u=o.useLeftInsteadTransform;if(i.moveStatus&&n.layout&&a&&s){var l=n.isTabVertical(),c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.isTabVertical(),r=+(""+e).replace("%","");return(""+e).indexOf("%")>=0&&(r/=100,r*=t?n.layout.clientHeight:n.layout.clientWidth),r}();c+=l?"horizontal"===r?0:i.moveStatus.y:"vertical"===r?0:i.moveStatus.x;var f=l?-n.layout.scrollHeight+n.layout.clientHeight:-n.layout.scrollWidth+n.layout.clientWidth;c=Math.min(c,0),c=Math.max(c,f),F(n.layout,c,"px",l,u),t=c}},onPanEnd:function(){if(n.props.swipeable&&n.props.animated){e=t;var r=n.isTabVertical(),i=n.getOffsetIndex(t,r?n.layout.clientHeight:n.layout.clientWidth);n.setState({isMoving:!1}),i===n.state.currentTab?n.props.usePaged&&U(n.layout.style,n.getContentPosByIndex(i,n.isTabVertical(),n.props.useLeftInsteadTransform)):n.goToTab(i)}},setCurrentOffset:function(t){return e=t}}}(),n.onSwipe=function(e){var t=n.props,r=t.tabBarPosition,i=t.swipeable,o=t.usePaged;if(i&&o&&!n.isTabVertical())switch(r){case"top":case"bottom":switch(e.direction){case 2:n.isTabVertical()||n.goToTab(n.prevCurrentTab+1);case 8:n.isTabVertical()&&n.goToTab(n.prevCurrentTab+1);break;case 4:n.isTabVertical()||n.goToTab(n.prevCurrentTab-1);case 16:n.isTabVertical()&&n.goToTab(n.prevCurrentTab-1)}}},n.setContentLayout=function(e){n.layout=e},n.state=i()({},n.state,new G,{contentPos:n.getContentPosByIndex(n.getTabIndex(e),n.isTabVertical(e.tabDirection),e.useLeftInsteadTransform)}),n}return h()(t,e),a()(t,[{key:"goToTab",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.usePaged,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.props,o=i.tabDirection,a=i.useLeftInsteadTransform,s={};return r&&(s={contentPos:this.getContentPosByIndex(e,this.isTabVertical(o),a)}),u()(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"goToTab",this).call(this,e,n,s,i)}},{key:"tabClickGoToTab",value:function(e){this.goToTab(e,!1,!0)}},{key:"getContentPosByIndex",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=100*-e+"%";return this.onPan.setCurrentOffset(r),n?""+r:"translate3d("+(t?"0px, "+r:r+", 0px")+", 1px)"}},{key:"renderContent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSubElements(),n=this.props,r=n.prefixCls,o=n.tabs,a=n.animated,s=n.destroyInactiveTab,u=n.useLeftInsteadTransform,l=this.state,c=l.currentTab,f=l.isMoving,d=l.contentPos,p=this.isTabVertical(),h=r+"-content-wrap";a&&!f&&(h+=" "+h+"-animated");var m=a?u?i()({position:"relative"},this.isTabVertical()?{top:d}:{left:d}):j(d):i()({position:"relative"},this.isTabVertical()?{top:100*-c+"%"}:{left:100*-c+"%"}),v=this.getTabBarBaseProps().instanceId;return g.a.createElement("div",{className:h,style:m,ref:this.setContentLayout},o.map(function(n,i){var o=r+"-pane-wrap";e.state.currentTab===i?o+=" "+o+"-active":o+=" "+o+"-inactive";var a=n.key||"tab_"+i;return e.shouldRenderTab(i)?e.tabCache[i]=e.getSubElement(n,i,t):s&&(e.tabCache[i]=void 0),g.a.createElement(H,{key:a,className:o,active:c===i,role:"tabpanel","aria-hidden":c!==i,"aria-labelledby":"m-tabs-"+v+"-"+i,fixX:p,fixY:!p},e.tabCache[i])}))}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.tabBarPosition,r=e.tabDirection,o=e.useOnPan,a=e.noRenderContent,s=this.isTabVertical(r),u=i()({},this.getTabBarBaseProps()),l=!s&&o?this.onPan:{},c=[g.a.createElement("div",{key:"tabBar",className:t+"-tab-bar-wrap"},this.renderTabBar(u,q)),!a&&g.a.createElement(R,i()({key:"$content",onSwipe:this.onSwipe},l),this.renderContent())];return g.a.createElement("div",{className:t+" "+t+"-"+r+" "+t+"-"+n},"top"===n||"left"===n?c:c.reverse())}}]),t}(z);Y.DefaultTabBar=q,Y.defaultProps=i()({},z.defaultProps,{prefixCls:"rmc-tabs",useOnPan:!0}),n.d(t,"Tabs",function(){return Y}),n.d(t,"DefaultTabBar",function(){return q})},"0tVQ":function(e,t,n){n("FlQf"),n("VJsP"),e.exports=n("WEpk").Array.from},"0ycA":function(e,t){e.exports=function(){return[]}},"1+5i":function(e,t,n){var r=n("w/wX"),i=n("sEf8"),o=n("mdPL"),a=o&&o.isSet,s=a?i(a):r;e.exports=s},"1/IK":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"10ky":function(e,t,n){"use strict";var r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const u=String.fromCharCode(9),l=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},c=function(e){const t={};if(!e)return t;const n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r,i=n.length;for(;i--;)""!==n[i]&&((r=/([^=]*)=(.*)/.exec(n[i]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),t[r[0]]=r[1]);return t};class f extends r{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;if(0===(e=e.trim()).length)return;if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce((t,n)=>{const r=n(e);return r===e?t:t.concat([r])},[e]).forEach(e=>{for(let t=0;te),this.customParsers.push(i=>{if(e.exec(i))return this.trigger("data",{type:"custom",data:n(i),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(n=>e.test(n)?t(n):n)}}const d=function(e){const t={};return Object.keys(e).forEach(function(n){var r;t[(r=n,r.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()))]=e[n]}),t},p=function(e){const{serverControl:t,targetDuration:n,partTargetDuration:r}=e;if(!t)return;const i="#EXT-X-SERVER-CONTROL",o="holdBack",a="partHoldBack",s=n&&3*n,u=r&&2*r;n&&!t.hasOwnProperty(o)&&(t[o]=s,this.trigger("info",{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${s}).`})),s&&t[o]{i.uri||!i.parts&&!i.preloadHints||(!i.map&&n&&(i.map=n),!i.key&&r&&(i.key=r),i.timeline||"number"!==typeof c||(i.timeline=c),this.manifest.preloadSegment=i)}),this.parseStream.on("data",function(s){let f,v;({tag(){({version(){s.version&&(this.manifest.version=s.version)},"allow-cache"(){this.manifest.allowCache=s.allowed,"allowed"in s||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in s&&(i.byterange=e,e.length=s.length,"offset"in s||(s.offset=h)),"offset"in s&&(i.byterange=e,e.offset=s.offset),h=e.offset+e.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),s.duration>0&&(i.duration=s.duration),0===s.duration&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(s.attributes)if("NONE"!==s.attributes.METHOD)if(s.attributes.URI){if("com.apple.streamingkeydelivery"===s.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:s.attributes});if("com.microsoft.playready"===s.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:s.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===s.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(s.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===s.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==s.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):s.attributes.KEYID&&"0x"===s.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:s.attributes.KEYFORMAT,keyId:s.attributes.KEYID.substring(2)},pssh:Object(a.a)(s.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}s.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:s.attributes.METHOD||"AES-128",uri:s.attributes.URI},"undefined"!==typeof s.attributes.IV&&(r.iv=s.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(s.number)?this.manifest.mediaSequence=s.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+s.number})},"discontinuity-sequence"(){isFinite(s.number)?(this.manifest.discontinuitySequence=s.number,c=s.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+s.number})},"playlist-type"(){/VOD|EVENT/.test(s.playlistType)?this.manifest.playlistType=s.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+s.playlist})},map(){n={},s.uri&&(n.uri=s.uri),s.byterange&&(n.byterange=s.byterange),r&&(n.key=r)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||l,s.attributes?(i.attributes||(i.attributes={}),o()(i.attributes,s.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(s.attributes&&s.attributes.TYPE&&s.attributes["GROUP-ID"]&&s.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[s.attributes.TYPE];e[s.attributes["GROUP-ID"]]=e[s.attributes["GROUP-ID"]]||{},f=e[s.attributes["GROUP-ID"]],(v={default:/yes/i.test(s.attributes.DEFAULT)}).default?v.autoselect=!0:v.autoselect=/yes/i.test(s.attributes.AUTOSELECT),s.attributes.LANGUAGE&&(v.language=s.attributes.LANGUAGE),s.attributes.URI&&(v.uri=s.attributes.URI),s.attributes["INSTREAM-ID"]&&(v.instreamId=s.attributes["INSTREAM-ID"]),s.attributes.CHARACTERISTICS&&(v.characteristics=s.attributes.CHARACTERISTICS),s.attributes.FORCED&&(v.forced=/yes/i.test(s.attributes.FORCED)),f[s.attributes.NAME]=v},discontinuity(){c+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){"undefined"===typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=s.dateTimeString,this.manifest.dateTimeObject=s.dateTimeObject),i.dateTimeString=s.dateTimeString,i.dateTimeObject=s.dateTimeObject},targetduration(){!isFinite(s.duration)||s.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+s.duration}):(this.manifest.targetDuration=s.duration,p.call(this,this.manifest))},start(){s.attributes&&!isNaN(s.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:s.attributes["TIME-OFFSET"],precise:s.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){i.cueOut=s.data},"cue-out-cont"(){i.cueOutCont=s.data},"cue-in"(){i.cueIn=s.data},skip(){this.manifest.skip=d(s.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",s.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const e=this.manifest.segments.length,t=d(s.attributes);i.parts=i.parts||[],i.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=m),m=t.byterange.offset+t.byterange.length);const n=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${e}`,s.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){const e=this.manifest.serverControl=d(s.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),p.call(this,this.manifest),e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const e=this.manifest.segments.length,t=d(s.attributes),n=t.type&&"PART"===t.type;i.preloadHints=i.preloadHints||[],i.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=n?m:0,n&&(m=t.byterange.offset+t.byterange.length)));const r=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${e}`,s.attributes,["TYPE","URI"]),t.type)for(let o=0;o=0&&n.splice(r,1);return n},t.arrAdd=function(e,t){var n=e.slice();-1===n.indexOf(t)&&n.push(t);return n},t.posToArr=function(e){return e.split("-")},t.getPosition=function(e,t){return"".concat(e,"-").concat(t)},t.isTreeNode=function(e){return e&&e.type&&e.type.isTreeNode},t.getDragNodesKeys=function(e,t){var n=[e];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var r=t.key,i=t.children;n.push(r),e(i)})}(t[e].children),n},t.calcDropPosition=function(e,t){var n=e.clientY,r=t.selectHandle.getBoundingClientRect(),i=r.top,o=r.bottom,a=r.height,s=Math.max(a*u,l);if(n<=i+s)return-1;if(n>=o-s)return 1;return 0},t.calcSelectedKeys=function(e,t){if(!e)return;if(t.multiple)return e.slice();if(e.length)return[e[0]];return e},t.convertDataToTree=function e(t,n){if(!t)return[];var i=n||{},a=i.processProps,s=void 0===a?c:a;var u=Array.isArray(t)?t:[t];return u.map(function(t){var i=t.children,a=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(t,["children"]),u=e(i,n);return r.default.createElement(o.default,Object.assign({},s(a)),u)})},t.parseCheckedKeys=function(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==s(e))return(0,i.default)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t},t.conductExpandParent=function(e,t){var n={};return(e||[]).forEach(function(e){!function e(r){if(!n[r]){var i=t[r];if(i){n[r]=!0;var o=i.parent,a=i.node;a.disabled||o&&e(o.key)}}}(e)}),Object.keys(n)},t.getDataAndAria=function(e){var t={};return Object.keys(e).forEach(function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=e[n])}),t};var r=a(n("q1tI")),i=a(n("UeG5")),o=a(n("JpES"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return(s="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})(e)}var u=.25,l=2;var c=function(e){return e}},"1hJj":function(e,t,n){var r=n("e4Nc"),i=n("ftKO"),o=n("3A9y");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t=a.F1&&t<=a.F12)return!1;switch(t){case a.ALT:case a.CAPS_LOCK:case a.CONTEXT_MENU:case a.CTRL:case a.DOWN:case a.END:case a.ESC:case a.HOME:case a.INSERT:case a.LEFT:case a.MAC_FF_META:case a.META:case a.NUMLOCK:case a.NUM_CENTER:case a.PAGE_DOWN:case a.PAGE_UP:case a.PAUSE:case a.PRINT_SCREEN:case a.RIGHT:case a.SHIFT:case a.UP:case a.WIN_KEY:case a.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=a.ZERO&&e<=a.NINE)return!0;if(e>=a.NUM_ZERO&&e<=a.NUM_MULTIPLY)return!0;if(e>=a.A&&e<=a.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case a.SPACE:case a.QUESTION_MARK:case a.NUM_PLUS:case a.NUM_MINUS:case a.NUM_PERIOD:case a.NUM_DIVISION:case a.SEMICOLON:case a.DASH:case a.EQUALS:case a.COMMA:case a.PERIOD:case a.SLASH:case a.APOSTROPHE:case a.SINGLE_QUOTE:case a.OPEN_SQUARE_BRACKET:case a.BACKSLASH:case a.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},s=a;function u(){var e=[].slice.call(arguments,0);return 1===e.length?e[0]:function(){for(var t=0;t1&&(p=i.a.createElement("div",{className:"".concat(n,"-content")},s)),i.a.createElement("div",{ref:t,className:d()(r,!o&&"".concat(e.hiddenClassName)),onMouseEnter:u,onMouseLeave:l,onMouseDown:c,onTouchStart:f,style:a},p)});Xe.displayName="PopupInner";var Qe=Xe;function Ze(e){var t=e.prefixCls,n=e.motion,r=e.animation,i=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:i?{motionName:i}:null)}function Je(e){return(Je="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})(e)}function et(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tt(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 nt(e){for(var t=1;t=n.subMenuTitle.offsetWidth||(e.style.minWidth="".concat(n.subMenuTitle.offsetWidth,"px"))}},n.saveSubMenuTitle=function(e){n.subMenuTitle=e},n.getBaseProps=function(){var e=Pt(n).props;return{mode:"horizontal"===e.mode?"vertical":e.mode,visible:n.props.isOpen,level:e.level+1,inlineIndent:e.inlineIndent,focusable:!1,onClick:n.onSubMenuClick,onSelect:n.onSelect,onDeselect:n.onDeselect,onDestroy:n.onDestroy,selectedKeys:e.selectedKeys,eventKey:"".concat(e.eventKey,"-menu-"),openKeys:e.openKeys,motion:e.motion,onOpenChange:n.onOpenChange,subMenuOpenDelay:e.subMenuOpenDelay,parentMenu:Pt(n),subMenuCloseDelay:e.subMenuCloseDelay,forceSubMenuRender:e.forceSubMenuRender,triggerSubMenuAction:e.triggerSubMenuAction,builtinPlacements:e.builtinPlacements,defaultActiveFirst:e.store.getState().defaultActiveFirst[j(e.eventKey)],multiple:e.multiple,prefixCls:e.rootPrefixCls,id:n.internalMenuId,manualRef:n.saveMenuInstance,itemIcon:e.itemIcon,expandIcon:e.expandIcon,direction:e.direction}},n.getMotion=function(e,t){var r=Pt(n).haveRendered,i=n.props,o=i.motion,a=i.rootPrefixCls;return Nt({},o,{leavedClassName:"".concat(a,"-hidden"),removeOnLeave:!1,motionAppear:r||!t||"inline"!==e})};var r=e.store,o=e.eventKey,a=r.getState().defaultActiveFirst;n.isRootMenu=!1;var u=!1;return a&&(u=a[o]),Lt(r,o,u),n}var n,r,o;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&&At(e,t)}(t,i.a.Component),n=t,(r=[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e=this,t=this.props,n=t.mode,r=t.parentMenu,i=t.manualRef;i&&i(this),"horizontal"===n&&r.isRootMenu&&this.props.isOpen&&(this.minWidthTimeout=setTimeout(function(){return e.adjustWidth()},0))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.onDestroy,n=e.eventKey;t&&t(n),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(e){var t=this,n=this.getBaseProps(),r=this.getMotion(n.mode,n.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||n.visible||n.forceSubMenuRender,!this.haveOpened)return i.a.createElement("div",null);var o=n.direction;return i.a.createElement(Ye,Object.assign({visible:n.visible},r),function(r){var a=r.className,s=r.style,u=d()("".concat(n.prefixCls,"-sub"),a,Mt({},"".concat(n.prefixCls,"-rtl"),"rtl"===o));return i.a.createElement(gn,Object.assign({},n,{id:t.internalMenuId,className:u,style:s}),e)})}},{key:"render",value:function(){var e,t=Nt({},this.props),n=t.isOpen,r=this.getPrefixCls(),o="inline"===t.mode,a=d()(r,"".concat(r,"-").concat(t.mode),(Mt(e={},t.className,!!t.className),Mt(e,this.getOpenClassName(),n),Mt(e,this.getActiveClassName(),t.active||n&&!o),Mt(e,this.getDisabledClassName(),t.disabled),Mt(e,this.getSelectedClassName(),this.isChildrenSelected()),e));this.internalMenuId||(t.eventKey?this.internalMenuId="".concat(t.eventKey,"$Menu"):(Rt+=1,this.internalMenuId="$__$".concat(Rt,"$Menu")));var s={},u={},l={};t.disabled||(s={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},u={onClick:this.onTitleClick},l={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var c={},f=t.direction;o&&("rtl"===f?c.paddingRight=t.inlineIndent*t.level:c.paddingLeft=t.inlineIndent*t.level);var p={};this.props.isOpen&&(p={"aria-owns":this.internalMenuId});var h=null;"horizontal"!==t.mode&&(h=this.props.expandIcon,"function"===typeof this.props.expandIcon&&(h=i.a.createElement(this.props.expandIcon,Nt({},this.props))));var m=i.a.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:c,className:"".concat(r,"-title"),role:"button"},l,u,{"aria-expanded":n},p,{"aria-haspopup":"true",title:"string"===typeof t.title?t.title:void 0}),t.title,h||i.a.createElement("i",{className:"".concat(r,"-arrow")})),g=this.renderChildren(t.children),v=t.parentMenu.isRootMenu?t.parentMenu.props.getPopupContainer:function(e){return e.parentNode},y=jt[t.mode],b=t.popupOffset?{offset:t.popupOffset}:{},_="inline"===t.mode?"":t.popupClassName;_+="rtl"===f?" ".concat(r,"-rtl"):"";var w=t.disabled,E=t.triggerSubMenuAction,S=t.subMenuOpenDelay,T=t.forceSubMenuRender,C=t.subMenuCloseDelay,O=t.builtinPlacements;F.forEach(function(e){return delete t[e]}),delete t.onClick;var x="rtl"===f?Object.assign({},Ot,O):Object.assign({},Ct,O);return delete t.direction,i.a.createElement("li",Object.assign({},t,s,{className:a,role:"menuitem"}),o&&m,o&&g,!o&&i.a.createElement(St,{prefixCls:r,popupClassName:d()("".concat(r,"-popup"),_),getPopupContainer:v,builtinPlacements:x,popupPlacement:y,popupVisible:n,popupAlign:b,popup:g,action:w?[]:[E],mouseEnterDelay:S,mouseLeaveDelay:C,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:T},m))}}])&&kt(n.prototype,r),o&&kt(n,o),t}();Ft.defaultProps={onMouseEnter:M,onMouseLeave:M,onTitleMouseEnter:M,onTitleMouseLeave:M,onTitleClick:M,manualRef:M,mode:"vertical",title:""};var Ut=Object(o.connect)(function(e,t){var n=e.openKeys,r=e.activeKey,i=e.selectedKeys,o=t.eventKey,a=t.subMenuKey;return{isOpen:n.indexOf(o)>-1,active:r[a]===o,selectedKeys:i}})(Ft);Ut.isSubMenu=!0;var Bt=Ut;function Ht(e){return(Ht="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})(e)}function Vt(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $t(e,t){for(var n=0;n=0});o.forEach(function(e){B(e,"display","inline-block")}),e.menuItemSizes=i.map(function(e){return U(e)}),o.forEach(function(e){B(e,"display","none")}),e.overflowedIndicatorWidth=U(t.children[t.children.length-1]),e.originalTotalWidth=e.menuItemSizes.reduce(function(e,t){return e+t},0),e.handleResize(),B(r,"display","none")}}}},e.handleResize=function(){if("horizontal"===e.props.mode){var t=W.a.findDOMNode(Yt(e));if(t){var n=U(t);e.overflowedItems=[];var r,i=0;e.originalTotalWidth>n+Zt&&(r=-1,e.menuItemSizes.forEach(function(t){(i+=t)+e.overflowedIndicatorWidth<=n&&(r+=1)})),e.setState({lastVisibleIndex:r})}}},e}var n,r,o;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&&Xt(e,t)}(t,i.a.Component),n=t,(r=[{key:"componentDidMount",value:function(){var e=this;if(this.setChildrenWidthAndResize(),1===this.props.level&&"horizontal"===this.props.mode){var t=W.a.findDOMNode(this);if(!t)return;this.resizeObserver=new q.default(function(t){t.forEach(e.setChildrenWidthAndResize)}),[].slice.call(t.children).concat(t).forEach(function(t){e.resizeObserver.observe(t)}),"undefined"!==typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(){e.resizeObserver.disconnect(),[].slice.call(t.children).concat(t).forEach(function(t){e.resizeObserver.observe(t)}),e.setChildrenWidthAndResize()}),this.mutationObserver.observe(t,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect()}},{key:"renderChildren",value:function(e){var t=this,n=this.state.lastVisibleIndex;return(e||[]).reduce(function(r,o,a){var s=o;if("horizontal"===t.props.mode){var u=t.getOverflowedSubMenuItem(o.props.eventKey,[]);void 0!==n&&-1!==t.props.className.indexOf("".concat(t.props.prefixCls,"-root"))&&(a>n&&(s=i.a.cloneElement(o,{style:{display:"none"},eventKey:"".concat(o.props.eventKey,"-hidden"),className:"".concat(Qt)})),a===n+1&&(t.overflowedItems=e.slice(n+1).map(function(e){return i.a.cloneElement(e,{key:e.props.eventKey,mode:"vertical-left"})}),u=t.getOverflowedSubMenuItem(o.props.eventKey,t.overflowedItems)));var l=[].concat(Vt(r),[u,s]);return a===e.length-1&&l.push(t.getOverflowedSubMenuItem(o.props.eventKey,[],!0)),l}return[].concat(Vt(r),[s])},[])}},{key:"render",value:function(){var e=this.props,t=(e.visible,e.prefixCls,e.overflowedIndicator,e.mode,e.level,e.tag),n=e.children,r=(e.theme,zt(e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"])),o=t;return i.a.createElement(o,Object.assign({},r),this.renderChildren(n))}}])&&$t(n.prototype,r),o&&$t(n,o),t}();Jt.defaultProps={tag:"div",className:""};var en=Jt;function tn(e){return(tn="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})(e)}function nn(){return(nn=Object.assign||function(e){for(var t=1;tt||o>e&&a=t&&s>=n?o-e-r:a>t&&sn?a-t+i:0}var Ln=function(e,t){var n=t.scrollMode,r=t.block,i=t.inline,o=t.boundary,a=t.skipOverflowHiddenElements,s="function"===typeof o?o:function(e){return e!==o};if(!Nn(e))throw new TypeError("Invalid target");for(var u=document.scrollingElement||document.documentElement,l=[],c=e;Nn(c)&&s(c);){if((c=c.parentNode)===u){l.push(c);break}c===document.body&&Rn(c)&&!Rn(document.documentElement)||Rn(c,a)&&l.push(c)}for(var f=window.visualViewport?visualViewport.width:innerWidth,d=window.visualViewport?visualViewport.height:innerHeight,p=window.scrollX||pageXOffset,h=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),g=m.height,v=m.width,y=m.top,b=m.right,_=m.bottom,w=m.left,E="start"===r||"nearest"===r?y:"end"===r?_:y+g/2,S="center"===i?w+v/2:"end"===i?b:w,T=[],C=0;C=0&&w>=0&&_<=d&&b<=f&&y>=P&&_<=I&&w>=N&&b<=A)return T;var M=getComputedStyle(O),R=parseInt(M.borderLeftWidth,10),j=parseInt(M.borderTopWidth,10),L=parseInt(M.borderRightWidth,10),F=parseInt(M.borderBottomWidth,10),U=0,B=0,H="offsetWidth"in O?O.offsetWidth-O.clientWidth-R-L:0,V="offsetHeight"in O?O.offsetHeight-O.clientHeight-j-F:0;if(u===O)U="start"===r?E:"end"===r?E-d:"nearest"===r?jn(h,h+d,d,j,F,h+E,h+E+g,g):E-d/2,B="start"===i?S:"center"===i?S-f/2:"end"===i?S-f:jn(p,p+f,f,R,L,p+S,p+S+v,v),U=Math.max(0,U+h),B=Math.max(0,B+p);else{U="start"===r?E-P-j:"end"===r?E-I+F+V:"nearest"===r?jn(P,I,k,j,F+V,E,E+g,g):E-(P+k/2)+V/2,B="start"===i?S-N-R:"center"===i?S-(N+D/2)+H/2:"end"===i?S-A+L+H:jn(N,A,D,R,L+H,S,S+v,v);var W=O.scrollLeft,q=O.scrollTop;E+=q-(U=Math.max(0,Math.min(q+U,O.scrollHeight-k+V))),S+=W-(B=Math.max(0,Math.min(W+B,O.scrollWidth-D+H)))}T.push({el:O,top:U,left:B})}return T};function Fn(e){return e===Object(e)&&0!==Object.keys(e).length}var Un=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(Fn(t)&&"function"===typeof t.behavior)return t.behavior(n?[]:Ln(e,t));if(!n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:Fn(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach(function(e){var r=e.el,i=e.top,o=e.left;r.scroll&&n?r.scroll({top:i,left:o,behavior:t}):(r.scrollTop=i,r.scrollLeft=o)})}(Ln(e,r),r.behavior)}};function Bn(e){return(Bn="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})(e)}function Hn(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 Vn(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[];return new l(function(t){var n=function(){return y=!0,t()};C(v,e).then(n,n)})},window.__NEXT_PRELOADREADY=T.preloadReady,t.default=T},"2rMq":function(e,t,n){var r;!function(){"use strict";var i=!("undefined"===typeof window||!window.document||!window.document.createElement),o={canUseDOM:i,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:i&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:i&&!!window.screen};void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},"2wwy":function(e,t,n){e.exports=n("nhzr")},"3+53":function(e,t,n){"use strict";t.__esModule=!0;var r,i,o=p(n("QbLZ")),a=p(n("iCc5")),s=p(n("FYw3")),u=p(n("mRg0")),l=n("q1tI"),c=p(l),f=p(n("KrAl")),d=p(n("dmj+"));function p(e){return e&&e.__esModule?e:{default:e}}var h=(i=r=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,e.apply(this,arguments))}return(0,u.default)(t,e),t.prototype.componentDidUpdate=function(){(0,this.props.handleParse)()},t.prototype.render=function(){var e=this.props,t=e.colorScheme,n=e.href,r=void 0===n?(0,d.default)():n,i=e.numPosts,o=e.orderBy,a=e.width,s=e.children,u=e.mobile;return c.default.createElement("div",{className:"fb-comments","data-colorscheme":t,"data-numposts":i,"data-href":r,"data-order-by":o,"data-width":a,"data-skin":t,"data-mobile":u},s)},t}(l.PureComponent),r.defaultProps={href:void 0,numPosts:void 0,orderBy:void 0,width:void 0,colorScheme:void 0,children:void 0,mobile:void 0},i);t.default=(0,l.forwardRef)(function(e,t){return c.default.createElement(f.default,null,function(n){var r=n.handleParse;return c.default.createElement(h,(0,o.default)({},e,{handleParse:r,ref:t}))})})},"3+Pc":function(e,t,n){var r=n("+KcL");function i(){return e.exports=i=r||function(e){for(var t=1;td&&(f-=d,f-=d,f-=l(2))}return Number(f)}),d=function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!==typeof e&&"number"!==typeof e||"number"===typeof e&&e!==e)&&(e=0),e=l(e);for(var i,o=(i=e,Math.ceil(function(e){return e.toString(2).length}(i)/8)),a=new Uint8Array(new ArrayBuffer(o)),s=0;s=t.length&&l.call(t,function(t,n){return t===(u[n]?u[n]&e[o+n]:e[o+n])})}},"3niX":function(e,t,n){"use strict";t.__esModule=!0,t.flush=function(){var e=o.cssRules();return o.flush(),e},t.default=void 0;var r,i=n("q1tI");var o=new(((r=n("SevZ"))&&r.__esModule?r:{default:r}).default),a=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).prevProps={},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.dynamic=function(e){return e.map(function(e){var t=e[0],n=e[1];return o.computeId(t,n)}).join(" ")};var i=r.prototype;return i.shouldComponentUpdate=function(e){return this.props.id!==e.id||String(this.props.dynamic)!==String(e.dynamic)},i.componentWillUnmount=function(){o.remove(this.props)},i.render=function(){return this.shouldComponentUpdate(this.prevProps)&&(this.prevProps.id&&o.remove(this.prevProps),o.add(this.props),this.prevProps=this.props),null},r}(i.Component);t.default=a},"3pki":function(e,t,n){"use strict";n.r(t);var r=n("QbLZ"),i=n.n(r),o=n("iCc5"),a=n.n(o),s=n("V7oC"),u=n.n(s),l=n("FYw3"),c=n.n(l),f=n("mRg0"),d=n.n(f),p=n("q1tI"),h=n.n(p),m=[{component:function(e){function t(){a()(this,t);var e=c()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.handleClick=function(t){t.preventDefault(),e.props.previousSlide()},e}return d()(t,e),u()(t,[{key:"render",value:function(){return h.a.createElement("button",{style:this.getButtonStyles(0===this.props.currentSlide&&!this.props.wrapAround),onClick:this.handleClick},"PREV")}},{key:"getButtonStyles",value:function(e){return{border:0,background:"rgba(0,0,0,0.4)",color:"white",padding:10,outline:0,opacity:e?.3:1,cursor:"pointer"}}}]),t}(h.a.Component),position:"CenterLeft"},{component:function(e){function t(){a()(this,t);var e=c()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.handleClick=function(t){t.preventDefault(),e.props.nextSlide&&e.props.nextSlide()},e}return d()(t,e),u()(t,[{key:"render",value:function(){return h.a.createElement("button",{style:this.getButtonStyles(this.props.currentSlide+this.props.slidesToScroll>=this.props.slideCount&&!this.props.wrapAround),onClick:this.handleClick},"NEXT")}},{key:"getButtonStyles",value:function(e){return{border:0,background:"rgba(0,0,0,0.4)",color:"white",padding:10,outline:0,opacity:e?.3:1,cursor:"pointer"}}}]),t}(h.a.Component),position:"CenterRight"},{component:function(e){function t(){return a()(this,t),c()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d()(t,e),u()(t,[{key:"render",value:function(){var e=this,t=this.getIndexes(this.props.slideCount,this.props.slidesToScroll);return h.a.createElement("ul",{style:this.getListStyles()},t.map(function(t){return h.a.createElement("li",{style:e.getListItemStyles(),key:t},h.a.createElement("button",{style:e.getButtonStyles(e.props.currentSlide===t),onClick:e.props.goToSlide&&e.props.goToSlide.bind(null,t)},"\u2022"))}))}},{key:"getIndexes",value:function(e,t){for(var n=[],r=0;r=h.a.Children.count(n.props.children)||e<0){if(!n.props.wrapAround)return;if(e>=h.a.Children.count(n.props.children))return r(n.state.currentSlide,0),n.setState({currentSlide:0},function(){n.animateSlide(null,null,n.getTargetLeft(null,e),function(){n.animateSlide(null,.01),i(0),n.resetAutoplay(),n.setExternalData()})});var o=h.a.Children.count(n.props.children)-n.state.slidesToScroll;return r(n.state.currentSlide,o),n.setState({currentSlide:o},function(){n.animateSlide(null,null,n.getTargetLeft(null,e),function(){n.animateSlide(null,.01),i(o),n.resetAutoplay(),n.setExternalData()})})}r(n.state.currentSlide,e),n.setState({currentSlide:e},function(){n.animateSlide(),n.props.afterSlide(e),n.resetAutoplay(),n.setExternalData()})},n.nextSlide=function(){var e=h.a.Children.count(n.props.children),t=n.props.slidesToShow;if("auto"===n.props.slidesToScroll&&(t=n.state.slidesToScroll),!(n.state.currentSlide>=e-t)||n.props.wrapAround)if(n.props.wrapAround)n.goToSlide(n.state.currentSlide+n.state.slidesToScroll);else{if(1!==n.props.slideWidth)return n.goToSlide(n.state.currentSlide+n.state.slidesToScroll);n.goToSlide(Math.min(n.state.currentSlide+n.state.slidesToScroll,e-t))}},n.previousSlide=function(){n.state.currentSlide<=0&&!n.props.wrapAround||(n.props.wrapAround?n.goToSlide(n.state.currentSlide-n.state.slidesToScroll):n.goToSlide(Math.max(0,n.state.currentSlide-n.state.slidesToScroll)))},n.onResize=function(){n.setDimensions()},n.onReadyStateChange=function(){n.setDimensions()},n.state={currentSlide:n.props.slideIndex,dragging:!1,frameWidth:0,left:0,slideCount:0,slidesToScroll:n.props.slidesToScroll,slideWidth:0,top:0,tweenQueue:[]},n.touchObject={},n.clickSafe=!0,n}return d()(t,e),u()(t,[{key:"componentWillMount",value:function(){this.setInitialDimensions()}},{key:"componentDidMount",value:function(){this.setDimensions(),this.bindEvents(),this.setExternalData(),this.props.autoplay&&this.startAutoplay()}},{key:"componentWillReceiveProps",value:function(e){this.setState({slideCount:e.children.length}),this.setDimensions(e),this.props.slideIndex!==e.slideIndex&&e.slideIndex!==this.state.currentSlide&&this.goToSlide(e.slideIndex),this.props.autoplay!==e.autoplay&&(e.autoplay?this.startAutoplay():this.stopAutoplay())}},{key:"componentWillUnmount",value:function(){this.unbindEvents(),this.stopAutoplay(),b.a.cancel(this._rafID),this._rafID=-1}},{key:"tweenState",value:function(e,t){var n=this,r=t.easing,i=t.duration,o=t.delay,a=t.beginValue,s=t.endValue,u=t.onEnd,l=t.stackBehavior;this.setState(function(t){var c=t,f=void 0,d=void 0;if("string"===typeof e)f=e,d=e;else{for(var p=0;pc.duration?c.duration:Math.max(0,o-l);n+=(0===c.duration?c.endValue:c.easing(f,c.beginValue,c.endValue,c.duration))-c.endValue}}return n}},{key:"render",value:function(){var e=this,t=h.a.Children.count(this.props.children)>1?this.formatChildren(this.props.children):this.props.children;return h.a.createElement("div",{className:["slider",this.props.className||""].join(" "),ref:"slider",style:i()({},this.getSliderStyles(),this.props.style)},h.a.createElement("div",i()({className:"slider-frame",ref:"frame",style:this.getFrameStyles()},this.getTouchEvents(),this.getMouseEvents(),{onClick:this.handleClick}),h.a.createElement("ul",{className:"slider-list",ref:"list",style:this.getListStyles()},t)),this.props.decorators?this.props.decorators.map(function(t,n){return h.a.createElement("div",{style:i()({},e.getDecoratorStyles(t.position),t.style||{}),className:"slider-decorator-"+n,key:n},h.a.createElement(t.component,{currentSlide:e.state.currentSlide,slideCount:e.state.slideCount,frameWidth:e.state.frameWidth,slideWidth:e.state.slideWidth,slidesToScroll:e.state.slidesToScroll,cellSpacing:e.props.cellSpacing,slidesToShow:e.props.slidesToShow,wrapAround:e.props.wrapAround,nextSlide:e.nextSlide,previousSlide:e.previousSlide,goToSlide:e.goToSlide}))}):null,h.a.createElement("style",{type:"text/css",dangerouslySetInnerHTML:{__html:this.getStyleTagStyles()}}))}},{key:"getTouchEvents",value:function(){var e=this;return!1===this.props.swiping?null:{onTouchStart:function(t){e.touchObject={startX:t.touches[0].pageX,startY:t.touches[0].pageY},e.handleMouseOver()},onTouchMove:function(t){var n=e.swipeDirection(e.touchObject.startX,t.touches[0].pageX,e.touchObject.startY,t.touches[0].pageY);0!==n&&t.preventDefault();var r=e.props.vertical?Math.round(Math.sqrt(Math.pow(t.touches[0].pageY-e.touchObject.startY,2))):Math.round(Math.sqrt(Math.pow(t.touches[0].pageX-e.touchObject.startX,2)));e.touchObject={startX:e.touchObject.startX,startY:e.touchObject.startY,endX:t.touches[0].pageX,endY:t.touches[0].pageY,length:r,direction:n},e.setState({left:e.props.vertical?0:e.getTargetLeft(e.touchObject.length*e.touchObject.direction),top:e.props.vertical?e.getTargetLeft(e.touchObject.length*e.touchObject.direction):0})},onTouchEnd:function(t){e.handleSwipe(t),e.handleMouseOut()},onTouchCancel:function(t){e.handleSwipe(t)}}}},{key:"getMouseEvents",value:function(){var e=this;return!1===this.props.dragging?null:{onMouseOver:function(){e.handleMouseOver()},onMouseOut:function(){e.handleMouseOut()},onMouseDown:function(t){e.touchObject={startX:t.clientX,startY:t.clientY},e.setState({dragging:!0})},onMouseMove:function(t){if(e.state.dragging){var n=e.swipeDirection(e.touchObject.startX,t.clientX,e.touchObject.startY,t.clientY);0!==n&&t.preventDefault();var r=e.props.vertical?Math.round(Math.sqrt(Math.pow(t.clientY-e.touchObject.startY,2))):Math.round(Math.sqrt(Math.pow(t.clientX-e.touchObject.startX,2)));e.touchObject={startX:e.touchObject.startX,startY:e.touchObject.startY,endX:t.clientX,endY:t.clientY,length:r,direction:n},e.setState({left:e.props.vertical?0:e.getTargetLeft(e.touchObject.length*e.touchObject.direction),top:e.props.vertical?e.getTargetLeft(e.touchObject.length*e.touchObject.direction):0})}},onMouseUp:function(t){e.state.dragging&&e.handleSwipe(t)},onMouseLeave:function(t){e.state.dragging&&e.handleSwipe(t)}}}},{key:"handleMouseOver",value:function(){this.props.autoplay&&(this.autoplayPaused=!0,this.stopAutoplay())}},{key:"handleMouseOut",value:function(){this.props.autoplay&&this.autoplayPaused&&(this.startAutoplay(),this.autoplayPaused=null)}},{key:"handleSwipe",value:function(e){"undefined"!==typeof this.touchObject.length&&this.touchObject.length>44?this.clickSafe=!0:this.clickSafe=!1;var t=this.props,n=t.slidesToShow,r=t.slidesToScroll,i=t.swipeSpeed;"auto"===r&&(n=this.state.slidesToScroll),h.a.Children.count(this.props.children)>1&&this.touchObject.length>this.state.slideWidth/n/i?1===this.touchObject.direction?this.state.currentSlide>=h.a.Children.count(this.props.children)-n&&!this.props.wrapAround?this.animateSlide(this.props.edgeEasing):this.nextSlide():-1===this.touchObject.direction&&(this.state.currentSlide<=0&&!this.props.wrapAround?this.animateSlide(this.props.edgeEasing):this.previousSlide()):this.goToSlide(this.state.currentSlide),this.touchObject={},this.setState({dragging:!1})}},{key:"swipeDirection",value:function(e,t,n,r){var i=e-t,o=n-r,a=Math.atan2(o,i),s=Math.round(180*a/Math.PI);return s<0&&(s=360-Math.abs(s)),s<=45&&s>=0?1:s<=360&&s>=315?1:s>=135&&s<=225?-1:!0===this.props.vertical?s>=35&&s<=135?1:-1:0}},{key:"startAutoplay",value:function(){h.a.Children.count(this.props.children)<=1||(this.autoplayID=setInterval(this.autoplayIterator,this.props.autoplayInterval))}},{key:"resetAutoplay",value:function(){this.props.resetAutoplay&&this.props.autoplay&&!this.autoplayPaused&&(this.stopAutoplay(),this.startAutoplay())}},{key:"stopAutoplay",value:function(){this.autoplayID&&clearInterval(this.autoplayID)}},{key:"animateSlide",value:function(e,t,n,r){this.tweenState(this.props.vertical?"top":"left",{easing:e||this.props.easing,duration:t||this.props.speed,endValue:n||this.getTargetLeft(),delay:null,beginValue:null,onEnd:r||null,stackBehavior:_})}},{key:"getTargetLeft",value:function(e,t){var n=void 0,r=t||this.state.currentSlide,i=this.props.cellSpacing;switch(this.props.cellAlign){case"left":n=0,n-=i*r;break;case"center":n=(this.state.frameWidth-this.state.slideWidth)/2,n-=i*r;break;case"right":n=this.state.frameWidth-this.state.slideWidth,n-=i*r}var o=this.state.slideWidth*r;return this.state.currentSlide>0&&r+this.state.slidesToScroll>=this.state.slideCount&&1!==this.props.slideWidth&&!this.props.wrapAround&&"auto"===this.props.slidesToScroll&&(o=this.state.slideWidth*this.state.slideCount-this.state.frameWidth,n=0,n-=i*(this.state.slideCount-1)),-1*(o-(n-=e||0))}},{key:"bindEvents",value:function(){v.a.canUseDOM&&(w(window,"resize",this.onResize),w(document,"readystatechange",this.onReadyStateChange))}},{key:"unbindEvents",value:function(){v.a.canUseDOM&&(E(window,"resize",this.onResize),E(document,"readystatechange",this.onReadyStateChange))}},{key:"formatChildren",value:function(e){var t=this,n=this.props.vertical?this.getTweeningValue("top"):this.getTweeningValue("left");return h.a.Children.map(e,function(e,r){return h.a.createElement("li",{className:"slider-slide",style:t.getSlideStyles(r,n),key:r},e)})}},{key:"setInitialDimensions",value:function(){var e=this,t=this.props,n=t.vertical,r=t.initialSlideHeight,i=t.initialSlideWidth,o=t.slidesToShow,a=t.cellSpacing,s=t.children,u=n?r||0:i||0,l=r?r*o:0,c=l+a*(o-1);this.setState({slideHeight:l,frameWidth:n?c:"100%",slideCount:h.a.Children.count(s),slideWidth:u},function(){e.setLeft(),e.setExternalData()})}},{key:"setDimensions",value:function(e){var t,n,r=this,i=void 0,o=void 0,a=(e=e||this.props).slidesToScroll,s=this.refs.frame,u=s.childNodes[0].childNodes[0];u?(u.style.height="auto",i=this.props.vertical?u.offsetHeight*e.slidesToShow:u.offsetHeight):i=100,o="number"!==typeof e.slideWidth?parseInt(e.slideWidth,10):e.vertical?i/e.slidesToShow*e.slideWidth:s.offsetWidth/e.slidesToShow*e.slideWidth,e.vertical||(o-=e.cellSpacing*((100-100/e.slidesToShow)/100)),n=i+e.cellSpacing*(e.slidesToShow-1),t=e.vertical?n:s.offsetWidth,"auto"===e.slidesToScroll&&(a=Math.floor(t/(o+e.cellSpacing))),this.setState({slideHeight:i,frameWidth:t,slideWidth:o,slidesToScroll:a,left:e.vertical?0:this.getTargetLeft(),top:e.vertical?this.getTargetLeft():0},function(){r.setLeft()})}},{key:"setLeft",value:function(){this.setState({left:this.props.vertical?0:this.getTargetLeft(),top:this.props.vertical?this.getTargetLeft():0})}},{key:"setExternalData",value:function(){this.props.data&&this.props.data()}},{key:"getListStyles",value:function(){var e=this.state.slideWidth*h.a.Children.count(this.props.children),t=this.props.cellSpacing,n=t*h.a.Children.count(this.props.children),r="translate3d("+this.getTweeningValue("left")+"px, "+this.getTweeningValue("top")+"px, 0)";return{transform:r,WebkitTransform:r,msTransform:"translate("+this.getTweeningValue("left")+"px, "+this.getTweeningValue("top")+"px)",position:"relative",display:"block",margin:this.props.vertical?t/2*-1+"px 0px":"0px "+t/2*-1+"px",padding:0,height:this.props.vertical?e+n:this.state.slideHeight,width:this.props.vertical?"auto":e+n,cursor:!0===this.state.dragging?"pointer":"inherit",boxSizing:"border-box",MozBoxSizing:"border-box"}}},{key:"getFrameStyles",value:function(){return{position:"relative",display:"block",overflow:this.props.frameOverflow,height:this.props.vertical?this.state.frameWidth||"initial":"auto",margin:this.props.framePadding,padding:0,transform:"translate3d(0, 0, 0)",WebkitTransform:"translate3d(0, 0, 0)",msTransform:"translate(0, 0)",boxSizing:"border-box",MozBoxSizing:"border-box"}}},{key:"getSlideStyles",value:function(e,t){var n=this.getSlideTargetPosition(e,t),r=this.props.cellSpacing;return{position:"absolute",left:this.props.vertical?0:n,top:this.props.vertical?n:0,display:this.props.vertical?"block":"inline-block",listStyleType:"none",verticalAlign:"top",width:this.props.vertical?"100%":this.state.slideWidth,height:"auto",boxSizing:"border-box",MozBoxSizing:"border-box",marginLeft:this.props.vertical?"auto":r/2,marginRight:this.props.vertical?"auto":r/2,marginTop:this.props.vertical?r/2:"auto",marginBottom:this.props.vertical?r/2:"auto"}}},{key:"getSlideTargetPosition",value:function(e,t){var n=this.state.frameWidth/this.state.slideWidth,r=(this.state.slideWidth+this.props.cellSpacing)*e,i=(this.state.slideWidth+this.props.cellSpacing)*n*-1;if(this.props.wrapAround){var o=Math.ceil(t/this.state.slideWidth);if(this.state.slideCount-o<=e)return(this.state.slideWidth+this.props.cellSpacing)*(this.state.slideCount-e)*-1;var a=Math.ceil((Math.abs(t)-Math.abs(i))/this.state.slideWidth);if(1!==this.state.slideWidth&&(a=Math.ceil((Math.abs(t)-this.state.slideWidth)/this.state.slideWidth)),e<=a-1)return(this.state.slideWidth+this.props.cellSpacing)*(this.state.slideCount+e)}return r}},{key:"getSliderStyles",value:function(){return{position:"relative",display:"block",width:this.props.width,height:"auto",boxSizing:"border-box",MozBoxSizing:"border-box",visibility:this.state.slideWidth?"visible":"hidden"}}},{key:"getStyleTagStyles",value:function(){return".slider-slide > img {width: 100%; display: block;}"}},{key:"getDecoratorStyles",value:function(e){switch(e){case"TopLeft":return{position:"absolute",top:0,left:0};case"TopCenter":return{position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",WebkitTransform:"translateX(-50%)",msTransform:"translateX(-50%)"};case"TopRight":return{position:"absolute",top:0,right:0};case"CenterLeft":return{position:"absolute",top:"50%",left:0,transform:"translateY(-50%)",WebkitTransform:"translateY(-50%)",msTransform:"translateY(-50%)"};case"CenterCenter":return{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"};case"CenterRight":return{position:"absolute",top:"50%",right:0,transform:"translateY(-50%)",WebkitTransform:"translateY(-50%)",msTransform:"translateY(-50%)"};case"BottomLeft":return{position:"absolute",bottom:0,left:0};case"BottomCenter":return{position:"absolute",bottom:0,width:"100%",textAlign:"center"};case"BottomRight":return{position:"absolute",bottom:0,right:0};default:return{position:"absolute",top:0,left:0}}}}]),t}(h.a.Component);S.defaultProps={afterSlide:function(){},autoplay:!1,resetAutoplay:!0,swipeSpeed:12,autoplayInterval:3e3,beforeSlide:function(){},cellAlign:"left",cellSpacing:0,data:function(){},decorators:m,dragging:!0,easing:function(e,t,n,r){return(n-t)*Math.sqrt(1-(e=e/r-1)*e)+t},edgeEasing:function(e,t,n,r){return(n-t)*e/r+t},framePadding:"0px",frameOverflow:"hidden",slideIndex:0,slidesToScroll:1,slidesToShow:1,slideWidth:1,speed:500,swiping:!0,vertical:!1,width:"100%",wrapAround:!1,style:{}};var T=S;n.d(t,"default",function(){return T})},"3r9c":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},"3tWz":function(e,t){var n=Array.prototype.join;e.exports=function(e,t){return null==e?"":n.call(e,t)}},"3tmb":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={transitionstart:{transition:"transitionstart",WebkitTransition:"webkitTransitionStart",MozTransition:"mozTransitionStart",OTransition:"oTransitionStart",msTransition:"MSTransitionStart"},animationstart:{animation:"animationstart",WebkitAnimation:"webkitAnimationStart",MozAnimation:"mozAnimationStart",OAnimation:"oAnimationStart",msAnimation:"MSAnimationStart"}},i={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},o=[],a=[];function s(e,t,n){e.addEventListener(t,n,!1)}function u(e,t,n){e.removeEventListener(t,n,!1)}"undefined"!==typeof window&&"undefined"!==typeof document&&function(){var e=document.createElement("div").style;function t(t,n){for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];for(var o in i)if(o in e){n.push(i[o]);break}}}"AnimationEvent"in window||(delete r.animationstart.animation,delete i.animationend.animation),"TransitionEvent"in window||(delete r.transitionstart.transition,delete i.transitionend.transition),t(r,o),t(i,a)}();var l={startEvents:o,addStartEventListener:function(e,t){0!==o.length?o.forEach(function(n){s(e,n,t)}):window.setTimeout(t,0)},removeStartEventListener:function(e,t){0!==o.length&&o.forEach(function(n){u(e,n,t)})},endEvents:a,addEndEventListener:function(e,t){0!==a.length?a.forEach(function(n){s(e,n,t)}):window.setTimeout(t,0)},removeEndEventListener:function(e,t){0!==a.length&&a.forEach(function(n){u(e,n,t)})}};t.default=l,e.exports=t.default},"3zPy":function(e,t){function n(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"===typeof e)return a[e];var n,o=String(e);return(n=r[o.toLowerCase()])?n:(n=i[o.toLowerCase()])||(1===o.length?o.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"===typeof e){var n=e.which||e.keyCode||e.charCode;if(null===n||void 0===n)return!1;if("string"===typeof t){var o;if(o=r[t.toLowerCase()])return o===n;if(o=i[t.toLowerCase()])return o===n}else if("number"===typeof t)return t===n;return!1}};var r=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(o=97;o<123;o++)r[String.fromCharCode(o)]=o-32;for(var o=48;o<58;o++)r[o-48]=o;for(o=1;o<13;o++)r["f"+o]=o+111;for(o=0;o<10;o++)r["numpad "+o]=o+96;var a=t.names=t.title={};for(o in r)a[r[o]]=o;for(var s in i)r[s]=i[s]},"4/ic":function(e,t,n){var r=n("ZWtO");e.exports=function(e){return function(t){return r(t,e)}}},"44Ds":function(e,t,n){var r=n("e4Nc"),i="Expected a function";function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},"49sm":function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},"4ANG":function(e,t,n){var r=n("iadd").NAMESPACE,i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+i.source+o.source+"*(?::"+i.source+o.source+"*)?$"),s=0,u=1,l=2,c=3,f=4,d=5,p=6,h=7;function m(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,m)}function g(){}function v(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function y(e,t,n,i,o,a){function m(e,t,r){n.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),r)}for(var g,v=++t,y=s;;){var b=e.charAt(v);switch(b){case"=":if(y===u)g=e.slice(t,v),y=c;else{if(y!==l)throw new Error("attribute equal must after attrName");y=c}break;case"'":case'"':if(y===c||y===u){if(y===u&&(a.warning('attribute value must after "="'),g=e.slice(t,v)),t=v+1,!((v=e.indexOf(b,t))>0))throw new Error("attribute value no end '"+b+"' match");m(g,_=e.slice(t,v),t-1),y=d}else{if(y!=f)throw new Error('attribute value must after "="');m(g,_=e.slice(t,v),t),a.warning('attribute "'+g+'" missed start quot('+b+")!!"),t=v+1,y=d}break;case"/":switch(y){case s:n.setTagName(e.slice(t,v));case d:case p:case h:y=h,n.closed=!0;case f:case u:break;case l:n.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),y==s&&n.setTagName(e.slice(t,v)),v;case">":switch(y){case s:n.setTagName(e.slice(t,v));case d:case p:case h:break;case f:case u:"/"===(_=e.slice(t,v)).slice(-1)&&(n.closed=!0,_=_.slice(0,-1));case l:y===l&&(_=g),y==f?(a.warning('attribute "'+_+'" missed quot(")!'),m(g,_,t)):(r.isHTML(i[""])&&_.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+_+'" missed value!! "'+_+'" instead!!'),m(_,_,t));break;case c:throw new Error("attribute value missed!!")}return v;case"\x80":b=" ";default:if(b<=" ")switch(y){case s:n.setTagName(e.slice(t,v)),y=p;break;case u:g=e.slice(t,v),y=l;break;case f:var _=e.slice(t,v);a.warning('attribute "'+_+'" missed quot(")!!'),m(g,_,t);case d:y=p}else switch(y){case l:n.tagName;r.isHTML(i[""])&&g.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!'),m(g,g,t),t=v,y=u;break;case d:a.warning('attribute space is required"'+g+'"!!');case p:y=u,t=v;break;case c:y=f,t=v;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}v++}}function b(e,t,n){for(var i=e.tagName,o=null,a=e.length;a--;){var s=e[a],u=s.qName,l=s.value;if((p=u.indexOf(":"))>0)var c=s.prefix=u.slice(0,p),f=u.slice(p+1),d="xmlns"===c&&f;else f=u,c=null,d="xmlns"===u&&"";s.localName=f,!1!==d&&(null==o&&(o={},E(n,n={})),n[d]=o[d]=l,s.uri=r.XMLNS,t.startPrefixMapping(d,l))}for(a=e.length;a--;){(c=(s=e[a]).prefix)&&("xml"===c&&(s.uri=r.XML),"xmlns"!==c&&(s.uri=n[c||""]))}var p;(p=i.indexOf(":"))>0?(c=e.prefix=i.slice(0,p),f=e.localName=i.slice(p+1)):(c=null,f=e.localName=i);var h=e.uri=n[c||""];if(t.startElement(h,f,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=o,!0;if(t.endElement(h,f,i),o)for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&t.endPrefixMapping(c)}function _(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return t+1}function w(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf(""))t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var o=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;i.lastIndex=t,i.exec(e);for(;n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],u=!1,l=!1;a>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],l=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(l=o[3][0]));var c=o[a-1];return n.startDTD(s,u,l),n.endDTD(),c.index+c[0].length}}return-1}function T(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){i[0].length;return n.processingInstruction(i[1],i[2]),r+2}return-1}return-1}function C(){this.attributeNames={}}m.prototype=new Error,m.prototype.name=m.name,g.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),E(t,t={}),function(e,t,n,i,o){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function s(t){if(t>g){var n=e.substring(g,t).replace(/&#?\w+;/g,a);d&&u(g),i.characters(n,0,t-g),g=t}}function u(t,n){for(;t>=c&&(n=f.exec(e));)l=n.index,c=l+n[0].length,d.lineNumber++;d.columnNumber=t-l+1}var l=0,c=0,f=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,p=[{currentNSMap:t}],h={},g=0;for(;;){try{var E=e.indexOf("<",g);if(E<0){if(!e.substr(g).match(/^\s*$/)){var O=i.doc,x=O.createTextNode(e.substr(g));O.appendChild(x),i.currentElement=x}return}switch(E>g&&s(E),e.charAt(E+1)){case"/":var k=e.indexOf(">",E+3),D=e.substring(E+2,k).replace(/[ \t\n\r]+$/g,""),P=p.pop();k<0?(D=e.substring(E+2).replace(/[\s<].*/,""),o.error("end tag name: "+D+" is not complete:"+P.tagName),k=E+1+D.length):D.match(/\sg?g=k:s(Math.max(E,g)+1)}}(e,t,n,i,this.errorHandler),i.endDocument()}},C.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=g,t.ParseError=m},"4Hbs":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n("W5Sr"),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=0;f>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[f-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[f]=(p+this.temp[f-7]|0)+(h+this.temp[f-16]|0)}var m=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&l)|0)+(c+(r.KEY[f]+this.temp[f]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;c=l,l=u,u=s,s=a+m|0,a=o,o=i,i=n,n=m+g|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=l,t[7]+=c},e}();t.RawSha256=i},"4JlD":function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===typeof e?o(a(e),function(a){var s=encodeURIComponent(r(a))+n;return i(e[a])?o(e[a],function(e){return s+encodeURIComponent(r(e))}).join(t):s+encodeURIComponent(r(e[a]))}).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r=0))throw new D(x,new Error(e.tagName+"@"+n));for(var i=t.length-1;r"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function B(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(B(e,t))return!0}while(e=e.nextSibling)}function H(){this.ownerDocument=this}function V(e,t,n,r){e&&e._inc++,n.namespaceURI===o.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function W(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o,delete r[r.length]}}}function q(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,W(e.ownerDocument,e),t}function K(e){return e&&e.nodeType===F.DOCUMENT_TYPE_NODE}function z(e){return e&&e.nodeType===F.ELEMENT_NODE}function $(e){return e&&e.nodeType===F.TEXT_NODE}function G(e,t){var n=e.childNodes||[];if(i(n,z)||K(t))return!1;var r=i(n,K);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function Y(e,t){var n=e.childNodes||[];if(i(n,function(e){return z(e)&&e!==t}))return!1;var r=i(n,K);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function X(e,t,n){if(!function(e){return e&&(e.nodeType===F.DOCUMENT_NODE||e.nodeType===F.DOCUMENT_FRAGMENT_NODE||e.nodeType===F.ELEMENT_NODE)}(e))throw new D(O,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new D(x,"child not in parent");if(!function(e){return e&&(z(e)||$(e)||K(e)||e.nodeType===F.DOCUMENT_FRAGMENT_NODE||e.nodeType===F.COMMENT_NODE||e.nodeType===F.PROCESSING_INSTRUCTION_NODE)}(t)||K(t)&&e.nodeType!==F.DOCUMENT_NODE)throw new D(O,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function Q(e,t,n){var r=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===F.DOCUMENT_FRAGMENT_NODE){var a=o.filter(z);if(a.length>1||i(o,$))throw new D(O,"More than one element or text in fragment");if(1===a.length&&!Y(e,n))throw new D(O,"Element in fragment can not be inserted before doctype")}if(z(t)&&!Y(e,n))throw new D(O,"Only one element can be added and only after doctype");if(K(t)){if(i(r,function(e){return K(e)&&e!==n}))throw new D(O,"Only one doctype is allowed");var s=i(r,z);if(n&&r.indexOf(s)1||i(o,$))throw new D(O,"More than one element or text in fragment");if(1===a.length&&!G(e,n))throw new D(O,"Element in fragment can not be inserted before doctype")}if(z(t)&&!G(e,n))throw new D(O,"Only one element can be added and only after doctype");if(K(t)){if(i(r,K))throw new D(O,"Only one doctype is allowed");var s=i(r,z);if(n&&r.indexOf(s)=0;S--){if(""===(T=i[S]).prefix&&T.namespace===e.namespaceURI){f=T.namespace;break}}if(f!==e.namespaceURI)for(S=i.length-1;S>=0;S--){var T;if((T=i[S]).namespace===e.namespaceURI){T.prefix&&(c=T.prefix+":"+l);break}}}t.push("<",c);for(var C=0;C"),n&&/^script$/i.test(l))for(;u;)u.data?t.push(u.data):me(u,t,n,r,i.slice()),u=u.nextSibling;else for(;u;)me(u,t,n,r,i.slice()),u=u.nextSibling;t.push("")}else t.push("/>");return;case _:case E:for(u=e.firstChild;u;)me(u,t,n,r,i.slice()),u=u.nextSibling;return;case p:return he(t,e.name,e.value);case h:return t.push(e.data.replace(/[<&>]/g,U));case m:return t.push("");case b:return t.push("\x3c!--",e.data,"--\x3e");case w:var D=e.publicId,P=e.systemId;if(t.push("");else if(P&&"."!=P)t.push(" SYSTEM ",P,">");else{var A=e.internalSubset;A&&t.push(" [",A,"]"),t.push(">")}return;case y:return t.push("");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ge(e,t,n){e[t]=n}D.prototype=Error.prototype,l(T,D),P.prototype={length:0,item:function(e){return e>=0&&e0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r;t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},l(f,F),l(f,F.prototype),H.prototype={nodeName:"#document",nodeType:_,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==E){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Z(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===d&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),q(this,e)},replaceChild:function(e,t){Z(this,e,t,Q),e.ownerDocument=this,t&&this.removeChild(t),z(e)&&(this.documentElement=e)},importNode:function(e,t){return function e(t,n,r){var i;switch(n.nodeType){case d:(i=n.cloneNode(!1)).ownerDocument=t;case E:break;case p:r=!0}i||(i=n.cloneNode(!1));i.ownerDocument=t;i.parentNode=null;if(r)for(var o=n.firstChild;o;)i.appendChild(e(t,o,r)),o=o.nextSibling;return i}(this,e,t)},getElementById:function(e){var t=null;return B(this.documentElement,function(n){if(n.nodeType==d&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=u(e);return new A(this,function(n){var r=[];return t.length>0&&B(n.documentElement,function(i){if(i!==n&&i.nodeType===d){var o=i.getAttribute("class");if(o){var a=e===o;if(!a){var s=u(o);a=t.every((l=s,function(e){return l&&-1!==l.indexOf(e)}))}a&&r.push(i)}}var l}),r})},createElement:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new P,(t.attributes=new N)._ownerElement=t,t},createDocumentFragment:function(){var e=new le;return e.ownerDocument=this,e.childNodes=new P,e},createTextNode:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new re;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ce;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new J,r=t.split(":"),i=n.attributes=new N;return n.childNodes=new P,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ee,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},c(H,F),J.prototype={nodeType:d,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===E?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,W(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new A(this,function(t){var n=[];return B(t,function(r){r===t||r.nodeType!=d||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new A(this,function(n){var r=[];return B(n,function(i){i===n||i.nodeType!==d||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}},H.prototype.getElementsByTagName=J.prototype.getElementsByTagName,H.prototype.getElementsByTagNameNS=J.prototype.getElementsByTagNameNS,c(J,F),ee.prototype.nodeType=p,c(ee,F),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(C[O])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},c(te,F),ne.prototype={nodeName:"#text",nodeType:h,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},c(ne,te),re.prototype={nodeName:"#comment",nodeType:b},c(re,te),ie.prototype={nodeName:"#cdata-section",nodeType:m},c(ie,te),oe.prototype.nodeType=w,c(oe,F),ae.prototype.nodeType=S,c(ae,F),se.prototype.nodeType=v,c(se,F),ue.prototype.nodeType=g,c(ue,F),le.prototype.nodeName="#document-fragment",le.prototype.nodeType=E,c(le,F),ce.prototype.nodeType=y,c(ce,F),fe.prototype.serializeToString=function(e,t,n){return de.call(e,t,n)},F.prototype.toString=de;try{if(Object.defineProperty){Object.defineProperty(A.prototype,"length",{get:function(){return I(this),this.$$length}}),Object.defineProperty(F.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case d:case E:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case d:case E:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ge=function(e,t,n){e["$$"+t]=n}}}catch(ve){}t.DocumentType=oe,t.DOMException=D,t.DOMImplementation=L,t.Element=J,t.Node=F,t.NodeList=P,t.XMLSerializer=fe},"4d7F":function(e,t,n){e.exports={default:n("aW7e"),__esModule:!0}},"4kuk":function(e,t,n){var r=n("SfRM"),i=n("Hvzi"),o=n("u8Dt"),a=n("ekgI"),s=n("JSQU");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0&&void 0!==arguments[0]?arguments[0]:{};return function(t){return function(n){function s(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return e.displayName="LazyLoad"+u(t),e}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(s,i.Component),r(s,[{key:"render",value:function(){return o.default.createElement(a.default,e,o.default.createElement(t,this.props))}}]),s}()}}},"4mXO":function(e,t,n){e.exports=n("7TPF")},"4oAd":function(e,t,n){var r=n("OzcY"),i=n("Wpu+");function o(t,n,a){return!function(){if("undefined"===typeof Reflect||!r)return!1;if(r.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(r(Date,[],function(){})),!0}catch(e){return!1}}()?e.exports=o=function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&i(o,n.prototype),o}:e.exports=o=r,o.apply(null,arguments)}e.exports=o},"4sDh":function(e,t,n){var r=n("4uTw"),i=n("03A+"),o=n("Z0cm"),a=n("wJg7"),s=n("shjB"),u=n("9Nap");e.exports=function(e,t,n){for(var l=-1,c=(t=r(t,e)).length,f=!1;++l-1){r=[];for(var i=0;i0)for(var p=0;p0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];return u.default.createElement(f.default,{key:t,prefixCls:r,style:{flex:1},disabled:i,itemStyle:o,indicatorStyle:a},e.map(function(e){return u.default.createElement(f.default.Item,{value:e.value,key:e.value},e.label)}))})}},{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.className,i=e.rootNativeProps,o=e.style,a=this.getCols(),s=(0,r.default)({flexDirection:"row",alignItems:"center"},o);return u.default.createElement(c.default,{style:s,prefixCls:t,className:n,selectedValue:this.state.value,rootNativeProps:i,onValueChange:this.onValueChange,onScrollChange:e.onScrollChange},a)}}]),t}(u.default.Component);p.defaultProps={cols:3,prefixCls:"rmc-cascader",pickerPrefixCls:"rmc-picker",data:[],disabled:!1},t.default=p,e.exports=t.default},"5oMp":function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},"5pKv":function(e,t){e.exports="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},"5vMV":function(e,t,n){var r=n("B+OT"),i=n("NsO/"),o=n("W070")(!1),a=n("VVlx")("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,l=[];for(n in s)n!=a&&r(s,n)&&l.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(l,n)||l.push(n));return l}},"6+eU":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),i=n.n(r),o=n("TSYQ"),a=n.n(o);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(e){var t,n="".concat(e.rootPrefixCls,"-item"),r=a()(n,"".concat(n,"-").concat(e.page),(s(t={},"".concat(n,"-active"),e.active),s(t,e.className,!!e.className),s(t,"".concat(n,"-disabled"),!e.page),t));return i.a.createElement("li",{title:e.showTitle?e.page:null,className:r,onClick:function(){e.onClick(e.page)},onKeyPress:function(t){e.onKeyPress(t,e.onClick,e.page)},tabIndex:"0"},e.itemRender(e.page,"page",i.a.createElement("a",null,e.page)))},l={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};function c(e){return(c="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})(e)}function f(e,t){for(var n=0;n=0||e.relatedTarget.className.indexOf("".concat(o,"-next"))>=0)||i(n.getValidValue())},n.go=function(e){""!==n.state.goInputText&&(e.keyCode!==l.ENTER&&"click"!==e.type||(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue())))},n}var n,r,o;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&&h(e,t)}(t,i.a.Component),n=t,(r=[{key:"getValidValue",value:function(){var e=this.state,t=e.goInputText,n=e.current;return!t||isNaN(t)?n:Number(t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.pageSize,r=t.pageSizeOptions,o=t.locale,a=t.rootPrefixCls,s=t.changeSize,u=t.quickGo,l=t.goButton,c=t.selectComponentClass,f=t.buildOptionText,d=t.selectPrefixCls,p=t.disabled,h=this.state.goInputText,m="".concat(a,"-options"),g=c,v=null,y=null,b=null;if(!s&&!u)return null;if(s&&g){var _=r.map(function(t,n){return i.a.createElement(g.Option,{key:n,value:t},(f||e.buildOptionText)(t))});v=i.a.createElement(g,{disabled:p,prefixCls:d,showSearch:!1,className:"".concat(m,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||r[0]).toString(),onChange:this.changeSize,getPopupContainer:function(e){return e.parentNode}},_)}return u&&(l&&(b="boolean"===typeof l?i.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:p},o.jump_to_confirm):i.a.createElement("span",{onClick:this.go,onKeyUp:this.go},l)),y=i.a.createElement("div",{className:"".concat(m,"-quick-jumper")},o.jump_to,i.a.createElement("input",{disabled:p,type:"text",value:h,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),o.page,b)),i.a.createElement("li",{className:"".concat(m)},v,y)}}])&&f(n.prototype,r),o&&f(n,o),t}();m.defaultProps={pageSizeOptions:["10","20","30","40"]};var g=m;function v(e){return(v="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})(e)}function y(){return(y=Object.assign||function(e){for(var t=1;tr?r:t,0===r&&(t=n.state.current),"number"===typeof e&&("pageSize"in n.props||n.setState({pageSize:e}),"current"in n.props||n.setState({current:t,currentInputValue:t})),n.props.onShowSizeChange(t,e)},n.handleChange=function(e){var t=n.props.disabled,r=e;if(n.isValid(r)&&!t){var i=O(void 0,n.state,n.props);r>i?r=i:r<1&&(r=1),"current"in n.props||n.setState({current:r,currentInputValue:r});var o=n.state.pageSize;return n.props.onChange(r,o),r}return n.state.current},n.prev=function(){n.hasPrev()&&n.handleChange(n.state.current-1)},n.next=function(){n.hasNext()&&n.handleChange(n.state.current+1)},n.jumpPrev=function(){n.handleChange(n.getJumpPrevPage())},n.jumpNext=function(){n.handleChange(n.getJumpNextPage())},n.hasPrev=function(){return n.state.current>1},n.hasNext=function(){return n.state.current2?n-2:0),i=2;ii?i:r,"current"in e||(n.current=r,n.currentInputValue=r),n.pageSize=e.pageSize}return n}}],(o=[{key:"componentDidUpdate",value:function(e,t){var n=this.props.prefixCls;if(t.current!==this.state.current&&this.paginationNode){var r=this.paginationNode.querySelector(".".concat(n,"-item-").concat(t.current));r&&document.activeElement===r&&r.blur()}}},{key:"getValidValue",value:function(e){var t=e.target.value,n=O(void 0,this.state,this.props),r=this.state.currentInputValue;return""===t?t:isNaN(Number(t))?r:t>=n?n:Number(t)}},{key:"renderPrev",value:function(e){var t=this.props,n=t.prevIcon,i=(0,t.itemRender)(e,"prev",this.getItemIcon(n)),o=!this.hasPrev();return Object(r.isValidElement)(i)?Object(r.cloneElement)(i,{disabled:o}):i}},{key:"renderNext",value:function(e){var t=this.props,n=t.nextIcon,i=(0,t.itemRender)(e,"next",this.getItemIcon(n)),o=!this.hasNext();return Object(r.isValidElement)(i)?Object(r.cloneElement)(i,{disabled:o}):i}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,o=t.className,s=t.style,l=t.disabled,c=t.hideOnSinglePage,f=t.total,d=t.locale,p=t.showQuickJumper,h=t.showLessItems,m=t.showTitle,v=t.showTotal,b=t.showSizeChanger,w=t.simple,E=t.itemRender,S=t.showPrevNextJumpers,T=t.jumpPrevIcon,C=t.jumpNextIcon,x=t.selectComponentClass,k=t.selectPrefixCls,D=t.pageSizeOptions,P=this.state,A=P.current,I=P.pageSize,N=P.currentInputValue;if(!0===c&&f<=I)return null;var M=O(void 0,this.state,this.props),R=[],j=null,L=null,F=null,U=null,B=null,H=p&&p.goButton,V=h?1:2,W=A-1>0?A-1:0,q=A+1=2*V&&3!==A&&(R[0]=Object(r.cloneElement)(R[0],{className:"".concat(n,"-item-after-jump-prev")}),R.unshift(j)),M-A>=2*V&&A!==M-2&&(R[R.length-1]=Object(r.cloneElement)(R[R.length-1],{className:"".concat(n,"-item-before-jump-next")}),R.push(L)),1!==Q&&R.unshift(F),Z!==M&&R.push(U)}var te=null;v&&(te=i.a.createElement("li",{className:"".concat(n,"-total-text")},v(f,[0===f?0:(A-1)*I+1,A*I>f?f:A*I])));var ne=!this.hasPrev()||!M,re=!this.hasNext()||!M;return i.a.createElement("ul",y({className:a()(n,o,_({},"".concat(n,"-disabled"),l)),style:s,unselectable:"unselectable",ref:this.savePaginationNode},K),te,i.a.createElement("li",{title:m?d.prev_page:null,onClick:this.prev,tabIndex:ne?null:0,onKeyPress:this.runIfEnterPrev,className:a()("".concat(n,"-prev"),_({},"".concat(n,"-disabled"),ne)),"aria-disabled":ne},this.renderPrev(W)),R,i.a.createElement("li",{title:m?d.next_page:null,onClick:this.next,tabIndex:re?null:0,onKeyPress:this.runIfEnterNext,className:a()("".concat(n,"-next"),_({},"".concat(n,"-disabled"),re)),"aria-disabled":re},this.renderNext(q)),i.a.createElement(g,{disabled:l,locale:d,rootPrefixCls:n,selectComponentClass:x,selectPrefixCls:k,changeSize:b?this.changePageSize:null,current:A,pageSize:I,pageSizeOptions:D,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:H}))}}])&&w(n.prototype,o),s&&w(n,s),t}();x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:C,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showSizeChanger:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:C,locale:{items_per_page:"\u6761/\u9875",jump_to:"\u8df3\u81f3",jump_to_confirm:"\u786e\u5b9a",page:"\u9875",prev_page:"\u4e0a\u4e00\u9875",next_page:"\u4e0b\u4e00\u9875",prev_5:"\u5411\u524d 5 \u9875",next_5:"\u5411\u540e 5 \u9875",prev_3:"\u5411\u524d 3 \u9875",next_3:"\u5411\u540e 3 \u9875"},style:{},itemRender:function(e,t,n){return n}};var k=x;n.d(t,"default",function(){return k})},"6/1s":function(e,t,n){var r=n("YqAc")("meta"),i=n("93I4"),o=n("B+OT"),a=n("2faE").f,s=0,u=Object.isExtensible||function(){return!0},l=!n("KUxP")(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&f.NEED&&u(e)&&!o(e,r)&&c(e),e}}},"6BQ9":function(e,t,n){e.exports=n("uekQ")},"6CmU":function(e,t,n){n("LzdP"),e.exports=n("WEpk").Date.now},"6ddS":function(e,t,n){},"6sVZ":function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},"6tYh":function(e,t,n){var r=n("93I4"),i=n("5K7Z"),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n("2GTP")(Function.call,n("vwuL").f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(i){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},"711d":function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},"74aM":function(e,t,n){"use strict";n("oZKO"),n("i710"),n("PctG")},"77Zs":function(e,t,n){var r=n("Xi7e");e.exports=function(){this.__data__=new r,this.size=0}},"7GkX":function(e,t,n){var r=n("b80T"),i=n("A90E"),o=n("MMmD");e.exports=function(e){return o(e)?r(e):i(e)}},"7Ix3":function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},"7PK7":function(e,t,n){},"7TPF":function(e,t,n){n("AUvm"),e.exports=n("WEpk").Object.getOwnPropertySymbols},"7fqy":function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},"7m0m":function(e,t,n){var r=n("Y7ZC"),i=n("uplh"),o=n("NsO/"),a=n("vwuL"),s=n("IP1Z");r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),u=a.f,l=i(r),c={},f=0;l.length>f;)void 0!==(n=u(r,t=l[f++]))&&s(c,t,n);return c}})},"7ntV":function(e,t,n){e.exports=n("/eQG")},"7zRj":function(e,t,n){(function(t){var r,i="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},o=n(0);"undefined"!==typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),e.exports=r}).call(this,n("3r9c"))},"85Yc":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),i=n.n(r);function o(e){return(o="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})(e)}function a(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}function s(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r=r||n<0||n>=r)return e;var i=e[t],o=t-n;return o>0?[].concat(c(e.slice(0,n)),[i],c(e.slice(n,t)),c(e.slice(t+1,r))):o<0?[].concat(c(e.slice(0,t)),c(e.slice(t+1,n+1)),[i],c(e.slice(n+1,r))):e}var X="'${name}' is not a valid ${type}",Q={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:X,method:X,array:X,object:X,number:X,date:X,boolean:X,integer:X,float:X,regexp:X,email:X,url:X,hex:X},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}};function Z(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 J(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).forEach(function(r){var a=t[r];"string"===typeof a?n[r]=i(a):a&&"object"===o(a)?(n[r]={},e(a,n[r])):n[r]=a}),n}($({},Q,e))}function ne(e,t,n,r){return re.apply(this,arguments)}function re(){return(re=A(D.a.mark(function e(t,n,i,o){var a,u,l,f,d,p;return D.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=J({},i),u=null,a&&"array"===a.type&&a.defaultField&&(u=a.defaultField,delete a.defaultField),l=new ee(s({},t,[a])),f=te(o.validateMessages,t,a),l.messages(f),d=[],e.prev=7,e.next=10,Promise.resolve(l.validate(s({},t,n),J({},o)));case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),e.t0.errors?d=e.t0.errors.map(function(e,t){var n=e.message;return r.isValidElement(n)?r.cloneElement(n,{key:"error_".concat(t)}):n}):(console.error(e.t0),d=[f.default()]);case 15:if(d.length||!u){e.next=20;break}return e.next=18,Promise.all(n.map(function(e,n){return ne("".concat(t,".").concat(n),e,u,o)}));case 18:return p=e.sent,e.abrupt("return",p.reduce(function(e,t){return[].concat(c(e),c(t))},[]));case 20:return e.abrupt("return",d);case 21:case"end":return e.stop()}},e,null,[[7,12]])}))).apply(this,arguments)}function ie(e,t,n,r,i){var o=e.join("."),a=n.map(function(e){var t=e.validator;return t?J({},e,{validator:function(e,n,r){var i=!1,o=t(e,n,function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];e.validatePromise===a&&(e.validatePromise=null,e.errors=t,e.reRender())}),a},e.isFieldValidating=function(){return!!e.validatePromise},e.isFieldTouched=function(){return e.touched},e.getErrors=function(){return e.errors},e.getMeta=function(){return e.prevValidating=e.isFieldValidating(),{touched:e.isFieldTouched(),validating:e.prevValidating,errors:e.errors,name:e.getNamePath()}},e.getOnlyChild=function(t){if("function"===typeof t){var n=e.getMeta();return ue({},e.getOnlyChild(t(e.getControlled(),n,e.context)),{isFunction:!0})}var o=function e(t){var n=[];return i.a.Children.forEach(t,function(t){void 0!==t&&null!==t&&(Array.isArray(t)?n=n.concat(e(t)):Object(v.isFragment)(t)&&t.props?n=n.concat(e(t.props.children)):n.push(t))}),n}(t);return 1===o.length&&r.isValidElement(o[0])?{child:o[0],isFunction:!1}:{child:o,isFunction:!1}},e.getValue=function(t){var n=e.context.getFieldsValue,r=e.getNamePath();return H(t||n(!0),r)},e.getControlled=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.props,r=n.trigger,i=n.validateTrigger,o=n.getValueFromEvent,a=n.normalize,u=n.valuePropName,l=e.getNamePath(),c=e.context,f=c.getInternalHooks,d=c.getFieldsValue,p=f(T).dispatch,h=e.getValue(),m=t[r],g=ue({},t,s({},u,h));return g[r]=function(){var t;e.touched=!0;for(var n=arguments.length,r=new Array(n),i=0;i=t.length)){var n=o.keys.map(function(t,n){return n=n.length||t<0||t>=n.length||(o.keys=Y(o.keys,e,t),a(Y(n,e,t)))}}};return n(r.map(function(e,t){var n=o.keys[t];return void 0===n&&(o.keys[t]=o.id,n=o.keys[t],o.id+=1),{name:t,key:n}}),f)}))};function me(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){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||l(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.")}()}var ge=n("zLVn");function ve(e,t){if(null==e)return{};var n,r,i=Object(ge.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var ye=function(){function e(){f(this,e),this.list=[]}return p(e,[{key:"set",value:function(e,t){var n=this.list.findIndex(function(t){return G(t.key,e)});-1!==n?this.list[n].value=t:this.list.push({key:e,value:t})}},{key:"get",value:function(e){var t=this.list.find(function(t){return G(t.key,e)});return t&&t.value}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.list=this.list.filter(function(t){return!G(t.key,e)})}},{key:"map",value:function(e){return this.list.map(e)}},{key:"toJSON",value:function(){var e={};return this.map(function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null}),e}}]),e}();function be(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 _e(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0]?n.fieldEntities.filter(function(e){return e.getNamePath().length}):n.fieldEntities},this.getFieldsMap=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new ye;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t},this.getFieldEntitiesForNamePathList=function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=B(e);return t.get(n)||{INVALIDATE_NAME_PATH:B(e)}})},this.getFieldsValue=function(e,t){if(n.warningUnhooked(),!0===e&&!t)return n.store;var r=n.getFieldEntitiesForNamePathList(Array.isArray(e)?e:null),i=[];return r.forEach(function(e){var n="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(t){var r="getMeta"in e?e.getMeta():null;t(r)&&i.push(n)}else i.push(n)}),W(n.store,i.map(B))},this.getFieldValue=function(e){n.warningUnhooked();var t=B(e);return H(n.store,t)},this.getFieldsError=function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return!t||"INVALIDATE_NAME_PATH"in t?{name:B(e[n]),errors:[]}:{name:t.getNamePath(),errors:t.getErrors()}})},this.getFieldError=function(e){n.warningUnhooked();var t=B(e);return n.getFieldsError([t])[0].errors},this.isFieldsTouched=function(){n.warningUnhooked();for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})});return function e(n){(i.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var i=n.getNamePath();n.isFieldTouched()&&i.length&&(r.push(i),e(i))}})}(e),r},this.triggerOnFieldsChange=function(e){var t=n.callbacks.onFieldsChange;if(t){var r=n.getFields();t(r.filter(function(t){var n=t.name;return q(e,n)}),r)}},this.validateFields=function(e,t){n.warningUnhooked();var r=!!e,i=r?e.map(B):[],o=[];n.getFieldEntities(!0).forEach(function(e){if(r||i.push(e.getNamePath()),e.props.rules&&e.props.rules.length){var a=e.getNamePath();if(!r||q(i,a)){var s=e.validateRules(_e({validateMessages:_e({},Q,{},n.validateMessages)},t));o.push(s.then(function(){return{name:a,errors:[]}}).catch(function(e){return Promise.reject({name:a,errors:e})}))}}});var a=function(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,o){e.forEach(function(e,a){e.catch(function(e){return t=!0,e}).then(function(e){n-=1,r[a]=e,n>0||(t&&o(r),i(r))})})}):Promise.resolve([])}(o);n.lastValidatePromise=a,a.catch(function(e){return e}).then(function(e){var t=e.map(function(e){return e.name});n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t)});var s=a.then(function(){return n.lastValidatePromise===a?Promise.resolve(n.getFieldsValue(i)):Promise.reject([])}).catch(function(e){var t=e.filter(function(e){return e&&e.errors.length});return Promise.reject({values:n.getFieldsValue(i),errorFields:t,outOfDate:n.lastValidatePromise!==a})});return s.catch(function(e){return e}),s},this.submit=function(){n.warningUnhooked(),n.validateFields().then(function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(r){console.error(r)}}).catch(function(e){var t=n.callbacks.onFinishFailed;t&&t(e)})},this.forceRootUpdate=t};var Ee=function(e){var t=r.useRef(),n=me(r.useState(),2)[1];if(!t.current)if(e)t.current=e;else{var i=new we(function(){n({})});t.current=i.getForm()}return[t.current]};function Se(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 Te(e){for(var t=1;t1?t-1:0),i=1;i0&&void 0!==arguments[0]&&arguments[0],t=[a.default.createElement("meta",{key:"charSet",charSet:"utf-8"})];return e||t.push(a.default.createElement("meta",{key:"viewport",name:"viewport",content:"width=device-width,minimum-scale=1,initial-scale=1"})),t}function d(e,t){return"string"===typeof t||"number"===typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce(function(e,t){return"string"===typeof t||"number"===typeof t?e:e.concat(t)},[])):e.concat(t)}t.defaultHead=f;var p=["name","httpEquiv","charSet","itemProp"];function h(e,t){return e.reduce(function(e,t){var n=a.default.Children.toArray(t.props.children);return e.concat(n)},[]).reduce(d,[]).reverse().concat(f(t.inAmpMode)).filter(function(){var e=new r,t=new r,n=new r,i={};return function(o){if(o.key&&"number"!==typeof o.key&&0===o.key.indexOf(".$"))return!e.has(o.key)&&(e.add(o.key),!0);if(e.has(".$".concat(o.key)))return!1;switch(o.type){case"title":case"base":if(t.has(o.type))return!1;t.add(o.type);break;case"meta":for(var a=0,s=p.length;a(n,r,o)=>{const a=t.levels[r],s=new RegExp(`^(${a})$`);if("log"!==n&&o.unshift(n.toUpperCase()+":"),o.unshift(e+":"),j){j.push([].concat(o));const e=j.length-1e3;j.splice(0,e>0?e:0)}if(!i.a.console)return;let u=i.a.console[n];u||"debug"!==n||(u=i.a.console.info||i.a.console.log),u&&a&&s.test(n)&&u[Array.isArray(o)?"apply":"call"](i.a.console,o)};const F=function e(t){let n,r="info";const i=function(...e){n("log",r,e)};return n=L(t,i),i.createLogger=n=>e(t+": "+n),i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},i.level=e=>{if("string"===typeof e){if(!i.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);r=e}return r},(i.history=()=>j?[].concat(j):[]).filter=e=>(j||[]).filter(t=>new RegExp(`.*${e}.*`).test(t[0])),i.history.clear=()=>{j&&(j.length=0)},i.history.disable=()=>{null!==j&&(j.length=0,j=null)},i.history.enable=()=>{null===j&&(j=[])},i.error=(...e)=>n("error",r,e),i.warn=(...e)=>n("warn",r,e),i.debug=(...e)=>n("debug",r,e),i}("VIDEOJS"),U=F.createLogger,B=Object.prototype.toString,H=function(e){return q(e)?Object.keys(e):[]};function V(e,t){H(e).forEach(n=>t(e[n],n))}function W(e,t,n=0){return H(e).reduce((n,r)=>t(n,e[r],r),n)}function q(e){return!!e&&"object"===typeof e}function K(e){return q(e)&&"[object Object]"===B.call(e)&&e.constructor===Object}function z(...e){const t={};return e.forEach(e=>{e&&V(e,(e,n)=>{K(e)?(K(t[n])||(t[n]={}),t[n]=z(t[n],e)):t[n]=e})}),t}function $(e,t,n,r=!0){const i=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),o={configurable:!0,enumerable:!0,get(){const e=n();return i(e),e}};return r&&(o.set=i),Object.defineProperty(e,t,o)}var G=Object.freeze({__proto__:null,each:V,reduce:W,isObject:q,isPlain:K,merge:z,defineLazyProperty:$});let Y,X=!1,Q=null,Z=!1,J=!1,ee=!1,te=!1,ne=!1,re=null,ie=null,oe=null,ae=!1,se=!1,ue=!1,le=!1;const ce=Boolean(ge()&&("ontouchstart"in i.a||i.a.navigator.maxTouchPoints||i.a.DocumentTouch&&i.a.document instanceof i.a.DocumentTouch)),fe=i.a.navigator&&i.a.navigator.userAgentData;if(fe&&(Z="Android"===fe.platform,ee=Boolean(fe.brands.find(e=>"Microsoft Edge"===e.brand)),te=Boolean(fe.brands.find(e=>"Chromium"===e.brand)),ne=!ee&&te,re=ie=(fe.brands.find(e=>"Chromium"===e.brand)||{}).version||null,se="Windows"===fe.platform),!te){const e=i.a.navigator&&i.a.navigator.userAgent||"";X=/iPod/i.test(e),Q=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Z=/Android/i.test(e),Y=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+"."+t[2]):n||null}(),J=/Firefox/i.test(e),ee=/Edg/i.test(e),te=/Chrome/i.test(e)||/CriOS/i.test(e),ne=!ee&&te,re=ie=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),oe=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),ae=/Safari/i.test(e)&&!ne&&!Z&&!ee,se=/Windows/i.test(e),ue=/iPad/i.test(e)||ae&&ce&&!/iPhone/i.test(e),le=/iPhone/i.test(e)&&!ue}const de=le||ue||X,pe=(ae||de)&&!ne;var he=Object.freeze({__proto__:null,get IS_IPOD(){return X},get IOS_VERSION(){return Q},get IS_ANDROID(){return Z},get ANDROID_VERSION(){return Y},get IS_FIREFOX(){return J},get IS_EDGE(){return ee},get IS_CHROMIUM(){return te},get IS_CHROME(){return ne},get CHROMIUM_VERSION(){return re},get CHROME_VERSION(){return ie},get IE_VERSION(){return oe},get IS_SAFARI(){return ae},get IS_WINDOWS(){return se},get IS_IPAD(){return ue},get IS_IPHONE(){return le},TOUCH_ENABLED:ce,IS_IOS:de,IS_ANY_SAFARI:pe});function me(e){return"string"===typeof e&&Boolean(e.trim())}function ge(){return a.a===i.a.document}function ve(e){return q(e)&&1===e.nodeType}function ye(){try{return i.a.parent!==i.a.self}catch(e){return!0}}function be(e){return function(t,n){if(!me(t))return a.a[e](null);me(n)&&(n=a.a.querySelector(n));const r=ve(n)?n:a.a;return r[e]&&r[e](t)}}function _e(e="div",t={},n={},r){const i=a.a.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){const n=t[e];"textContent"===e?we(i,n):i[e]===n&&"tabIndex"!==e||(i[e]=n)}),Object.getOwnPropertyNames(n).forEach(function(e){i.setAttribute(e,n[e])}),r&&Be(i,r),i}function we(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function Ee(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Se(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function Te(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function Ce(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(F.warn("removeClass was called with an element that doesn't exist"),null)}function Oe(e,t,n){return"function"===typeof n&&(n=n(e,t)),"boolean"!==typeof n&&(n=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,n)),e}function xe(e,t){Object.getOwnPropertyNames(t).forEach(function(n){const r=t[n];null===r||"undefined"===typeof r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)})}function ke(e){const t={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0){const r=e.attributes;for(let i=r.length-1;i>=0;i--){const o=r[i].name;let a=r[i].value;"boolean"!==typeof e[o]&&-1===n.indexOf(","+o+",")||(a=null!==a),t[o]=a}}return t}function De(e,t){return e.getAttribute(t)}function Pe(e,t,n){e.setAttribute(t,n)}function Ae(e,t){e.removeAttribute(t)}function Ie(){a.a.body.focus(),a.a.onselectstart=function(){return!1}}function Ne(){a.a.onselectstart=function(){return!0}}function Me(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(n[e]=t[e])}),n.height||(n.height=parseFloat(Ke(e,"height"))),n.width||(n.width=parseFloat(Ke(e,"width"))),n}}function Re(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,n=e.offsetHeight;let r=0,i=0;for(;e.offsetParent&&e!==a.a[I.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function je(e,t){const n={x:0,y:0};if(de){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Ke(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}t=t.parentNode}}const r={},i=Re(t.target),o=Re(e),a=o.width,s=o.height;let u=t.offsetY-(o.top-i.top),l=t.offsetX-(o.left-i.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-o.left,u=t.changedTouches[0].pageY+o.top,de&&(l-=n.x,u-=n.y)),r.y=1-Math.max(0,Math.min(1,u/s)),r.x=Math.max(0,Math.min(1,l/a)),r}function Le(e){return q(e)&&3===e.nodeType}function Fe(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Ue(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"===typeof e&&(e=e()),ve(e)||Le(e)?e:"string"===typeof e&&/\S/.test(e)?a.a.createTextNode(e):void 0)).filter(e=>e)}function Be(e,t){return Ue(t).forEach(t=>e.appendChild(t)),e}function He(e,t){return Be(Fe(e),t)}function Ve(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}const We=be("querySelector"),qe=be("querySelectorAll");function Ke(e,t){if(!e||!t)return"";if("function"===typeof i.a.getComputedStyle){let r;try{r=i.a.getComputedStyle(e)}catch(n){return""}return r?r.getPropertyValue(t)||r[t]:""}return""}var ze=Object.freeze({__proto__:null,isReal:ge,isEl:ve,isInFrame:ye,createEl:_e,textContent:we,prependTo:Ee,hasClass:Se,addClass:Te,removeClass:Ce,toggleClass:Oe,setAttributes:xe,getAttributes:ke,getAttribute:De,setAttribute:Pe,removeAttribute:Ae,blockTextSelection:Ie,unblockTextSelection:Ne,getBoundingClientRect:Me,findPosition:Re,getPointerPosition:je,isTextNode:Le,emptyEl:Fe,normalizeContent:Ue,appendContent:Be,insertContent:He,isSingleLeftClick:Ve,$:We,$$:qe,computedStyle:Ke});let $e,Ge=!1;const Ye=function(){if(!1===$e.options.autoSetup)return;const e=Array.prototype.slice.call(a.a.getElementsByTagName("video")),t=Array.prototype.slice.call(a.a.getElementsByTagName("audio")),n=Array.prototype.slice.call(a.a.getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(let i=0,o=r.length;i-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function ct(e,t,n){if(!et.has(e))return;const r=et.get(e);if(!r.handlers)return;if(Array.isArray(t))return ot(ct,e,t,n);const i=function(e,t){r.handlers[t]=[],it(e,t)};if(void 0===t){for(const t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&i(e,t);return}const o=r.handlers[t];if(o)if(n){if(n.guid)for(let e=0;e=t&&(e(...r),n=o)}},yt=function(e,t,n,r=i.a){let o;const a=function(){const i=this,a=arguments;let s=function(){o=null,s=null,n||e.apply(i,a)};!o&&n&&e.apply(i,a),r.clearTimeout(o),o=r.setTimeout(s,t)};return a.cancel=()=>{r.clearTimeout(o),o=null},a};var bt=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:mt,bind_:gt,throttle:vt,debounce:yt});let _t;class wt{on(e,t){const n=this.addEventListener;this.addEventListener=()=>{},lt(this,e,t),this.addEventListener=n}off(e,t){ct(this,e,t)}one(e,t){const n=this.addEventListener;this.addEventListener=()=>{},dt(this,e,t),this.addEventListener=n}any(e,t){const n=this.addEventListener;this.addEventListener=()=>{},pt(this,e,t),this.addEventListener=n}trigger(e){const t=e.type||e;"string"===typeof e&&(e={type:t}),e=at(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ft(this,e)}queueTrigger(e){_t||(_t=new Map);const t=e.type||e;let n=_t.get(this);n||(n=new Map,_t.set(this,n));const r=n.get(t);n.delete(t),i.a.clearTimeout(r);const o=i.a.setTimeout(()=>{n.delete(t),0===n.size&&(n=null,_t.delete(this)),this.trigger(e)},0);n.set(t,o)}}wt.prototype.allowedEvents_={},wt.prototype.addEventListener=wt.prototype.on,wt.prototype.removeEventListener=wt.prototype.off,wt.prototype.dispatchEvent=wt.prototype.trigger;const Et=e=>"function"===typeof e.name?e.name():"string"===typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,St=e=>e instanceof wt||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"===typeof e[t]),Tt=(e,t)=>{St(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},Ct=e=>"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,Ot=(e,t,n)=>{if(!e||!e.nodeName&&!St(e))throw new Error(`Invalid target for ${Et(t)}#${n}; must be a DOM node or evented object.`)},xt=(e,t,n)=>{if(!Ct(e))throw new Error(`Invalid event type for ${Et(t)}#${n}; must be a non-empty string or array.`)},kt=(e,t,n)=>{if("function"!==typeof e)throw new Error(`Invalid listener for ${Et(t)}#${n}; must be a function.`)},Dt=(e,t,n)=>{const r=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let i,o,a;return r?(i=e.eventBusEl_,t.length>=3&&t.shift(),[o,a]=t):[i,o,a]=t,Ot(i,e,n),xt(o,e,n),kt(a,e,n),{isTargetingSelf:r,target:i,type:o,listener:a=gt(e,a)}},Pt=(e,t,n,r)=>{Ot(e,e,t),e.nodeName?ht[t](e,n,r):e[t](n,r)},At={on(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=Dt(this,e,"on");if(Pt(n,"on",r,i),!t){const e=()=>this.off(n,r,i);e.guid=i.guid;const t=()=>this.off("dispose",e);t.guid=i.guid,Pt(this,"on","dispose",e),Pt(n,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=Dt(this,e,"one");if(t)Pt(n,"one",r,i);else{const e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,Pt(n,"one",r,e)}},any(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=Dt(this,e,"any");if(t)Pt(n,"any",r,i);else{const e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,Pt(n,"any",r,e)}},off(e,t,n){if(!e||Ct(e))ct(this.eventBusEl_,e,t);else{const r=e,i=t;Ot(r,this,"off"),xt(i,this,"off"),kt(n,this,"off"),n=gt(this,n),this.off("dispose",n),r.nodeName?(ct(r,i,n),ct(r,"dispose",n)):St(r)&&(r.off(i,n),r.off("dispose",n))}},trigger(e,t){Ot(this.eventBusEl_,this,"trigger");const n=e&&"string"!==typeof e?e.type:e;if(!Ct(n))throw new Error(`Invalid event type for ${Et(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.");return ft(this.eventBusEl_,e,t)}};function It(e,t={}){const{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw new Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=_e("span",{className:"vjs-event-bus"});return Object.assign(e,At),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&et.has(e)&&et.delete(e)}),i.a.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const Nt={state:{},setState(e){let t;return"function"===typeof e&&(e=e()),V(e,(e,n)=>{this.state[n]!==e&&((t=t||{})[n]={from:this.state[n],to:e}),this.state[n]=e}),t&&St(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function Mt(e,t){return Object.assign(e,Nt),e.state=Object.assign({},e.state,t),"function"===typeof e.handleStateChanged&&St(e)&&e.on("statechanged",e.handleStateChanged),e}const Rt=function(e){return"string"!==typeof e?e:e.replace(/./,e=>e.toLowerCase())},jt=function(e){return"string"!==typeof e?e:e.replace(/./,e=>e.toUpperCase())},Lt=function(e,t){return jt(e)===jt(t)};var Ft=Object.freeze({__proto__:null,toLowerCase:Rt,toTitleCase:jt,titleCaseEquals:Lt});class Ut{constructor(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=z({},this.options_),t=this.options_=z(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${rt()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(It(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Mt(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=z(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,n){return _e(e,t,n)}localize(e,t,n=e){const r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[r],a=r&&r.split("-")[0],s=i&&i[a];let u=n;return o&&o[e]?u=o[e]:s&&s[e]&&(u=s[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,n){const r=t[n-1];let i=r;return"undefined"===typeof r&&(i=e),i})),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let n=0;n=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[jt(e.name())]=null,this.childNameIndex_[Rt(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,n=e=>{const n=e.name;let r=e.opts;if(void 0!==t[n]&&(r=t[n]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;const i=this.addChild(n,r);i&&(this[n]=i)};let r;const i=Ut.getComponent("Tech");(r=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(e){return!r.some(function(t){return"string"===typeof t?e===t:e===t.name})})).map(t=>{let n,r;return"string"===typeof t?r=e[n=t]||this.options_[n]||{}:(n=t.name,r=t),{name:n,opts:r}}).filter(e=>{const t=Ut.getComponent(e.opts.componentClass||jt(e.name));return t&&!i.isTech(t)}).forEach(n)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return We(e,t||this.contentEl())}$$(e,t){return qe(e,t||this.contentEl())}hasClass(e){return Se(this.el_,e)}addClass(...e){Te(this.el_,...e)}removeClass(...e){Ce(this.el_,...e)}toggleClass(e,t){Oe(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return De(this.el_,e)}setAttribute(e,t){Pe(this.el_,e,t)}removeAttribute(e){Ae(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+jt(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ke(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){const n=`offset${jt(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(u.a.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;let n;this.on("touchstart",function(r){1===r.touches.length&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=i.a.performance.now(),n=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)n=!1;else if(t){const r=e.touches[0].pageX-t.pageX,i=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+i*i)>10&&(n=!1)}});const r=function(){n=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){if(t=null,!0===n){i.a.performance.now()-e<200&&(r.preventDefault(),this.trigger("tap"))}})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=gt(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const n=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}setTimeout(e,t){var n;return e=gt(this,e),this.clearTimersOnDispose_(),n=i.a.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),i.a.clearTimeout(e)),e}setInterval(e,t){e=gt(this,e),this.clearTimersOnDispose_();const n=i.a.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),i.a.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=gt(this,e),t=i.a.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=gt(this,t);const n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),i.a.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,n)=>this[t](n))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if("string"!==typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=Ut.getComponent("Tech"),r=n&&n.isTech(t),i=Ut===t||Ut.prototype.isPrototypeOf(t.prototype);if(r||!i){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=jt(e),Ut.components_||(Ut.components_={});const o=Ut.getComponent("Player");if("Player"===e&&o&&o.players){const e=o.players,t=Object.keys(e);if(e&&t.length>0&&t.map(t=>e[t]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Ut.components_[e]=t,Ut.components_[Rt(e)]=t,t}static getComponent(e){if(e&&Ut.components_)return Ut.components_[e]}}function Bt(e,t,n,r){return function(e,t,n){if("number"!==typeof t||t<0||t>n)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}(e,r,n.length-1),n[r][t]}function Ht(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Bt.bind(null,"start",0,e),end:Bt.bind(null,"end",1,e)},i.a.Symbol&&i.a.Symbol.iterator&&(t[i.a.Symbol.iterator]=()=>(e||[]).values()),t}function Vt(e,t){return Array.isArray(e)?Ht(e):void 0===e||void 0===t?Ht():Ht([[e,t]])}Ut.registerComponent("Component",Ut);const Wt=function(e,t){e=e<0?0:e;let n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600);const o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),(i=i>0||a>0?i+":":"")+(r=((i||o>=10)&&r<10?"0"+r:r)+":")+(n=n<10?"0"+n:n)};let qt=Wt;function Kt(e){qt=e}function zt(){qt=Wt}function $t(e,t=e){return qt(e,t)}var Gt=Object.freeze({__proto__:null,createTimeRanges:Vt,createTimeRange:Vt,setFormatTime:Kt,resetFormatTime:zt,formatTime:$t});function Yt(e,t){let n,r,i=0;if(!t)return 0;e&&e.length||(e=Vt(0,0));for(let o=0;ot&&(r=t),i+=r-n;return i/t}function Xt(e){if(e instanceof Xt)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:q(e)&&("number"===typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Xt.defaultMessages[this.code]||"")}Xt.prototype.code=0,Xt.prototype.message="",Xt.prototype.status=null,Xt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Xt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let t=0;t{})}const Jt=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,n,r)=>(e[n]&&(t[n]=e[n]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var en={textTracksToJson:function(e){const t=e.$$("track"),n=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){const t=Jt(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===n.indexOf(e)}).map(Jt))},jsonToTextTracks:function(e,t){return e.forEach(function(e){const n=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>n.addCue(e))}),t.textTracks()},trackToJson_:Jt};const tn="vjs-modal-dialog";class nn extends Ut{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=_e("div",{className:`${tn}-content`},{role:"document"}),this.descEl_=_e("p",{className:`${tn}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),we(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${tn} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}}opened(e){return"boolean"===typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"===typeof e){const t=this.closeable_=!!e;let n=this.getChild("closeButton");if(t&&!n){const e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),He(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);const i=this.getChild("closeButton");i&&n.appendChild(i.el_)}empty(){this.trigger("beforemodalempty"),Fe(this.contentEl()),this.trigger("modalempty")}content(e){return"undefined"!==typeof e&&(this.content_=e),this.content_}conditionalFocus_(){const e=a.a.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),u.a.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!u.a.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let i=0;i(e instanceof i.a.HTMLAnchorElement||e instanceof i.a.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof i.a.HTMLInputElement||e instanceof i.a.HTMLSelectElement||e instanceof i.a.HTMLTextAreaElement||e instanceof i.a.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof i.a.HTMLIFrameElement||e instanceof i.a.HTMLObjectElement||e instanceof i.a.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}nn.prototype.options_={pauseOnOpen:!0,temporary:!0},Ut.registerComponent("ModalDialog",nn);class rn extends wt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},St(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;nthis.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class un{constructor(e){un.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let n=0;const r=e.length;this.cues_=e,this.length_=e.length;const i=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(tt[r],set(){}});Object.defineProperty(this,"label",{get:()=>n,set(e){e!==n&&(n=e,this.trigger("labelchange"))}})}}const hn=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],n=a.a.createElement("a");n.href=e;const r={};for(let i=0;i0&&(i.a.console&&i.a.console.groupCollapsed&&i.a.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach(e=>F.error(e)),i.a.console&&i.a.console.groupEnd&&i.a.console.groupEnd()),n.flush()},_n=function(e,t){const n={uri:e},r=vn(e);r&&(n.cors=r);const o="use-credentials"===t.tech_.crossOrigin();o&&(n.withCredentials=o),d()(n,gt(this,function(e,n,r){if(e)return F.error(e,n);t.loaded_=!0,"function"!==typeof i.a.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return bn(r,t);F.error(`vttjs failed to load, stopping trying to process ${t.src}`)}):bn(r,t)}))};class wn extends pn{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=z(e,{kind:fn[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=dn[t.mode]||"disabled";const r=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(n="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const i=new un(this.cues_),o=new un(this.activeCues_);let a=!1;this.timeupdateHandler=gt(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==n&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>n,set(e){dn[e]&&n!==e&&(n=e,this.preload_||"disabled"===n||0!==this.cues.length||_n(this.src,this),this.stopTracking(),"disabled"!==n&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?i:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return o;const e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n=e&&t.push(r)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let n=0;nn,set(e){"boolean"===typeof e&&e!==n&&(n=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Sn extends pn{constructor(e={}){const t=z(e,{kind:ln[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"selected",{get:()=>n,set(e){"boolean"===typeof e&&e!==n&&(n=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Tn extends wt{constructor(e={}){let t;super();const n=new wn(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>n}}),t=Tn.NONE,n.addEventListener("loadeddata",()=>{t=Tn.LOADED,this.trigger({type:"load",target:this})})}}Tn.prototype.allowedEvents_={load:"load"},Tn.NONE=0,Tn.LOADING=1,Tn.LOADED=2,Tn.ERROR=3;const Cn={audio:{ListClass:class extends rn{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){on(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&on(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,on(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:En,capitalName:"Audio"},video:{ListClass:class extends rn{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){an(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e{this.changing_||(this.changing_=!0,an(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:Sn,capitalName:"Video"},text:{ListClass:sn,TrackClass:wn,capitalName:"Text"}};Object.keys(Cn).forEach(function(e){Cn[e].getterName=`${e}Tracks`,Cn[e].privateName=`${e}Tracks_`});const On={remoteText:{ListClass:sn,TrackClass:wn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;tthis.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),xn.names.forEach(t=>{const n=xn[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new xn.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(gt(this,function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Vt(0,0)}bufferedPercent(){return Yt(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Cn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(e=>{const t=this[`${e}Tracks`]()||[];let n=t.length;for(;n--;){const r=t[n];"text"===e&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Xt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Vt(0,0):Vt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Cn.names.forEach(e=>{const t=Cn[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})}addWebVttScript_(){if(!i.a.WebVTT)if(a.a.body.contains(this.el())){if(!this.options_["vtt.js"]&&K(h.a)&&Object.keys(h.a).length>0)return void this.trigger("vttjsloaded");const e=a.a.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),i.a.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",n),t.on("removetrack",r),this.addWebVttScript_();const i=()=>this.trigger("texttrackchange"),o=()=>{i();for(let t=0;tthis.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=rt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return kn.canPlayType(e.type)}static isTech(e){return e.prototype instanceof kn||e instanceof kn||e===kn}static registerTech(e,t){if(kn.techs_||(kn.techs_={}),!kn.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!kn.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!kn.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=jt(e),kn.techs_[e]=t,kn.techs_[Rt(e)]=t,"Tech"!==e&&kn.defaultTechOrder_.push(e),t}static getTech(e){if(e)return kn.techs_&&kn.techs_[e]?kn.techs_[e]:(e=jt(e),i.a&&i.a.videojs&&i.a.videojs[e]?(F.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),i.a.videojs[e]):void 0)}}xn.names.forEach(function(e){const t=xn[e];kn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),kn.prototype.featuresVolumeControl=!0,kn.prototype.featuresMuteControl=!0,kn.prototype.featuresFullscreenResize=!1,kn.prototype.featuresPlaybackRate=!1,kn.prototype.featuresProgressEvents=!1,kn.prototype.featuresSourceset=!1,kn.prototype.featuresTimeupdateEvents=!1,kn.prototype.featuresNativeTextTracks=!1,kn.prototype.featuresVideoFrameCallback=!1,kn.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){const n=e.sourceHandlers||[];let r;for(let e=0;e(function e(t={},n=[],r,i,o=[],a=!1){const[s,...u]=n;if("string"===typeof s)e(t,Dn[s],r,i,o,a);else if(s){const n=function(e,t){const n=Pn[e.id()];let r=null;if(void 0===n||null===n)return r=t(e),Pn[e.id()]=[[t,r]],r;for(let i=0;i=0;i--){const o=e[i];o[t]&&o[t](r,n)}}(e,n,s,a),s}const Mn={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Rn={setCurrentTime:1,setMuted:1,setVolume:1},jn={play:1,pause:1};function Ln(e){return(t,n)=>t===An?An:n[e]?n[e](t):t}const Fn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Un=function(e=""){const t=gn(e);return Fn[t.toLowerCase()]||""},Bn=(e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const n=e.cache_.sources.filter(e=>e.src===t);if(n.length)return n[0].type;const r=e.$$("source");for(let i=0;ithis.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&F.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;const r=_e(e,t,n);return r.appendChild(_e("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=_e("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,we(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!==typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){u.a.isEventKey(e,"Space")||u.a.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ut.registerComponent("ClickableComponent",Wn);class qn extends Wn{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return _e("div",{className:"vjs-poster"})}crossOrigin(e){if("undefined"===typeof e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(_e("picture",{className:"vjs-poster",tabIndex:-1},{},_e("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Zt(this.player_.play()):this.player_.pause())}}qn.prototype.crossorigin=qn.prototype.crossOrigin,Ut.registerComponent("PosterImage",qn);const Kn="#222",zn="#ccc",$n={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Gn(e,t){let n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Yn(e,t,n){try{e.style[t]=n}catch(r){return}}Ut.registerComponent("TextTrackDisplay",class extends Ut{constructor(e,t,n){super(e,t,n);const r=e=>this.updateDisplay(e);e.on("loadstart",e=>this.toggleDisplay(e)),e.on("texttrackchange",r),e.on("loadedmetadata",e=>this.preselectTrack(e)),e.ready(gt(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",r),e.on("playerresize",r);const t=i.a.screen.orientation||i.a,n=i.a.screen.orientation?"change":"orientationchange";t.addEventListener(n,r),e.on("dispose",()=>t.removeEventListener(n,r));const o=this.options_.playerOptions.tracks||[];for(let e=0;e!e.activeCues))return;const t=[];for(let n=0;nthis.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return Zt(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const i=()=>r.focus();Qt(t)?t.then(i,()=>{}):this.setTimeout(i,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Qn.prototype.controlText_="Play Video",Ut.registerComponent("BigPlayButton",Qn);Ut.registerComponent("CloseButton",class extends Xn{constructor(e,t){super(e,t),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){u.a.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class Zn extends Xn{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Zt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}Zn.prototype.controlText_="Play",Ut.registerComponent("PlayToggle",Zn);class Jn extends Ut{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended"],e=>this.updateContent(e)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=_e("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\xa0`},{role:"presentation"});return t.appendChild(n),this.contentEl_=_e("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}updateTextNode_(e=0){e=$t(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,F.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=a.a.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Jn.prototype.labelText_="Time",Jn.prototype.controlText_="Time",Ut.registerComponent("TimeDisplay",Jn);class er extends Jn{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}er.prototype.labelText_="Current Time",er.prototype.controlText_="Current Time",Ut.registerComponent("CurrentTimeDisplay",er);class tr extends Jn{constructor(e,t){super(e,t);const n=e=>this.updateContent(e);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}tr.prototype.labelText_="Duration",tr.prototype.controlText_="Duration",Ut.registerComponent("DurationDisplay",tr);Ut.registerComponent("TimeDivider",class extends Ut{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return t.appendChild(n),e.appendChild(t),e}});class nr extends Jn{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(_e("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!==typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}nr.prototype.labelText_="Remaining Time",nr.prototype.controlText_="Remaining Time",Ut.registerComponent("RemainingTimeDisplay",nr);Ut.registerComponent("LiveDisplay",class extends Ut{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=_e("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(_e("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\xa0`})),this.contentEl_.appendChild(a.a.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class rr extends Xn{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=_e("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function ir(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}rr.prototype.controlText_="Seek to live, currently playing live",Ut.registerComponent("SeekToLive",rr);var or=Object.freeze({__proto__:null,clamp:ir});class ar extends Ut{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||ne||e.preventDefault(),Ie(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Ne(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_?e:(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}),e)}getProgress(){return Number(ir(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=je(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){u.a.isEventKey(e,"Left")||u.a.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):u.a.isEventKey(e,"Right")||u.a.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Ut.registerComponent("Slider",ar);const sr=(e,t)=>ir(e/t*100,0,100).toFixed(2)+"%";Ut.registerComponent("LoadProgressBar",class extends Ut{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=_e("span",{className:"vjs-control-text"}),n=_e("span",{textContent:this.localize("Loaded")}),r=a.a.createTextNode(": ");return this.percentageEl_=_e("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,o=sr(r,n);this.percent_!==o&&(this.el_.style.width=o,we(this.percentageEl_,o),this.percent_=o);for(let a=0;at.length;a--)this.el_.removeChild(i[a-1]);i.length=t.length})}});Ut.registerComponent("TimeTooltip",class extends Ut{constructor(e,t){super(e,t),this.update=vt(gt(this,this.update),mt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,n){const r=Re(this.el_),i=Me(this.player_.el()),o=e.width*t;if(!i||!r)return;const a=e.left-i.left+o,s=e.width-o+(i.right-e.right);let u=r.width/2;ar.width&&(u=r.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(n)}write(e){we(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let i;const o=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),n=e-t*e;i=(n<1?"":"-")+$t(n,e)}else i=$t(n,o);this.update(e,t,i),r&&r()})}});class ur extends Ut{constructor(e,t){super(e,t),this.update=vt(gt(this,this.update),mt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const n=this.getChild("timeTooltip");if(!n)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,r)}}ur.prototype.options_={children:[]},de||Z||ur.prototype.options_.children.push("timeTooltip"),Ut.registerComponent("PlayProgressBar",ur);class lr extends Ut{constructor(e,t){super(e,t),this.update=vt(gt(this,this.update),mt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,()=>{this.el_.style.left=`${e.width*t}px`})}}lr.prototype.options_={children:["timeTooltip"]},Ut.registerComponent("MouseTimeDisplay",lr);const cr=5,fr=12;class dr extends ar{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=gt(this,this.update),this.update=vt(this.update_,mt),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a.a&&"visibilityState"in a.a&&this.on(a.a,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===a.a.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,mt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===a.a.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),n=this.player_.liveTracker;let r=this.player_.duration();n&&n.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===r||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[$t(e,r),$t(r,r)],"{1} of {2}")),this.currentTime_=e,this.duration_=r),this.bar&&this.bar.update(Me(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Ve(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Ve(e))return;let n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(r>=.99)return void i.seekToLiveEdge();const e=i.seekableStart(),t=i.liveCurrentTime();if((n=e+r*i.liveWindow())>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}else(n=r*this.player_.duration())===this.player_.duration()&&(n-=.1);this.userSeek_(n)}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Zt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+cr)}stepBack(){this.userSeek_(this.player_.currentTime()-cr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(u.a.isEventKey(e,"Space")||u.a.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(u.a.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(u.a.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(u()(e))){e.preventDefault(),e.stopPropagation();const n=10*(u.a.codes[u()(e)]-u.a.codes[0])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else u.a.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-cr*fr)):u.a.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+cr*fr)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a.a&&"visibilityState"in a.a&&this.off(a.a,"visibilitychange",this.toggleVisibility_),super.dispose()}}dr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},de||Z||dr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Ut.registerComponent("SeekBar",dr);class pr extends Ut{constructor(e,t){super(e,t),this.handleMouseMove=vt(gt(this,this.handleMouseMove),mt),this.throttledHandleMouseSeek=vt(gt(this,this.handleMouseSeek),mt),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!n&&!r)return;const i=t.el(),o=Re(i);let a=je(i,e).x;a=ir(a,0,1),r&&r.update(o,a),n&&n.update(o,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Zt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}pr.prototype.options_={children:["seekBar"]},Ut.registerComponent("ProgressControl",pr);class hr extends Xn{constructor(e,t){super(e,t),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>{"audio"===e.currentType().substring(0,5)||e.audioPosterMode()||e.audioOnlyMode()?(e.isInPictureInPicture()&&e.exitPictureInPicture(),this.hide()):this.show()}),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control ${super.buildCSSClass()}`}handlePictureInPictureEnabledChange(){a.a.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in i.a?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}}hr.prototype.controlText_="Picture-in-Picture",Ut.registerComponent("PictureInPictureToggle",hr);class mr extends Xn{constructor(e,t){super(e,t),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===a.a[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?this.controlText("Exit Fullscreen"):this.controlText("Fullscreen")}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}mr.prototype.controlText_="Fullscreen",Ut.registerComponent("FullscreenToggle",mr);const gr=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};Ut.registerComponent("VolumeLevel",class extends Ut{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}});Ut.registerComponent("VolumeLevelTooltip",class extends Ut{constructor(e,t){super(e,t),this.update=vt(gt(this,this.update),mt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,n,r){if(!n){const n=Me(this.el_),r=Me(this.player_.el()),i=e.width*t;if(!r||!n)return;const o=e.left-r.left+i,a=e.width-i+(r.right-e.right);let s=n.width/2;on.width&&(s=n.width),this.el_.style.right=`-${s}px`}this.write(`${r}%`)}write(e){we(this.el_,e)}updateVolume(e,t,n,r,i){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,n,r.toFixed(0)),i&&i()})}});class vr extends Ut{constructor(e,t){super(e,t),this.update=vt(gt(this,this.update),mt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,n){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}vr.prototype.options_={children:["volumeLevelTooltip"]},Ut.registerComponent("MouseVolumeLevelDisplay",vr);class yr extends ar{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Ve(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const n=this.el(),r=Me(n),i=this.vertical();let o=je(n,e);o=ir(o=i?o.y:o.x,0,1),t.update(r,o,i)}Ve(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}yr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},de||Z||yr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),yr.prototype.playerEvent="volumechange",Ut.registerComponent("VolumeBar",yr);class br extends Ut{constructor(e,t={}){t.vertical=t.vertical||!1,("undefined"===typeof t.volumeBar||K(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),gr(this,e),this.throttledHandleMouseMove=vt(gt(this,this.handleMouseMove),mt),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}br.prototype.options_={children:["volumeBar"]},Ut.registerComponent("VolumeControl",br);const _r=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})};class wr extends Xn{constructor(e,t){super(e,t),_r(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){const e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;de&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),Ce(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),Te(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}wr.prototype.controlText_="Mute",Ut.registerComponent("MuteToggle",wr);class Er extends Ut{constructor(e,t={}){"undefined"!==typeof t.inline?t.inline=t.inline:t.inline=!0,("undefined"===typeof t.volumeControl||K(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){u.a.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),lt(a.a,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),ct(a.a,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){u.a.isEventKey(e,"Esc")&&this.handleMouseOut()}}Er.prototype.options_={children:["muteToggle","volumeControl"]},Ut.registerComponent("VolumePanel",Er);Ut.registerComponent("SkipForward",class extends Xn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let i;i=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}});class Sr extends Xn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let i;i=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Sr.prototype.controlText_="Skip Backward",Ut.registerComponent("SkipBackward",Sr);class Tr extends Ut{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof Ut&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Ut&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"===typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=_e(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),lt(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||a.a.activeElement;if(!this.children().some(e=>e.el()===t)){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const n=t.filter(t=>t.el()===e.target)[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}}handleKeyDown(e){u.a.isEventKey(e,"Left")||u.a.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(u.a.isEventKey(e,"Right")||u.a.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Ut.registerComponent("Menu",Tr);class Cr extends Ut{constructor(e,t={}){super(e,t),this.menuButton_=new Xn(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=Xn.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),lt(a.a,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Tr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=_e("li",{className:"vjs-menu-title",textContent:jt(this.options_.title),tabIndex:-1}),n=new Ut(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;tu.a.isEventKey(e,t))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Ut.registerComponent("MenuItem",kr);class Dr extends kr{constructor(e,t){const n=t.track,r=e.textTracks();t.label=n.label||n.language||"Unknown",t.selected="showing"===n.mode,super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const o=(...e)=>{this.handleTracksChange.apply(this,e)},s=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],o),r.addEventListener("change",o),r.addEventListener("selectedlanguagechange",s),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],o),r.removeEventListener("change",o),r.removeEventListener("selectedlanguagechange",s)}),void 0===r.onchange){let e;this.on(["tap","click"],function(){if("object"!==typeof i.a.Event)try{e=new i.a.Event("change")}catch(t){}e||(e=a.a.createEvent("Event")).initEvent("change",!0,!0),r.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let r=0;r-1&&"showing"===e.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let n=!0;for(let r=0,i=t.length;r-1&&"showing"===e.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Ut.registerComponent("OffTextTrackMenuItem",Pr);class Ar extends Or{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Dr){let n;this.label_&&(n=`${this.label_} off`),e.push(new Pr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i-1){const r=new t(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});r.addClass(`vjs-${n.kind}-menu-item`),e.push(r)}}return e}}Ut.registerComponent("TextTrackButton",Ar);class Ir extends kr{constructor(e,t){const n=t.track,r=t.cue,i=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=i&&i{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(jt(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n-1&&(this.label_="captions"),this.menuButton_.controlText(jt(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new jr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Fr)}}Ur.prototype.kinds_=["captions","subtitles"],Ur.prototype.controlText_="Subtitles",Ut.registerComponent("SubsCapsButton",Ur);class Br extends kr{constructor(e,t){const n=t.track,r=e.audioTracks();t.label=n.label||n.language||"Unknown",t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const i=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener("change",i),this.on("dispose",()=>{r.removeEventListener("change",i)})}createEl(e,t,n){const r=super.createEl(e,t,n),i=r.querySelector(".vjs-menu-item-text");return"main-desc"===this.options_.track.kind&&(i.appendChild(_e("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(_e("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;tthis.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Vr.prototype.contentElType="button",Ut.registerComponent("PlaybackRateMenuItem",Vr);class Wr extends Cr{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=_e("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new Vr(this.player(),{rate:e[n]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Wr.prototype.controlText_="Playback Rate",Ut.registerComponent("PlaybackRateMenuButton",Wr);class qr extends Ut{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},n={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,n)}}Ut.registerComponent("Spacer",qr);Ut.registerComponent("CustomControlSpacer",class extends qr{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}});class Kr extends Ut{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Kr.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in a.a&&Kr.prototype.options_.children.splice(Kr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Ut.registerComponent("ControlBar",Kr);class zr extends nn{constructor(e,t){super(e,t),this.on(e,"error",e=>this.open(e))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}zr.prototype.options_=Object.assign({},nn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Ut.registerComponent("ErrorDisplay",zr);const $r="vjs-text-track-settings",Gr=["#000","Black"],Yr=["#00F","Blue"],Xr=["#0FF","Cyan"],Qr=["#0F0","Green"],Zr=["#F0F","Magenta"],Jr=["#F00","Red"],ei=["#FFF","White"],ti=["#FF0","Yellow"],ni=["1","Opaque"],ri=["0.5","Semi-Transparent"],ii=["0","Transparent"],oi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Gr,ei,Jr,Qr,Yr,ti,Zr,Xr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[ni,ri,ii]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ei,Gr,Jr,Qr,Yr,ti,Zr,Xr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[ni,ri]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[ii,ri,ni]}};function ai(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}oi.windowColor.options=oi.backgroundColor.options;Ut.registerComponent("TextTrackSettings",class extends nn{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=_e("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),V(oi,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",n="label"){const r=oi[e],i=r.id.replace("%s",this.id_),o=[t,i].join(" ").trim();return[`<${n} id="${i}" class="${"label"===n?"vjs-label":""}">`,this.localize(r.label),``,`").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['
',``,this.localize("Text"),"",'',this.createElSelect_("color",e),"",'',this.createElSelect_("textOpacity",e),"","
"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['
',``,this.localize("Text Background"),"",'',this.createElSelect_("backgroundColor",e),"",'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['
',``,this.localize("Caption Area Background"),"",'',this.createElSelect_("windowColor",e),"",'',this.createElSelect_("windowOpacity",e),"","
"].join("")}createElColors_(){return _e("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return _e("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return _e("div",{className:"vjs-track-settings-controls",innerHTML:[`",``].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return W(oi,(e,t,n)=>{const r=function(e,t){return ai(e.options[e.options.selectedIndex].value,t)}(this.$(t.selector),t.parser);return void 0!==r&&(e[n]=r),e},{})}setValues(e){V(oi,(t,n)=>{!function(e,t,n){if(t)for(let r=0;r{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(i.a.localStorage.getItem($r))}catch(t){F.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?i.a.localStorage.setItem($r,JSON.stringify(e)):i.a.localStorage.removeItem($r)}catch(t){F.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()}handleLanguagechange(){this.fill()}});Ut.registerComponent("ResizeManager",class extends Ut{constructor(e,t){let n=t.ResizeObserver||i.a.ResizeObserver;null===t.ResizeObserver&&(n=!1),super(e,z({createEl:!n,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||i.a.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=yt(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){ct(this,"resize",e),ct(this,"unload",t),t=null};lt(this.el_.contentWindow,"unload",t),lt(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const si={trackingThreshold:20,liveTolerance:15};Ut.registerComponent("LiveTracker",class extends Ut{constructor(e,t){super(e,z(si,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(i.a.performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),o=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-o)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,mt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"===typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}});Ut.registerComponent("TitleBar",class extends Ut{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:_e("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${rt()}`}),description:_e("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${rt()}`})},_e("div",{className:"vjs-title-bar"},{},Object.values(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const r=this.state[e],i=this.els[e],o=n[e];Fe(i),r&&we(i,r),t&&(t.removeAttribute(o),r&&t.setAttribute(o,i.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const ui=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const n=e.$$("source"),r=[];let i="";if(!n.length)return!1;for(let o=0;o{let n={};for(let r=0;rci([e.el(),i.a.HTMLMediaElement.prototype,i.a.Element.prototype,li],"innerHTML"))(e),o=n=>(...r)=>{const i=n.apply(t,r);return ui(e),i};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(n[e]=t[e],t[e]=o(n[e]))}),Object.defineProperty(t,"innerHTML",z(r,{set:o(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach(e=>{t[e]=n[e]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},di=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?mn(i.a.Element.prototype.getAttribute.call(this,"src")):""},set(e){return i.a.Element.prototype.setAttribute.call(this,"src",e),e}}),pi=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const n=(e=>ci([e.el(),i.a.HTMLMediaElement.prototype,di],"src"))(e),r=t.setAttribute,o=t.load;Object.defineProperty(t,"src",z(n,{set:r=>{const i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=(n,i)=>{const o=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),o},t.load=()=>{const n=o.call(t);return ui(e)||(e.triggerSourceset(""),fi(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):ui(e)||fi(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=o,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}};class hi extends kn{constructor(e,t){super(e,t);const n=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,n&&(this.el_.currentSrc!==n.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const n=[];for(;t--;){const i=e[t];"track"===i.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),this.textTracks().addTrack(i.track),r||this.el_.hasAttribute("crossorigin")||!vn(i.src)||(r=!0)):n.push(i))}for(let r=0;r{t=[];for(let n=0;ne.removeEventListener("change",n));const r=()=>{for(let e=0;e{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Cn[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;const i={change:t=>{const n={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(n),"text"===e&&this[On.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},o=function(){const e=[];for(let t=0;t{const t=i[e];n.addEventListener(e,t),this.on("dispose",r=>n.removeEventListener(e,t))}),this.on("loadstart",o),this.on("dispose",e=>this.off("loadstart",o))}proxyNativeTracks_(){Cn.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),hi.disposeMediaElement(e),e=t}else{e=a.a.createElement("video");const t=z({},this.options_.tag&&ke(this.options_.tag));ce&&!0===this.options_.nativeControlsForTouch||delete t.controls,xe(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&Pe(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let n=0;n=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&pe?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){F(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Z&&ne&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"===typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Zt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}reset(){hi.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=a.a.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let n=t.length;for(;n--;)e!==t[n]&&e!==t[n].track||this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),i.a.performance&&(e.creationTime=i.a.performance.now()),e}}$(hi,"TEST_VID",function(){if(!ge())return;const e=a.a.createElement("video"),t=a.a.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),hi.isSupported=function(){try{hi.TEST_VID.volume=.5}catch(e){return!1}return!(!hi.TEST_VID||!hi.TEST_VID.canPlayType)},hi.canPlayType=function(e){return hi.TEST_VID.canPlayType(e)},hi.canPlaySource=function(e,t){return hi.canPlayType(e.type)},hi.canControlVolume=function(){try{const t=hi.TEST_VID.volume;hi.TEST_VID.volume=t/2+.1;const n=t!==hi.TEST_VID.volume;return n&&de?(i.a.setTimeout(()=>{hi&&hi.prototype&&(hi.prototype.featuresVolumeControl=t!==hi.TEST_VID.volume)}),!1):n}catch(e){return!1}},hi.canMuteVolume=function(){try{const t=hi.TEST_VID.muted;return hi.TEST_VID.muted=!t,hi.TEST_VID.muted?Pe(hi.TEST_VID,"muted","muted"):Ae(hi.TEST_VID,"muted"),t!==hi.TEST_VID.muted}catch(e){return!1}},hi.canControlPlaybackRate=function(){if(Z&&ne&&ie<58)return!1;try{const t=hi.TEST_VID.playbackRate;return hi.TEST_VID.playbackRate=t/2+.1,t!==hi.TEST_VID.playbackRate}catch(e){return!1}},hi.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(a.a.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(a.a.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(a.a.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(a.a.createElement("audio"),"innerHTML",{get:t,set:t})}catch(e){return!1}return!0},hi.supportsNativeTextTracks=function(){return pe||de&&ne},hi.supportsNativeVideoTracks=function(){return!(!hi.TEST_VID||!hi.TEST_VID.videoTracks)},hi.supportsNativeAudioTracks=function(){return!(!hi.TEST_VID||!hi.TEST_VID.audioTracks)},hi.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){$(hi.prototype,e,()=>hi[t](),!0)}),hi.prototype.featuresVolumeControl=hi.canControlVolume(),hi.prototype.movingMediaElementInDOM=!de,hi.prototype.featuresFullscreenResize=!0,hi.prototype.featuresProgressEvents=!0,hi.prototype.featuresTimeupdateEvents=!0,hi.prototype.featuresVideoFrameCallback=!(!hi.TEST_VID||!hi.TEST_VID.requestVideoFrameCallback),hi.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},hi.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let n=t.length;for(;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){hi.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){hi.prototype["set"+jt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){hi.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){hi.prototype["set"+jt(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){hi.prototype[e]=function(){return this.el_[e]()}}),kn.withSourceHandlers(hi),hi.nativeSourceHandler={},hi.nativeSourceHandler.canPlayType=function(e){try{return hi.TEST_VID.canPlayType(e)}catch(t){return""}},hi.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return hi.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=gn(e.src);return hi.nativeSourceHandler.canPlayType(`video/${t}`)}return""},hi.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},hi.nativeSourceHandler.dispose=function(){},hi.registerSourceHandler(hi.nativeSourceHandler),kn.registerTech("Html5",hi);const mi=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],gi={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},vi=["tiny","xsmall","small","medium","large","xlarge","huge"],yi={};vi.forEach(e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;yi[e]=`vjs-layout-${t}`});const bi={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class _i extends Ut{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${rt()}`,(t=Object.assign(_i.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const n=e.closest("[lang]");n&&(t.language=n.getAttribute("lang"))}if(super(null,t,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=U(this.id_),this.fsApi_=I,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ke(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach(function(n){e[n.toLowerCase()]=t.languages[n]}),this.languages_=e}else this.languages_=_i.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!==typeof this[e])throw new Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),It(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(lt(a.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=z(this.options_);t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),ce&&this.addClass("vjs-touch-enabled"),de||this.addClass("vjs-workinghover"),_i.players[this.id_]=this;const i=k.split(".")[0];this.addClass(`vjs-v${i}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),ct(a.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),ct(a.a,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),_i.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Pn[this.id()]=null,xn.names.forEach(e=>{const t=this[xn[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r="video-js"===this.tag.tagName.toLowerCase();n?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const o=ke(t);if(r){for(e=this.el_=t,t=this.tag=a.a.createElement("video");e.children.length;)t.appendChild(e.firstChild);Se(e,"video-js")||Te(e,"video-js"),e.appendChild(t),n=this.playerElIngest_=e,Object.keys(e).forEach(n=>{try{t[n]=e[n]}catch(r){}})}if(t.setAttribute("tabindex","-1"),o.tabindex="-1",ne&&se&&(t.setAttribute("role","application"),o.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach(function(n){r&&"class"===n||e.setAttribute(n,o[n]),r&&t.setAttribute(n,o[n])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==i.a.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ze("vjs-styles-dimensions");const e=We(".vjs-styles-defaults"),t=We("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const s=t.getElementsByTagName("a");for(let i=0;i{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===i.a.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"===typeof this.width_?this.width_:this.options_.width,t="number"===typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(e>=0&&(n.width=e),t>=0&&(n.height=t)))}let e,t,n,r;const o=(n=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),a=o[1]/o[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Je(this.styleEl_,`\n .${r} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${r}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*a}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const n=jt(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(kn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let i=this.autoplay();("string"===typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(i=!1);const o={source:t,autoplay:i,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};xn.names.forEach(e=>{const t=xn[e];o[t.getterName]=this[t.privateName]}),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);const a=kn.getTech(e);if(!a)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new a(o),this.tech_.ready(gt(this,this.handleTechReady_),!0),en.jsonToTextTracks(this.textTracksJson_||[],this.tech_),mi.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${jt(e)}_`](t))}),Object.keys(gi).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${gi[e]}_`].bind(this),event:t}):this[`handleTech${gi[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||Ee(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){xn.names.forEach(e=>{const t=xn[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=en.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&F.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!==typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const n=this.play();if(Qt(n))return n.catch(e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};let n;return"any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():t():Qt(n=this.play())&&(n=n.catch(t)),Qt(n)?n.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,n="";"string"!==typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=Bn(this,t)),this.cache_.source=z({},e,{src:t,type:n});const r=this.cache_.sources.filter(e=>e.src&&e.src===t),i=[],o=this.$$("source"),a=[];for(let s=0;sthis.updateSourceCaches_(e);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;const t=this.techGet("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Zt(this.play()):this.pause()))}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const n=this.el();let r=a.a[this.fsApi_.fullscreenElement]===n;!r&&n.matches?r=n.matches(":"+this.fsApi_.fullscreen):!r&&n.msMatchesSelector&&(r=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Rn)return function(e,t,n,r){return t[n](e.reduce(Ln(n),r))}(this.middleware_,this.tech_,e,t);if(e in jn)return Nn(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(n){throw F(n),n}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Mn)return function(e,t,n){return e.reduceRight(Ln(n),t[n]())}(this.middleware_,this.tech_,e);if(e in jn)return Nn(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw F(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw F(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw F(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Zt){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),n=Boolean(pe||de);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&n&&this.load());const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Vt(0,0)}scrubbing(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return"undefined"!==typeof e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Vt(0,0)),e}bufferedPercent(){return Yt(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((n,r)=>{function i(){t.off("fullscreenerror",a),t.off("fullscreenchange",o)}function o(){i(),n()}function a(e,t){i(),r(t)}t.one("fullscreenchange",o),t.one("fullscreenerror",a);const s=t.requestFullscreenHelper_(e);s&&(s.then(i,i),s.then(n,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,n)=>{function r(){e.off("fullscreenerror",o),e.off("fullscreenchange",i)}function i(){r(),t()}function o(e,t){r(),n(t)}e.one("fullscreenchange",i),e.one("fullscreenerror",o);const a=e.exitFullscreenHelper_();a&&(a.then(r,r),a.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=a.a[this.fsApi_.exitFullscreen]();return e&&Zt(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=a.a.documentElement.style.overflow,lt(a.a,"keydown",this.boundFullWindowOnEscKey_),a.a.documentElement.style.overflow="hidden",Te(a.a.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){u.a.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,ct(a.a,"keydown",this.boundFullWindowOnEscKey_),a.a.documentElement.style.overflow=this.docOrigOverflow,Ce(a.a.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&i.a.documentPictureInPicture){const e=a.a.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(_e("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),i.a.documentPictureInPicture.requestWindow({initialAspectRatio:this.videoWidth()/this.videoHeight(),copyStyleSheets:!0}).then(t=>(this.el_.parentNode.insertBefore(e,this.el_),t.document.body.append(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),t.addEventListener("unload",t=>{const n=t.target.querySelector(".video-js");e.replaceWith(n),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in a.a&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return i.a.documentPictureInPicture&&i.a.documentPictureInPicture.window?(i.a.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in a.a?a.a.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;(e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"===typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=(e=>u.a.isEventKey(e,"f")),muteKey:r=(e=>u.a.isEventKey(e,"m")),playPauseKey:i=(e=>u.a.isEventKey(e,"k")||u.a.isEventKey(e,"Space"))}=t;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Ut.getComponent("FullscreenToggle");!1!==a.a[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else if(r.call(this,e)){e.preventDefault(),e.stopPropagation(),Ut.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(i.call(this,e)){e.preventDefault(),e.stopPropagation(),Ut.getComponent("PlayToggle").prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n[e,kn.getTech(e)]).filter(([e,t])=>t?t.isSupported():(F.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(e,t,n){let r;return e.some(e=>t.some(t=>{if(r=n(e,t))return!0})),r};let r;const i=([e,t],n)=>{if(t.canPlaySource(n,this.options_[e.toLowerCase()]))return{source:n,tech:e}};var o;return(r=this.options_.sourceOrder?n(e,t,(o=i,(e,t)=>o(t,e))):n(t,e,i))||!1}handleSrc_(e,t){if("undefined"===typeof e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=Hn(e);if(n.length){if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),In(this,n[0],(e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e))return n.length>1?this.handleSrc_(n.slice(1)):(this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void this.triggerReady());!function(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}(r,this.tech_)}),n.length>1){const e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Lt(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}load(){this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{Zt(this.play().then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),St(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:i}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),i&&(i.update(),i.loadProgressBar&&i.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"===typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"===typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t="undefined"===typeof t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(P("beforeerror").forEach(t=>{const n=t(this,e);q(n)&&!Array.isArray(n)||"string"===typeof n||"number"===typeof n||null===n?e=n:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Xt(e),this.addClass("vjs-error"),F.error(`(CODE:${this.error_.code} ${Xt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),P("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,n;const r=gt(this,this.reportUserActivity),i=function(t){r(),this.clearInterval(e)};this.on("mousedown",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())}),this.on("mouseup",i),this.on("mouseleave",i);const o=this.getChild("controlBar");let a;!o||de||Z||(o.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),o.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),n=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!==typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){if("boolean"!==typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){return this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),St(this)&&this.trigger("languagechange"))}languages(){return z(_i.prototype.options_.languages,this.languages_)}toJSON(){const e=z(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;nthis.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:u,description:i||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Un(t.poster)}]),t}return z(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},n=ke(e),r=n["data-setup"];if(Se(e,"vjs-fill")&&(n.fill=!0),Se(e,"vjs-fluid")&&(n.fluid=!0),null!==r){const[e,t]=c()(r||"{}");e&&F.error(e),Object.assign(n,t)}if(Object.assign(t,n),e.hasChildNodes()){const n=e.childNodes;for(let e=0,r=n.length;e"number"===typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}xn.names.forEach(function(e){const t=xn[e];_i.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),_i.prototype.crossorigin=_i.prototype.crossOrigin,_i.players={};const wi=i.a.navigator;_i.prototype.options_={techOrder:kn.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:wi&&(wi.languages&&wi.languages[0]||wi.userLanguage||wi.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){_i.prototype[e]=function(){return this.techGet_(e)}}),mi.forEach(function(e){_i.prototype[`handleTech${jt(e)}_`]=function(){return this.trigger(e)}}),Ut.registerComponent("Player",_i);const Ei="plugin",Si="activePlugins_",Ti={},Ci=e=>Ti.hasOwnProperty(e),Oi=e=>Ci(e)?Ti[e]:void 0,xi=(e,t)=>{e[Si]=e[Si]||{},e[Si][t]=!0},ki=(e,t,n)=>{const r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},Di=function(e,t){const n=function(){ki(this,{name:e,plugin:t,instance:null},!0);const n=t.apply(this,arguments);return xi(this,e),ki(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n},Pi=(e,t)=>(t.prototype.name=e,function(...n){ki(this,{name:e,plugin:t,instance:null},!0);const r=new t(...[this,...n]);return this[e]=()=>r,ki(this,r.getEventHash()),r});class Ai{constructor(e){if(this.constructor===Ai)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),It(this),delete this.trigger,Mt(this,this.constructor.defaultState),xi(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ft(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Si][e]=!1,this.player=this.state=null,t[e]=Pi(e,Ti[e])}static isBasic(e){const t="string"===typeof e?Oi(e):e;return"function"===typeof t&&!Ai.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!==typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Ci(e))F.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(_i.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!==typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Ti[e]=t,e!==Ei&&(Ai.isBasic(t)?_i.prototype[e]=Di(e,t):_i.prototype[e]=Pi(e,t)),t}static deregisterPlugin(e){if(e===Ei)throw new Error("Cannot de-register base plugin.");Ci(e)&&(delete Ti[e],delete _i.prototype[e])}static getPlugins(e=Object.keys(Ti)){let t;return e.forEach(e=>{const n=Oi(e);n&&((t=t||{})[e]=n)}),t}static getPluginVersion(e){const t=Oi(e);return t&&t.VERSION||""}}function Ii(e,t,n,r){return function(e,t){let n=!1;return function(...r){return n||F.warn(e),n=!0,t.apply(this,r)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}Ai.getPlugin=Oi,Ai.BASE_PLUGIN_NAME=Ei,Ai.registerPlugin(Ei,Ai),_i.prototype.usingPlugin=function(e){return!!this[Si]&&!0===this[Si][e]},_i.prototype.hasPlugin=function(e){return!!Ci(e)};const Ni=e=>0===e.indexOf("#")?e.slice(1):e;function Mi(e,t,n){let r=Mi.getPlayer(e);if(r)return t&&F.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;const i="string"===typeof e?We("#"+Ni(e)):e;if(!ve(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");i.ownerDocument.defaultView&&i.ownerDocument.body.contains(i)||F.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(i.parentNode&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),P("beforesetup").forEach(e=>{const n=e(i,z(t));q(n)&&!Array.isArray(n)?t=z(t,n):F.error("please return an object in beforesetup hooks")});const o=Ut.getComponent("Player");return r=new o(i,t,n),P("setup").forEach(e=>e(r)),r}if(Mi.hooks_=D,Mi.hooks=P,Mi.hook=function(e,t){P(e,t)},Mi.hookOnce=function(e,t){P(e,[].concat(t).map(t=>{const n=(...r)=>(A(e,n),t(...r));return n}))},Mi.removeHook=A,!0!==i.a.VIDEOJS_NO_DYNAMIC_STYLE&&ge()){let e=We(".vjs-styles-defaults");if(!e){e=Ze("vjs-styles-defaults");const t=We("head");t&&t.insertBefore(e,t.firstChild),Je(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Xe(1,Mi),Mi.VERSION=k,Mi.options=_i.prototype.options_,Mi.getPlayers=()=>_i.players,Mi.getPlayer=e=>{const t=_i.players;let n;if("string"===typeof e){const r=Ni(e),i=t[r];if(i)return i;n=We("#"+r)}else n=e;if(ve(n)){const{player:e,playerId:r}=n;if(e||t[r])return e||t[r]}},Mi.getAllPlayers=()=>Object.keys(_i.players).map(e=>_i.players[e]).filter(Boolean),Mi.players=_i.players,Mi.getComponent=Ut.getComponent,Mi.registerComponent=(e,t)=>{kn.isTech(t)&&F.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Ut.registerComponent.call(Ut,e,t)},Mi.getTech=kn.getTech,Mi.registerTech=kn.registerTech,Mi.use=function(e,t){Dn[e]=Dn[e]||[],Dn[e].push(t)},Object.defineProperty(Mi,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Mi.middleware,"TERMINATOR",{value:An,writeable:!1,enumerable:!0}),Mi.browser=he,Mi.obj=G,Mi.mergeOptions=Ii(9,"videojs.mergeOptions","videojs.obj.merge",z),Mi.defineLazyProperty=Ii(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",$),Mi.bind=Ii(9,"videojs.bind","native Function.prototype.bind",gt),Mi.registerPlugin=Ai.registerPlugin,Mi.deregisterPlugin=Ai.deregisterPlugin,Mi.plugin=(e,t)=>(F.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ai.registerPlugin(e,t)),Mi.getPlugins=Ai.getPlugins,Mi.getPlugin=Ai.getPlugin,Mi.getPluginVersion=Ai.getPluginVersion,Mi.addLanguage=function(e,t){return e=(""+e).toLowerCase(),Mi.options.languages=z(Mi.options.languages,{[e]:t}),Mi.options.languages[e]},Mi.log=F,Mi.createLogger=U,Mi.time=Gt,Mi.createTimeRange=Ii(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Vt),Mi.createTimeRanges=Ii(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Vt),Mi.formatTime=Ii(9,"videojs.formatTime","videojs.time.formatTime",$t),Mi.setFormatTime=Ii(9,"videojs.setFormatTime","videojs.time.setFormatTime",Kt),Mi.resetFormatTime=Ii(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",zt),Mi.parseUrl=Ii(9,"videojs.parseUrl","videojs.url.parseUrl",hn),Mi.isCrossOrigin=Ii(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",vn),Mi.EventTarget=wt,Mi.any=pt,Mi.on=lt,Mi.one=dt,Mi.off=ct,Mi.trigger=ft,Mi.xhr=d.a,Mi.TextTrack=wn,Mi.AudioTrack=En,Mi.VideoTrack=Sn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{Mi[e]=function(){return F.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),ze[e].apply(null,arguments)}}),Mi.computedStyle=Ii(9,"videojs.computedStyle","videojs.dom.computedStyle",Ke),Mi.dom=ze,Mi.fn=bt,Mi.num=or,Mi.str=Ft,Mi.url=yn;class Ri{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class ji extends Mi.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const n=this.levels_.length;return t=new Ri(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;nn&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,n=this.length;tr,e.qualityLevels.VERSION="3.0.0",r}(this,Mi.mergeOptions({},e))};Li("qualityLevels",Fi),Fi.VERSION="3.0.0";const Ui=m.a,Bi=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Hi=e=>Mi.log.debug?Mi.log.debug.bind(Mi,"VHS:",`${e} >`):function(){};function Vi(...e){const t=Mi.obj||Mi;return(t.merge||t.mergeOptions).apply(t,e)}function Wi(...e){const t=Mi.time||Mi;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const qi=1/30,Ki=3*qi,zi=function(e,t){const n=[];let r;if(e&&e.length)for(r=0;r=t})},Gi=function(e,t){return zi(e,function(e){return e-qi>=t})},Yi=function(e){if(e.length<2)return Wi();const t=[];for(let n=1;n{const t=[];if(!e||!e.length)return"";for(let n=0;n "+e.end(n));return t.join(", ")},Zi=function(e,t,n=1){return((e.length?e.end(e.length-1):0)-t)/n},Ji=e=>{const t=[];for(let n=0;no||(n+=t>i&&t<=o?o-t:o-i)}return n},ro=(e,t)=>{if(!t.preload)return t.duration;let n=0;return(t.parts||[]).forEach(function(e){n+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(n+=e.partTargetDuration)}),n},io=e=>(e.segments||[]).reduce((e,t,n)=>(t.parts?t.parts.forEach(function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e),[]),oo=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},ao=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:n}=e;let r=(n||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0);return r+=t&&t.length?t.length:0},so=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const n=oo(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},uo=function(e,t,n){if("undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),tr&&([n,r]=[r,n]),n<0){for(let t=n;tDate.now()},ho=function(e){return e.excludeUntil&&e.excludeUntil===1/0},mo=function(e){const t=po(e);return!e.disabled&&!t},go=function(e,t){return t.attributes&&t.attributes[e]},vo=(e,t)=>{if(1===e.playlists.length)return!0;const n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!mo(e)&&(e.attributes.BANDWIDTH||0)!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri)))),bo=function(e,t){const n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let r=!1;for(const i in n){for(const e in n[i])if(r=t(n[i][e]))break;if(r)break}return!!r},_o=e=>{if(!e||!e.playlists||!e.playlists.length){return bo(e,e=>e.playlists&&e.playlists.length||e.uri)}for(let t=0;tObject(b.f)(e)))&&!bo(e,e=>yo(n,e)))return!1}return!0};var wo={liveEdgeDelay:so,duration:lo,seekable:function(e,t,n){const r=t||0,i=fo(e,t,!0,n);return null===i?Wi():Wi(r,i)},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:n,startingPartIndex:r,startTime:i,exactManifestTimings:o}){let a=t-i;const s=io(e);let u=0;for(let l=0;l0)for(let t=u-1;t>=0;t--){const n=s[t];if(a+=n.duration,o){if(a<0)continue}else if(a+qi<=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i-co({defaultDuration:e.targetDuration,durationList:s,startIndex:u,endIndex:t})}}return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:t}}if(u<0){for(let n=u;n<0;n++)if((a-=e.targetDuration)<0)return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:t};u=0}for(let l=u;l0)continue}else if(a-qi>=0)continue;return{partIndex:t.partIndex,segmentIndex:t.segmentIndex,startTime:i+co({defaultDuration:e.targetDuration,durationList:s,startIndex:u,endIndex:l})}}return{segmentIndex:s[s.length-1].segmentIndex,partIndex:s[s.length-1].partIndex,startTime:t}},isEnabled:mo,isDisabled:function(e){return e.disabled},isExcluded:po,isIncompatible:ho,playlistEnd:fo,isAes:function(e){for(let t=0;t`${e}-${t}`,To=({onwarn:e,oninfo:t,manifestString:n,customTagParsers:r=[],customTagMappers:i=[],llhls:o})=>{const a=new y.a;e&&a.on("warn",e),t&&a.on("info",t),r.forEach(e=>a.addParser(e)),i.forEach(e=>a.addTagMapper(e)),a.push(n),a.end();const s=a.manifest;if(o||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){s.hasOwnProperty(e)&&delete s[e]}),s.segments&&s.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!s.targetDuration){let t=10;s.segments&&s.segments.length&&(t=s.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e(`manifest has no targetDuration defaulting to ${t}`),s.targetDuration=t}const u=oo(s);if(u.length&&!s.partTargetDuration){const t=u.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e(`manifest has no partTargetDuration defaulting to ${t}`),Eo.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),s.partTargetDuration=t}return s},Co=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(n=>{if(e.mediaGroups[n])for(const r in e.mediaGroups[n])for(const i in e.mediaGroups[n][r]){const o=e.mediaGroups[n][r][i];t(o,n,r,i)}})},Oo=({playlist:e,uri:t,id:n})=>{e.id=n,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},xo=(e,t)=>{const n=So(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:i.a.location.href,resolvedUri:i.a.location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r},ko=(e,t,n=((e,t,n)=>`placeholder-uri-${e}-${t}-${n}`))=>{e.uri=t;for(let i=0;i{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===i&&!t.uri)for(let t=0;t{let t=e.playlists.length;for(;t--;){const n=e.playlists[t];Oo({playlist:n,id:So(t,n.uri)}),n.resolvedUri=Ui(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||Eo.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{Co(e,t=>{t.uri&&(t.resolvedUri=Ui(e.uri,t.uri))})})(e)},{EventTarget:Do}=Mi,Po=(e,t)=>{if(t.endList||!t.serverControl)return e;const n={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let r=t.mediaSequence+t.segments.length;if(e){const i=e.parts||[],o=ao(t)-1;o>-1&&o!==i.length-1&&(n._HLS_part=o),(o>-1||i.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){const t=new i.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){n.hasOwnProperty(e)&&t.searchParams.set(e,n[e])}),e=t.toString()}return e},Ao=(e,t)=>{if(!e)return t;const n=Vi(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(let r=0;r{!e.resolvedUri&&e.uri&&(e.resolvedUri=Ui(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Ui(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Ui(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Ui(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=Ui(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=Ui(t,e.uri))})},No=function(e){const t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(let e=0;ee===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,Ro=(e,t,n=Mo)=>{const r=Vi(e,{}),i=r.playlists[t.id];if(!i)return null;if(n(i,t))return null;t.segments=No(t);const o=Vi(i,t);if(o.preloadSegment&&!t.preloadSegment&&delete o.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e{const r=e.slice(),i=t.slice();n=n||0;const o=[];let a;for(let s=0;s{Io(e,o.resolvedUri)});for(let a=0;a{if(e.playlists)for(let a=0;a{const n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],o=i&&i.duration||r&&r.duration;return t&&o?1e3*o:500*(e.partTargetDuration||e.targetDuration||10)};class Lo extends Do{constructor(e,t,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Hi("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r;const i=t.options_;this.customTagParsers=i&&i.customTagParsers||[],this.customTagMappers=i&&i.customTagMappers||[],this.llhls=i&&i.llhls,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=Ui(this.main.uri,e.uri);this.llhls&&(t=Po(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,n){const{uri:r,id:i}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[i],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return To({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const i=t||this.parseManifest_({url:n,manifestString:e});i.lastRequest=Date.now(),Oo({playlist:i,uri:n,id:r});const o=Ro(this.main,i);this.targetDuration=i.partTargetDuration||i.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(jo(this.media(),!!o)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),i.a.clearTimeout(this.mediaUpdateTimeout),i.a.clearTimeout(this.finalRenditionTimeout),this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"===typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(i.a.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=i.a.setTimeout(this.media.bind(this,e,!1),t))}const n=this.state,r=!this.media_||e.id!==this.media_.id,o=this.main.playlists[e.id];if(o&&o.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(jo(e,!0)),r){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Bi(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,n);this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(i.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(i.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=i.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(i.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=i.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"===typeof this.src)return this.src.uri||(this.src.uri=i.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=Bi(this.src,t);const n=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(n)})}srcUri(){return"string"===typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,ko(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=No(e),e.segments.forEach(t=>{Io(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||i.a.location.href;this.main=xo(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}}const{xhr:Fo}=Mi,Uo=function(e,t,n,r){const i="arraybuffer"===e.responseType?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(i||e.responseText)))),r(t,e)},Bo=function(){const e=function e(t,n){t=Vi({timeout:45e3},t);const r=e.beforeRequest||Mi.Vhs.xhr.beforeRequest;if(r&&"function"===typeof r){const e=r(t);e&&(t=e)}const i=(!0===Mi.Vhs.xhr.original?Fo:Mi.Vhs.xhr)(t,function(e,t){return Uo(i,e,t,n)}),o=i.abort;return i.abort=function(){return i.aborted=!0,o.apply(i,arguments)},i.uri=t.uri,i.requestTime=Date.now(),i};return e.original=!0,e},Ho=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;return"bytes="+e.offset+"-"+(t="bigint"===typeof e.offset||"bigint"===typeof e.length?i.a.BigInt(e.offset)+i.a.BigInt(e.length)-i.a.BigInt(1):e.offset+e.length-1)}(e.byterange)),t},Vo=function(e,t){return e.start(t)+"-"+e.end(t)},Wo=function(e,t){const n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},qo=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Ko=function(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];Object(w.e)(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r}),t},zo=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},$o=function(e){return e.resolvedUri},Go=e=>{const t=Array.prototype.slice.call(e);let n,r,i="";for(let o=0;oGo(e),textRanges:e=>{let t,n="";for(t=0;t{if(!n)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return n({message:"getProgramTime: playlist and time must be provided"});const r=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let n,r=0;for(let o=0;or){if(e>r+.25*i.duration)return null;n=i}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:r-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!r)return n({message:"valid programTime was not found"});if("estimate"===r.type)return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const i={mediaSeconds:t},o=((e,t)=>{if(!t.dateTimeObject)return null;const n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)})(t,r.segment);return o&&(i.programDateTime=o.toISOString()),n(null,i)},Qo=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:i=!0,tech:o,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if("undefined"===typeof e||!t||!r)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!o.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t{let n;try{n=new Date(e)}catch(s){return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(ne.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds)(i.videoTimingInfo):i.duration+.25*i.duration;return n>new Date(o.getTime()+1e3*a)?null:(n>o&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:wo.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!s)return a({message:`${e} was not found in the stream`});const u=s.segment,l=((e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch(o){}const i=n.getTime();return(r.getTime()-i)/1e3})(u.dateTimeObject,e);if("estimate"===s.type)return 0===n?a({message:`${e} is not buffered yet. Try again`}):(r(s.estimatedStart+l),void o.one("seeked",()=>{Qo({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:i,tech:o,callback:a})}));const c=u.start+l;o.one("seeked",()=>a(null,o.currentTime())),i&&o.pause(),r(c)},Zo=(e,t)=>{if(4===e.readyState)return t()},Jo=(e,t,n)=>{let r,i=[],o=!1;const a=function(e,t,r,i){return t.abort(),o=!0,n(e,t,r,i)},s=function(e,t){if(o)return;if(e)return a(e,t,"",i);const n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=Object(w.d)(i,Object(w.h)(n,!0)),r=r||Object(C.a)(i),i.length<10||r&&i.lengtha(e,t,"",i));const s=Object(O.a)(i);return"ts"===s&&i.length<188?Zo(t,()=>a(e,t,"",i)):!s&&i.length<376?Zo(t,()=>a(e,t,"",i)):a(null,t,s,i)},u=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:n}){return Uo(e,null,{statusCode:e.status},s)})}},function(e,t){return Uo(u,e,t,s)});return u},{EventTarget:ea}=Mi,ta=function(e,t){if(!Mo(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let n=0;n{return`placeholder-uri-${e}-${t}-${r.attributes.NAME||n}`},ra=({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:i})=>{const o=Object(E.c)(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:i});return ko(o,t,na),o},ia=(e,t,n)=>{let r=!0,i=Vi(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let o=0;o{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,s=Ro(i,e.playlists[0],ta);s&&(o in(i=s).mediaGroups[t][n]||(i.mediaGroups[t][n][o]=e),i.mediaGroups[t][n][o].playlists[0]=i.playlists[a],r=!1)}}),((e,t)=>{Co(e,(n,r,i,o)=>{o in t.mediaGroups[r][i]||delete e.mediaGroups[r][i][o]})})(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i},oa=(e,t)=>{return(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},aa=(e,t)=>{const n={};for(const r in e){const i=e[r].sidx;if(i){const e=Object(E.b)(i);if(!t[e])break;const r=t[e].sidxInfo;oa(r,i)&&(n[e]=t[e])}}return n},sa=(e,t)=>{let n=aa(e.playlists,t);return Co(e,(e,r,i,o)=>{if(e.playlists&&e.playlists.length){const r=e.playlists;n=Vi(n,aa(r,t))}}),n};class ua extends ea{constructor(e,t,n={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:i=!1}=n;if(this.vhs_=t,this.withCredentials=i,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Hi("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!==typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,n){const r=e.sidx&&Object(E.b)(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=i.a.setTimeout(()=>n(!1),0));const o=Bi(e.sidx.resolvedUri),a=(i,o)=>{if(this.requestErrored_(i,o,t))return;const a=this.mainPlaylistLoader_.sidxMapping_;let s;try{s=T()(Object(w.k)(o.response).subarray(8))}catch(u){return void this.requestErrored_(u,o,t)}return a[r]={sidxInfo:e.sidx,sidx:s},Object(E.a)(e,s,e.sidx.resolvedUri),n(!0)};this.request=Jo(o,this.vhs_.xhr,(t,n,r,i)=>{if(t)return a(t,n);if(!r||"mp4"!==r)return a({status:n.status,message:`Unsupported ${r||"unknown"} container type for sidx segment at URL: ${o}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n);const{offset:s,length:u}=e.sidx.byterange;if(i.length>=u+s)return a(t,{response:i.subarray(s,s+u),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:o,responseType:"arraybuffer",headers:Ho({byterange:e.sidx.byterange})},a)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},i.a.clearTimeout(this.minimumUpdatePeriodTimeout_),i.a.clearTimeout(this.mediaRequest_),i.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"===typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,n=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),i.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(i.a.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){i.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=i.a.setTimeout(()=>this.load(),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=i.a.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(t,n)=>{if(this.requestErrored_(t,n))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const r=n.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Bi(this.mainPlaylistLoader_.srcUrl,n),r?(this.handleMain_(),void this.syncClientServerClock_(()=>e(n,r))):e(n,r)})}syncClientServerClock_(e){const t=Object(E.d)(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Ui(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},(n,r)=>{if(!this.request)return;if(n)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let i;i="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=i-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=ra({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=ia(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(i.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!==typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=i.a.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=sa(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=i.a.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},jo(this.media(),Boolean(n))))};e()}this.trigger("loadedplaylist")}}var la={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const ca=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},fa=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const n=new BlobBuilder;return n.append(e),URL.createObjectURL(n.getBlob())}}(e),n=ca(new Worker(t));n.objURL=t;const r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},da=function(e){return`var browserWorkerPolyFill = ${ca.toString()};\n`+"browserWorkerPolyFill(self);\n"+e},pa=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)};var ha=fa(da(pa(function(){var t="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},n=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,o;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return r(C.ftyp,O,x,O,k)},y=function(e){return r(C.hdlr,A[e])},s=function(e){return r(C.mdat,e)},v=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),r(C.mdhd,t)},g=function(e){return r(C.mdia,v(e),y(e.type),l(e))},u=function(e){return r(C.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},l=function(e){return r(C.minf,"video"===e.type?r(C.vmhd,I):r(C.smhd,N),i(),_(e))},c=function(e,t){for(var n=[],i=t.length;i--;)n[i]=E(t[i]);return r.apply(null,[C.moof,u(e)].concat(n))},f=function(e){for(var t=e.length,n=[];t--;)n[t]=h(e[t]);return r.apply(null,[C.moov,p(4294967295)].concat(n).concat(d(e)))},d=function(e){for(var t=e.length,n=[];t--;)n[t]=S(e[t]);return r.apply(null,[C.mvex].concat(n))},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 r(C.mvhd,t)},b=function(e){var t,n,i=e.samples||[],o=new Uint8Array(4+i.length);for(n=0;n>>8),a.push(255&i[t].byteLength),a=a.concat(Array.prototype.slice.call(i[t]));for(t=0;t>>8),s.push(255&o[t].byteLength),s=s.concat(Array.prototype.slice.call(o[t]));if(n=[C.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(C.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length],a,[o.length],s))),r(C.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(r(C.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return r.apply(null,n)},t=function(e){return r(C.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),o(e))}}(),m=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(C.tkhd,t)},E=function(e){var t,n,i,o,a,s;return t=r(C.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/V),s=Math.floor(e.baseMediaDecodeTime%V),n=r(C.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s])),92,"audio"===e.type?(i=T(e,92),r(C.traf,t,n,i)):(o=b(e),i=T(e,o.length+92),r(C.traf,t,n,i,o))},h=function(e){return e.duration=e.duration||4294967295,r(C.trak,m(e),g(e))},S=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),r(C.trex,t)},function(){var e,t,n;n=function(e,t){var n=0,r=0,i=0,o=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(o=8)),[0,0,n|r|i|o,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var i,o,a,s,u,l;for(t+=20+16*(s=e.samples||[]).length,a=n(s,t),(o=new Uint8Array(a.length+16*s.length)).set(a),i=a.length,l=0;l>>24,o[i++]=(16711680&u.duration)>>>16,o[i++]=(65280&u.duration)>>>8,o[i++]=255&u.duration,o[i++]=(4278190080&u.size)>>>24,o[i++]=(16711680&u.size)>>>16,o[i++]=(65280&u.size)>>>8,o[i++]=255&u.size,o[i++]=u.flags.isLeading<<2|u.flags.dependsOn,o[i++]=u.flags.isDependedOn<<6|u.flags.hasRedundancy<<4|u.flags.paddingValue<<1|u.flags.isNonSyncSample,o[i++]=61440&u.flags.degradationPriority,o[i++]=15&u.flags.degradationPriority,o[i++]=(4278190080&u.compositionTimeOffset)>>>24,o[i++]=(16711680&u.compositionTimeOffset)>>>16,o[i++]=(65280&u.compositionTimeOffset)>>>8,o[i++]=255&u.compositionTimeOffset;return r(C.trun,o)},e=function(e,t){var i,o,a,s,u,l;for(t+=20+8*(s=e.samples||[]).length,a=n(s,t),(i=new Uint8Array(a.length+8*s.length)).set(a),o=a.length,l=0;l>>24,i[o++]=(16711680&u.duration)>>>16,i[o++]=(65280&u.duration)>>>8,i[o++]=255&u.duration,i[o++]=(4278190080&u.size)>>>24,i[o++]=(16711680&u.size)>>>16,i[o++]=(65280&u.size)>>>8,i[o++]=255&u.size;return r(C.trun,i)},T=function(n,r){return"audio"===n.type?e(n,r):t(n,r)}}();var W,q,K,z,$,G,Y,X,Q={ftyp:a,mdat:s,moof:c,moov:f,initSegment:function(e){var t,n=a(),r=f(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}},Z=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},J={groupNalsIntoFrames:function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var n,r,i,o,a,s=t||0,u=[];for(n=0;noe.ONE_SECOND_IN_TS/2))){for((a=ie()[e.samplerate])||(a=t[0].data),s=0;s=n?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,n,r=[];for(t=0;t=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},me.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},me.prototype.addText=function(e){this.rows[this.rowIdx]+=e},me.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var ge=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new me(-1),this.windows=[],this.stream=n,"string"===typeof t&&this.createTextDecoder(t)};ge.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new me(n),"function"===typeof t&&(this.windows[n].beforeRowOverflow=t)},ge.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},ge.prototype.createTextDecoder=function(e){if("undefined"===typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var ve=function(e){e=e||{},ve.prototype.init.call(this);var t,n=this,r=e.captionServices||{},i={};Object.keys(r).forEach(e=>{t=r[e],/^SERVICE/.test(e)&&(i[e]=t.encoding)}),this.serviceEncodings=i,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};ve.prototype=new ce,ve.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ve.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},ve.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,o=t[i++];for(e.seq=o>>6,e.sizeCode=63&o;i>5)&&r>0&&(n=o=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},ve.prototype.pushServiceBlock=function(e,t,n){var r,i=t,o=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,i));i>5,o.rowLock=(16&r)>>4,o.columnLock=(8&r)>>3,o.priority=7&r,r=n[++e],o.relativePositioning=(128&r)>>7,o.anchorVertical=127&r,r=n[++e],o.anchorHorizontal=r,r=n[++e],o.anchorPoint=(240&r)>>4,o.rowCount=15&r,r=n[++e],o.columnCount=63&r,r=n[++e],o.windowStyle=(56&r)>>3,o.penStyle=7&r,o.virtualRowCount=o.rowCount+1,e},ve.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(192&r)>>6,i.fillRed=(48&r)>>4,i.fillGreen=(12&r)>>2,i.fillBlue=3&r,r=n[++e],i.borderType=(192&r)>>6,i.borderRed=(48&r)>>4,i.borderGreen=(12&r)>>2,i.borderBlue=3&r,r=n[++e],i.borderType+=(128&r)>>5,i.wordWrap=(64&r)>>6,i.printDirection=(48&r)>>4,i.scrollDirection=(12&r)>>2,i.justify=3&r,r=n[++e],i.effectSpeed=(240&r)>>4,i.effectDirection=(12&r)>>2,i.displayEffect=3&r,e},ve.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},ve.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},ve.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<>4,i.offset=(12&r)>>2,i.penSize=3&r,r=n[++e],i.italics=(128&r)>>7,i.underline=(64&r)>>6,i.edgeType=(56&r)>>3,i.fontStyle=7&r,e},ve.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penColor;return r=n[++e],i.fgOpacity=(192&r)>>6,i.fgRed=(48&r)>>4,i.fgGreen=(12&r)>>2,i.fgBlue=3&r,r=n[++e],i.bgOpacity=(192&r)>>6,i.bgRed=(48&r)>>4,i.bgGreen=(12&r)>>2,i.bgBlue=3&r,r=n[++e],i.edgeRed=(48&r)>>4,i.edgeGreen=(12&r)>>2,i.edgeBlue=3&r,e},ve.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=n[++e],i.row=15&r,r=n[++e],i.column=63&r,e},ve.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var ye={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},be=function(e){return null===e?"":(e=ye[e]||e,String.fromCharCode(e))},_e=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],we=function(){for(var e=[],t=15;t--;)e.push("");return e},Ee=function(e,t){Ee.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,o;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=we();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=we();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=we()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))o=be((r=(3&r)<<8)|i),this[this.mode_](e.pts,o),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),o=be((r=(3&r)<<8)|i),this[this.mode_](e.pts,o),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&i)&&this.addFormatting(e.pts,["i"]),1===(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i))this.column_+=3&i;else if(this.isPAC(r,i)){var a=_e.indexOf(7968&t);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(i)&&14===(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),o=be(r),o+=be(i),this[this.mode_](e.pts,o),this.column_+=o.length)}else this.lastControlCode_=null}};Ee.prototype=new ce,Ee.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(n){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ee.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=we(),this.nonDisplayed_=we(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ee.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ee.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ee.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ee.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ee.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ee.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},Ee.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ee.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ee.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=we(),this.displayed_=we()),void 0!==t&&t!==this.row_)for(var n=0;n"},"");this[this.mode_](e,n)},Ee.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[],this[this.mode_](e,t)}},Ee.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},Ee.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},Ee.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},xe=function(e){var t,n;xe.prototype.init.call(this),this.type_=e||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Oe(e.dts,n),e.pts=Oe(e.pts,n),t=e.dts,this.trigger("data",e))},this.flush=function(){n=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};xe.prototype=new Ce;var ke,De={TimestampRolloverStream:xe,handleRollover:Oe},Pe=(e,t,n)=>{if(!e)return-1;for(var r=n;r>>2;c*=4,c+=3&l[7],s.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=s.timeStamp,t.dts=s.timeStamp),this.trigger("timestamp",s)}t.frames.push(s),n+=10,n+=a}while(n>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=ze.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=ze.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new qe,He.STREAM_TYPES={h264:27,adts:15},(Ve=function(){var e,t=this,n=!1,r={data:[],size:0},i={data:[],size:0},o={data:[],size:0},a=function(e,n,r){var i,o,a=new Uint8Array(e.size),s={type:n},u=0,l=0;if(e.data.length&&!(e.size<9)){for(s.trackId=e.data[0].pid,u=0;u>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,s),i="video"===n||s.packetLength<=e.size,(r||i)&&(e.size=0,e.data.length=0),i&&t.trigger("data",s)}};Ve.prototype.init.call(this),this.push=function(s){({pat:function(){},pes:function(){var e,t;switch(s.streamType){case ze.H264_STREAM_TYPE:e=r,t="video";break;case ze.ADTS_STREAM_TYPE:e=i,t="audio";break;case ze.METADATA_STREAM_TYPE:e=o,t="timed-metadata";break;default:return}s.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(s),e.size+=s.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=s.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[s.type]()},this.reset=function(){r.size=0,r.data.length=0,i.size=0,i.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(r,"video"),a(i,"audio"),a(o,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new qe;var Ge={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Be,TransportParseStream:He,ElementaryStream:Ve,TimestampRolloverStream:$e,CaptionStream:Ke.CaptionStream,Cea608Stream:Ke.Cea608Stream,Cea708Stream:Ke.Cea708Stream,MetadataStream:We};for(var Ye in ze)ze.hasOwnProperty(Ye)&&(Ge[Ye]=ze[Ye]);var Xe,Qe=Ge,Ze=U,Je=re.ONE_SECOND_IN_TS,et=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(Xe=function(e){var t,n=0;Xe.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${n} outside syncword`})},this.push=function(r){var i,o,a,s,u,l=0;if(e||(n=0),"audio"===r.type){var c;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+r.data.byteLength)).set(a),t.set(r.data,a.byteLength)):t=r.data;l+7>5,u=(s=1024*(1+(3&t[l+6])))*Je/et[(60&t[l+2])>>>2],t.byteLength-l>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:et[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+o,l+i)}),n++,l+=i}else"number"!==typeof c&&(c=l),l++;"number"===typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new Ze;var tt,nt,rt,it=Xe,ot=U,at=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,o=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");o.set(e.subarray(i,i+a)),n=new DataView(o.buffer).getUint32(0),r=8*a,t-=a},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),o=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?o<>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(nt=function(){var e,t,n=0;nt.prototype.init.call(this),this.push=function(r){var i;t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;for(var o=t.byteLength;n3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ot,rt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(tt=function(){var e,t,n,r,i,o,a,s=new nt;tt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,s.push(e))},s.on("data",function(a){var s={trackId:t,pts:n,dts:r,data:a,nalUnitTypeCode:31&a[0]};switch(s.nalUnitTypeCode){case 5:s.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:s.nalUnitType="sei_rbsp",s.escapedRBSP=i(a.subarray(1));break;case 7:s.nalUnitType="seq_parameter_set_rbsp",s.escapedRBSP=i(a.subarray(1)),s.config=o(s.escapedRBSP);break;case 8:s.nalUnitType="pic_parameter_set_rbsp";break;case 9:s.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",s)}),s.on("done",function(){e.trigger("done")}),s.on("partialdone",function(){e.trigger("partialdone")}),s.on("reset",function(){e.trigger("reset")}),s.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){s.flush()},this.partialFlush=function(){s.partialFlush()},this.reset=function(){s.reset()},this.endTimeline=function(){s.endTimeline()},a=function(e,t){var n,r=8,i=8;for(n=0;n=0?n:0,(16&e[t+5])>>4?n+20:n+10},ft=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=ct(e,t),ft(e,t))},dt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},pt={isLikelyAacData:function(e){var t=ft(e,0);return e.length>=t+2&&255===(255&e[t])&&240===(240&e[t+1])&&16===(22&e[t+1])},parseId3TagSize:ct,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2];t++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=dt(e.subarray(10,14)));do{if((n=dt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i>>2;return a*=4,a+=3&o[7]}break}}t+=10,t+=n}while(t=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!==(255&e[u])||240!==(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(s=ht.parseAdtsSize(e,u))>e.length)break;o={type:"audio",data:e.subarray(u,u+s),pts:t,dts:t},this.trigger("data",o),u+=s}else{if(e.length-u<10)break;if(u+(s=ht.parseId3TagSize(e,u))>e.length)break;i={type:"timed-metadata",data:e.subarray(u,u+s)},this.trigger("data",i),u+=s}r=e.length-u,e=r>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new U;var mt,gt,vt,yt,bt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],_t=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],wt=U,Et=Q,St=J,Tt=ae,Ct=ue,Ot=Qe,xt=re,kt=it,Dt=ut.H264Stream,Pt=st,At=pt.isLikelyAacData,It=re.ONE_SECOND_IN_TS,Nt=bt,Mt=_t,Rt=function(e,t){t.stream=e,this.trigger("log",t)},jt=function(e,t){for(var n=Object.keys(t),r=0;r=-1e4&&n<=45e3&&(!r||s>n)&&(r=o,s=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,o,s,u,l;for(o=e.byteLength,s=e.nalCount,u=e.duration,t=n=0;tr.pts?t++:(n++,o-=i.byteLength,s-=i.nalCount,u-=i.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=o,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,r,i,o,s,u;for(t=a.length-1,n=e.length-1,o=null,s=!1;t>=0&&n>=0;){if(r=a[t],i=e[n],r.pts===i.pts){s=!0;break}r.pts>i.pts?t--:(t===a.length-1&&(o=n),n--)}if(!s&&null===o)return null;if(0===(u=s?n:o))return e;var l=e.slice(u),c=l.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){a=e}}).prototype=new wt,(yt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,"undefined"!==typeof(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"===typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,yt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new wt,yt.prototype.flush=function(e){var t,n,r,i,o=0,a={captions:[],captionStreams:{},metadata:[],info:{}},s=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(s=this.videoTrack.timelineStartInfo.pts,Mt.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(s=this.audioTrack.timelineStartInfo.pts,Nt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,r=Et.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(r.byteLength),a.initSegment.set(r),a.data=new Uint8Array(this.pendingBytes),i=0;i=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},yt.prototype.setRemux=function(e){this.remuxTracks=e},(vt=function(e){var t,n,r=this,i=!0;vt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new Ot.MetadataStream,i.aacStream=new Pt,i.audioTimestampRolloverStream=new Ot.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Ot.TimestampRolloverStream("timed-metadata"),i.adtsStream=new kt,i.coalesceStream=new yt(e,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",function(e){i.aacStream.setTimestamp(e.timeStamp)}),i.aacStream.on("data",function(o){"timed-metadata"!==o.type&&"audio"!==o.type||i.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new gt(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))}),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),jt(this,i)},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new Ot.MetadataStream,i.packetStream=new Ot.TransportPacketStream,i.parseStream=new Ot.TransportParseStream,i.elementaryStream=new Ot.ElementaryStream,i.timestampRolloverStream=new Ot.TimestampRolloverStream,i.adtsStream=new kt,i.h264Stream=new Dt,i.captionStream=new Ot.CaptionStream(e),i.coalesceStream=new yt(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",function(o){var a;if("metadata"===o.type){for(a=o.tracks.length;a--;)t||"video"!==o.tracks[a].type?n||"audio"!==o.tracks[a].type||((n=o.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=o.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new mt(t,e),i.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),i.videoSegmentStream.on("timelineStartInfo",function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))}),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),i.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new gt(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}}),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",function(e){e.dispatchType=i.metadataStream.dispatchType,r.trigger("id3Frame",e)}),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),jt(this,i)},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,Ct.clearDtsInfo(n),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Ct.clearDtsInfo(t),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(e){if(i){var t=At(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new wt;var Ut,Bt,Ht,Vt,Wt,qt,Kt,zt,$t={Transmuxer:vt,VideoSegmentStream:mt,AudioSegmentStream:gt,AUDIO_PROPERTIES:Nt,VIDEO_PROPERTIES:Mt,generateSegmentTimingInfo:Ft},Gt=function(e){return e>>>0},Yt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Xt=Gt,Qt=Yt,Zt=function(e,t){var n,r,i,o,a,s=[];if(!t.length)return null;for(n=0;n1?n+r:e.byteLength,i===t[0]&&(1===t.length?s.push(e.subarray(n+8,o)):(a=Zt(e.subarray(n+8,o),t.slice(1))).length&&(s=s.concat(a))),n=o;return s},Jt=Gt,en=H.getUint64,tn=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=en(e.subarray(4)):t.baseMediaDecodeTime=Jt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},nn=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},rn=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],o=4&n.flags[2],a=1&n.flags[1],s=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=r.getUint32(4),f=8;for(i&&(n.dataOffset=r.getInt32(f),f+=4),o&&c&&(t={flags:nn(e.subarray(f,f+4))},f+=4,a&&(t.duration=r.getUint32(f),f+=4),s&&(t.size=r.getUint32(f),f+=4),l&&(1===n.version?t.compositionTimeOffset=r.getInt32(f):t.compositionTimeOffset=r.getUint32(f),f+=4),n.samples.push(t),c--);c--;)t={},a&&(t.duration=r.getUint32(f),f+=4),s&&(t.size=r.getUint32(f),f+=4),u&&(t.flags=nn(e.subarray(f,f+4)),f+=4),l&&(1===n.version?t.compositionTimeOffset=r.getInt32(f):t.compositionTimeOffset=r.getUint32(f),f+=4),n.samples.push(t);return n},on=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],o=2&r.flags[2],a=8&r.flags[2],s=16&r.flags[2],u=32&r.flags[2],l=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),o&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),a&&(r.defaultSampleDuration=n.getUint32(t),t+=4),s&&(r.defaultSampleSize=n.getUint32(t),t+=4),u&&(r.defaultSampleFlags=n.getUint32(t)),l&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r},an=(Ut="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},le.discardEmulationPreventionBytes),sn=Se.CaptionStream,un=Zt,ln=tn,cn=rn,fn=on,dn=Ut,pn=function(e,t){for(var n=e,r=0;r0?ln(l[0]).baseMediaDecodeTime:0,f=un(o,["trun"]);t===u&&f.length>0&&(n=function(e,t,n){var r,i,o,a,s=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(i=0;i+40;){var u=t.shift();this.parse(u,o,a)}return(s=function(e,t,n){if(null===t)return null;var r=hn(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r))&&s.logs&&(i.logs=i.logs.concat(s.logs)),null!==s&&s.seiNals?(this.pushNals(s.seiNals),this.flushStream(),i):i.logs.length?{logs:i.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;o?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={},i.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},gn=function(e){for(var t=0,n=String.fromCharCode(e[t]),r="";"\0"!==n;)r+=n,t++,n=String.fromCharCode(e[t]);return r+=n},vn=H.getUint64,yn=function(e,t){var n="\0"!==t.scheme_id_uri,r=0===e&&bn(t.presentation_time_delta)&&n,i=1===e&&bn(t.presentation_time)&&n;return!(e>1)&&r||i},bn=function(e){return void 0!==e||null!==e},_n=Gt,wn=function(e){return("00"+e.toString(16)).slice(-2)},En=Zt,Sn=Yt,Tn={parseEmsgBox:function(e){var t,n,r,i,o,a,s,u=4,l=e[0];if(0===l)u+=(t=gn(e.subarray(u))).length,u+=(n=gn(e.subarray(u))).length,r=(c=new DataView(e.buffer)).getUint32(u),u+=4,o=c.getUint32(u),u+=4,a=c.getUint32(u),u+=4,s=c.getUint32(u),u+=4;else if(1===l){var c;r=(c=new DataView(e.buffer)).getUint32(u),u+=4,i=vn(e.subarray(u)),u+=8,a=c.getUint32(u),u+=4,s=c.getUint32(u),u+=4,u+=(t=gn(e.subarray(u))).length,u+=(n=gn(e.subarray(u))).length}var f={scheme_id_uri:t,value:n,timescale:r||1,presentation_time:i,presentation_time_delta:o,event_duration:a,id:s,message_data:new Uint8Array(e.subarray(u,e.byteLength))};return yn(l,f)?f:void 0},scaleTime:function(e,t,n,r){return e||0===e?e/t:r+n/t}},Cn=on,On=rn,xn=tn,kn=H.getUint64,Dn=Ut,Pn=Le.parseId3Frames;Bt=function(e){return En(e,["moov","trak"]).reduce(function(e,t){var n,r,i,o,a;return(n=En(t,["tkhd"])[0])?(r=n[0],o=_n(n[i=0===r?12:20]<<24|n[i+1]<<16|n[i+2]<<8|n[i+3]),(a=En(t,["mdia","mdhd"])[0])?(i=0===(r=a[0])?12:20,e[o]=_n(a[i]<<24|a[i+1]<<16|a[i+2]<<8|a[i+3]),e):null):null},{})},Ht=function(e,t){var n=En(t,["moof","traf"]).reduce(function(t,n){var r,i=En(n,["tfhd"])[0],o=_n(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),a=e[o]||9e4,s=En(n,["tfdt"])[0],u=new DataView(s.buffer,s.byteOffset,s.byteLength);let l;return"bigint"===typeof(r=1===s[0]?kn(s.subarray(4,12)):u.getUint32(4))?l=r/Dn.BigInt(a):"number"!==typeof r||isNaN(r)||(l=r/a),l11?(i.codec+=".",i.codec+=wn(c[9]),i.codec+=wn(c[10]),i.codec+=wn(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=f.subarray(28),"esds"===Sn(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+wn(c[19]),i.codec+="."+wn(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var d=En(e,["mdia","mdhd"])[0];d&&(i.timescale=Kt(d)),n.push(i)}),n},zt=function(e,t=0){return En(e,["emsg"]).map(e=>{var n=Tn.parseEmsgBox(new Uint8Array(e)),r=Pn(n.message_data);return{cueTime:Tn.scaleTime(n.presentation_time,n.timescale,n.presentation_time_delta,t),duration:Tn.scaleTime(n.event_duration,n.timescale),frames:r}})};var An={findBox:En,parseType:Sn,timescale:Bt,startTime:Ht,compositionStartTime:Vt,videoTrackIds:Wt,tracks:qt,getTimescaleFromMediaHeader:Kt=function(e){var t=0===e[0]?12:20;return _n(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},getEmsgID3:zt},In=Te,Nn=function(e){var t=31&e[1];return t<<=8,t|=e[2]},Mn=function(e){return!!(64&e[1])},Rn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},jn=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Ln={parseType:function(e,t){var n=Nn(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=Mn(e),n=4+Rn(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=Mn(e),r=4+Rn(e);if(n&&(r+=e[r]+1),1&e[r+5]){var i;i=3+((15&e[r+1])<<8|e[r+2])-4;for(var o=12+((15&e[r+10])<<8|e[r+11]);o=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+Rn(e),n=e.subarray(t),r=0,i=0,o=!1;i3&&"slice_layer_without_partitioning_rbsp_idr"===jn(31&n[i+3])&&(o=!0),o}},Fn=Te,Un=De.handleRollover,Bn={};Bn.ts=Ln,Bn.aac=pt;var Hn=re.ONE_SECOND_IN_TS,Vn=function(e,t,n){for(var r,i,o,a,s=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[s]||71!==e[u]&&u!==e.byteLength)s++,u++;else{switch(r=e.subarray(s,u),Bn.ts.parseType(r,t.pid)){case"pes":i=Bn.ts.parsePesType(r,t.table),o=Bn.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&o&&(a=Bn.ts.parsePesTime(r))&&(a.type="audio",n.audio.push(a),l=!0)}if(l)break;s+=188,u+=188}for(s=(u=e.byteLength)-188,l=!1;s>=0;)if(71!==e[s]||71!==e[u]&&u!==e.byteLength)s--,u--;else{switch(r=e.subarray(s,u),Bn.ts.parseType(r,t.pid)){case"pes":i=Bn.ts.parsePesType(r,t.table),o=Bn.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&o&&(a=Bn.ts.parsePesTime(r))&&(a.type="audio",n.audio.push(a),l=!0)}if(l)break;s-=188,u-=188}},Wn=function(e,t,n){for(var r,i,o,a,s,u,l,c=0,f=188,d=!1,p={data:[],size:0};f=0;)if(71!==e[c]||71!==e[f])c--,f--;else{switch(r=e.subarray(c,f),Bn.ts.parseType(r,t.pid)){case"pes":i=Bn.ts.parsePesType(r,t.table),o=Bn.ts.parsePayloadUnitStartIndicator(r),"video"===i&&o&&(a=Bn.ts.parsePesTime(r))&&(a.type="video",n.video.push(a),d=!0)}if(d)break;c-=188,f-=188}},qn=function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,i=188;i=3;){switch(Bn.aac.parseType(e,s)){case"timed-metadata":if(e.length-s<10){n=!0;break}if((a=Bn.aac.parseId3TagSize(e,s))>e.length){n=!0;break}null===o&&(t=e.subarray(s,s+a),o=Bn.aac.parseAacTimestamp(t)),s+=a;break;case"audio":if(e.length-s<7){n=!0;break}if((a=Bn.aac.parseAdtsSize(e,s))>e.length){n=!0;break}null===i&&(t=e.subarray(s,s+a),i=Bn.aac.parseSampleRate(t)),r++,s+=a;break;default:s++}if(n)return null}if(null===i||null===o)return null;var u=Hn/i;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*r*u,pts:o+1024*r*u}]}}(e):qn(e))&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;("undefined"===typeof n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach(function(e){e.dts=Un(e.dts,n),e.pts=Un(e.pts,n),e.dtsTime=e.dts/Hn,e.ptsTime=e.pts/Hn})}if(e.video&&e.video.length){var r=t;if(("undefined"===typeof r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach(function(e){e.dts=Un(e.dts,r),e.pts=Un(e.pts,r),e.dtsTime=e.dts/Hn,e.ptsTime=e.pts/Hn}),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=Un(i.dts,r),i.pts=Un(i.pts,r),i.dtsTime=i.dts/Hn,i.ptsTime=i.pts/Hn}}}(n,t),n):null},parseAudioPes_:Vn};const zn=function(e,t){t.on("data",function(t){const n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};const r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){const n={start:{decode:re.videoTsToSeconds(t.start.dts),presentation:re.videoTsToSeconds(t.start.pts)},end:{decode:re.videoTsToSeconds(t.end.dts),presentation:re.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:re.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=re.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})}),t.on("audioSegmentTimingInfo",function(t){const n={start:{decode:re.videoTsToSeconds(t.start.dts),presentation:re.videoTsToSeconds(t.start.pts)},end:{decode:re.videoTsToSeconds(t.end.dts),presentation:re.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:re.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=re.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:re.videoTsToSeconds(t.start),end:re.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:re.videoTsToSeconds(t.start),end:re.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})};class $n{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new $t.Transmuxer(this.options),zn(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new mn,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const n=An.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=An.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const n="number"!==typeof t||isNaN(t)?void 0:t*re.ONE_SECOND_IN_TS,r=Kn.inspect(e,n);let i=null;r&&((i={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(i.videoStart=r.video[0].ptsTime),i.hasAudio&&(i.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:i,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(re.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(re.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new $n(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new $n(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));const ma=e=>{const{transmuxer:t,bytes:n,audioAppendStart:r,gopsToAlignWith:i,remux:o,onData:a,onTrackInfo:s,onAudioTimingInfo:u,onVideoTimingInfo:l,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:f,onId3:d,onCaptions:p,onDone:h,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:v}=e,y={buffer:[]};let b=v;if(t.onmessage=n=>{t.currentTransmux===e&&("data"===n.data.action&&((e,t,n)=>{const{type:r,initSegment:i,captions:o,captionStreams:a,metadata:s,videoFrameDtsTime:u,videoFramePtsTime:l}=e.data.segment;t.buffer.push({captions:o,captionStreams:a,metadata:s});const c=e.data.segment.boxes||{data:e.data.segment.data},f={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(i.data,i.byteOffset,i.byteLength)};"undefined"!==typeof u&&(f.videoFrameDtsTime=u),"undefined"!==typeof l&&(f.videoFramePtsTime=l),n(f)})(n,y,a),"trackinfo"===n.data.action&&s(n.data.trackInfo),"gopInfo"===n.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(n,y),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&f(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&d([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&p(n.data.caption),"endedtimeline"===n.data.action&&(b=!1,m()),"log"===n.data.action&&g(n.data.log),"transmuxed"===n.data.type&&(b||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:y,callback:h}),ga(t))))},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),"undefined"!==typeof o&&t.postMessage({action:"setRemux",remux:o}),n.byteLength){const e=n instanceof ArrayBuffer?n:n.buffer,r=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:e,byteOffset:r,byteLength:n.byteLength},[e])}v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},ga=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"===typeof e.currentTransmux?e.currentTransmux():ma(e.currentTransmux))},va=(e,t)=>{e.postMessage({action:t}),ga(e)},ya=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void va(t,e);t.transmuxQueue.push(va.bind(null,t,e))},ba=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ma(e);e.transmuxer.transmuxQueue.push(e)};var _a={reset:e=>{ya("reset",e)},endTimeline:e=>{ya("endTimeline",e)},transmux:ba,createTransmuxer:e=>{const t=new ha;t.currentTransmux=null,t.transmuxQueue=[];const n=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)),t.postMessage({action:"init",options:e}),t}};const wa=function(e){const t=e.transmuxer,n=e.endAction||e.action,r=e.callback,i=v()({},e,{endAction:null,transmuxer:null,callback:null}),o=i=>{i.data.action===n&&(t.removeEventListener("message",o),i.data.data&&(i.data.data=new Uint8Array(i.data.data,e.byteOffset||0,e.byteLength||i.data.data.byteLength),e.data&&(e.data=i.data.data)),r(i.data))};if(t.addEventListener("message",o),e.data){const n=e.data instanceof ArrayBuffer;i.byteOffset=n?0:e.data.byteOffset,i.byteLength=e.data.byteLength;const r=[n?e.data:e.data.buffer];t.postMessage(i,r)}else t.postMessage(i)},Ea={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Sa=e=>{e.forEach(e=>{e.abort()})},Ta=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Ea.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Ea.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Ea.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Ea.FAILURE,xhr:t}:null,Ca=(e,t,n)=>(r,i)=>{const o=i.response,a=Ta(r,i);if(a)return n(a,e);if(16!==o.byteLength)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:Ea.FAILURE,xhr:i},e);const s=new DataView(o),u=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);for(let e=0;e{const n=Object(O.a)(e.map.bytes);if("mp4"!==n){const r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${n||"unknown"} container for initialization segment at URL: ${r}`,code:Ea.FAILURE})}wa({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:n,data:r})=>(e.map.bytes=r,n.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"===typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))}),t(null))})},xa=({segment:e,finishProcessingFn:t,responseType:n})=>(r,i)=>{const o=Ta(r,i);if(o)return t(o,e);const a="arraybuffer"!==n&&i.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(i),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)},ka=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})=>{const p=e.map&&e.map.tracks||{},h=Boolean(p.audio&&p.video);let m=r.bind(null,e,"audio","start");const g=r.bind(null,e,"audio","end");let v=r.bind(null,e,"video","start");const y=r.bind(null,e,"video","end");wa({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;const p=r.result;p&&(n(e,{hasAudio:p.hasAudio,hasVideo:p.hasVideo,isMuxed:h}),n=null,p.hasAudio&&!h&&m(p.audioStart),p.hasVideo&&v(p.videoStart),m=null,v=null),ba({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:h,onData:t=>{t.type="combined"===t.type?"video":t.type,c(e,t)},onTrackInfo:t=>{n&&(h&&(t.isMuxed=!0),n(e,t))},onAudioTimingInfo:e=>{m&&"undefined"!==typeof e.start&&(m(e.start),m=null),g&&"undefined"!==typeof e.end&&g(e.end)},onVideoTimingInfo:e=>{v&&"undefined"!==typeof e.start&&(v(e.start),v=null),y&&"undefined"!==typeof e.end&&y(e.end)},onVideoSegmentTimingInfo:e=>{i(e)},onAudioSegmentTimingInfo:e=>{o(e)},onId3:(t,n)=>{a(e,t,n)},onCaptions:t=>{s(e,[t])},isEndOfTimeline:u,onEndedTimeline:()=>{l()},onTransmuxerLog:d,onDone:t=>{f&&(t.type="combined"===t.type?"video":t.type,f(null,e,t))}})}})},Da=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})=>{let p=new Uint8Array(t);if(Object(O.b)(p)){e.isFmp4=!0;const{tracks:i}=e.map,o={isFmp4:!0,hasVideo:!!i.video,hasAudio:!!i.audio};i.audio&&i.audio.codec&&"enca"!==i.audio.codec&&(o.audioCodec=i.audio.codec),i.video&&i.video.codec&&"encv"!==i.video.codec&&(o.videoCodec=i.video.codec),i.video&&i.audio&&(o.isMuxed=!0),n(e,o);const a=t=>{c(e,{data:p,type:o.hasAudio&&!o.isMuxed?"audio":"video"}),t&&t.length&&s(e,t),f(null,e,{})};wa({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:n,startTime:s})=>{t=n.buffer,e.bytes=p=n,o.hasAudio&&!o.isMuxed&&r(e,"audio","start",s),o.hasVideo&&r(e,"video","start",s),i.video&&n.byteLength&&e.transmuxer?wa({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[i.video.id],callback:n=>{t=n.data.buffer,e.bytes=p=n.data,n.logs.forEach(function(e){d(Vi(e,{stream:"mp4CaptionParser"}))}),a(n.captions)}}):a()}})}else if(e.transmuxer){if("undefined"===typeof e.container&&(e.container=Object(O.a)(p)),"ts"!==e.container&&"aac"!==e.container)return n(e,{hasAudio:!1,hasVideo:!1}),void f(null,e,{});ka({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})}else f(null,e,{})},Pa=function({id:e,key:t,encryptedBytes:n,decryptionWorker:r},i){const o=t=>{if(t.data.source===e){r.removeEventListener("message",o);const e=t.data.decrypted;i(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let a;r.addEventListener("message",o),a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(Ko({source:e,encrypted:n,key:a,iv:t.iv}),[n.buffer,a.buffer])},Aa=({activeXhrs:e,decryptionWorker:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})=>{let p=0,h=!1;return(m,g)=>{if(!h){if(m)return h=!0,Sa(e),f(m,g);if((p+=1)===e.length){const p=function(){if(g.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})=>{Pa({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e,Da({segment:t,bytes:t.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})})})({decryptionWorker:t,segment:g,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d});Da({segment:g,bytes:g.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c,doneFn:f,onTransmuxerLog:d})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return Pa({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},t=>{g.map.bytes=t,Oa(g,t=>{if(t)return Sa(e),f(t,g);p()})});p()}}}},Ia=({segment:e,progressFn:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:o,id3Fn:a,captionsFn:s,isEndOfTimeline:u,endedTimelineFn:l,dataFn:c})=>n=>{if(!n.target.aborted)return e.stats=Vi(e.stats,(e=>{const t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n})(n)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(n,e)},Na=({xhr:e,xhrOptions:t,decryptionWorker:n,segment:r,abortFn:i,progressFn:o,trackInfoFn:a,timingInfoFn:s,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:d,endedTimelineFn:p,dataFn:h,doneFn:m,onTransmuxerLog:g})=>{const v=[],y=Aa({activeXhrs:v,decryptionWorker:n,trackInfoFn:a,timingInfoFn:s,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:d,endedTimelineFn:p,dataFn:h,doneFn:m,onTransmuxerLog:g});if(r.key&&!r.key.bytes){const n=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&n.push(r.map.key);const i=e(Vi(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),Ca(r,n,y));v.push(i)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const n=e(Vi(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),Ca(r,[r.map.key],y));v.push(n)}const n=e(Vi(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Ho(r.map)}),(({segment:e,finishProcessingFn:t})=>(n,r)=>{const i=Ta(n,r);if(i)return t(i,e);const o=new Uint8Array(r.response);if(e.map.key)return e.map.encryptedBytes=o,t(null,e);e.map.bytes=o,Oa(e,function(n){if(n)return n.xhr=r,n.status=r.status,t(n,e);t(null,e)})})({segment:r,finishProcessingFn:y}));v.push(n)}const b=Vi(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Ho(r)}),_=e(b,xa({segment:r,finishProcessingFn:y,responseType:b.responseType}));_.addEventListener("progress",Ia({segment:r,progressFn:o,trackInfoFn:a,timingInfoFn:s,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:l,id3Fn:c,captionsFn:f,isEndOfTimeline:d,endedTimelineFn:p,dataFn:h})),v.push(_);const w={};return v.forEach(e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>n=>{n.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:w,abortFn:i}))}),()=>Sa(v)},Ma=Hi("CodecUtils"),Ra=(e,t)=>{const n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},ja=function(e){const t={};return e.forEach(({mediaType:e,type:n,details:r})=>{t[e]=t[e]||[],t[e].push(Object(b.i)(`${n}${r}`))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return Ma(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]}),t},La=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Fa=function(e,t){const n=t.attributes||{},r=ja(function(e){const t=e.attributes||{};if(t.CODECS)return Object(b.h)(t.CODECS)}(t)||[]);if(Ra(e,t)&&!r.audio&&!((e,t)=>{if(!Ra(e,t))return!0;const n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(const i in r)if(!r[i].uri&&!r[i].playlists)return!0;return!1})(e,t)){const t=ja(Object(b.d)(e,n.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},Ua=Hi("PlaylistSelector"),Ba=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},Ha=function(e,t){if(!e)return"";const n=i.a.getComputedStyle(e);return n?n[t]:""},Va=function(e,t){const n=e.slice();e.sort(function(e,r){const i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i})},Wa=function(e,t){let n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||i.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),n-(r=r||i.a.Number.MAX_VALUE)};let qa=function(e,t,n,r,o,a){if(!e)return;const s={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:o};let u=e.playlists;wo.isAudioOnly(e)&&(u=a.getAudioTrackPlaylists_(),s.audioOnly=!0);let l=u.map(e=>{let t;const n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:t=(t=e.attributes&&e.attributes.BANDWIDTH)||i.a.Number.MAX_VALUE,width:n,height:r,playlist:e}});Va(l,(e,t)=>e.bandwidth-t.bandwidth);let c=(l=l.filter(e=>!wo.isIncompatible(e.playlist))).filter(e=>wo.isEnabled(e.playlist));c.length||(c=l.filter(e=>!wo.isDisabled(e.playlist)));const f=c.filter(e=>e.bandwidth*la.BANDWIDTH_VARIANCEe.bandwidth===d.bandwidth)[0];if(!1===o){const e=p||c[0]||l[0];if(e&&e.playlist){let t="sortedPlaylistReps";return p&&(t="bandwidthBestRep"),c[0]&&(t="enabledPlaylistReps"),Ua(`choosing ${Ba(e)} using ${t} with options`,s),e.playlist}return Ua("could not choose a playlist with options",s),null}const h=f.filter(e=>e.width&&e.height);Va(h,(e,t)=>e.width-t.width);const m=h.filter(e=>e.width===n&&e.height===r);d=m[m.length-1];const g=m.filter(e=>e.bandwidth===d.bandwidth)[0];let v,y,b,_;if(g||(y=(v=h.filter(e=>e.width>n||e.height>r)).filter(e=>e.width===v[0].width&&e.height===v[0].height),d=y[y.length-1],b=y.filter(e=>e.bandwidth===d.bandwidth)[0]),a.leastPixelDiffSelector){const e=h.map(e=>(e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e));Va(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),_=e[0]}const w=_||b||g||p||c[0]||l[0];if(w&&w.playlist){let e="sortedPlaylistReps";return _?e="leastPixelDiffRep":b?e="resolutionPlusOneRep":g?e="resolutionBestRep":p?e="bandwidthBestRep":c[0]&&(e="enabledPlaylistReps"),Ua(`choosing ${Ba(w)} using ${e} with options`,s),w.playlist}return Ua("could not choose a playlist with options",s),null};const Ka=function(){const e=this.useDevicePixelRatio&&i.a.devicePixelRatio||1;return qa(this.playlists.main,this.systemBandwidth,parseInt(Ha(this.tech_.el(),"width"),10)*e,parseInt(Ha(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},za=function(e){const{main:t,currentTime:n,bandwidth:r,duration:i,segmentDuration:o,timeUntilRebuffer:a,currentTimeline:s,syncController:u}=e,l=t.playlists.filter(e=>!wo.isIncompatible(e));let c=l.filter(wo.isEnabled);c.length||(c=l.filter(e=>!wo.isDisabled(e)));const f=c.filter(wo.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{const t=u.getSyncPoint(e,i,s,n)?1:2;return{playlist:e,rebufferingImpact:wo.estimateSegmentRequestTime(o,r,e)*t-a}}),d=f.filter(e=>e.rebufferingImpact<=0);return Va(d,(e,t)=>Wa(t.playlist,e.playlist)),d.length?d[0]:(Va(f,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),f[0]||null)},$a=e=>{let t,n=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,n),n+=e.byteLength})),t},Ga=function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"});let r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);const i=t.textTracks().getTrackById(r);if(i)e[n]=i;else{let i=n,o=n,a=!1;const s=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];s&&(i=s.label,o=s.language,a=s.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:a,label:i,language:o},!1).track}}},Ya=function({inbandTextTracks:e,captionArray:t,timestampOffset:n}){if(!t)return;const r=i.a.WebKitDataCue||i.a.VTTCue;t.forEach(t=>{const i=t.stream;e[i].addCue(new r(t.startTime+n,t.endTime+n,t.text))})},Xa=({inbandTextTracks:e,metadataArray:t,timestampOffset:n,videoDuration:r})=>{if(!t)return;const o=i.a.WebKitDataCue||i.a.VTTCue,a=e.metadataTrack_;if(!a)return;if(t.forEach(e=>{const t=e.cueTime+n;!("number"!==typeof t||i.a.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(e=>{const n=new o(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(Mi.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(Mi.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(Mi.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(n),a.addCue(n)})}),!a.cues||!a.cues.length)return;const s=a.cues,u=[];for(let i=0;i{const n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e},{}),c=Object.keys(l).sort((e,t)=>Number(e)-Number(t));c.forEach((e,t)=>{const n=l[e],i=Number(c[t+1])||r;n.forEach(e=>{e.endTime=i})})},Qa=(e,t,n)=>{e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},Za=function(e,t,n){let r,i;if(n&&n.cues)for(r=n.cues.length;r--;)(i=n.cues[r]).startTime>=e&&i.endTime<=t&&n.removeCue(i)},Ja=function(e){const t=e.cues;if(t)for(let n=0;n1&&r.push(t[e]);r.length&&r.forEach(t=>e.removeCue(t))}},es=(e,t,n)=>{if("undefined"===typeof t||null===t||!e.length)return[];const r=Math.ceil((t-n+3)*x.ONE_SECOND_IN_TS);let i;for(i=0;ir);i++);return e.slice(i)},ts=(e,t,n)=>{if(!t.length)return e;if(n)return t.slice();const r=t[0].pts;let i=0;for(;i=r);i++);return e.slice(0,i).concat(t)},ns=(e,t,n,r)=>{const i=Math.ceil((t-r)*x.ONE_SECOND_IN_TS),o=Math.ceil((n-r)*x.ONE_SECOND_IN_TS),a=e.slice();let s=e.length;for(;s--&&!(e[s].pts<=o););if(-1===s)return a;let u=s+1;for(;u--&&!(e[u].pts<=i););return u=Math.max(u,0),a.splice(u,s-u+1),a},rs=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;in))return o}return 0===r.length?0:r[r.length-1]},as=1,ss=500,us=e=>"number"===typeof e&&isFinite(e),ls=1/60,cs=(e,t,n)=>"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null,fs=(e,t,n)=>{let r=t-la.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));const i=t-n;return Math.min(i,r)},ds=e=>{const{startOfSegment:t,duration:n,segment:r,part:i,playlist:{mediaSequence:o,id:a,segments:s=[]},mediaIndex:u,partIndex:l,timeline:c}=e,f=s.length-1;let d="mediaIndex/partIndex increment";e.getMediaInfoForTime?d=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(d+=` with independent ${e.independent}`);const p="number"===typeof l,h=e.segment.uri?"segment":"pre-segment",m=p?ao({preloadSegment:r})-1:0;return`${h} [${o+u}/${o+f}]`+(p?` part [${l}/${m}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(p?` part start/end [${i.start} => ${i.end}]`:"")+` startOfSegment [${t}]`+` duration [${n}]`+` timeline [${c}]`+` selected by [${d}]`+` playlist [${a}]`},ps=e=>`${e}TimingInfo`,hs=({segmentTimeline:e,currentTimeline:t,startOfSegment:n,buffered:r,overrideCheck:i})=>i||e!==t?e{if(t===n)return!1;if("audio"===r){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==n}if("main"===r&&i){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==n}return!1},gs=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+qi,vs=(e,t)=>{if("hls"!==t)return null;const n=(e=>{let t=0;return["video","audio"].forEach(function(n){const r=e[`${n}TimingInfo`];if(!r)return;const{start:o,end:a}=r;let s;"bigint"===typeof o||"bigint"===typeof a?s=i.a.BigInt(a)-i.a.BigInt(o):"number"===typeof o&&"number"===typeof a&&(s=a-o),"undefined"!==typeof s&&s>t&&(t=s)}),"bigint"===typeof t&&t=11,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Hi(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}createTransmuxer_(){return _a.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&i.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,i.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return"undefined"!==typeof e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&_a.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Wi();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const n=zo(e);let r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const n=$o(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_(`playlist update [${i} => ${e.id||e.uri}]`),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const o=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${o}]`),null!==this.mediaIndex)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=o,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(i.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&_a.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,n=(()=>{}),r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let i=1;const o=()=>{0===--i&&n()};!r&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(e,t,o)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=ns(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,o));for(const a in this.inbandTextTracks_)Za(e,t,this.inbandTextTracks_[a]);Za(e,t,this.segmentMetadataTrack_),o()}monitorBuffer_(){this.checkBufferTimeout_&&i.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i.a.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&i.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i.a.setTimeout(this.monitorBufferTick_.bind(this),ss)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"===typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;const r="number"===typeof e&&t.segments[e],i=e+1===t.segments.length,o=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&i&&o}chooseNextRequest_(){const e=this.buffered_(),t=to(e)||0,n=no(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,i=n>=this.goalBufferLength_(),o=this.playlist_.segments;if(!o.length||r||i)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=os(this.currentTimeline_,o,t);else if(null!==this.mediaIndex){const e=o[this.mediaIndex],n="number"===typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[n+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=n+1):a.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:e,startTime:n,partIndex:r}=wo.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,a.mediaIndex=e,a.startOfSegment=n,a.partIndex=r}const s=o[a.mediaIndex];let u=s&&"number"===typeof a.partIndex&&s.parts&&s.parts[a.partIndex];if(!s||"number"===typeof a.partIndex&&!u)return null;if("number"!==typeof a.partIndex&&s.parts&&(a.partIndex=0,u=s.parts[0]),!n&&u&&!u.independent)if(0===a.partIndex){const e=o[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else s.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const l=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=o.length-1&&l&&!this.seeking_()?null:this.generateSegmentInfo_(a)}generateSegmentInfo_(e){const{independent:t,playlist:n,mediaIndex:r,startOfSegment:i,isSyncRequest:o,partIndex:a,forceTimestampOffset:s,getMediaInfoForTime:u}=e,l=n.segments[r],c="number"===typeof a&&l.parts[a],f={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:r,partIndex:c?a:null,isSyncRequest:o,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},d="undefined"!==typeof s?s:this.isPendingTimestampOffset_;f.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:d});const p=to(this.sourceUpdater_.audioBuffered());return"number"===typeof p&&(f.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(f.gopsToAlignWith=es(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),f}timestampOffsetForSegment_(e){return hs(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=wo.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),o=Zi(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(i<=o)return;const a=za({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const s=i-o-a.rebufferingImpact;let u=.5;o<=qi&&(u=1),!a.playlist||a.playlist.uri===this.playlist_.uri||s{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)}),Object.keys(r).forEach(e=>{const{startTime:t,endTime:i,captions:o}=r[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`),Ga(a,this.vhs_.tech_,e),Za(t,i,a[e]),Ya({captionArray:o,inbandTextTracks:a,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n));const r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();Qa(this.inbandTextTracks_,n,this.vhs_.tech_),Xa({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:this.duration_()})}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!ms({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:n,hasVideo:r,isMuxed:i}=t;return!(r&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo)&&!ms({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[ps(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!==typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){const e=zo(n);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){const o=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ji(o).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ji(a).join(", "));const s=o.length?o.start(0):0,u=o.length?o.end(o.length-1):0,l=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(u-s<=as&&c-l<=as)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+`Appended byte length: ${n.byteLength}, `+`audio buffer: ${Ji(o).join(", ")}, `+`video buffer: ${Ji(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));const f=this.currentTime_()-as;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${f}`),this.remove(0,f,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${as}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=i.a.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*as)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){r&&(r.code!==is?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(`${t} append of ${n.length}b failed for segment `+`#${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:i}){if(!i){const e=[r];let t=r.byteLength;n&&(e.unshift(n),t+=n.byteLength),i=$a({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:i},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:i}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,i=`${e}TimingInfo`;r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){const{type:n,data:r}=t;if(!r||!r.byteLength)return;if("audio"===n&&this.audioDisabled_)return;const i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"===typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(()=>{const t=v()({},e,{forceTimestampOffset:!0});v()(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)})}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,i=e.timeline!==this.currentTimeline_&&e.timeline>0,o=n||r&&i;this.logger_(`Requesting ${ds(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Na({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:o,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:n,stream:r})=>{this.logger_(`${ds(e)} logged from transmuxer stream ${r} as a ${n}: ${t}`)}})}trimBackBuffer_(e){const t=fs(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,n=e.part,r={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];if(i&&i.timeline===t.timeline&&(i.videoTimingInfo?r.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(r.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key){const n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=n}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e3*e.playlist.targetDuration,o=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(i||o)return this.logger_(`bad ${i?"segment":"part"} ${ds(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},ws=["video","audio"],Es=(e,t)=>{const n=t[`${e}Buffer`];return n&&n.updating||t.queuePending[e]},Ss=(e,t)=>{if(0===t.queue.length)return;let n=0,r=t.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Es(e,t)){if(r.type!==e){if(null===(n=((e,t)=>{for(let n=0;n{const n=t[`${e}Buffer`],r=_s(e);n&&(n.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),n.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Cs=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Os={appendBuffer:(e,t,n)=>(r,i)=>{const o=i[`${r}Buffer`];if(Cs(i.mediaSource,o)){i.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{o.appendBuffer(e)}catch(a){i.logger_(`Error with code ${a.code} `+(a.code===is?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,n(a)}}},remove:(e,t)=>(n,r)=>{const i=r[`${n}Buffer`];if(Cs(r.mediaSource,i)){r.logger_(`Removing ${e} to ${t} from ${n}Buffer`);try{i.remove(e,t)}catch(o){r.logger_(`Remove ${e} to ${t} from ${n}Buffer failed`)}}},timestampOffset:e=>(t,n)=>{const r=n[`${t}Buffer`];Cs(n.mediaSource,r)&&(n.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},callback:e=>(t,n)=>{e()},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(n){Mi.log.warn("Failed to call media source endOfStream",n)}}},duration:e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(n){Mi.log.warn("Failed to set media source duration",n)}},abort:()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const n=t[`${e}Buffer`];if(Cs(t.mediaSource,n)){t.logger_(`calling abort on ${e}Buffer`);try{n.abort()}catch(r){Mi.log.warn(`Failed to abort on ${e}Buffer`,r)}}},addSourceBuffer:(e,t)=>n=>{const r=_s(e),i=Object(b.e)(t);n.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const o=n.mediaSource.addSourceBuffer(i);o.addEventListener("updateend",n[`on${r}UpdateEnd_`]),o.addEventListener("error",n[`on${r}Error_`]),n.codecs[e]=t,n[`${e}Buffer`]=o},removeSourceBuffer:e=>t=>{const n=t[`${e}Buffer`];if(Ts(e,t),Cs(t.mediaSource,n)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(n)}catch(r){Mi.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,r)}}},changeType:e=>(t,n)=>{const r=n[`${t}Buffer`],i=Object(b.e)(e);Cs(n.mediaSource,r)&&n.codecs[t]!==e&&(n.logger_(`changing ${t}Buffer codec from ${n.codecs[t]} to ${e}`),r.changeType(i),n.codecs[t]=e)}},xs=({type:e,sourceUpdater:t,action:n,doneFn:r,name:i})=>{t.queue.push({type:e,action:n,doneFn:r,name:i}),Ss(e,t)},ks=(e,t)=>n=>{if(t.queuePending[e]){const n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[`${e}Error_`])}Ss(e,t)};class Ds extends Mi.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ss("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Hi("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=ks("video",this),this.onAudioUpdateEnd_=ks("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){xs({type:"mediaSource",sourceUpdater:this,action:Os.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){xs({type:e,sourceUpdater:this,action:Os.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?xs({type:"mediaSource",sourceUpdater:this,action:Os.removeSourceBuffer(e),name:"removeSourceBuffer"}):Mi.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Mi.browser.IE_VERSION&&!Mi.browser.IS_FIREFOX&&i.a.MediaSource&&i.a.MediaSource.prototype&&"function"===typeof i.a.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return i.a.SourceBuffer&&i.a.SourceBuffer.prototype&&"function"===typeof i.a.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?xs({type:e,sourceUpdater:this,action:Os.changeType(t),name:"changeType"}):Mi.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!==typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)})}appendBuffer(e,t){const{segmentInfo:n,type:r,bytes:i}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${i.length} until video append`);const o=t;if(xs({type:r,sourceUpdater:this,action:Os.appendBuffer(i,n||{mediaIndex:-1},o),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return Cs(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Wi()}videoBuffered(){return Cs(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Wi()}buffered(){const e=Cs(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Cs(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Xi(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=bs){xs({type:"mediaSource",sourceUpdater:this,action:Os.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=bs){"string"!==typeof e&&(e=void 0),xs({type:"mediaSource",sourceUpdater:this,action:Os.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,n=bs){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?xs({type:"audio",sourceUpdater:this,action:Os.remove(e,t),doneFn:n,name:"remove"}):n()}removeVideo(e,t,n=bs){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?xs({type:"video",sourceUpdater:this,action:Os.remove(e,t),doneFn:n,name:"remove"}):n()}updating(){return!(!Es("audio",this)&&!Es("video",this))}audioTimestampOffset(e){return"undefined"!==typeof e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(xs({type:"audio",sourceUpdater:this,action:Os.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return"undefined"!==typeof e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(xs({type:"video",sourceUpdater:this,action:Os.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&xs({type:"audio",sourceUpdater:this,action:Os.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&xs({type:"video",sourceUpdater:this,action:Os.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),ws.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Ts(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Ps=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),As=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class Is extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Ns extends ys{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Wi();const e=this.subtitlesTrack_.cues;return Wi([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const n=zo(e);let r=this.initSegments_[n];if(t&&!r&&e.bytes){const t=As.byteLength+e.bytes.byteLength,i=new Uint8Array(t);i.set(e.bytes),i.set(As,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:i}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return"undefined"===typeof e?this.subtitlesTrack_:(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Za(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Ea.TIMEOUT&&this.handleTimeout_(),e.code===Ea.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const o=r.segment;if(o.map&&(o.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!==typeof i.a.WebVTT&&"function"===typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,n),()=>this.stopForError({message:"Error loading vtt.js"}));o.requested=!0;try{this.parseVTTCues_(r)}catch(a){return void this.stopForError({message:a.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=o.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new i.a.VTTCue(e.startTime,e.endTime,e.text):e)}),Ja(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,n=!1;if("function"!==typeof i.a.WebVTT)throw new Is;"function"===typeof i.a.TextDecoder?t=new i.a.TextDecoder("utf8"):(t=i.a.WebVTT.StringDecoder(),n=!0);const r=new i.a.WebVTT.Parser(i.a,i.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{Mi.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;n&&(t=Ps(t)),r.parse(t)}let o=e.bytes;n&&(o=Ps(o)),r.parse(o),r.flush()}updateTimeMapping_(e,t,n){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const i=e.timestampmap,o=i.MPEGTS/x.ONE_SECOND_IN_TS-i.LOCAL+t.mapping;if(e.cues.forEach(e=>{e.startTime+=o,e.endTime+=o}),!n.syncInfo){const t=e.cues[0].startTime,i=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(t,i-r.duration)}}}}const Ms=function(e,t){const n=e.cues;for(let r=0;r=e.adStartTime&&t<=e.adEndTime)return e}return null},Rs=function(e,t,n=0){if(!e.segments)return;let r,o=n;for(let a=0;a{if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"ProgramDateTime",run:(e,t,n,r,i)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let o=null,a=null;const s=io(t);i=i||0;for(let u=0;u{let o=null,a=null;i=i||0;const s=io(t);for(let u=0;u=t)&&(a=t,o={time:l,segmentIndex:e.segmentIndex,partIndex:e.partIndex})}}return o}},{name:"Discontinuity",run:(e,t,n,r,i)=>{let o=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let r=0;r=e)&&(n=e,o={time:u.time,segmentIndex:a,partIndex:null})}}}return o}},{name:"Playlist",run:(e,t,n,r,i)=>{if(t.syncInfo){return{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}}return null}}];class Fs extends Mi.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.logger_=Hi("SyncController")}getSyncPoint(e,t,n,r){const i=this.runStrategies_(e,t,n,r);return i.length?this.selectSyncPoint_(i,{key:"time",value:r}):null}getExpiredTime(e,t){if(!e||!e.segments)return null;const n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;const r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+co({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r){const i=[];for(let o=0;ojs)Mi.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);else for(let r=n-1;r>=0;r--){const n=e.segments[r];if(n&&"undefined"!==typeof n.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time},`+` mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const i=r.dateTimeObject;r.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[r.timeline]=-i.getTime()/1e3)}timestampOffsetForTimeline(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){const r=e.segment,i=e.part;let o,a,s=this.timelines[e.timeline];if("number"===typeof e.timestampOffset)s={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=s,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: `+`[time: ${s.time}] [mapping: ${s.mapping}]`)),o=e.startOfSegment,a=t.end+s.mapping;else{if(!s)return!1;o=t.start+s.mapping,a=t.end+s.mapping}return i&&(i.start=o,i.end=a),(!r.start||os){let r;r=a<0?n.start-co({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+co({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[o]={time:r,accuracy:s}}}}dispose(){this.trigger("dispose"),this.off()}}class Us extends Mi.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:n}){return"number"===typeof t&&"number"===typeof n&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){return"number"===typeof t&&"number"===typeof n&&(this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var Bs=fa(da(pa(function(){var t=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r>7))^o]=o;for(a=s=0;!r[a];a^=c||1,s=l[s]||1)for(p=(p=s^s<<1^s<<2^s<<3^s<<4)>>8^255&p^99,r[a]=p,i[p]=a,m=16843009*(d=u[f=u[c=u[a]]])^65537*f^257*c^16843008*a,h=257*u[p]^16843008*p,o=0;o<4;o++)t[o][a]=h=h<<24^h>>>8,n[o][p]=m=m<<24^m>>>8;for(o=0;o<5;o++)t[o]=t[o].slice(0),n[o]=n[o].slice(0);return e};let r=null;class i{constructor(e){let t,i,o;r||(r=n()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];const a=this._tables[0][4],s=this._tables[1],u=e.length;let l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");const c=e.slice(0),f=[];for(this._key=[c,f],t=u;t<4*u+28;t++)o=c[t-1],(t%u===0||8===u&&t%u===4)&&(o=a[o>>>24]<<24^a[o>>16&255]<<16^a[o>>8&255]<<8^a[255&o],t%u===0&&(o=o<<8^o>>>24^l<<24,l=l<<1^283*(l>>7))),c[t]=c[t-u]^o;for(i=0;t;i++,t--)o=c[3&i?t:t-4],f[i]=t<=4||i<4?o:s[0][a[o>>>24]]^s[1][a[o>>16&255]]^s[2][a[o>>8&255]]^s[3][a[255&o]]}decrypt(e,t,n,r,i,o){const a=this._key[1];let s,u,l,c=e^a[0],f=r^a[1],d=n^a[2],p=t^a[3];const h=a.length/4-2;let m,g=4;const v=this._tables[1],y=v[0],b=v[1],_=v[2],w=v[3],E=v[4];for(m=0;m>>24]^b[f>>16&255]^_[d>>8&255]^w[255&p]^a[g],u=y[f>>>24]^b[d>>16&255]^_[p>>8&255]^w[255&c]^a[g+1],l=y[d>>>24]^b[p>>16&255]^_[c>>8&255]^w[255&f]^a[g+2],p=y[p>>>24]^b[c>>16&255]^_[f>>8&255]^w[255&d]^a[g+3],g+=4,c=s,f=u,d=l;for(m=0;m<4;m++)i[(3&-m)+o]=E[c>>>24]<<24^E[f>>16&255]<<16^E[d>>8&255]<<8^E[255&p]^a[g++],s=c,c=f,f=d,d=p,p=s}}class o extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},s=function(e,t,n){const r=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),o=new i(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),u=new Int32Array(s.buffer);let l,c,f,d,p,h,m,g,v;for(l=n[0],c=n[1],f=n[2],d=n[3],v=0;v{const r=e[n];!function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer}(r)?t[n]=r:t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}}),t};self.onmessage=function(e){const t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new u(n,r,i,function(e,n){self.postMessage(d({source:t.source,decrypted:n}),[n.buffer])})}})));const Hs=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Vs=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Ws=(e,t)=>{t.activePlaylistLoader=e,e.load()},qs={AUDIO:(e,t)=>()=>{const{segmentLoaders:{[e]:n},mediaTypes:{[e]:r},excludePlaylist:i}=t;Vs(n,r);const o=r.activeTrack(),a=r.activeGroup(),s=(a.filter(e=>e.default)[0]||a[0]).id,u=r.tracks[s];if(o!==u){Mi.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in r.tracks)r.tracks[e].enabled=r.tracks[e]===u;r.onTrackChanged()}else i({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;Mi.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Vs(n,r);const i=r.activeTrack();i&&(i.mode="disabled"),r.onTrackChanged()}},Ks={AUDIO:(e,t,n)=>{if(!t)return;const{tech:r,requestOptions:i,segmentLoaders:{[e]:o}}=n;t.on("loadedmetadata",()=>{const e=t.media();o.playlist(e,i),(!r.paused()||e.endList&&"none"!==r.preload())&&o.load()}),t.on("loadedplaylist",()=>{o.playlist(t.media(),i),r.paused()||o.load()}),t.on("error",qs[e](e,n))},SUBTITLES:(e,t,n)=>{const{tech:r,requestOptions:i,segmentLoaders:{[e]:o},mediaTypes:{[e]:a}}=n;t.on("loadedmetadata",()=>{const e=t.media();o.playlist(e,i),o.track(a.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&o.load()}),t.on("loadedplaylist",()=>{o.playlist(t.media(),i),r.paused()||o.load()}),t.on("error",qs[e](e,n))}},zs={AUDIO:(e,t)=>{const{vhs:n,sourceType:r,segmentLoaders:{[e]:i},requestOptions:o,main:{mediaGroups:a},mediaTypes:{[e]:{groups:s,tracks:u,logger_:l}},mainPlaylistLoader:c}=t,f=_o(c.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},f&&(a[e].main.default.playlists=c.main.playlists));for(const d in a[e]){s[d]||(s[d]=[]);for(const i in a[e][d]){let p,h=a[e][d][i];if(f?(l(`AUDIO group '${d}' label '${i}' is a main playlist`),h.isMainPlaylist=!0,p=null):p="vhs-json"===r&&h.playlists?new Lo(h.playlists[0],n,o):h.resolvedUri?new Lo(h.resolvedUri,n,o):h.playlists&&"dash"===r?new ua(h.playlists[0],n,o,c):null,h=Vi({id:i,playlistLoader:p},h),Ks[e](e,h.playlistLoader,t),s[d].push(h),"undefined"===typeof u[i]){const e=new Mi.AudioTrack({id:i,kind:Hs(h),enabled:!1,language:h.language,default:h.default,label:i});u[i]=e}}}i.on("error",qs[e](e,t))},SUBTITLES:(e,t)=>{const{tech:n,vhs:r,sourceType:i,segmentLoaders:{[e]:o},requestOptions:a,main:{mediaGroups:s},mediaTypes:{[e]:{groups:u,tracks:l}},mainPlaylistLoader:c}=t;for(const f in s[e]){u[f]||(u[f]=[]);for(const o in s[e][f]){if(s[e][f][o].forced)continue;let d,p=s[e][f][o];if("hls"===i)d=new Lo(p.resolvedUri,r,a);else if("dash"===i){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;d=new ua(p.playlists[0],r,a,c)}else"vhs-json"===i&&(d=new Lo(p.playlists?p.playlists[0]:p.resolvedUri,r,a));if(p=Vi({id:o,playlistLoader:d},p),Ks[e](e,p.playlistLoader,t),u[f].push(p),"undefined"===typeof l[o]){const e=n.addRemoteTextTrack({id:o,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:o},!1).track;l[o]=e}}}o.on("error",qs[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:i,tracks:o}}}=t;for(const a in r[e]){i[a]||(i[a]=[]);for(const t in r[e][a]){const s=r[e][a][t];if(!/^(?:CC|SERVICE)/.test(s.instreamId))continue;const u=n.options_.vhs&&n.options_.vhs.captionServices||{};let l={label:t,language:s.language,instreamId:s.instreamId,default:s.default&&s.autoselect};if(u[l.instreamId]&&(l=Vi(l,u[l.instreamId])),void 0===l.default&&delete l.default,i[a].push(Vi({id:t},s)),"undefined"===typeof o[t]){const e=n.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default,language:l.language,label:l.label},!1).track;o[t]=e}}}}},$s=(e,t)=>{for(let n=0;n()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if("showing"===n[e].mode||"hidden"===n[e].mode)return n[e];return null}},Ys=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{zs[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{AUDIO:o,main:a}}=e;["AUDIO","SUBTITLES"].forEach(n=>{t[n].activeGroup=((e,t)=>n=>{const{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:i}}}=t,o=r.media();if(!o)return null;let a=null;o.attributes[e]&&(a=i[o.attributes[e]]);const s=Object.keys(i);if(!a)if("AUDIO"===e&&s.length>1&&_o(t.main))for(let e=0;ee.id===n.id)[0]||null})(n,e),t[n].activeTrack=Gs[n](n,e),t[n].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:i}}=t,o=i.activeTrack(),a=i.getActiveGroup(),s=i.activePlaylistLoader,u=i.lastGroup_;a&&u&&a.id===u.id||(i.lastGroup_=a,i.lastTrack_=o,Vs(n,i),a&&!a.isMainPlaylist&&(a.playlistLoader?(n.resyncLoader(),Ws(a.playlistLoader,i)):s&&r.resetEverything()))})(n,e),t[n].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()})(n,e),t[n].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:i},mediaTypes:{[e]:o}}=t,a=o.activeTrack(),s=o.getActiveGroup(),u=o.activePlaylistLoader,l=o.lastTrack_;if((!l||!a||l.id!==a.id)&&(o.lastGroup_=s,o.lastTrack_=a,Vs(r,o),s)){if(s.isMainPlaylist){if(!a||!l||a.id===l.id)return;const e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;return o.logger_(`track change. Switching main audio from ${l.id} to ${a.id}`),n.pause(),i.resetEverything(),void e.fastQualityChange_(r)}if("AUDIO"===e){if(!s.playlistLoader)return i.setAudio(!0),void i.resetEverything();r.setAudio(!0),i.setAudio(!1)}u!==s.playlistLoader?(r.track&&r.track(a),r.resetEverything(),Ws(s.playlistLoader,o)):Ws(s.playlistLoader,o)}})(n,e),t[n].getActiveGroup=((e,{mediaTypes:t})=>()=>{const n=t[e].activeTrack();return n?t[e].activeGroup(n):null})(n,e)});const s=t.AUDIO.activeGroup();if(s){const e=(s.filter(e=>e.default)[0]||s[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),o.setAudio(!0)):a.setAudio(!0)}n.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),n.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const u=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",u),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",()=>{r.audioTracks().removeEventListener("change",u),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(const l in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[l])},Xs=()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:bs,activeTrack:bs,getActiveGroup:bs,onGroupChanged:bs,onTrackChanged:bs,lastTrack_:null,logger_:Hi(`MediaGroups[${t}]`)}}),e},Qs=120;let Zs;const Js=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],eu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},tu=function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:o,duration:a,bufferBasedABR:s,log:u}){if(!r)return Mi.log.warn("We received no playlist to switch to. Please check your stream."),!1;const l=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return u(`${l} as current playlist is not set`),!0;if(r.id===e.id)return!1;const c=Boolean($i(t,n).length);if(!e.endList)return c||"number"!==typeof e.partTargetDuration?(u(`${l} as current playlist is live`),!0):(u(`not ${l} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const f=no(t,n),d=s?la.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:la.MAX_BUFFER_LOW_WATER_LINE;if(ah)&&f>=i){let e=`${l} as forwardBuffer >= bufferLowWaterLine (${f} >= ${i})`;return s&&(e+=` and next bandwidth > current bandwidth (${p} > ${h})`),u(e),!0}return u(`not ${l} as no switching criteria met`),!1};class nu extends Mi.EventTarget{constructor(e){super();const{src:t,withCredentials:n,tech:r,bandwidth:o,externVhs:a,useCueTags:s,playlistExclusionDuration:u,enableLowInitialPlaylist:l,sourceType:c,cacheEncryptionKeys:f,bufferBasedABR:d,leastPixelDiffSelector:p,captionServices:h}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null!==m&&"undefined"!==typeof m||(m=1/0),Zs=a,this.bufferBasedABR=Boolean(d),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=c,this.useCueTags_=s,this.playlistExclusionDuration=u,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=l,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Xs(),this.mediaSource=new i.a.MediaSource,this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Wi(),this.hasPlayed_=!1,this.syncController_=new Fs(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Bs,this.sourceUpdater_=new Ds(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Us;const g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:h,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:o,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:f,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings};this.mainPlaylistLoader_="dash"===this.sourceType_?new ua(t,this.vhs_,this.requestOptions_):new Lo(t,this.vhs_,this.requestOptions_),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new ys(Vi(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new ys(Vi(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Ns(Vi(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function n(){r.off("vttjserror",i),e()}function i(){r.off("vttjsloaded",n),t()}r.one("vttjsloaded",n),r.one("vttjserror",i),r.addWebVttScript_()})}),e),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),Js.forEach(e=>{this[e+"_"]=eu.bind(this,e)}),this.logger_=Hi("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const v="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(v,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){const r=this.media(),i=r&&(r.id||r.uri),o=e.id||e.uri;i&&i!==o&&(this.logger_(`switch media ${i} -> ${o} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,n)}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=i.a.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(i.a.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const n=e.mediaGroups.AUDIO,r=Object.keys(n);let i;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{const e=n.main||r.length&&n[r[0]];for(const t in e)if(e[t].default){i={label:t};break}}if(!i)return t;const o=[];for(const a in n)if(n[a][i.label]){const t=n[a][i.label];if(t.playlists&&t.playlists.length)o.push.apply(o,t.playlists);else if(t.uri)o.push(t);else if(e.playlists.length)for(let n=0;n{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;vo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Ys({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;if(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!("vhs-json"===this.sourceType_&&this.initialMedia_.segments))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;vo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const n=e.mediaGroups||{};let r=!0;const i=Object.keys(n.AUDIO);for(const o in n.AUDIO)for(const e in n.AUDIO[o]){n.AUDIO[o][e].uri||(r=!1)}r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Zs.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine(),o=this.tech_.buffered();return tu({buffered:o,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:Qs}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e!==this.mainPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(()=>{Mi.browser.IE_VERSION||Mi.browser.IS_EDGE?this.tech_.setCurrentTime(this.tech_.currentTime()+.04):this.tech_.setCurrentTime(this.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime(){this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0)),this.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(e.end(0))}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const n=Zs.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=Ki;const o=i.end(i.length-1);return o-r<=Ki&&n-o<=Ki}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,i=r.filter(mo),o=1===i.length&&i[0]===e;if(1===r.length&&n!==1/0)return Mi.log.warn(`Problem encountered with playlist ${e.id}. `+"Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(o);if(o){let t=!1;r.forEach(n=>{if(n===e)return;const r=n.excludeUntil;"undefined"!==typeof r&&r!==1/0&&(t=!0,delete n.excludeUntil)}),t&&(Mi.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*n,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const s=this.selectPlaylist();if(!s)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const u=t.internal?this.logger_:Mi.log.warn,l=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.`+`${l} Switching to playlist ${s.id}.`),s.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),s.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const c=s.targetDuration/2*1e3||5e3,f="number"===typeof s.lastRequest&&Date.now()-s.lastRequest<=c;return this.switchMedia_(s,"exclude",o||f)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const n=[],r="all"===e;(r||"main"===e)&&n.push(this.mainPlaylistLoader_);const i=[];(r||"audio"===e)&&i.push("AUDIO"),(r||"subtitle"===e)&&(i.push("CLOSED-CAPTIONS"),i.push("SUBTITLES")),i.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),["main","audio","subtitle"].forEach(t=>{const r=this[`${t}SegmentLoader_`];!r||e!==t&&"all"!==e||n.push(r)}),n.forEach(e=>t.forEach(t=>{"function"===typeof e[t]&&e[t]()}))}setCurrentTime(e){const t=$i(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let n=this.syncController_.getExpiredTime(t,this.duration());if(null===n)return;const r=this.mainPlaylistLoader_.main,i=Zs.Playlist.seekable(t,n,Zs.Playlist.liveEdgeDelay(r,t));if(0===i.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,n,Zs.Playlist.liveEdgeDelay(r,t))).length)return}let o,a;this.seekable_&&this.seekable_.length&&(o=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>i.end(0)||i.start(0)>e.end(0)?this.seekable_=i:this.seekable_=Wi([[e.start(0)>i.start(0)?e.start(0):i.start(0),e.end(0)0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const n in t)t[n].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=Fa(this.main(),t),r={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||b.b),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||b.a}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||b.a,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const o={};let a;if(["video","audio"].forEach(function(t){if(r.hasOwnProperty(t)&&(n=e[t].isFmp4,i=r[t],!(n?Object(b.c)(i):Object(b.g)(i)))){const n=e[t].isFmp4?"browser":"muxer";o[n]=o[n]||[],o[n].push(r[t]),"audio"===t&&(a=n)}var n,i}),i&&a&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach(n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${r.audio}"`)}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const n=(Object(b.h)(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,i=(Object(b.h)(r[t]||"")[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const e=Object.keys(o).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${o[t].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{const r=e[n];if(-1!==t.indexOf(r.id))return;t.push(r.id);const i=Fa(this.main,r),o=[];!i.audio||Object(b.g)(i.audio)||Object(b.c)(i.audio)||o.push(`audio codec ${i.audio}`),!i.video||Object(b.g)(i.video)||Object(b.c)(i.video)||o.push(`video codec ${i.video}`),i.text&&"stpp.ttml.im1t"===i.text&&o.push(`text codec ${i.text}`),o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${o.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],n=this.main().playlists,r=ja(Object(b.h)(e)),i=La(r),o=r.video&&Object(b.h)(r.video)[0]||null,a=r.audio&&Object(b.h)(r.audio)[0]||null;Object.keys(n).forEach(e=>{const r=n[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);const s=[],u=Fa(this.mainPlaylistLoader_.main,r),l=La(u);if(u.audio||u.video){if(l!==i&&s.push(`codec count "${l}" !== "${i}"`),!this.sourceUpdater_.canChangeType()){const e=u.video&&Object(b.h)(u.video)[0]||null,t=u.audio&&Object(b.h)(u.audio)[0]||null;e&&o&&e.type.toLowerCase()!==o.type.toLowerCase()&&s.push(`video codec "${e.type}" !== "${o.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&s.push(`audio codec "${t.type}" !== "${a.type}"`)}s.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${s.join(" && ")}`))}})}updateAdCues_(e){let t=0;const n=this.seekable();n.length&&(t=n.start(0)),Rs(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=la.GOAL_BUFFER_LENGTH,n=la.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,la.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=la.BUFFER_LOW_WATER_LINE,n=la.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,la.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,la.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?i:r)}bufferHighWaterLine(){return la.BUFFER_HIGH_WATER_LINE}}const ru=(e,t,n)=>r=>{const i=e.main.playlists[t],o=ho(i),a=mo(i);return"undefined"===typeof r?a:(r?delete i.disabled:i.disabled=!0,r===a||o||(n(),r?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),r)};class iu{constructor(e,t,n){const{playlistController_:r}=e,i=r.fastQualityChange_.bind(r);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Fa(r.main(),t),this.playlist=t,this.id=n,this.enabled=ru(e.playlists,t.id,i)}}const ou=function(e){e.representations=()=>{const t=e.playlistController_.main(),n=_o(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(e=>!ho(e)).map((t,n)=>new iu(e,t,t.id)):[]}},au=["seeking","seeked","pause","playing","error"];class su{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Hi("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),o=()=>this.resetTimeUpdate_(),a=this.playlistController_,s=["main","subtitle","audio"],u={};s.forEach(e=>{u[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on("appendsdone",u[e].updateend),a[`${e}SegmentLoader_`].on("playlistupdate",u[e].reset),this.tech_.on(["seeked","seeking"],u[e].reset)});const l=e=>{["main","audio"].forEach(t=>{a[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(au,o),this.tech_.on("canplay",n),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(au,o),this.tech_.off("canplay",n),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),s.forEach(e=>{a[`${e}SegmentLoader_`].off("appendsdone",u[e].updateend),a[`${e}SegmentLoader_`].off("playlistupdate",u[e].reset),this.tech_.off(["seeked","seeking"],u[e].reset)}),this.checkCurrentTimeTimeout_&&i.a.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&i.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=i.a.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),i=eo(this[`${e}Buffered_`],r);this[`${e}Buffered_`]=r,i?this.resetSegmentDownloads_(e):(this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Ji(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ki>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let n;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)){n=e.end(e.length-1)}if(this.beforeSeekableWindow_(e,t)){const t=e.start(0);n=t+(t===e.end(0)?0:Ki)}if("undefined"!==typeof n)return this.logger_(`Trying to seek outside of seekable at time ${t} with `+`seekable range ${Qi(e)}. Seeking to `+`${n}.`),this.tech_.setCurrentTime(n),!0;const r=this.playlistController_.sourceUpdater_,i=this.tech_.buffered(),o=r.audioBuffer?r.audioBuffered():null,a=r.videoBuffer?r.videoBuffered():null,s=this.media(),u=s.partTargetDuration?s.partTargetDuration:2*(s.targetDuration-qi),l=[o,a];for(let f=0;f ${n.end(0)}]. Attempting to resume `+"playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to `+`live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const i=Gi(r,t);return i.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${i.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let i=e.end(e.length-1)+Ki;return!n.endList&&r&&(i=e.end(e.length-1)+3*n.targetDuration),t>i}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:e,end:i}}return null}}const uu={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},lu=function(e,t){let n=0,r=0;const i=Vi(uu,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const o=function(){r&&e.currentTime(r)},a=function(t){null!==t&&void 0!==t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",o),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},s=function(){if(Date.now()-n<1e3*i.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(i.getSource&&"function"===typeof i.getSource)return n=Date.now(),i.getSource.call(e,a);Mi.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},u=function(){e.off("loadedmetadata",o),e.off("error",s),e.off("dispose",u)};e.on("error",s),e.on("dispose",u),e.reloadSourceOnError=function(t){u(),lu(e,t)}},cu=function(e){lu(this,e)};var fu="3.0.2",du="6.3.0",pu="1.0.1",hu="6.0.0",mu="4.0.1";const gu={PlaylistLoader:Lo,Playlist:wo,utils:Yo,STANDARD_PLAYLIST_SELECTOR:Ka,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(wo.isEnabled);return Va(e,(e,t)=>Wa(e,t)),e.filter(e=>!!Fa(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:Ka,movingAverageBandwidthSelector:function(e){let t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const r=this.useDevicePixelRatio&&i.a.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),qa(this.playlists.main,t,parseInt(Ha(this.tech_.el(),"width"),10)*r,parseInt(Ha(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:Wa,comparePlaylistResolution:function(e,t){let n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||i.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),n===(r=r||i.a.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:Bo()};Object.keys(la).forEach(e=>{Object.defineProperty(gu,e,{get:()=>(Mi.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),la[e]),set(t){Mi.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!==typeof t||t<0?Mi.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):la[e]=t}})});const vu=function(e,t){const n=t.media();let r=-1;for(let i=0;i{e.addQualityLevel(t)}),vu(e,t.playlists)};gu.canPlaySource=function(){return Mi.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const bu=({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const i=((e,t)=>e.reduce((e,n)=>{if(!n.contentProtection)return e;const r=t.reduce((e,t)=>{const r=n.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]))(n?r.concat([n]):r,Object.keys(t)),o=[],a=[];return i.forEach(t=>{a.push(new Promise((t,n)=>{e.tech_.one("keysessioncreated",t)})),o.push(new Promise((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):n()})}))}),Promise.race([Promise.all(o),Promise.race(a)])},_u=({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{const i=((e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=ja(Object(b.h)(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);const i=Object(b.e)(r.video),o=Object(b.e)(r.audio),a={};for(const s in e)a[s]={},o&&(a[s].audioContentType=o),i&&(a[s].videoContentType=i),t.contentProtection&&t.contentProtection[s]&&t.contentProtection[s].pssh&&(a[s].pssh=t.contentProtection[s].pssh),"string"===typeof e[s]&&(a[s].url=e[s]);return Vi(e,a)})(t,n,r);return!!i&&(e.currentSource().keySystems=i,!(i&&!e.eme)||(Mi.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},wu=()=>{if(!i.a.localStorage)return null;const e=i.a.localStorage.getItem("videojs-vhs");if(!e)return null;try{return JSON.parse(e)}catch(t){return null}},Eu=e=>{if(!i.a.localStorage)return!1;let t=wu();t=t?Vi(t,e):e;try{i.a.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(n){return!1}return t},Su=e=>0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e;gu.supportsNativeHls=function(){if(!a.a||!a.a.createElement)return!1;const e=a.a.createElement("video");if(!Mi.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),gu.supportsNativeDash=!!(a.a&&a.a.createElement&&Mi.getTech("Html5").isSupported())&&/maybe|probably/i.test(a.a.createElement("video").canPlayType("application/dash+xml")),gu.supportsTypeNatively=e=>"hls"===e?gu.supportsNativeHls:"dash"===e&&gu.supportsNativeDash,gu.isSupported=function(){return Mi.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Tu=Mi.getComponent("Component");class Cu extends Tu{constructor(e,t,n){if(super(t,n.vhs),"number"===typeof n.initialBandwidth&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=Hi("VhsHandler"),t.options_&&t.options_.playerId){const e=Mi.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(a.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=a.a.fullscreenElement||a.a.webkitFullscreenElement||a.a.mozFullScreenElement||a.a.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(){if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!==typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=300),"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=wu();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=la.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===la.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{"undefined"!==typeof this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=Su(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=gu,this.options_.sourceType=Object(_.a)(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new nu(this.options_);const n=Vi({liveRangeSafeTimeDelta:Ki},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new su(n),this.playlistController_.on("error",()=>{const e=Mi.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!==typeof t||t.code?"string"===typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const r=this.options_.bufferBasedABR?gu.movingAverageBandwidthSelector(.55):gu.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=gu.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=i.a.navigator.connection||i.a.navigator.mozConnection||i.a.navigator.webkitConnection;if(this.options_.useNetworkInformationApi&&t){const n=1e3*t.downlink*1e3;e=n>=1e7&&e>=1e7?Math.max(e,n):n}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){Mi.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ji(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ji(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&Eu({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{ou(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=i.a.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),bu({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=_u({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{if("output-restricted"!==e.status)return;const t=this.playlistController_.main();if(!t||!t.playlists)return;const n=[];t.playlists.forEach(e=>{e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,n.push(e))}),n.length&&(Mi.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.',...n),this.playlistController_.fastQualityChange_())}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==Mi.browser.IE_VERSION&&t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=Mi.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{yu(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{vu(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":fu,"mux.js":du,"mpd-parser":pu,"m3u8-parser":hu,"aes-decrypter":mu}}version(){return this.constructor.version()}canChangeType(){return Ds.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&i.a.URL.revokeObjectURL&&(i.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Xo({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return Qo({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}const Ou={name:"videojs-http-streaming",VERSION:fu,canHandleSource(e,t={}){const n=Vi(Mi.options,t);return Ou.canPlayType(e.type,n)},handleSource(e,t,n={}){const r=Vi(Mi.options,n);return t.vhs=new Cu(e,t,r),t.vhs.xhr=Bo(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const n=Object(_.a)(e);if(!n)return"";const r=Ou.getOverrideNative(t);return!gu.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,n=!(Mi.browser.IS_ANY_SAFARI||Mi.browser.IS_IOS),{overrideNative:r=n}=t;return r}};Object(b.c)("avc1.4d400d,mp4a.40.2")&&Mi.getTech("Html5").registerSourceHandler(Ou,0),Mi.VhsHandler=Cu,Mi.VhsSourceHandler=Ou,Mi.Vhs=gu,Mi.use||Mi.registerComponent("Vhs",gu),Mi.options.vhs=Mi.options.vhs||{},Mi.getPlugin&&Mi.getPlugin("reloadSourceOnError")||Mi.registerPlugin("reloadSourceOnError",cu)}).call(this,n("3r9c"))},"8eQP":function(e,t,n){"use strict";t.__esModule=!0;var r,i,o=d(n("QbLZ")),a=d(n("iCc5")),s=d(n("FYw3")),u=d(n("mRg0")),l=n("q1tI"),c=d(l),f=d(n("KrAl"));function d(e){return e&&e.__esModule?e:{default:e}}var p=(i=r=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,e.apply(this,arguments))}return(0,u.default)(t,e),t.prototype.componentDidUpdate=function(){(0,this.props.handleParse)()},t.prototype.render=function(){var e=this.props,t=e.origin,n=e.prechecked,r=e.allowLogin,i=e.userRef,o=e.messengerAppId,a=e.pageId,s=e.children,u=e.size,l=e.centerAlign,f=e.skin;return c.default.createElement("div",{className:"fb-messenger-checkbox",messenger_app_id:o,page_id:a,size:u,origin:t,user_ref:i,prechecked:n,allow_login:r,skin:f,center_align:l},s)},t}(l.PureComponent),r.defaultProps={size:void 0,allowLogin:void 0,prechecked:void 0,userRef:void 0,children:void 0,origin:void 0,skin:void 0,centerAlign:void 0},i);t.default=(0,l.forwardRef)(function(e,t){return c.default.createElement(f.default,null,function(n){var r=n.handleParse;return c.default.createElement(p,(0,o.default)({},e,{handleParse:r,ref:t}))})})},"8gHz":function(e,t,n){var r=n("5K7Z"),i=n("eaoh"),o=n("UWiX")("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},"8iia":function(e,t,n){var r=n("QMMT"),i=n("RRc/");e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},"8oxB":function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&p())}function p(){if(!c){var e=s(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var n=1;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _(e){return(_="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})(e)}function w(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 E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e,t){for(var n=0;n=i&&(t.updateKey=s[0].notice.updateKey||s[0].notice.key,s.shift()),s.push({notice:t,holderCallback:n})),{notices:s}})},e.remove=function(t){e.setState(function(e){return{notices:e.notices.filter(function(e){return e.notice.key!==t})}})},e}var n,o,a;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&&O(e,t)}(t,r["Component"]),n=t,(o=[{key:"getTransitionName",value:function(){var e=this.props,t=e.prefixCls,n=e.animation,r=this.props.transitionName;return!r&&n&&(r="".concat(t,"-").concat(n)),r}},{key:"render",value:function(){var e=this,t=this.state.notices,n=this.props,r=n.prefixCls,o=n.className,a=n.closeIcon,l=n.style,f=t.map(function(n,o){var s=n.notice,l=n.holderCallback,c=Boolean(o===t.length-1&&s.updateKey),f=s.updateKey?s.updateKey:s.key,d=Object(u.a)(e.remove.bind(e,s.key),s.onClose),p=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o,s=function(o){function a(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,n,r));i.i18n=n.i18n||t.i18n||r.i18n||y(),i.namespaces="function"===typeof e?e(n):e||i.i18n.options&&i.i18n.options.defaultNS,"string"===typeof i.namespaces&&(i.namespaces=[i.namespaces]);var o=i.i18n&&i.i18n.options&&i.i18n.options.react||{};return i.options=T({},g(),o,t),i.getWrappedInstance=i.getWrappedInstance.bind(i),i}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,r["Component"]),C(a,[{key:"shouldComponentUpdate",value:function(e){return!this.options.usePureComponent||!function(e,t){if(f(e,t))return!0;if("object"!==("undefined"===typeof e?"undefined":l(e))||null===e||"object"!==("undefined"===typeof t?"undefined":l(t))||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i-1)p=this.props.i18nKey.split(this.i18n.options.nsSeparator)[0];this.t.ns&&(d["data-i18next-options"]=JSON.stringify({ns:p}))}return o&&(d.className=o),a&&(d.style=a),i.a.createElement.apply(this,[t,d].concat(f))}}]),t}();D.propTypes={className:a.a.string},D.defaultProps={className:""},D.contextTypes={i18n:a.a.object.isRequired,t:a.a.func.isRequired};var P=n("vM4K"),A=n.n(P),I=function(){function e(e,t){for(var n=0;n"+t+""));return j(r[0])}var F=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),I(t,[{key:"render",value:function(){var e=N({i18n:this.context.i18n,t:this.context.t},this.props),t=e.children,n=e.count,r=e.parent,o=e.i18nKey,a=e.i18n,s=e.t,u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["children","count","parent","i18nKey","i18n","t"]),l=s||a.t.bind(a),c=a.options&&a.options.react||{},f=void 0!==r?r:c.defaultTransParent,d=function e(t,n,r){return"[object Array]"!==Object.prototype.toString.call(n)&&(n=[n]),n.forEach(function(n,r){var o=""+r;if("string"===typeof n)t=""+t+n;else if(R(n))t=t+"<"+o+">"+e("",j(n),r+1)+"";else if(i.a.isValidElement(n))t=t+"<"+o+">";else if("object"===("undefined"===typeof n?"undefined":M(n))){var a=N({},n),s=a.format;delete a.format;var u=Object.keys(a);s&&1===u.length?t=t+"<"+o+">{{"+u[0]+", "+s+"}}":1===u.length?t=t+"<"+o+">{{"+u[0]+"}}":console&&console.warn&&console.warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",n)}else console&&console.warn&&console.warn("react-i18next: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",n)}),t}("",t),p=c.hashTransKey,h=o||(p?p(d):d),m=h?l(h,{interpolation:{prefix:"#$?",suffix:"?$#"},defaultValue:d,count:n}):d;if(c.exposeNamespace){var g="string"===typeof l.ns?l.ns:l.ns[0];if(o&&a.options&&a.options.nsSeparator&&o.indexOf(a.options.nsSeparator)>-1)g=o.split(a.options.nsSeparator)[0];l.ns&&(u["data-i18next-options"]=JSON.stringify({ns:g}))}return f?i.a.createElement(f,u,L(t,m,a)):L(t,m,a)}}]),t}();F.propTypes={count:a.a.number,parent:a.a.node,i18nKey:a.a.string,i18n:a.a.object,t:a.a.func},F.contextTypes={i18n:a.a.object.isRequired,t:a.a.func};var U=function(){function e(e,t){for(var n=0;n>>0}},"9rSQ":function(e,t,n){"use strict";var r=n("xTJ+");function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},A5Xg:function(e,t,n){var r=n("NsO/"),i=n("ar/p").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(t){return a.slice()}}(e):i(r(e))}},A8zu:function(e,t,n){e.exports=n("5biZ")},A90E:function(e,t,n){var r=n("6sVZ"),i=n("V6Ve"),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},AM7I:function(e,t,n){"use strict";var r=SyntaxError,i=Function,o=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(t){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(C){s=null}var u=function(){throw new o},l=s?function(){try{return arguments.callee,u}catch(e){try{return s(arguments,"callee").get}catch(t){return u}}}():u,c=n("H6wF")(),f=Object.getPrototypeOf||function(e){return e.__proto__},d={},p="undefined"===typeof Uint8Array?void 0:f(Uint8Array),h={"%AggregateError%":"undefined"===typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":c?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"===typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"===typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":d,"%Int8Array%":"undefined"===typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"===typeof JSON?JSON:void 0,"%Map%":"undefined"===typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&c?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?void 0:Promise,"%Proxy%":"undefined"===typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&c?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?f(""[Symbol.iterator]()):void 0,"%Symbol%":c?Symbol:void 0,"%SyntaxError%":r,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":o,"%Uint8Array%":"undefined"===typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?void 0:WeakSet},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=n("D3zA"),v=n("oNNP"),y=g.call(Function.call,Array.prototype.concat),b=g.call(Function.apply,Array.prototype.splice),_=g.call(Function.call,String.prototype.replace),w=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,T=function(e,t){var n,i=e;if(v(m,i)&&(i="%"+(n=m[i])[0]+"%"),v(h,i)){var s=h[i];if(s===d&&(s=function e(t){var n;if("%AsyncFunction%"===t)n=a("async function () {}");else if("%GeneratorFunction%"===t)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=a("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(n=f(i.prototype))}return h[t]=n,n}(i)),"undefined"===typeof s&&!t)throw new o("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new r("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');var n=function(e){var t=w(e,0,1),n=w(e,-1);if("%"===t&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var i=[];return _(e,E,function(e,t,n,r){i[i.length]=n?_(r,S,"$1"):t||e}),i}(e),i=n.length>0?n[0]:"",a=T("%"+i+"%",t),u=a.name,l=a.value,c=!1,f=a.alias;f&&(i=f[0],b(n,y([0,1],f)));for(var d=1,p=!0;d=n.length){var O=s(l,m);l=(p=!!O)&&"get"in O&&!("originalValue"in O.get)?O.get:l[m]}else p=v(l,m),l=l[m];p&&!c&&(h[u]=l)}}return l}},AMtu:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n("srD0");Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var i=n("0Prn");Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return i.isEmptyData}});var o=n("vUcc");Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return o.numToUint8}});var a=n("F5Rf");Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return a.uint32ArrayFrom}})},AP2z:function(e,t,n){var r=n("nmnc"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(u){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},AQMs:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n("D3pN"),i=n("W5Sr"),o=n("4Hbs"),a=n("AMtu"),s=function(){function e(e){this.secret=e,this.hash=new o.RawSha256,this.reset()}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(t){this.error=t}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,function(){return r.__generator(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new o.RawSha256,this.secret){this.outer=new o.RawSha256;var e=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(this.secret),t=new Uint8Array(i.BLOCK_SIZE);t.set(e);for(var n=0;n-1&&e%1==0&&e<=n}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?u.call(e):"";return t==i||t==o}(e)}(e)}(e)&&s.call(e,"callee")&&(!l.call(e,"callee")||u.call(e)==r)}},"AT/M":function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return r})},AUvm:function(e,t,n){"use strict";var r=n("5T2Y"),i=n("B+OT"),o=n("jmDH"),a=n("Y7ZC"),s=n("kTiW"),u=n("6/1s").KEY,l=n("KUxP"),c=n("29s/"),f=n("RfKB"),d=n("YqAc"),p=n("UWiX"),h=n("zLkG"),m=n("Zxgi"),g=n("R+7+"),v=n("kAMH"),y=n("5K7Z"),b=n("93I4"),_=n("JB68"),w=n("NsO/"),E=n("G8Mo"),S=n("rr1i"),T=n("oVml"),C=n("A5Xg"),O=n("vwuL"),x=n("mqlF"),k=n("2faE"),D=n("w6GO"),P=O.f,A=k.f,I=C.f,N=r.Symbol,M=r.JSON,R=M&&M.stringify,j=p("_hidden"),L=p("toPrimitive"),F={}.propertyIsEnumerable,U=c("symbol-registry"),B=c("symbols"),H=c("op-symbols"),V=Object.prototype,W="function"==typeof N&&!!x.f,q=r.QObject,K=!q||!q.prototype||!q.prototype.findChild,z=o&&l(function(){return 7!=T(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=P(V,t);r&&delete V[t],A(e,t,n),r&&e!==V&&A(V,t,r)}:A,$=function(e){var t=B[e]=T(N.prototype);return t._k=e,t},G=W&&"symbol"==typeof N.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof N},Y=function(e,t,n){return e===V&&Y(H,t,n),y(e),t=E(t,!0),y(n),i(B,t)?(n.enumerable?(i(e,j)&&e[j][t]&&(e[j][t]=!1),n=T(n,{enumerable:S(0,!1)})):(i(e,j)||A(e,j,S(1,{})),e[j][t]=!0),z(e,t,n)):A(e,t,n)},X=function(e,t){y(e);for(var n,r=g(t=w(t)),i=0,o=r.length;o>i;)Y(e,n=r[i++],t[n]);return e},Q=function(e){var t=F.call(this,e=E(e,!0));return!(this===V&&i(B,e)&&!i(H,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,j)&&this[j][e])||t)},Z=function(e,t){if(e=w(e),t=E(t,!0),e!==V||!i(B,t)||i(H,t)){var n=P(e,t);return!n||!i(B,t)||i(e,j)&&e[j][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=I(w(e)),r=[],o=0;n.length>o;)i(B,t=n[o++])||t==j||t==u||r.push(t);return r},ee=function(e){for(var t,n=e===V,r=I(n?H:w(e)),o=[],a=0;r.length>a;)!i(B,t=r[a++])||n&&!i(V,t)||o.push(B[t]);return o};W||(s((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(n){this===V&&t.call(H,n),i(this,j)&&i(this[j],e)&&(this[j][e]=!1),z(this,e,S(1,n))};return o&&K&&z(V,e,{configurable:!0,set:t}),$(e)}).prototype,"toString",function(){return this._k}),O.f=Z,k.f=Y,n("ar/p").f=C.f=J,n("NV0k").f=Q,x.f=ee,o&&!n("uOPS")&&s(V,"propertyIsEnumerable",Q,!0),h.f=function(e){return $(p(e))}),a(a.G+a.W+a.F*!W,{Symbol:N});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)p(te[ne++]);for(var re=D(p.store),ie=0;re.length>ie;)m(re[ie++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(U,e+="")?U[e]:U[e]=N(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in U)if(U[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),a(a.S+a.F*!W,"Object",{create:function(e,t){return void 0===t?T(e):X(T(e),t)},defineProperty:Y,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:J,getOwnPropertySymbols:ee});var oe=l(function(){x.f(1)});a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return x.f(_(e))}}),M&&a(a.S+a.F*(!W||l(function(){var e=N();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!G(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,R.apply(M,r)}}),N.prototype[L]||n("NegM")(N.prototype,L,N.prototype.valueOf),f(N,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},ApPD:function(e,t,n){var r=n("JB68"),i=n("U+KD");n("zn7N")("getPrototypeOf",function(){return function(e){return i(r(e))}})},Atq6:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n("iCc5")),i=l(n("V7oC")),o=l(n("FYw3")),a=l(n("mRg0")),s=l(n("q1tI")),u=l(n("17x9"));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){var e,n,i,a;(0,r.default)(this,t);for(var s=arguments.length,u=Array(s),l=0;l0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},BEI5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n("QbLZ")),i=d(n("iCc5")),o=d(n("V7oC")),a=d(n("FYw3")),s=d(n("mRg0")),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n("q1tI")),l=d(n("QDzw")),c=d(n("JQAH")),f=d(n("JMVr"));function d(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){(0,i.default)(this,t);var e=(0,a.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.scrollTo=function(){var t;return(t=e.listviewRef).scrollTo.apply(t,arguments)},e.getInnerViewNode=function(){return e.listviewRef.getInnerViewNode()},e}return(0,s.default)(t,e),(0,o.default)(t,[{key:"render",value:function(){var e=this,t=(0,c.default)(this.props,!1),n=t.restProps,i=t.extraProps;return u.createElement(l.default,(0,r.default)({ref:function(t){return e.listviewRef=t}},n,i))}}]),t}(u.Component);t.default=p,p.defaultProps={prefixCls:"am-list-view",listPrefixCls:"am-list"},p.DataSource=l.default.DataSource,p.IndexedList=f.default,e.exports=t.default},BETb:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultTabBar=void 0;var r=c(n("V7oC")),i=c(n("QbLZ")),o=c(n("iCc5")),a=c(n("FYw3")),s=c(n("mRg0")),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n("q1tI")),l=n("0nZY");function c(e){return e&&e.__esModule?e:{default:e}}var f=t.DefaultTabBar=function(e){function t(){return(0,o.default)(this,t),(0,a.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,s.default)(t,e),t}(l.DefaultTabBar);f.defaultProps=(0,i.default)({},l.DefaultTabBar.defaultProps,{prefixCls:"am-tabs-default-bar"});var d=function(e){function t(){(0,o.default)(this,t);var e=(0,a.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.renderTabBar=function(t){var n=e.props.renderTab;return u.createElement(f,(0,i.default)({},t,{renderTab:n}))},e}return(0,s.default)(t,e),(0,r.default)(t,[{key:"render",value:function(){return u.createElement(l.Tabs,(0,i.default)({renderTabBar:this.renderTabBar},this.props))}}]),t}(u.PureComponent);t.default=d,d.DefaultTabBar=f,d.defaultProps={prefixCls:"am-tabs"}},BFsH:function(e,t,n){"use strict";t.__esModule=!0,t.Fields=t.LoginStatus=t.MessengerColor=t.MessengerSize=t.CommentsOrderBy=t.LikeAction=t.ColorScheme=t.LikeLayout=t.LikeSize=t.SendToMessenger=t.MessengerCheckbox=t.MessageUs=t.CustomChat=t.Profile=t.Status=t.Subscribe=t.Group=t.Feed=t.CommentsCount=t.Comments=t.EmbeddedVideo=t.EmbeddedPost=t.LoginButton=t.Login=t.Page=t.ShareButton=t.Share=t.Send=t.Like=t.Initialize=t.Parser=t.FacebookProvider=void 0;var r=R(n("V8PK")),i=R(n("KrAl")),o=R(n("QcKL")),a=R(n("RXHi")),s=R(n("ZzZV")),u=R(n("O0p1")),l=R(n("HZH/")),c=R(n("kRo9")),f=R(n("4U6y")),d=R(n("xf+T")),p=R(n("vrJ/")),h=R(n("lN7P")),m=R(n("3+53")),g=R(n("ob1i")),v=R(n("+Rr8")),y=R(n("onUd")),b=R(n("sUP8")),_=R(n("SQZ2")),w=R(n("DGOD")),E=R(n("nvaz")),S=R(n("hd1h")),T=R(n("8eQP")),C=R(n("GFGy")),O=R(n("I/45")),x=R(n("evL1")),k=R(n("gLH3")),D=R(n("l/tl")),P=R(n("SgDx")),A=R(n("c+eJ")),I=R(n("Elc7")),N=R(n("qilP")),M=R(n("oWHo"));function R(e){return e&&e.__esModule?e:{default:e}}t.FacebookProvider=r.default,t.Parser=i.default,t.Initialize=o.default,t.Like=a.default,t.Send=s.default,t.Share=u.default,t.ShareButton=l.default,t.Page=c.default,t.Login=f.default,t.LoginButton=d.default,t.EmbeddedPost=p.default,t.EmbeddedVideo=h.default,t.Comments=m.default,t.CommentsCount=g.default,t.Feed=v.default,t.Group=y.default,t.Subscribe=b.default,t.Status=_.default,t.Profile=w.default,t.CustomChat=E.default,t.MessageUs=S.default,t.MessengerCheckbox=T.default,t.SendToMessenger=C.default,t.LikeSize=O.default,t.LikeLayout=x.default,t.ColorScheme=k.default,t.LikeAction=D.default,t.CommentsOrderBy=P.default,t.MessengerSize=A.default,t.MessengerColor=I.default,t.LoginStatus=N.default,t.Fields=M.default},"BGR+":function(e,t,n){"use strict";n.r(t);var r=n("QbLZ"),i=n.n(r);t.default=function(e,t){for(var n=i()({},e),r=0;r0&&void 0!==arguments[0]?arguments[0]:[{text:"\u786e\u5b9a"}],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ios",n=!1,s=document.createElement("div");function u(){i.unmountComponentAtNode(s),s&&s.parentNode&&s.parentNode.removeChild(s)}document.body.appendChild(s);var l=e.map(function(e){var t=e.onPress||function(){};return e.onPress=function(){if(!n){var e=t();e&&e.then?e.then(function(){n=!0,u()}).catch(function(){}):(n=!0,u())}},e});return i.render(r.createElement(a.default,{visible:!0,operation:!0,transparent:!0,prefixCls:"am-modal",transitionName:"am-zoom",closable:!1,maskClosable:!0,onClose:u,footer:l,maskTransitionName:"am-fade",className:"am-modal-operation",platform:t,wrapProps:{onTouchStart:function(e){/iPhone|iPod|iPad/i.test(navigator.userAgent)&&((0,o.default)(e.target,".am-modal-footer")||e.preventDefault())}}}),s),{close:u}};var r=u(n("q1tI")),i=u(n("i8i4")),o=s(n("24A9")),a=s(n("Ck2F"));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}e.exports=t.default},Cwc5:function(e,t,n){var r=n("NKxu"),i=n("Npjl");e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},CxY0:function(e,t,n){"use strict";var r=n("GYWy"),i=n("Nehr");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=b(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),f=["%","/","?",";","#"].concat(c),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n("s4NR");function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o127?N+="x":N+=I[M];if(!N.match(p)){var j=P.slice(0,x),L=P.slice(x+1),F=I.match(h);F&&(j.push(F[1]),L.unshift(F[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=r.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[E])for(x=0,A=c.length;x0)&&n.host.split("@"))&&(n.auth=D.shift(),n.host=n.hostname=D.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=S.slice(-1)[0],O=(n.host||e.host||S.length>1)&&("."===C||".."===C)||""===C,x=0,k=S.length;k>=0;k--)"."===(C=S[k])?S.splice(k,1):".."===C?(S.splice(k,1),x++):x&&(S.splice(k,1),x--);if(!w&&!E)for(;x--;x)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),O&&"/"!==S.join("/").substr(-1)&&S.push("");var D,P=""===S[0]||S[0]&&"/"===S[0].charAt(0);T&&(n.hostname=n.host=P?"":S.length?S.shift():"",(D=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=D.shift(),n.host=n.hostname=D.shift()));return(w=w||n.host&&S.length)&&!P&&S.unshift(""),S.length?n.pathname=S.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},D3Ub:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n("4d7F"),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e){return function(){var t=e.apply(this,arguments);return new o.default(function(e,n){return function r(i,a){try{var s=t[i](a),u=s.value}catch(l){return void n(l)}if(!s.done)return o.default.resolve(u).then(function(e){r("next",e)},function(e){r("throw",e)});e(u)}("next")})}}},D3pN:function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return o}),n.d(t,"__rest",function(){return a}),n.d(t,"__decorate",function(){return s}),n.d(t,"__param",function(){return u}),n.d(t,"__metadata",function(){return l}),n.d(t,"__awaiter",function(){return c}),n.d(t,"__generator",function(){return f}),n.d(t,"__createBinding",function(){return d}),n.d(t,"__exportStar",function(){return p}),n.d(t,"__values",function(){return h}),n.d(t,"__read",function(){return m}),n.d(t,"__spread",function(){return g}),n.d(t,"__spreadArrays",function(){return v}),n.d(t,"__await",function(){return y}),n.d(t,"__asyncGenerator",function(){return b}),n.d(t,"__asyncDelegator",function(){return _}),n.d(t,"__asyncValues",function(){return w}),n.d(t,"__makeTemplateObject",function(){return E}),n.d(t,"__importStar",function(){return S}),n.d(t,"__importDefault",function(){return T}),n.d(t,"__classPrivateFieldGet",function(){return C}),n.d(t,"__classPrivateFieldSet",function(){return O});var r=function(e,t){return(r=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])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function l(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}function f(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var e=[],t=0;t1||s(e,t)})})}function s(e,t){try{(n=i[e](t)).value instanceof y?Promise.resolve(n.value.v).then(u,l):c(o[0][2],n)}catch(r){c(o[0][3],r)}var n}function u(e){s("next",e)}function l(e){s("throw",e)}function c(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,i,(t=e[n](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function T(e){return e&&e.__esModule?e:{default:e}}function C(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function O(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},D3zA:function(e,t,n){"use strict";var r=n("aI7X");e.exports=Function.prototype.bind||r},D8kY:function(e,t,n){var r=n("Ojgd"),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},DBpT:function(e,t,n){e.exports=n("JbBM")},DDhV:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},DGOD:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i,o=g(n("14Xm")),a=g(n("D3Ub")),s=g(n("iCc5")),u=g(n("FYw3")),l=g(n("mRg0")),c=n("q1tI"),f=g(c),d=g(n("QcKL")),p=g(n("sUP8")),h=g(n("oWHo")),m=g(n("qilP"));function g(e){return e&&e.__esModule?e:{default:e}}var v=(i=r=function(e){function t(){var n,r,i,l=this;(0,s.default)(this,t);for(var c=arguments.length,f=Array(c),d=0;d-1?t.splice(n,1):t.push(e)}this.setActiveKey(t)}},{key:"getItems",value:function(){var e=this,t=this.state.activeKey,n=this.props,o=n.prefixCls,a=n.accordion,s=n.destroyInactivePanel,u=[];return r.Children.forEach(this.props.children,function(n,r){if(n){var l=n.key||String(r),c=n.props,f=c.header,d=c.headerClass,p=c.disabled,h=!1;h=a?t[0]===l:t.indexOf(l)>-1;var m={key:l,header:f,headerClass:d,isActive:h,prefixCls:o,destroyInactivePanel:s,openAnimation:e.state.openAnimation,accordion:a,children:n.props.children,onItemClick:p?null:function(){return e.onClickItem(l)}};u.push(i.a.cloneElement(n,m))}}),u}},{key:"setActiveKey",value:function(e){"activeKey"in this.props||this.setState({activeKey:e}),this.props.onChange(this.props.accordion?e[0]:e)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.style,a=t.accordion,s=u()((S(e={},n,!0),S(e,r,!!r),e));return i.a.createElement("div",{className:s,style:o,role:a?"tablist":null},this.getItems())}}]),t}();C.propTypes={children:a.a.any,prefixCls:a.a.string,activeKey:a.a.oneOfType([a.a.string,a.a.arrayOf(a.a.string)]),defaultActiveKey:a.a.oneOfType([a.a.string,a.a.arrayOf(a.a.string)]),openAnimation:a.a.object,onChange:a.a.func,accordion:a.a.bool,className:a.a.string,style:a.a.object,destroyInactivePanel:a.a.bool},C.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},C.Panel=y;var O=C;n.d(t,"Panel",function(){return x});t.default=O;var x=O.Panel},DOPR:function(e,t,n){e.exports=n("+plK")},DSRE:function(e,t,n){(function(e){var r=n("Kz5y"),i=n("B8du"),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(this,n("1/IK")(e))},DfZB:function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"Dw+G":function(e,t,n){var r=n("juv8"),i=n("mTTR");e.exports=function(e,t){return e&&r(t,i(t),e)}},"E+oP":function(e,t,n){var r=n("A90E"),i=n("QqLw"),o=n("03A+"),a=n("Z0cm"),s=n("MMmD"),u=n("DSRE"),l=n("6sVZ"),c=n("c6wG"),f="[object Map]",d="[object Set]",p=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||c(e)||o(e)))return!e.length;var t=i(e);if(t==f||t==d)return!e.size;if(l(e))return!r(e).length;for(var n in e)if(p.call(e,n))return!1;return!0}},E0u0:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(n("QDlc")),o=r(n("Qetd")),a=!0,s=!1,u=["altKey","bubbles","cancelable","ctrlKey","currentTarget","eventPhase","metaKey","shiftKey","target","timeStamp","view","type"];function l(e){return null===e||void 0===e}var c=[{reg:/^key/,props:["char","charCode","key","keyCode","which"],fix:function(e,t){l(e.which)&&(e.which=l(t.charCode)?t.keyCode:t.charCode),void 0===e.metaKey&&(e.metaKey=e.ctrlKey)}},{reg:/^touch/,props:["touches","changedTouches","targetTouches"]},{reg:/^hashchange$/,props:["newURL","oldURL"]},{reg:/^gesturechange$/i,props:["rotation","scale"]},{reg:/^(mousewheel|DOMMouseScroll)$/,props:[],fix:function(e,t){var n=void 0,r=void 0,i=void 0,o=t.wheelDelta,a=t.axis,s=t.wheelDeltaY,u=t.wheelDeltaX,l=t.detail;o&&(i=o/120),l&&(i=0-(l%3===0?l/3:l)),void 0!==a&&(a===e.HORIZONTAL_AXIS?(r=0,n=0-i):a===e.VERTICAL_AXIS&&(n=0,r=i)),void 0!==s&&(r=s/120),void 0!==u&&(n=-1*u/120),n||r||(r=i),void 0!==n&&(e.deltaX=n),void 0!==r&&(e.deltaY=r),void 0!==i&&(e.delta=i)}},{reg:/^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,props:["buttons","clientX","clientY","button","offsetX","relatedTarget","which","fromElement","toElement","offsetY","pageX","pageY","screenX","screenY"],fix:function(e,t){var n=void 0,r=void 0,i=void 0,o=e.target,a=t.button;return o&&l(e.pageX)&&!l(t.clientX)&&(r=(n=o.ownerDocument||document).documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===a||(e.which=1&a?1:2&a?3:4&a?2:0),!e.relatedTarget&&e.fromElement&&(e.relatedTarget=e.fromElement===o?e.toElement:e.fromElement),e}}];function f(){return a}function d(){return s}function p(e){var t=e.type,n="function"===typeof e.stopPropagation||"boolean"===typeof e.cancelBubble;i.default.call(this),this.nativeEvent=e;var r=d;"defaultPrevented"in e?r=e.defaultPrevented?f:d:"getPreventDefault"in e?r=e.getPreventDefault()?f:d:"returnValue"in e&&(r=e.returnValue===s?f:d),this.isDefaultPrevented=r;var o=[],a=void 0,l=void 0,p=u.concat();for(c.forEach(function(e){t.match(e.reg)&&(p=p.concat(e.props),e.fix&&o.push(e.fix))}),a=p.length;a;)this[l=p[--a]]=e[l];for(!this.target&&n&&(this.target=e.srcElement||document),this.target&&3===this.target.nodeType&&(this.target=this.target.parentNode),a=o.length;a;)(0,o[--a])(this,e);this.timeStamp=e.timeStamp||Date.now()}var h=i.default.prototype;(0,o.default)(p.prototype,h,{constructor:p,preventDefault:function(){var e=this.nativeEvent;e.preventDefault?e.preventDefault():e.returnValue=s,h.preventDefault.call(this)},stopPropagation:function(){var e=this.nativeEvent;e.stopPropagation?e.stopPropagation():e.cancelBubble=a,h.stopPropagation.call(this)}}),t.default=p,e.exports=t.default},E2B7:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nc;)n=u[c++],r&&!a.call(s,n)||f.push(e?[n,s[n]]:s[n]);return f}}},"EBr+":function(e,t,n){"use strict";n("oZKO"),n("B/wb"),n("x9YY")},EE2X:function(e,t,n){var r;e.exports=(r=n("q1tI"),function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return window.location.search.substring(1).split("&").map(function(t){var n=t.split("=");return n[0]===e?n[1]:null}).filter(function(e){return!!e})[0]}Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n.n(i),a=n(3),s=(n.n(a),function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];e.photoSwipe.items.length=0,t.forEach(function(t){e.photoSwipe.items.push(t)}),e.photoSwipe.invalidateCurrItems(),e.photoSwipe.updateSize(!0)},this.closePhotoSwipe=function(){e.photoSwipe&&e.photoSwipe.close()},this.handleClose=function(){var t=e.props.onClose;e.setState({isOpen:!1},function(){t&&t()})}};t.default=d,e.exports=t.default},EP9H:function(e,t,n){var r=n("5T2Y").parseFloat,i=n("oc46").trim;e.exports=1/r(n("5pKv")+"-0")!==-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},EXMj:function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},EYix:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={WrapComponent:"div",transitionName:"am-slide-up",maskTransitionName:"am-fade"},e.exports=t.default},EdU1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={okText:"\u786e\u5b9a",dismissText:"\u53d6\u6d88",extra:"\u8bf7\u9009\u62e9"},e.exports=t.default},EiQ3:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.clientWidth,n=getComputedStyle(e),r=n.paddingLeft,i=n.paddingRight;return t-parseFloat(r)-parseFloat(i)}},Elc7:function(e,t,n){"use strict";t.__esModule=!0,t.default={BLUE:"blue",WHITE:"white"}},EnHN:function(e,t,n){n("zn7N")("getOwnPropertyNames",function(){return n("A5Xg").f})},EpBk:function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},ExA7:function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},"F+2o":function(e,t,n){e.exports={default:n("2Nb0"),__esModule:!0}},F39V:function(e,t,n){var r=n("NtLt");e.exports=function(e){return r(e).replace(/\s(\w)/g,function(e,t){return t.toUpperCase()})}},F5Rf:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n-1&&(n.onTap(),r=!0);if(r){e.stopPropagation&&e.stopPropagation(),v=!0;var s=t.features.isOldAndroid?600:30;setTimeout(function(){v=!1},s)}},O=function(e,n,r){t[(r?"add":"remove")+"Class"](e,"pswp__"+n)},x=function(){var e=1===g.getNumItemsFn();e!==m&&(O(r,"ui--one-slide",e),m=e)},k=function(){O(u,"share-modal--hidden",S)},D=function(){return(S=!S)?(t.removeClass(u,"pswp__share-modal--fade-in"),setTimeout(function(){S&&k()},300)):(k(),setTimeout(function(){S||t.addClass(u,"pswp__share-modal--fade-in")},30)),S||A(),!1},P=function(t){var n=(t=t||window.event).target||t.srcElement;return e.shout("shareLinkClick",t,n),!!n.href&&(!!n.hasAttribute("download")||(window.open(n.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),S||D(),!1))},A=function(){for(var e,t,n,r,i,o="",a=0;a