!function(){var e="undefined"!=typeof window?window:global,t={};if(function(g,r,e){var t;function i(e){var t=0;return function(){return t>4&15).toString(16)+(15&e).toString(16)}(t=le.prototype).ra="",t.Ya="",t.qa="",t.ob=null,t.ia="",t.Oa="",t.toString=function(){var e,t=[],n=this.ra;return n&&t.push(z(n,W,!0),":"),(n=this.qa)&&(t.push("//"),(e=this.Ya)&&t.push(z(e,W,!0),"@"),t.push(encodeURIComponent(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.ob)&&t.push(":",String(n))),(n=this.ia)&&(this.qa&&"/"!=n.charAt(0)&&t.push("/"),t.push(z(n,"/"==n.charAt(0)?ee:Z,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.Oa)&&t.push("#",z(n,ne)),t.join("")},t.resolve=function(e){var t=this.clone();"data"===t.ra&&(t=new le);var n=!!e.ra;n?H(t,e.ra):n=!!e.Ya,n?t.Ya=e.Ya:n=!!e.qa,n?t.qa=e.qa:n=null!=e.ob;var r,i=e.ia;if(n)K(t,e.ob);else if(n=!!e.ia){if("/"!=i.charAt(0)&&(this.qa&&!this.ia?i="/"+i:-1!=(r=t.ia.lastIndexOf("/"))&&(i=t.ia.substr(0,r+1)+i)),".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var a=[],o=0;o=t.j){if(!t.c)throw new Re(De,de,fe);t.a=1,t.b=t.f}return(n=t.a,t.a++,0==n)?e.return():(r=t.b*(1+(2*Math.random()-1)*t.h),Se(e,new Promise(function(e){new ae(e).R(r/1e3)}),2))}t.b*=t.g,Ee(e)})}function ue(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:0}}function Re(e,t,n,r){for(var i=[],a=3;a=r.priority)&&(tt[e]={priority:n,He:t})}function $e(e,t){return{uris:e,method:"GET",body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null}}function Je(){this.a=0}function Qe(e,t,n){he.call(this,e,t),this.b=n}Re.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,UNKNOWN_DATA_URI_ENCODING:1005,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:fe,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_COULD_NOT_GUESS_MIME_TYPE:4021,HLS_MASTER_PLAYLIST_NOT_PROVIDED:4022,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,HLS_COULD_NOT_PARSE_SEGMENT_START_TIME:4030,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,HLS_AES_128_ENCRYPTION_NOT_SUPPORTED:4034,HLS_INTERNAL_SKIP_STREAM:4035,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,CS_IMA_SDK_MISSING:1e4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004},pe.prototype.resolve=function(){},pe.prototype.reject=function(){},he.prototype.abort=function(){return this.a=!0,this.c()},he.prototype.finally=function(e){return this.promise.then(function(){return e(!0)},function(){return e(!1)}),this},he.prototype.U=function(r,i){function e(n){return function(e){var t;o.a&&n?s.reject(u):(t=n?r:i)?a=function(e,t,n){try{var r=e(t);return r&&r.promise&&r.abort?(n.resolve(r.promise),function(){return r.abort()}):(n.resolve(r),function(){return Promise.resolve(r).then(function(){},function(){})})}catch(e){return n.reject(e),function(){return Promise.resolve()}}}(t,e,s):(n?s.resolve:s.reject)(e)}}function a(){return s.reject(u),o.abort()}var o=this,s=new pe,u=new Re(De,de,7001);return this.promise.then(e(!0),e(!1)),new he(s,function(){return a()})},C("shaka.util.AbortableOperation",he),he.prototype.chain=he.prototype.U,he.prototype.finally=he.prototype.finally,he.all=be,he.prototype.abort=he.prototype.abort,he.notAbortable=ge,he.completed=ye,he.aborted=ve,he.failed=me,C("shaka.util.BufferUtils",we),we.toDataView=Oe,we.toUint8=Le,we.toArrayBuffer=_e,we.equal=Te,je.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},je.prototype.stopImmediatePropagation=function(){this.a=!0},je.prototype.stopPropagation=function(){},Be.prototype.push=function(e,t){this.a.hasOwnProperty(e)?this.a[e].push(t):this.a[e]=[t]},Be.prototype.get=function(e){return(e=this.a[e])?e.slice():null},Be.prototype.remove=function(e,t){e in this.a&&(this.a[e]=this.a[e].filter(function(e){return e!=t}))},Fe.prototype.addEventListener=function(e,t){this.Cc.push(e,t)},Fe.prototype.removeEventListener=function(e,t){this.Cc.remove(e,t)},Fe.prototype.dispatchEvent=function(e){for(var t=this.Cc.get(e.type)||[],n=(t=xe(t)).next();!n.done;n=t.next()){n=n.value,e.target=this.Vb,e.currentTarget=this.Vb;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch(e){}if(e.a)break}return e.defaultPrevented},ze.prototype.destroy=function(){for(var e=[],t=xe(this.a),n=t.next();!n.done;n=t.next())(n=n.value).promise.catch(function(){}),e.push(n.abort());return this.a=[],Promise.all(e)},p(We,Fe),(t=We.prototype).Je=function(e){this.a.add(e)},t.bf=function(e){this.a.delete(e)},t.be=function(){this.a.clear()},t.Ke=function(e){this.b.add(e)},t.cf=function(e){this.b.delete(e)},t.ce=function(){this.b.clear()},t.destroy=function(){return this.f=!0,this.a.clear(),this.b.clear(),this.g.destroy()},t.request=function(r,e){var i=this,t=new Je;if(this.f){var n=Promise.reject(new Re(De,de,7001));return n.catch(function(){}),new Qe(n,function(){return Promise.resolve()},t)}e.method=e.method||"GET",e.headers=e.headers||{},e.retryParameters=e.retryParameters?Ve(e.retryParameters):ue(),e.uris=Ve(e.uris);var a=(n=function(e,t,n){for(var r=ye(void 0),i={},a=(e=xe(e.a)).next();!a.done;i={uc:i.uc},a=e.next())i.uc=a.value,r=r.U(function(e){return function(){return n.body&&(n.body=_e(n.body)),e.uc(t,n)}}(i));return r.U(void 0,function(e){if(e instanceof Re&&7001==e.code)throw e;throw new Re(De,1,1006,e)})}(this,r,e)).U(function(){return function n(r,i,a,o,s,u,c){var e=new le(a.uris[s]),t=e.ra,l=!1;t||(t=location.protocol,t=t.slice(0,-1),H(e,t),a.uris[s]=e.toString());t=t.toLowerCase();var d=(t=tt[t])?t.He:null;if(!d)return me(new Re(De,1,1e3,e));var f;return ge(se(o)).U(function(){return r.f?ve():(f=Date.now(),d(a.uris[s],a,i,function(e,t,n){r.c&&i==Ze&&(r.c(e,t),l=!0,c.a=n)}))}).U(function(e){return null==e.timeMs&&(e.timeMs=Date.now()-f),{response:e,Ae:l}},function(e){if(r.f)return ve();if(e instanceof Re){if(7001==e.code)throw e;if(e.code==fe)throw u;if(1==e.severity){var t=new je("retry",{error:e});return r.dispatchEvent(t),s=(s+1)%a.uris.length,n(r,i,a,o,s,e,c)}}throw e})}(i,r,e,new oe(e.retryParameters,!1),0,null,t)}),o=a.U(function(e){return function(e,n,r){for(var t=ye(void 0),i={},a=(e=xe(e.b)).next();!a.done;i={vc:i.vc},a=e.next())i.vc=a.value,t=t.U(function(t){return function(){var e=r.response;return e.data&&(e.data=_e(e.data)),t.vc(n,e)}}(i));return t.U(function(){return r},function(e){var t=De;if(e instanceof Re){if(7001==e.code)throw e;t=e.severity}throw new Re(t,1,1007,e)})}(i,r,e)}),s=Date.now(),u=0;n.promise.then(function(){u=Date.now()-s},function(){});var c=0;a.promise.then(function(){c=Date.now()},function(){});var l=o.U(function(e){var t=Date.now()-c,n=e.response;return n.timeMs+=u,n.timeMs+=t,e.Ae||!i.c||n.fromCache||r!=Ze||i.c(n.timeMs,n.data.byteLength),n},function(e){throw e&&(e.severity=De),e}),n=new Qe(l.promise,function(){return l.abort()},t);return Xe(this.g,n),n},C("shaka.net.NetworkingEngine",We),We.prototype.request=We.prototype.request,We.prototype.destroy=We.prototype.destroy,We.makeRequest=$e,We.defaultRetryParameters=ue,We.prototype.clearAllResponseFilters=We.prototype.ce,We.prototype.unregisterResponseFilter=We.prototype.cf,We.prototype.registerResponseFilter=We.prototype.Ke,We.prototype.clearAllRequestFilters=We.prototype.be,We.prototype.unregisterRequestFilter=We.prototype.bf,We.prototype.registerRequestFilter=We.prototype.Je,We.unregisterScheme=function(e){delete tt[e]},We.registerScheme=Ye,We.NumBytesRemainingClass=Je,p(Qe,he),We.PendingRequest=Qe;var Ze=1;We.RequestType={MANIFEST:0,SEGMENT:Ze,LICENSE:2,APP:3,TIMING:4};var et=3;We.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:et};var tt={};function nt(e){this.a=!1,this.b=new pe,this.c=e}function rt(e,t){if(e.a){if(t instanceof Re&&7003==t.code)throw t;throw new Re(De,de,7003,t)}}function it(){this.a=new Be}function at(e,t,n,r){this.target=e,this.type=t,this.listener=n,this.a=function(e,t){if(null==t)return!1;if("boolean"==typeof t)return t;var n=new Set(["passive","capture"]);return Object.keys(t).filter(function(e){return!n.has(e)}),function(e){var t=ot;if(null==t){t=!1;try{var n={},r={get:function(){return!(t=!0)}};Object.defineProperty(n,"passive",r),Object.defineProperty(n,"capture",r),r=function(){},e.addEventListener("test",r,n),e.removeEventListener("test",r,n)}catch(e){t=!1}ot=t}return t}(e)?t:t.capture||!1}(e,r),this.target.addEventListener(t,n,this.a)}nt.prototype.destroy=function(){var e=this;return this.a?this.b:(this.a=!0,this.c().then(function(){e.b.resolve()},function(){e.b.resolve()}))},(t=it.prototype).release=function(){this.Wa(),this.a=null},t.o=function(e,t,n,r){this.a&&(e=new at(e,t,n,r),this.a.push(t,e))},t.ha=function(n,r,i,e){var a=this;this.o(n,r,function e(t){a.oa(n,r,e),i(t)},e)},t.oa=function(e,t,n){if(this.a)for(var r=this.a.get(t)||[],i=(r=xe(r)).next();!i.done;i=r.next())(i=i.value).target!=e||n!=i.listener&&n||(i.oa(),this.a.remove(t,i))},t.Wa=function(){if(this.a){var e,t=this.a,n=[];for(e in t.a)n.push.apply(n,ce(t.a[e]));for(n=(t=xe(n)).next();!n.done;n=t.next())n.value.oa();this.a.a={}}},C("shaka.util.EventManager",it),it.prototype.removeAll=it.prototype.Wa,it.prototype.unlisten=it.prototype.oa,it.prototype.listenOnce=it.prototype.ha,it.prototype.listen=it.prototype.o,it.prototype.release=it.prototype.release,at.prototype.oa=function(){this.target.removeEventListener(this.type,this.listener,this.a),this.listener=this.target=null,this.a=!1};var ot=void 0;function st(){}function ut(e){return new le(e=Bt(e)).qa}function ct(e,t,n){function r(e){Oe(a).setUint32(o,e.byteLength,!0),o+=4,a.set(Le(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new Re(De,6,6015);var i="string"==typeof t?Vt(t,!0):t;e=Vt(e=Bt(e),!0);var a=new Uint8Array(12+e.byteLength+i.byteLength+n.byteLength),o=0;return r(e),r(i),r(n),a}function lt(e){this.b=e,this.a=void 0}function dt(e,t){this.a=e,this.b=t}function ft(e,t){var n=new dt(4,0),r=mt.a,i=n.b-r.b;(0<(n.a-r.a||i)?mt.c:mt.b)(mt.a,n,e,t)}function pt(e,t,n,r){Ce([n,"has been deprecated and will be removed in",t,". We are currently at version",e,". Additional information:",r].join(" "))}function ht(e,t,n,r){L([n,"has been deprecated and has been removed in",t,". We are now at version",e,". Additional information:",r].join(""))}C("shaka.util.FairPlayUtils",st),st.initDataTransform=ct,st.defaultGetContentId=ut,lt.prototype.value=function(){return null==this.a&&(this.a=this.b()),this.a},dt.prototype.toString=function(){return"v"+this.a+"."+this.b};var mt=null;function vt(e,t){return e.concat(t)}function yt(){}function gt(e){return null!=e}function bt(e){var t=Object.create(e.prototype||Object.prototype);return(e=e.call(t))||(ft("Factories requiring new","Factories should be plain functions"),e=t),e}function wt(e,t){if(0==t.length)return e;var n=t.map(function(e){return new le(e)});return e.map(function(e){return new le(e)}).map(function(t){return n.map(function(e){return t.resolve(e)})}).reduce(vt,[]).map(function(e){return e.toString()})}function Tt(e,t){return{keySystem:e,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:t||[],keyIds:new Set}}var xt={Ba:"video",cb:"audio",$:"text",pf:"image",ff:"application"};function St(e){for(var t=new Map,n=xe(Object.keys(e)),r=n.next();!r.done;r=n.next())r=r.value,t.set(r,e[r]);return t}function Et(e){var n={};return e.forEach(function(e,t){n[t]=e}),n}function It(e,t){var n=e;return t&&(n+='; codecs="'+t+'"'),n}function At(e){var t=(e=e.split("."))[0];return e.pop(),[t,e.join(".")]}var kt=(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");function Mt(){return!(!g.MediaSource||!MediaSource.isTypeSupported)}function Ct(e){return""!=Pt().canPlayType(e)}function Nt(){return!!navigator.vendor&&navigator.vendor.includes("Apple")&&!Dt("Tizen")}function Rt(){if(!Nt())return null;var e=navigator.userAgent.match(/Version\/(\d+)/);return(e=e||navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null}function Dt(e){return(navigator.userAgent||"").includes(e)}function Pt(){return Lt||(_t=_t||new ae(function(){Lt=null}),(Lt=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Lt=document.createElement("video")),_t.R(1),Lt)}var _t=null,Lt=null;function Ot(){}function Ut(e){if(!e)return"";239==(e=Le(e))[0]&&187==e[1]&&191==e[2]&&(e=e.subarray(3)),e=Ht(e),e=escape(e);try{return decodeURIComponent(e)}catch(e){throw new Re(De,2,2004)}}function jt(e,t,n){if(!e)return"";if(!n&&0!=e.byteLength%2)throw new Re(De,2,2004);var r=Math.floor(e.byteLength/2);n=new Uint16Array(r),e=Oe(e);for(var i=(r=xe(F(r))).next();!i.done;i=r.next())n[i=i.value]=e.getUint16(2*i,t);return Ht(n)}function Bt(e){function t(e){return n.byteLength<=e||32<=n[e]&&n[e]<=126}if(!e)return"";var n=Le(e);if(239==n[0]&&187==n[1]&&191==n[2])return Ut(n);if(254==n[0]&&255==n[1])return jt(n.subarray(2),!1);if(255==n[0]&&254==n[1])return jt(n.subarray(2),!0);if(0==n[0]&&0==n[2])return jt(e,!1);if(0==n[1]&&0==n[3])return jt(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return Ut(e);throw new Re(De,2,2003)}function Ft(e){e=encodeURIComponent(e);var t=unescape(e);e=new Uint8Array(t.length);for(var n=(t=xe(Ne(t))).next();!n.done;n=t.next())e[(n=n.value).Y]=n.item.charCodeAt(0);return _e(e)}function Vt(e,t){for(var n=new ArrayBuffer(2*e.length),r=new DataView(n),i=xe(Ne(e)),a=i.next();!a.done;a=i.next())a=a.value,r.setUint16(2*a.Y,a.item.charCodeAt(0),t);return n}function Ht(e){return Kt.value()(e)}C("shaka.util.StringUtils",Ot),Ot.resetFromCharCode=function(){Kt.a=void 0},Ot.toUTF16=Vt,Ot.toUTF8=Ft,Ot.fromBytesAutoDetect=Bt,Ot.fromUTF16=jt,Ot.fromUTF8=Ut;var Kt=new lt(function(){function e(e){try{var t=new Uint8Array(e);return 0e.end(e.length-1))&&t+n>=e.start(0)}function In(e,t){if(!e||!e.length||1==e.length&&e.end(0)-e.start(0)<1e-6)return 0;for(var n=0,r=xe(An(e)),i=r.next();!i.done;i=r.next()){var a=i.value,i=a.start;t<(a=a.end)&&(n+=a-Math.max(i,t))}return n}function An(e){if(!e)return[];for(var t=[],n=xe(F(e.length)),r=n.next();!r.done;r=n.next())r=r.value,t.push({start:e.start(r),end:e.end(r)});return t}function kn(){var t=this;this.a=new muxjs.mp4.Transmuxer({keepOriginalTimestamps:!0}),this.b=null,this.h=[],this.c=[],this.g=[],this.f=!1,this.a.on("data",function(e){t.c=e.captions,t.g=e.metadata,t.h.push($t(e.initSegment,e.data))}),this.a.on("done",function(){var e={data:$t.apply(qt,ce(t.h)),captions:t.c,metadata:t.g};t.b.resolve(e),t.f=!1})}function Mn(e,t){if(!g.muxjs||"mp2t"!=e.toLowerCase().split(";")[0].split("/")[1])return!1;if(t)return MediaSource.isTypeSupported(Cn(t,e));var n=Cn("audio",e),r=Cn("video",e);return MediaSource.isTypeSupported(n)||MediaSource.isTypeSupported(r)}function Cn(e,t){var n=t.replace(/mp2t/i,"mp4");"audio"==e&&(n=n.replace("video","audio"));var r,i,a,o=/avc1\.(66|77|100)\.(\d+)/.exec(n);return o&&(a="avc1.",a=("66"==(r=o[1])?a+"4200":"77"==r?a+"4d00":a+"6400")+((i=Number(o[2]))>>4).toString(16),a+=(15&i).toString(16),n=n.replace(o[0],a)),n}function Nn(e,t,n){this.startTime=e,this.direction=On,this.endTime=t,this.payload=n,this.region=new qn,this.position=null,this.positionAlign=Rn,this.size=0,this.textAlign=Dn,this.writingMode=Un,this.lineInterpretation=jn,this.line=null,this.lineHeight="",this.lineAlign=Bn,this.displayAlign=_n,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="",this.fontWeight=Vn,this.fontStyle=Hn,this.linePadding=this.letterSpacing=this.fontFamily="",this.opacity=1,this.textDecoration=[],this.wrapLine=!0,this.id="",this.nestedCues=[],this.spacer=!1,this.cellResolution={columns:32,rows:15}}Tn.prototype.init=function(e){var t=muxjs.mp4.probe;e=Le(e),this.g=t.videoTrackIds(e),this.f=t.timescale(e),this.a.init()},Tn.prototype.b=function(e,t){var n=Le(e);(n=this.a.parse(n,this.g,this.f))&&n.captions&&t(n.captions),this.a.clearParsedCaptions()},Tn.prototype.c=function(){this.a.resetCaptionStream()},xn.prototype.init=function(){},xn.prototype.b=function(){},xn.prototype.c=function(){},kn.prototype.destroy=function(){return this.a.dispose(),this.a=null,Promise.resolve()},C("shaka.text.Cue",Nn);var Rn="auto";Nn.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Rn};var Dn="center",Pn={LEFT:"left",RIGHT:"right",CENTER:Dn,START:"start",END:"end"};Nn.textAlign=Pn;var _n="after",Ln={BEFORE:"before",CENTER:"center",AFTER:_n};Nn.displayAlign=Ln;var On="ltr";Nn.direction={HORIZONTAL_LEFT_TO_RIGHT:On,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Un="horizontal-tb";Nn.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Un,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var jn=0;Nn.lineInterpretation={LINE_NUMBER:jn,PERCENTAGE:1};var Bn="start",Fn={CENTER:"center",START:Bn,END:"end"};Nn.lineAlign=Fn;var Vn=400;Nn.fontWeight={NORMAL:Vn,BOLD:700};var Hn="normal",Kn={NORMAL:Hn,ITALIC:"italic",OBLIQUE:"oblique"};function qn(){this.id="",this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Gn,this.scroll=zn}Nn.fontStyle=Kn,Nn.textDecoration={UNDERLINE:"underline",LINE_THROUGH:"lineThrough",OVERLINE:"overline"},C("shaka.text.CueRegion",qn);var Gn=1;qn.units={PX:0,PERCENTAGE:Gn,LINES:2};var zn="";function Xn(e){this.l=null,this.c=e,this.f=this.v=0,this.g=1/0,this.b=this.a=null,this.j="",this.h=new Map}function Wn(e){return!!($n[e]||g.muxjs&&"application/cea-608"==e)}function Yn(e,t,n,r,i){for(var a=n+" "+r,o=new Map,s=(t=xe(t)).next();!s.done;s=t.next()){var u=s.value,s=u.stream;o.has(s)||o.set(s,new Map),o.get(s).has(a)||o.get(s).set(a,[]),u.startTime+=i,u.endTime+=i,u.startTime>=e.f&&u.startTime=r.b||(t<=r.a&&n>=r.b?r.a=r.b=null:t<=r.a&&nr.a&&n>=r.b&&(r.b=t)),Ee(e)})},C("shaka.text.TextEngine",Xn),Xn.prototype.destroy=Xn.prototype.destroy,Xn.unregisterParser=function(e){delete $n[e]},Xn.registerParser=function(e,t){$n[e]=t};var $n={};function Jn(e,t,n,r){var i,a,o,c=this;this.a=e,this.h=n,this.f={},this.c=null,this.C=r||function(){},this.g={},this.b=new it,this.l={},this.v=t,this.w=new pe,this.j=(a=(i=this).w,o=new MediaSource,i.b.ha(o,"sourceopen",a.resolve),i.a.src=pr(o),o),this.D=new nt(function(){return t=c,Me(function(e){if(1==e.a){for(r in n=[],t.g)for(i=t.g[r],a=i[0],t.g[r]=i.slice(0,1),a&&n.push(a.p.catch(yt)),o=xe(i.slice(1)),s=o.next();!s.done;s=o.next())s.value.p.reject(new Re(De,de,7003,void 0));for(u in t.c&&n.push(t.c.destroy()),t.h&&n.push(t.h.destroy()),t.l)n.push(t.l[u].destroy());return Se(e,Promise.all(n),2)}t.b&&(t.b.release(),t.b=null),t.a&&(t.a.removeAttribute("src"),t.a.load(),t.a=null),t.j=null,t.c=null,t.h=null,t.f={},t.l={},t.v=null,t.g={},Ee(e)});var t,n,r,i,a,o,s,u})}function Qn(e){var r,i,t=It(e.mimeType,e.codecs),n=(i=[(r=e).mimeType],kt.forEach(function(e,t){var n=r[t];n&&i.push(e+'="'+n+'"')}),i.join(";"));return Wn(t)||MediaSource.isTypeSupported(n)||Mn(t,e.type)}function Zn(e,t){e.c||(e.c=new Xn(e.h)),"application/cea-608"!=t&&(e.c.l=bt($n[t]))}function er(e){return!e.j||"ended"==e.j.readyState}function tr(e,t){var n="text"==t?e.c.a:!(n=rr(e,t))||1==n.length&&n.end(0)-n.start(0)<1e-6?null:1==n.length&&n.start(0)<0?0:n.length?n.start(0):null;return n}function nr(e,t){return"text"==t?e.c.b:Sn(rr(e,t))}function rr(e,t){try{return e.f[t].buffered}catch(e){return null}}function ir(u,c,l,d,f,p){var h,m,v,y;return Me(function(e){return 1==e.a?c==(h=xt).$?Se(e,(t=u.c,n=l,r=d,i=f,Me(function(e){return 1==e.a?Se(e,Promise.resolve(),2):t.l&&t.c?null==r||null==i?(t.l.parseInit(Le(n)),e.return()):(a={periodStart:t.v,segmentStart:r,segmentEnd:i},o=t.l.parseMedia(Le(n),a),s=o.filter(function(e){return e.startTime>=t.f&&e.startTime=i*r.bandwidth/this.i.bandwidthDowngradeTarget&&t<=a&&(n=r)}return this.f=Date.now(),n},t.enable=function(){this.c=!0},t.disable=function(){this.c=!1},t.segmentDownloaded=function(e,t){var n,r,i=this.a;if(t<16e3||(n=8e3*t/e,r=e/1e3,i.a+=t,R(i.b,r,n),R(i.c,r,n)),null!=this.f&&this.c)e:{if(this.j){if(Date.now()-this.f<1e3*this.i.switchInterval)break e}else{if(!(128e3<=this.a.a))break e;this.j=!0}i=this.chooseVariant(),this.a.getBandwidthEstimate(this.i.defaultBandwidthEstimate),i&&this.h(i)}},t.getBandwidthEstimate=function(){return this.a.getBandwidthEstimate(this.i.defaultBandwidthEstimate)},t.setVariants=function(e){this.b=e},t.playbackRateChanged=function(e){this.g=e},t.configure=function(e){this.i=e},C("shaka.abr.SimpleAbrManager",Lr),Lr.prototype.configure=Lr.prototype.configure,Lr.prototype.playbackRateChanged=Lr.prototype.playbackRateChanged,Lr.prototype.setVariants=Lr.prototype.setVariants,Lr.prototype.getBandwidthEstimate=Lr.prototype.getBandwidthEstimate,Lr.prototype.segmentDownloaded=Lr.prototype.segmentDownloaded,Lr.prototype.disable=Lr.prototype.disable,Lr.prototype.enable=Lr.prototype.enable,Lr.prototype.chooseVariant=Lr.prototype.chooseVariant,Lr.prototype.init=Lr.prototype.init,Lr.prototype.stop=Lr.prototype.stop,Ur.prototype.add=function(e){return!!jr(this.a,e)&&(this.b.add(e),!0)},Ur.prototype.values=function(){return this.b.values()},Vr.prototype.create=function(e){var t=this,n=e.filter(function(e){return jr(t.a,e)});return n.length?new Ur(n[0],n):this.b.create(e)},Hr.prototype.create=function(e){var t,n,r,i=[];t=e,n=this.f,i=(r=wr(yr(n),t.map(br)))?t.filter(function(e){return r==br(e)}):[];var a,o,s,u,c,l=e.filter(function(e){return e.primary}),i=i.length?i:l.length?l:e;for(this.c&&(a=i,o=this.c,s=this.g,(e=a.filter(function(e){if(s){var t=e[s];return t&&t.roles.includes(o)}return t=e.audio,e=e.video,t&&t.roles.includes(o)||e&&e.roles.includes(o)})).length&&(i=e)),this.a&&((e=Rr(i,this.a)).length&&(i=e)),this.b&&(u=i,c=this.b,(e=u.filter(function(e){return!!e.audio&&e.audio.label.toLowerCase()==c.toLowerCase()})).length&&(i=e)),e=new Ur(i[0]),l=(i=xe(i)).next();!l.done;l=i.next())l=l.value,jr(e.a,l)&&e.add(l);return e};var Gr=0,zr=1;function Xr(){}function Wr(s,u,c,l){var d,f,p,h;return Me(function(e){if(1==e.a)return l&&(d=$r[l.toLowerCase()])?e.return(d):(f=Yr(s))&&(p=Jr[f])?e.return(p):l?e.u(2):Se(e,(t=s,n=u,r=c,Me(function(e){return 1==e.a?((i=$e([t],r)).method="HEAD",Se(e,n.request(0,i).promise,2)):(a=e.b,o=a.headers["content-type"],e.return(o?o.toLowerCase().split(";").shift():""))})),3);var t,n,r,i,a,o;if(2!=e.a&&(l=e.b)&&(h=$r[l]))return e.return(h);throw new Re(De,4,4e3,s)})}function Yr(e){return 1==(e=new le(e).ia.split("/").pop().split(".")).length?"":e.pop().toLowerCase()}C("shaka.media.ManifestParser",Xr),Xr.unregisterParserByMime=function(e){delete $r[e]},Xr.registerParserByMime=function(e,t){$r[e]=t},Xr.registerParserByExtension=function(e,t){Jr[e]=t};var $r={},Jr={};function Qr(e){var t=this;this.a=e,this.f=!1,this.b=this.a.dc(),this.c=new ae(function(){t.a.Dd(.25*t.b)})}function Zr(e){e.c.stop();var t=e.f?0:e.b;if(0<=t)try{return void(e.a.dc()!=t&&e.a.fd(t))}catch(e){}e.c.xa(.25),0!=e.a.dc()&&e.a.fd(0)}function ei(e,t,n){this.c=e,this.b=t,this.a=n}function ti(e,t,n,r,i,a,o,s,u){this.startTime=e,this.endTime=t,this.c=n,this.b=r,this.a=i,this.f=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=u}function ni(e,t,n){this.f=e,this.kc=t,this.h=this.g=1/0,this.a=1,this.b=this.c=null,this.j=0,this.l=!0,this.v=0,this.w=void 0===n||n}function ri(e,t){this.g=e,this.h=ai(e),this.a=e.a.currentTime,this.f=Date.now()/1e3,this.b=!1,this.j=t,this.c=function(){}}function ii(e){this.a=e}function ai(e){if(e.a.paused||0==e.a.playbackRate||0==e.a.buffered.length)var t=!1;else e:{t=e.a.currentTime;for(var n=(e=xe(An(e.a.buffered))).next();!n.done;n=e.next())if(!(t<(n=n.value).start||t>n.end-.5)){t=!0;break e}t=!1}return t}function oi(e,t,n,r,i){var a=this;this.a=e,this.w=t,this.i=n,this.v=i,this.b=new it,this.j=!1,this.l=e.readyState,this.f=!1,this.c=r,this.h=!1,this.b.o(e,"waiting",function(){return si(a)}),this.g=new ae(function(){si(a)}).xa(.25)}function si(e){if(0!=e.a.readyState){if(e.a.seeking){if(!e.j)return}else e.j=!1;var t,n,r,i,a,o,s;e.a.paused||(e.a.readyState!=e.l&&(e.f=!1,e.l=e.a.readyState),a=e.i.smallGapLimit,r=e.a.currentTime,null==(n=function(e,r){if(!e||!e.length||1==e.length&&e.end(0)-e.start(0)<1e-6)return null;var i=Dt("Edge/")||Dt("Trident/")||Dt("Tizen")||Dt("CrKey")?.5:.1,t=An(e).findIndex(function(e,t,n){return e.start>r&&(0==t||n[t-1].end-r<=i)});return 0<=t?t:null}(t=e.a.buffered,r))?e.c&&(n=ai(t=(e=e.c).g),s=t.a.currentTime,r=Date.now()/1e3,e.a==s&&e.h==n||(e.f=r,e.a=s,e.h=n,e.b=!1),(s=r-e.f)>=e.j&&n&&!e.b&&(e.c(e.a,s),e.b=!0,e.a=t.a.currentTime)):0==n&&!e.h||(s=t.start(n))>=e.w.Da()||(a=(i=s-r)<=a,o=!1,i<.001||(a||e.f||(e.f=!0,(r=new je("largegap",{currentTime:r,gapSize:i})).cancelable=!0,e.v(r),e.i.jumpLargeGaps&&!r.defaultPrevented&&(o=!0)),!a&&!o)||(0!=n&&t.end(n-1),e.a.currentTime=s)))}}function ui(e,t,n,r){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?r():(t=ci.get(t),n.ha(e,t,r))}Qr.prototype.release=function(){this.c&&(this.c.stop(),this.c=null),this.a=null},Qr.prototype.set=function(e){this.b=e,Zr(this)},ei.prototype.Ic=function(){return this.b},ei.prototype.Hc=function(){return this.a},C("shaka.media.InitSegmentReference",ei),ei.prototype.getEndByte=ei.prototype.Hc,ei.prototype.getStartByte=ei.prototype.Ic,ti.prototype.ve=function(){return this.startTime},ti.prototype.ie=function(){return this.endTime},ti.prototype.Ic=function(){return this.b},ti.prototype.Hc=function(){return this.a},C("shaka.media.SegmentReference",ti),ti.prototype.getEndByte=ti.prototype.Hc,ti.prototype.getStartByte=ti.prototype.Ic,ti.prototype.getEndTime=ti.prototype.ie,ti.prototype.getStartTime=ti.prototype.ve,(t=ni.prototype).getDuration=function(){return this.g},t.ne=function(){return this.a},t.wa=function(e){this.g=e},t.ue=function(){return this.f},t.Nd=function(e){this.j=e},t.Nb=function(e){this.l=e},t.gd=function(e){this.h=e},t.We=function(e){this.kc=e},t.he=function(){return this.kc},t.mb=function(e){var t;0!=e.length&&(t=e[e.length-1].endTime,this.Sc(e[0].startTime),this.a=e.reduce(function(e,t){return Math.max(e,t.endTime-t.startTime)},this.a),this.b=Math.max(this.b,t),null!=this.f&&this.w&&(this.f=(Date.now()+this.j)/1e3-this.b-this.a))},t.Sc=function(e){this.c=null==this.c?e:Math.min(this.c,e)},t.Rc=function(e){this.a=Math.max(this.a,e)},t.offset=function(e){null!=this.c&&(this.c+=e),null!=this.b&&(this.b+=e)},t.S=function(){return 1/0==this.g&&!this.l},t.Sa=function(){return 1/0!=this.g&&!this.l},t.Pa=function(){return Math.max(this.v,this.Ka()-this.h)},t.Od=function(e){this.v=e},t.Ka=function(){return this.S()||this.Sa()?Math.min(Math.max(0,(Date.now()+this.j)/1e3-this.a-this.f),this.g):this.g},t.Eb=function(e){var t=Math.max(this.c,this.v);return 1/0==this.h?t:Math.max(t,Math.min(this.Ka()-this.h+e,this.Da()))},t.ib=function(){return this.Eb(0)},t.Da=function(){return Math.max(0,this.Ka()-(this.S()||this.Sa()?this.kc:0))},t.Rd=function(){return!(null==this.f||null!=this.b&&this.w)},C("shaka.media.PresentationTimeline",ni),ni.prototype.usingPresentationStartTime=ni.prototype.Rd,ni.prototype.getSeekRangeEnd=ni.prototype.Da,ni.prototype.getSeekRangeStart=ni.prototype.ib,ni.prototype.getSafeSeekRangeStart=ni.prototype.Eb,ni.prototype.getSegmentAvailabilityEnd=ni.prototype.Ka,ni.prototype.setUserSeekStart=ni.prototype.Od,ni.prototype.getSegmentAvailabilityStart=ni.prototype.Pa,ni.prototype.isInProgress=ni.prototype.Sa,ni.prototype.isLive=ni.prototype.S,ni.prototype.offset=ni.prototype.offset,ni.prototype.notifyMaxSegmentDuration=ni.prototype.Rc,ni.prototype.notifyMinSegmentStartTime=ni.prototype.Sc,ni.prototype.notifySegments=ni.prototype.mb,ni.prototype.getDelay=ni.prototype.he,ni.prototype.setDelay=ni.prototype.We,ni.prototype.setSegmentAvailabilityDuration=ni.prototype.gd,ni.prototype.setStatic=ni.prototype.Nb,ni.prototype.setClockOffset=ni.prototype.Nd,ni.prototype.getPresentationStartTime=ni.prototype.ue,ni.prototype.setDuration=ni.prototype.wa,ni.prototype.getMaxSegmentDuration=ni.prototype.ne,ni.prototype.getDuration=ni.prototype.getDuration,ri.prototype.release=function(){this.g=null,this.c=function(){}},oi.prototype.release=function(){this.b&&(this.b.release(),this.b=null),null!=this.g&&(this.g.stop(),this.g=null),this.c&&(this.c.release(),this.c=null),this.a=this.w=this.v=null},oi.prototype.Vc=function(){this.h=!0,si(this)};var ci=new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]]);function li(e,t,n){var r=this;this.a=e,this.g=t,this.f=n,this.h=!1,this.b=new it,this.c=new mi(e),ui(this.a,HTMLMediaElement.HAVE_METADATA,this.b,function(){pi(r,r.f)})}function di(e){return e.h?e.a.currentTime:e.f}function fi(e,t){0o.a.getDuration()?o.a.ib():o.a.Da():s<0&&(s=o.a.Da()+s),bi(o,Ti(o,s)))),this.h=new ae(function(){var e,t,n;0==u.b.readyState||u.b.paused||(e=u.b.currentTime,t=u.a.ib(),(n=u.a.Da())-t<3&&(t=n-3),es.endTime?Mi:ki;r.f.set(s,c);for(var l=xe(r.h),d=l.next();!d.done;d=l.next())(d=d.value).$a==u&&d.Za==c&&d.Ra(s,a)}}}function Ei(){this.b=function(){},this.a=new Set}function Ii(e){var n=this;this.g=e,this.f=new Map,this.a=function(){},this.b=function(){},this.c=function(){},this.h=[{$a:null,Za:ki,Ra:function(e,t){return n.a(e,t)}},{$a:Ai,Za:ki,Ra:function(e,t){return n.a(e,t)}},{$a:Mi,Za:ki,Ra:function(e,t){return n.a(e,t)}},{$a:ki,Za:Ai,Ra:function(e,t){return n.b(e,t)}},{$a:ki,Za:Mi,Ra:function(e,t){return n.b(e,t)}},{$a:Ai,Za:Mi,Ra:function(e,t){return n.c(e,t)}},{$a:Mi,Za:Ai,Ra:function(e,t){return n.c(e,t)}}]}li.prototype.release=function(){this.b&&(this.b.release(),this.b=null),null!=this.c&&(this.c.release(),this.c=null),this.g=function(){},this.a=null},mi.prototype.release=function(){this.a&&(this.a.stop(),this.a=null),this.b=null},yi.prototype.release=function(){this.b&&(this.b.release(),this.b=null),this.a=null},yi.prototype.l=function(e){this.c=this.f?this.c:e},yi.prototype.g=function(){return(this.f?this.a.currentTime:this.c)||0},yi.prototype.v=function(){},gi.prototype.release=function(){this.c&&(this.c.release(),this.c=null),this.f&&(this.f.release(),this.f=null),this.h&&(this.h.stop(),this.h=null),this.b=this.c=this.a=this.i=null,this.w=function(){}},gi.prototype.l=function(e){fi(this.c,e)},gi.prototype.g=function(){var e=di(this.c);return 0=n.startTime&&e=this.a.length?null:this.a[e]},t.offset=function(e){for(var t=xe(this.a),n=t.next();!n.done;n=t.next())(n=n.value).startTime+=e,n.endTime+=e,n.timestampOffset+=e},t.kb=function(e){var t=this.a[this.a.length-1],n=this.a.length?e.filter(function(e){return e.startTime>=t.startTime}):e;t&&n.length&&n[0].startTime==t.startTime&&this.a.pop(),this.a.push.apply(this.a,ce(n))},t.Na=function(t){var e=this.a.length;this.a=this.a.filter(function(e){return e.endTime>t}),this.c+=e-this.a.length},t.Ja=function(e,t){for(;this.a.length&&this.a[this.a.length-1].startTime>=t;)this.a.pop();for(;this.a.length&&this.a[0].endTime<=e;)this.a.shift(),this.c++;var n;0!=this.a.length&&(n=this.a[this.a.length-1],this.a[this.a.length-1]=new ti(n.startTime,t,n.c,n.b,n.a,n.f,n.timestampOffset,n.appendWindowStart,n.appendWindowEnd))},t.mc=function(e,t){var n=this;this.b&&this.b.stop(),this.b=new ae(function(){var e=t();n.a.push.apply(n.a,ce(e)),0==n.a.length&&(n.b.stop(),n.b=null)}),this.b.xa(e)},Ci.prototype[Symbol.iterator]=function(){return new Ri(this)},C("shaka.media.SegmentIndex",Ci),Ci.forSingleSegment=Ni,Ci.prototype.updateEvery=Ci.prototype.mc,Ci.prototype.fit=Ci.prototype.Ja,Ci.prototype.evict=Ci.prototype.Na,Ci.prototype.merge=Ci.prototype.kb,Ci.prototype.offset=Ci.prototype.offset,Ci.prototype.get=Ci.prototype.get,Ci.prototype.find=Ci.prototype.find,Ci.prototype.release=Ci.prototype.release,Ci.prototype.destroy=Ci.prototype.destroy,Ri.prototype.seek=function(e){return null==(e=this.b.find(e))?(this.a=Math.pow(2,31),null):(this.a=e,this.b.get(this.a++))},Ri.prototype.current=function(){return this.b.get(this.a-1)},Ri.prototype.next=function(){var e=this.b.get(this.a++);return{value:e,done:!e}},C("shaka.media.SegmentIterator",Ri),Ri.prototype.next=Ri.prototype.next,Ri.prototype.current=Ri.prototype.current,Ri.prototype.seek=Ri.prototype.seek,p(Di,Ci),(t=Di.prototype).clone=function(){var e=new Di;return e.f=this.f.slice(),e},t.release=function(){for(var e=xe(this.f),t=e.next();!t.done;t=e.next())t.value.release();this.f=[]},t.find=function(e){for(var t=0,n=xe(this.f),r=n.next();!r.done;r=n.next()){var i=(r=r.value).find(e);if(null!=i)return i+t;t+=r.c+r.a.length}return null},t.get=function(e){for(var t=0,n=xe(this.f),r=n.next();!r.done;r=n.next()){var i=(r=r.value).get(e-t);if(i)return i;t+=r.c+r.a.length}return null},t.offset=function(){},t.kb=function(){},t.Na=function(){},t.Ja=function(){},t.mc=function(){},C("shaka.media.MetaSegmentIndex",Di),Di.prototype.updateEvery=Di.prototype.mc,Di.prototype.fit=Di.prototype.Ja,Di.prototype.evict=Di.prototype.Na,Di.prototype.merge=Di.prototype.kb,Di.prototype.offset=Di.prototype.offset,Di.prototype.get=Di.prototype.get,Di.prototype.find=Di.prototype.find,Di.prototype.release=Di.prototype.release,(t=Pi.prototype).sa=function(){return this.Bthis.P.byteLength)throw _i();var t=Le(this.P,this.B,e);return this.B+=e,t},t.skip=function(e){if(this.B+e>this.P.byteLength)throw _i();this.B+=e},t.Jd=function(e){if(this.Bthis.P.byteLength)throw _i();this.B=e},t.Xc=function(){for(var e=this.B;this.sa()&&0!=this.P.getUint8(this.B);)this.B+=1;return e=Le(this.P,e,this.B-e),this.B+=1,Ut(e)},C("shaka.util.DataViewReader",Pi),Pi.prototype.readTerminatedString=Pi.prototype.Xc,Pi.prototype.seek=Pi.prototype.seek,Pi.prototype.rewind=Pi.prototype.Jd,Pi.prototype.skip=Pi.prototype.skip,Pi.prototype.readBytes=Pi.prototype.Va,Pi.prototype.readUint64=Pi.prototype.pb,Pi.prototype.readInt32=Pi.prototype.Hd,Pi.prototype.readUint32=Pi.prototype.J,Pi.prototype.readUint16=Pi.prototype.Kb,Pi.prototype.readUint8=Pi.prototype.na,Pi.prototype.getLength=Pi.prototype.je,Pi.prototype.getPosition=Pi.prototype.te,Pi.prototype.hasMoreData=Pi.prototype.sa;var Li=1;function Oi(){this.c=[],this.b=[],this.a=!1}function Ui(e){for(var t=null!=e.flags?12:8;e.reader.sa()&&!e.parser.a;)e.parser.jc(e.start+t,e.reader,e.partialOkay)}function ji(e){for(var t=null!=e.flags?12:8,n=e.reader.J(),r=(n=xe(F(n))).next();!r.done&&(e.parser.jc(e.start+t,e.reader,e.partialOkay),!e.parser.a);r=n.next());}function Bi(t){return function(e){t(e.reader.Va(e.reader.P.byteLength-e.reader.B))}}function Fi(e){for(var t=0,n=(e=xe(e)).next();!n.done;n=e.next())t=t<<8|n.value.charCodeAt(0);return t}function Vi(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}Pi.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Li},(t=Oi.prototype).K=function(e,t){var n=Fi(e);return this.c[n]=Hi,this.b[n]=t,this},t.ea=function(e,t){var n=Fi(e);return this.c[n]=Ki,this.b[n]=t,this},t.stop=function(){this.a=!0},t.parse=function(e,t){var n=new Pi(e,0);for(this.a=!1;n.sa()&&!this.a;)this.jc(0,n,t)},t.jc=function(e,t,n){var r=t.B,i=t.J(),a=t.J();switch(i){case 0:i=t.P.byteLength-r;break;case 1:i=t.pb()}var o,s,u=this.b[a];u?(s=o=null,this.c[a]==Ki&&(o=(s=t.J())>>>24,s&=16777215),a=r+i,n&&a>t.P.byteLength&&(a=t.P.byteLength),u({parser:this,partialOkay:n||!1,version:o,flags:s,reader:t=new Pi(t=0<(a-=t.B)?t.Va(a):new Uint8Array(0),0),size:i,start:r+e})):t.skip(Math.min(r+i-t.B,t.P.byteLength-t.B))},C("shaka.util.Mp4Parser",Oi),Oi.typeToString=Vi,Oi.allData=Bi,Oi.sampleDescription=ji,Oi.children=Ui,Oi.prototype.parseNext=Oi.prototype.jc,Oi.prototype.parse=Oi.prototype.parse,Oi.prototype.stop=Oi.prototype.stop,Oi.prototype.fullBox=Oi.prototype.ea,Oi.prototype.box=Oi.prototype.K;var Hi=0,Ki=1;function qi(e,t,n,r){return e=$e(e,r),0==t&&null==n||(e.headers.Range=n?"bytes="+t+"-"+n:"bytes="+t+"-"),e}function Gi(e,t){var o=this;this.s=t,this.m=e,this.i=null,this.f=1,this.c=this.b=null,this.a=new Map,this.h=!1,this.j=null,this.g=!1,this.D=new nt(function(){return t=o,Me(function(e){if(1==e.a){for(n=[],r=xe(t.a.values()),i=r.next();!i.done;i=r.next())ia(a=i.value),n.push(aa(a));return Se(e,Promise.all(n),2)}t.a.clear(),t.s=null,t.m=null,t.i=null,Ee(e)});var t,n,r,i,a})}function zi(e,t){var n,r,i=e.a.get("video");!i||(n=i.stream)&&(t?(r=n.trickModeVideo)&&!i.Xa&&(Yi(e,r,!1,0,!1),i.Xa=n):(n=i.Xa)&&Yi(e,n,!(i.Xa=null),0,!1))}function Xi(e,t,n,r){n=void 0!==n&&n,r=void 0===r?0:r,e.b=t,e.h&&(t.video&&Yi(e,t.video,n,r,!1),t.audio&&Yi(e,t.audio,n,r,!1))}function Wi(e,t){e.c=t,e.h&&Yi(e,t,!0,0,!1)}function Yi(t,e,n,r,i){var a,o,s,u,c,l,d,f,p,h,m,v=t.a.get(e.type);v||"text"!=e.type?v&&(v.Xa&&(e.trickModeVideo?e=(v.Xa=e).trickModeVideo:v.Xa=null),v.stream!=e||i)&&("text"==e.type&&Zn(t.s.L,It(e.mimeType,e.codecs)),v.stream=e,v.stream.segmentIndex?v.va=v.stream.segmentIndex[Symbol.iterator]():v.va=null,n&&(v.zb?v.oc=!0:v.Ua?(v.rb=!0,v.$b=r,v.oc=!0):(ia(v),na(t,v,!0,r).catch(function(e){t.s&&t.s.onError(e)}))),f=t,p=v,Me(function(e){if(1==e.a)return p.Ea?(h=p.stream,m=p.Ea,h.segmentIndex?e.u(2):Se(e,h.createSegmentIndex(),2)):e.return();if(p.Ea!=m||p.stream!=h)return e.return();p.va=p.stream.segmentIndex[Symbol.iterator]();var t=f.s.cc(),n=nr(f.s.L,p.type),r=Qi(f,p,t,n),i=r&&r.a?r.a-r.b:null;r&&!i&&(i=(r.endTime-r.startTime)*(p.stream.bandwidth||0)/8),(t=!!i&&((r=r.f)&&(i+=(r.a?r.a-r.b:null)||0),8*i/(r=f.s.getBandwidthEstimate())<(n||0)-t-Math.max(f.m.minBufferTime||0,f.i.rebufferingGoal)||p.Ea.b.a>i))&&p.Ea.abort(),Ee(e)}).catch(function(e){t.s&&t.s.onError(e)})):(a=t,o=e,Me(function(e){switch(e.a){case 1:return s=xt,Ie(e,2),Se(e,or(a.s.L,s.$),4);case 4:Ae(e,3);break;case 2:u=ke(e),a.s&&a.s.onError(u);case 3:c=It(o.mimeType,o.codecs),Zn(a.s.L,c),l=a.s.L.h,(l.isTextVisible()||a.i.alwaysStreamText)&&(d=Ji(o),a.a.set(s.$,d),ra(a,d,0)),Ee(e)}}))}function $i(t,e){e.zb||e.rb||(e.Ua?(e.rb=!0,e.$b=0):null==tr(t.s.L,e.type)?null==e.Ha&&ra(t,e,0):(ia(e),na(t,e,!1,0).catch(function(e){t.s&&t.s.onError(e)})))}function Ji(e){var t=e.segmentIndex?e.segmentIndex[Symbol.iterator]():null;return{stream:e,type:e.type,Hb:null,va:t,La:null,Oc:null,Pc:null,Nc:null,Mc:null,Xa:null,endOfStream:!1,Ua:!1,Ha:null,rb:!1,$b:0,oc:!1,zb:!1,Zc:!1,Fb:!1,Ea:null}}function Qi(e,t,n,r){return t.stream==t.Hb?t.va.current():t.La?t.va.seek(t.La.endTime):r?t.va.seek(r):((r=t.va.seek(Math.max(n-e.i.inaccurateManifestTolerance,0)))&&Zi(e,r)||(r=t.va.seek(n)),r)}function Zi(e,t){var n=e.m.presentationTimeline,r=n.Ka();return!(t.endTimer)}function ea(e){return e&&"text"==e.type&&"application/cea-608"==e.stream.mimeType}function ta(t,n,r){var i,a,o,s;return Me(function(e){return 1==e.a?(i=Ze,a=qi(r.c(),r.b,r.a,t.i.retryParameters),o=t.s.lb.request(i,a),Se(e,(n.Ea=o).promise,2)):(s=e.b,n.Ea=null,e.return(s.data))})}function na(t,n,r,i){var a,o;return Me(function(e){return 1==e.a?(n.rb=!1,n.oc=!1,n.$b=0,n.zb=!0,i?(a=t.s.cc(),o=t.s.L.getDuration(),Se(e,t.s.L.remove(n.type,a+i,o),3)):Se(e,or(t.s.L,n.type),4)):3!=e.a?(rt(t.D),r?Se(e,t.s.L.flush(n.type),3):e.u(3)):(rt(t.D),n.Hb=null,n.La=null,n.zb=!1,n.endOfStream=!1,ra(t,n,0),void Ee(e))})}function ra(n,r,e){r.Ha=new ie(function(){var t;return Me(function(e){return 1==e.a?(Ie(e,2),Se(e,n.Ib(r),4)):2!=e.a?Ae(e,0):(t=ke(e),n.s&&n.s.onError(t),void Ee(e))})}).R(e)}function ia(e){null!=e.Ha&&(e.Ha.stop(),e.Ha=null)}function aa(t){return Me(function(e){return t.Ea?Se(e,t.Ea.abort(),0):e.u(0)})}function oa(t,n){Me(function(e){if(1==e.a)return Se(e,se(t.j),2);rt(t.D),t.s.onError(n),n.handled||t.i.failureCallback(n),Ee(e)})}function sa(e,t){var n=lo(),i=this;this.h=t,this.c=e,this.f=n,this.j=null,this.g=[],this.b=this.a=null,this.l=Promise.resolve().then(function(){return o=i,Me(function(e){var t,n,r,i,a;return e=o.D.a?e.u(0):(n=(n=!(0==o.g.length||o.a&&!o.a.Qa||(o.a&&(o.a.ta.Ta(),o.a=null),(t=(n=o.g.shift()).create(o.f))?(n.ta.nb(),o.a={node:t.node,payload:t.payload,Qa:t.Qa,ta:n.ta}):n.ta.ic(),0)))?Promise.resolve():o.a?(r=o,Me(function(e){switch(e.a){case 1:return r.c=r.h.pe(r.c,r.f,r.a.node,r.a.payload),Ie(e,2),r.b=r.h.ee(r.c,r.f,r.a.payload),Se(e,r.b.promise,4);case 4:r.b=null,r.c==r.a.node&&(r.a.ta.fc(),r.a=null),Ae(e,0);break;case 2:return 7001==(i=ke(e)).code?r.a.ta.Ta():r.a.ta.onError(i),r.a=null,r.b=null,Se(e,(a=r).h.handleError(r.f,i),5);case 5:a.c=e.b,Ee(e)}})):(o.h.Fe(o.c),o.j=new pe,o.j),Se(e,n,1))});var o}),this.D=new nt(function(){return t=i,Me(function(e){if(1==e.a)return t.b&&t.b.abort(),ca(t),Se(e,t.l,2);for(t.a&&t.a.ta.Ta(),n=xe(t.g),r=n.next();!r.done;r=n.next())r.value.ta.Ta();t.a=null,t.g=[],t.h=null,Ee(e)});var t,n,r})}function ua(e,t){var n={nb:function(){},fc:function(){},Ta:function(){},onError:function(){},ic:function(){},Jf:function(){}};return e.g.push({create:t,ta:n}),e.b&&e.b.abort(),ca(e),n}function ca(e){e.j&&(e.j.resolve(),e.j=null)}function la(e){this.a=null;for(var t=xe(Array.from(e.textTracks)),n=t.next();!n.done;n=t.next())(n=n.value).mode="disabled","Shaka Player TextTrack"==n.label&&(this.a=n);this.a||(this.a=e.addTextTrack("subtitles","Shaka Player TextTrack")),this.a.mode="hidden"}function da(e){if(e.startTime>=e.endTime)return null;var t=new VTTCue(e.startTime,e.endTime,e.payload);t.lineAlign=e.lineAlign,t.positionAlign=e.positionAlign,e.size&&(t.size=e.size);try{t.align=e.textAlign}catch(e){}return"center"==e.textAlign&&"center"!=t.align&&(t.align="middle"),"vertical-lr"==e.writingMode?t.vertical="lr":"vertical-rl"==e.writingMode&&(t.vertical="rl"),1==e.lineInterpretation&&(t.snapToLines=!1),null!=e.line&&(t.line=e.line),null!=e.position&&(t.position=e.position),t}function fa(e,t){var n=e.mode;e.mode="showing"==n?"showing":"hidden";for(var r=xe(Array.from(e.cues)),i=r.next();!i.done;i=r.next())(i=i.value)&&t(i)&&e.removeCue(i);e.mode=n}function pa(){}function ha(e,t){var n=this;this.h=!1,this.f=[],this.a=e,this.g=t,this.b=document.createElement("div"),this.b.classList.add("shaka-text-container"),this.g.appendChild(this.b),this.j=new ae(function(){ma(n)}).xa(.25),this.c=new Map}function ma(t){function n(e){return t.f.includes(e)&&t.h&&e.startTime<=r&&e.endTime>=r}for(var e,r=t.a.currentTime,i=xe(t.c.keys()),a=i.next();!a.done;a=i.next()){n(a=a.value)||(e=t.c.get(a),t.b.removeChild(e),t.c.delete(a))}for(i=new Set(t.c.values()),e=(a=xe(Array.from(t.b.childNodes))).next();!e.done;e=a.next())e=e.value,i.has(e)||t.b.removeChild(e);for(a=(i=xe(i=t.f.filter(function(e){return n(e)&&!t.c.has(e)}).sort(function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime-t.endTime}))).next();!a.done;a=i.next())ya(t,t.b,a.value)}function va(e,t,n){var r=document.createElement("span");return n.spacer?r.style.display="block":ga(e,r,n,!0),t.appendChild(r),r}function ya(e,t,n){if(n.nestedCues.length){var r=document.createElement("p");r.style.width="100%",ga(e,r,n,!1);for(var i=0;i=a.a&&t, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),i.resolve()),t.b.ha(t.a,"error",function(){i.reject(to(t))}),new he(i,function(){return i.reject(new Re(De,de,7001)),Promise.resolve()})}(c,e,t)}),this.W=new sa(this.da,{pe:function(e,t,n,r){var i=null;return e==c.da&&(i=n==c.da?c.da:c.Ca),e==c.Ca&&(i=n==c.da||t.A!=r.A?c.da:n==c.Ca?c.Ca:n==c.pa||n==c.I?c.pa:n==c.Aa?c.Fc:null),e==c.pa&&(i=n==c.I&&t.A==r.A?c.pc:c.M),e==c.pc&&(i=co(c.I,c.Dc,c.M,n,t,r)),e==c.Dc&&(i=co(c.I,c.Ac,c.M,n,t,r)),e==c.Ac&&(i=co(c.I,c.I,c.M,n,t,r)),e==c.Fc&&(i=n==c.Aa&&t.A==r.A?c.Aa:c.M),e!=c.I&&e!=c.Aa||(i=c.M),e==c.M&&(i=r.A&&t.A==r.A?c.Ca:c.da),i},ee:function(e,t,n){return c.dispatchEvent(_a(Eo,{state:e.name})),r.get(e)(t,n)},handleError:function(t){return Me(function(e){return 1==e.a?Se(e,La(c,t),2):e.return(t.A?c.Ca:c.da)})},Fe:function(e){c.dispatchEvent(_a(Io,{state:e.name}))}}),e&&this.yb(e,!0)}function _a(e,t){return new je(e,t)}function La(t,n){var r,i,a,o,s,u,c,l,d;return Me(function(e){switch(e.a){case 1:return t.g!=Uo&&(t.g=jo),r=t.zc.map(function(e){return e()}),t.zc=[],Se(e,Promise.all(r),2);case 2:if(t.dispatchEvent(_a(_o)),n.mimeType=null,n.startTime=null,n.uri=null,n.A&&(t.b.oa(n.A,"loadedmetadata"),t.b.oa(n.A,"playing"),t.b.oa(n.A,"pause"),t.b.oa(n.A,"ended"),t.b.oa(n.A,"ratechange")),t.za&&(t.za.release(),t.za=null),t.Tb&&(t.Tb.stop(),t.Tb=null),t.l)return Se(e,t.l.stop(),4);e.u(3);break;case 4:t.l=null,t.Wb=null;case 3:if(t.j)return Se(e,t.j.stop(),5);e.u(5);break;case 5:if(t.c)return Se(e,t.c.destroy(),8);e.u(7);break;case 8:t.c=null;case 7:if(t.w&&(t.w.release(),t.w=null),t.v&&(t.v.release(),t.v=null),t.G)return Se(e,t.G.destroy(),10);e.u(9);break;case 10:t.G=null;case 9:if(t.H&&t.H.onAssetUnload(),n.A&&n.A.src)return Se(e,new Promise(function(e){return new ae(e).R(.1)}),12);e.u(11);break;case 12:n.A.removeAttribute("src"),n.A.load();case 11:if(t.h)return Se(e,t.h.destroy(),14);e.u(13);break;case 14:t.h=null;case 13:if(t.wb=null,t.C=null,t.m){for(i=xe(t.m.variants),a=i.next();!a.done;a=i.next())for(o=a.value,s=xe([o.audio,o.video]),u=s.next();!u.done;u=s.next())(c=u.value)&&c.segmentIndex&&c.segmentIndex.release();for(l=xe(t.m.textStreams),u=l.next();!u.done;u=l.next())(d=u.value).segmentIndex&&d.segmentIndex.release()}t.m=null,t.f=new Da,t.Bc=null,Ha(t),Ee(e)}})}function Oa(e,t){return new Jt(t,e.i.drm.updateExpirationTime)}function Ua(e,t){e.C=new Kr,e.C.a=Gr,qr(e.C,t,Math.min(.5,t/2)),Ha(e),e.Tb=new ae(function(){ja(e)}).xa(.25)}function ja(e){switch(e.g){case Fo:var t,n;n=!!e.a.ended||null!=(t=Sn(e.a.buffered))&&t>=e.a.duration-1;break;case Bo:e:if(e.a.ended||er(e.G))n=!0;else{if(e.m.presentationTimeline.S()){t=e.m.presentationTimeline.Ka();var r=Sn(e.a.buffered);if(null!=r&&t<=r){n=!0;break e}}n=!1}break;default:n=!1}r=In(e.a.buffered,e.a.currentTime);var i=n,a=(t=e.C).b.get(t.a);n=t.a,r=i||a<=r?zr:Gr,n!=(t.a=r)&&Ha(e)}function Ba(t){var e,n,r,i;if(t.l&&(e=Ve(t.i.manifest),t.a&&"AUDIO"===t.a.nodeName&&(e.disableVideo=!0),t.l.configure(e)),t.h&&t.h.configure(t.i.drm),t.c){t.c.configure(t.i.streaming);try{t.fb(t.m)}catch(e){Za(t,e)}t.j&&Ga(t),!(e=t.c.b)||e.allowedByApplication&&e.allowedByKeySystem||za(t)}t.G&&(e=t.i.textDisplayFactory,t.Bc!=e)&&(n=bt(e),i=(r=t.G).h,r.h=n,i&&(n.setTextVisibility(i.isTextVisible()),i.destroy()),r.c&&(r.c.c=n),t.Bc=e,!t.c||(n=(e=t.c).a.get("text"))&&Yi(e,n.stream,!0,0,!0)),t.j&&(t.j.configure(t.i.abr),t.i.abr.enabled?t.j.enable():t.j.disable(),Qa(t)),t.C&&(e=t.i.streaming.rebufferingGoal,t.m&&(e=Math.max(e,t.m.minBufferTime)),qr(t.C,e,Math.min(.5,e/2)))}function Fa(e){return Array.from(e.a.textTracks).filter(function(e){return"metadata"!=e.kind&&"Shaka Player TextTrack"!=e.label})}function Va(t){var e=Ea();return e.streaming.failureCallback=function(e){t.S()&&[1001,1002,1003].includes(e.code)&&(e.severity=1,t.$c())},e.textDisplayFactory=function(){return t.Yb?new ha(t.a,t.Yb):new la(t.a)},e}function Ha(e){var t,n=e.Kc();e.f&&e.C&&e.v&&((t=e.w).f=n,Zr(t),qa(e)),e.dispatchEvent(_a(mo,{buffering:n}))}function Ka(e){var t=e.a.playbackRate;0!=t&&(e.w&&e.w.set(t),t=_a(Ao),e.dispatchEvent(t))}function qa(e){var t;e.f&&e.C&&(t=e.f.b,e.C.a==Gr?ka(t,"buffering"):e.a.paused?ka(t,"paused"):e.a.ended?ka(t,"ended"):ka(t,"playing"))}function Ga(t){try{io(t,t.m)}catch(e){return Za(t,e),0}var e=t.m.variants.filter(Nr),e=t.xb.create(e);return t.j.setVariants(Array.from(e.values())),1}function za(e){var t;if(t=Ga(e)?e.j.chooseVariant():null){if(t==e.c.b)return;Na(e.f.a,t,!0),Xi(e.c,t,!0,0),Ya(e)}Xa(e)}function Xa(e){ao(e,_a(ho))}function Wa(e){ao(e,_a(Po))}function Ya(e){ao(e,_a(Lo))}function $a(e){ao(e,_a(Mo))}function Ja(e){ao(e,_a(Co))}function Qa(e){ao(e,_a(po,{If:e.i.abr.enabled}))}function Za(e,t){var n;e.g!=Uo&&(n=_a(go,{detail:t}),e.dispatchEvent(n),n.defaultPrevented&&(t.handled=!0))}function eo(e,t,n){e.dispatchEvent(_a(t,{detail:{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,eventElement:n.eventElement}}))}function to(e){if(!e.a.error)return null;var t=e.a.error.code;if(1==t)return null;var n=e.a.error.msExtendedCode;return n&&(n<0&&(n+=Math.pow(2,32)),n=n.toString(16)),new Re(De,3,3016,t,n,e.a.error.message)}function no(e,t){if(e.c){var n=Object.keys(t),r=1==n.length&&"00"==n[0],i=!1;if(n.length)for(var a=(n=xe(e.m.variants)).next();!a.done;a=n.next()){var o=[];(a=a.value).audio&&o.push(a.audio),a.video&&o.push(a.video);for(var s=(o=xe(o)).next();!s.done;s=o.next()){var u=s.value,s=a.allowedByKeySystem;if(u.keyIds.size){a.allowedByKeySystem=!0;for(var c=(u=xe(u.keyIds)).next();!c.done;c=u.next())c=c.value,c=t[r?"00":c],a.allowedByKeySystem=a.allowedByKeySystem&&!!c&&!Ho.includes(c)}s!=a.allowedByKeySystem&&(i=!0)}}i&&Ga(e),(r=e.c.b)&&!r.allowedByKeySystem&&za(e),i&&Wa(e)}}function ro(e,t,n){e.l&&e.l.onExpirationUpdated&&e.l.onExpirationUpdated(t,n),t=_a(bo),e.dispatchEvent(t)}function io(e,t){for(var n=e.h?Et(e.h.T):{},r=(r=Object.keys(n)).length&&"00"==r[0],i=!1,a=!1,o=new Set,s=new Set,u=xe(t.variants),c=u.next();!c.done;c=u.next()){var l=[];(c=c.value).audio&&l.push(c.audio),c.video&&l.push(c.video);for(var d=(l=xe(l)).next();!d.done;d=l.next())if((d=d.value).keyIds.size)for(var f=(d=xe(d.keyIds)).next();!f.done;f=d.next()){f=f.value;var p=n[r?"00":f];p?Ho.includes(p)&&s.add(p):o.add(f)}c.allowedByApplication?c.allowedByKeySystem&&(i=!0):a=!0}if(!i)throw n={hasAppRestrictions:a,missingKeys:Array.from(o),restrictedKeyStatuses:Array.from(s)},new Re(De,4,4012,n)}function ao(t,n){Me(function(e){if(1==e.a)return Se(e,Promise.resolve(),2);t.g!=Uo&&t.dispatchEvent(n),Ee(e)})}function oo(e){for(var t=new Set,n=(e=xe(e)).next();!n.done;n=e.next())(n=n.value).language?t.add(yr(n.language)):t.add("und");return t}function so(e){for(var t=new Map,n=(e=xe(e)).next();!n.done;n=e.next()){var r=n.value,n="und",i=[];for(r.language&&(n=yr(r.language)),(i="variant"==r.type?r.audioRoles:r.roles)&&i.length||(i=[""]),t.has(n)||t.set(n,new Set),i=(r=xe(i)).next();!i.done;i=r.next())i=i.value,t.get(n).add(i)}var a=[];return t.forEach(function(e,t){for(var n=xe(e),r=n.next();!r.done;r=n.next())a.push({language:t,role:r.value})}),a}function uo(){return new Re(De,de,7e3)}function co(e,t,n,r,i,a){return r==e&&i.A==a.A&&i.uri==a.uri&&i.mimeType==a.mimeType?t:n}function lo(){return{A:null,mimeType:null,startTime:null,hd:NaN,uri:null}}function fo(n){return new Promise(function(e,t){n.Ta=function(){return t(uo())},n.fc=function(){return e()},n.onError=function(e){return t(e)},n.ic=function(){return t(uo())}})}Gi.prototype.destroy=function(){return this.D.destroy()},Gi.prototype.configure=function(e){this.i=e,this.j=new oe({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0},!0)},Gi.prototype.start=function(){var t=this;return Me(function(e){if(1==e.a)return Se(e,(n=t,Me(function(e){if(1==e.a){if(r=xt,!n.b)throw new Re(De,5,5006);return i=new Map,a=new Set,n.b.audio&&(i.set(r.cb,n.b.audio),a.add(n.b.audio)),n.b.video&&(i.set(r.Ba,n.b.video),a.add(n.b.video)),n.c&&(i.set(r.$,n.c),a.add(n.c)),o=n.s.L,s=n.i.forceTransmuxTS,Se(e,o.init(i,s),2)}rt(n.D);var t=n.m.presentationTimeline.getDuration();for(t<1/0?n.s.L.wa(t):n.s.L.wa(Math.pow(2,32)),u=xe(i.keys()),c=u.next();!c.done;c=u.next())l=c.value,d=i.get(l),n.a.has(l)||(f=Ji(d),n.a.set(l,f),ra(n,f,0));Ee(e)})),2);var n,r,i,a,o,s,u,c,l,d,f;rt(t.D),t.h=!0,Ee(e)})},Gi.prototype.Ib=function(e){var n,r,i,a,o=this;return Me(function(t){switch(t.a){case 1:if(rt(o.D),e.Ua||null==e.Ha||e.zb)return t.return();if(e.Ha=null,e.rb)return Se(t,na(o,e,e.oc,e.$b),3);t.u(2);break;case 3:return t.return();case 2:if(e.stream.segmentIndex){t.u(4);break}return n=e.stream,Se(t,e.stream.createSegmentIndex(),5);case 5:if(n!=e.stream)return null==e.Ha&&ra(o,e,0),t.return();ea(e)||(e.va=e.stream.segmentIndex[Symbol.iterator]());case 4:try{null!=(r=function(e,t){if(ea(t))return ar(e.s.L,t.stream.originalId||""),null;var n=e.s.cc(),r=t.Hb&&t.La?t.La.endTime:n,i=function(e,t,n){return"text"==t?null==(e=e.c).b||e.b=e.m.presentationTimeline.getDuration())return t.endOfStream=!0,"video"==t.type&&(n=e.a.get("text"))&&ea(n)&&(n.endOfStream=!0),null;if(t.endOfStream=!1,a<=i)return.5;if(i=nr(e.s.L,t.type),!(i=Qi(e,t,n,i))||!Zi(e,i))return 1;a=1/0;for(var o=Array.from(e.a.values()),s=(o=xe(o)).next();!s.done;s=o.next())ea(s=s.value)||(a=Math.min(a,s.Hb&&s.La?s.La.endTime:n));return r>=a+e.m.presentationTimeline.a?1:(function(g,b,w,T){var x,S,E,I,A,k;return Me(function(e){switch(e.a){case 1:return x=xt,S=b.stream,b.Ua=!0,i=g,a=b,t=T,E=Me(function(e){return n=[],r=Math.max(0,t.appendWindowStart-.1),o=t.appendWindowEnd+.01,(h=t.timestampOffset)==a.Pc&&r==a.Nc&&o==a.Mc||(m=function(){var t;return Me(function(e){if(1==e.a)return Ie(e,2),a.Nc=r,a.Mc=o,a.Pc=h,Se(e,sr(i.s.L,a.type,h,r,o),4);if(2!=e.a)return Ae(e,0);throw t=ke(e),a.Nc=null,a.Mc=null,a.Pc=null,t})},n.push(m())),t.f!=a.Oc&&(a.Oc=t.f)&&(v=ta(i,a,t.f),y=function(){var t,n,r;return Me(function(e){switch(e.a){case 1:return Ie(e,2),Se(e,v,4);case 4:return t=e.b,rt(i.D),n=a.stream.closedCaptions&&0t}),!0)},t.append=function(e){for(var t=[],n=(e=xe(e)).next();!n.done;n=e.next())(n=n.value).nestedCues.length?t=t.concat(n.nestedCues):t.push(n);var r=[];e=this.a.cues?Array.from(this.a.cues):[],n={};for(var i=(t=xe(t)).next();!i.done;n={bb:n.bb},i=t.next())n.bb=i.value,e.some(function(t){return function(e){return e.startTime==t.bb.startTime&&e.endTime==t.bb.endTime&&e.text==t.bb.payload}}(n))||(i=da(n.bb))&&r.push(i);for(n=(t=xe(t=r.slice().sort(function(e,t){return e.startTime!=t.startTime?e.startTime-t.startTime:e.endTime!=t.endTime?e.endTime-t.startTime:r.indexOf(t)-r.indexOf(e)}))).next();!n.done;n=t.next())this.a.addCue(n.value)},t.destroy=function(){return this.a&&(fa(this.a,function(){return 1}),this.a.mode="disabled"),this.a=null,Promise.resolve()},t.isTextVisible=function(){return"showing"==this.a.mode},t.setTextVisibility=function(e){this.a.mode=e?"showing":"hidden"},C("shaka.text.SimpleTextDisplayer",la),la.prototype.setTextVisibility=la.prototype.setTextVisibility,la.prototype.isTextVisible=la.prototype.isTextVisible,la.prototype.destroy=la.prototype.destroy,la.prototype.append=la.prototype.append,la.prototype.remove=la.prototype.remove,C("shaka.util.Dom",pa),pa.removeAllChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},(t=ha.prototype).append=function(e){for(var t={},n=(e=xe(e)).next();!n.done;t={ab:t.ab},n=e.next())t.ab=n.value,this.f.some(function(t){return function(e){return e.payload==t.ab.payload&&e.startTime==t.ab.startTime&&e.endTime==t.ab.endTime}}(t))||this.f.push(t.ab);ma(this)},t.destroy=function(){this.g.removeChild(this.b),this.b=null,this.h=!1,this.f=[],this.j&&this.j.stop(),this.c.clear()},t.remove=function(t,n){return!!this.b&&(this.f=this.f.filter(function(e){return e.startTime=n}),ma(this),!0)},t.isTextVisible=function(){return this.h},t.setTextVisibility=function(e){this.h=e},C("shaka.text.UITextDisplayer",ha),ha.prototype.setTextVisibility=ha.prototype.setTextVisibility,ha.prototype.isTextVisible=ha.prototype.isTextVisible,ha.prototype.remove=ha.prototype.remove,ha.prototype.destroy=ha.prototype.destroy,ha.prototype.append=ha.prototype.append,C("shaka.util.ConfigUtils",wa),wa.convertToConfigObject=xa,wa.mergeConfigObjects=Ta,C("shaka.util.PlayerConfiguration",Sa),Sa.mergeConfigObjects=Ia,p(Pa,Fe),(t=Pa.prototype).destroy=function(){var t,n=this;return Me(function(e){switch(e.a){case 1:return n.g==Uo?e.return():(n.g=Uo,t=ua(n.W,function(){return{node:n.da,payload:lo(),Qa:!1}}),Se(e,new Promise(function(e){t.nb=function(){},t.fc=function(){e()},t.Ta=function(){e()},t.onError=function(){e()},t.ic=function(){e()}}),2));case 2:return Se(e,n.W.destroy(),3);case 3:if(n.b&&(n.b.release(),n.b=null),n.yc=null,n.j=null,n.i=null,n.f=null,n.Yb=null,n.N)return Se(e,n.N.destroy(),5);e.u(0);break;case 5:n.N=null,Ee(e)}})},t.yb=function(e,t){if(t=void 0===t||t,this.g==Uo)return Promise.reject(uo());var n=lo();n.A=e,Mt()||(t=!1);var r=t?this.pa:this.Ca,i=ua(this.W,function(){return{node:r,payload:n,Qa:!1}});return i.nb=function(){},fo(i)},t.detach=function(){var e=this;if(this.g==Uo)return Promise.reject(uo());var t=ua(this.W,function(){return{node:e.da,payload:lo(),Qa:!1}});return t.nb=function(){},fo(t)},t.ld=function(n){var r=this;if(n=void 0===n||n,this.g==Uo)return Promise.reject(uo());Mt()||(n=!1);var i=lo(),e=ua(this.W,function(e){var t=e.A&&n?r.pa:e.A?r.Ca:r.da;return i.A=e.A,{node:t,payload:i,Qa:!1}});return e.nb=function(){},fo(e)},t.load=function(e,t,n){var r=this;if(this.g==Uo)return Promise.reject(uo());this.dispatchEvent(_a(To));var i=lo();i.uri=e,i.hd=Date.now()/1e3,n&&(i.mimeType=n),void 0!==t&&(i.startTime=t);var a=function(e,t){if(!Mt())return 1;var n=t.mimeType,r=t.uri||"";return!!(n=n||{mp4:"video/mp4",m4v:"video/mp4",m4a:"audio/mp4",webm:"video/webm",weba:"audio/webm",mkv:"video/webm",ts:"video/mp2t",ogv:"video/ogg",ogg:"audio/ogg",mpg:"video/mpeg",mpeg:"video/mpeg",m3u8:"application/x-mpegurl",mp3:"audio/mpeg",aac:"audio/aac",flac:"audio/flac",wav:"audio/wav"}[Yr(r)])&&(""!=(t.A||Pt()).canPlayType(n)&&(!Mt()||!(n in $r||Yr(r)in Jr)||Nt()&&e.i.streaming.useNativeHlsOnSafari))}(this,i)?this.Aa:this.I,o=ua(this.W,function(e){return null==e.A?null:(i.A=e.A,{node:a,payload:i,Qa:!0})});return this.f=new Da,o.nb=function(){},new Promise(function(e,t){o.ic=function(){return t(new Re(De,de,7002))},o.fc=function(){e(),r.dispatchEvent(_a(wo))},o.Ta=function(){return t(uo())},o.onError=function(e){return t(e)}})},t.configure=function(e,t){2==arguments.length&&"string"==typeof e&&(e=xa(e,t)),e.manifest&&e.manifest.dash&&"defaultPresentationDelay"in e.manifest.dash&&(ft("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),e.manifest.defaultPresentationDelay=e.manifest.dash.defaultPresentationDelay,delete e.manifest.dash.defaultPresentationDelay);var n=Ia(this.i,e,Va(this));return Ba(this),n},t.getConfiguration=function(){var e=Va(this);return Ia(e,this.i,Va(this)),e},t.Pe=function(){for(var e in this.i)delete this.i[e];Ia(this.i,Va(this),Va(this)),Ba(this)},t.ke=function(){return this.g},t.oe=function(){return this.a},t.Db=function(){return this.N},t.Gc=function(){return this.wb},t.vd=function(){return function(e,t){for(var n=[],r=1;re&&(i.a.currentTime=i.j,i.j=null)}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(e){i.w=e.getStreamData().adProgressData,i.h&&(i.h.b=i.w)}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){i.f(new je("ad-first-quartile"))}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){i.f(new je("ad-midpoint"))}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){i.f(new je("ad-third-quartile"))}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){i.f(new je("ad-complete")),i.f(new je("ad-stopped")),i.v.removeAttribute("ad-active"),i.h=null}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){i.f(new je("ad-skipped")),i.f(new je("ad-stopped"))}),this.b.o(this.c,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(e){var t=e.getStreamData();e=[];for(var n=(t=xe(t.cuepoints)).next();!n.done;n=t.next())n=n.value,e.push(new es(n.start,n.end));i.f(new je("ad-cue-points-changed",{cuepoints:e}))})}function Zo(){Fe.call(this),this.a=this.b=null,this.f=new Go,this.c=navigator.language}function es(e,t){this.start=e,this.end=void 0===t?null:t}function ts(e){return JSON.stringify(e,function(e,t){if("function"!=typeof t){if(t instanceof Event||t instanceof je){var n={};for(i in t){var r=t[i];r&&"object"==typeof r?"detail"==i&&(n[i]=r):i in Event||(n[i]=r)}return n}if(t instanceof Error){var i=new Set(["name","message","stack"]);for(n in t)i.add(n);for(n=(r=xe(Object.getOwnPropertyNames(t))).next();!n.done;n=r.next())i.add(n.value);for(r={},n=(i=xe(i)).next();!n.done;n=i.next())r[n=n.value]=t[n];i={__type__:"Error",contents:r}}else if(t instanceof TimeRanges)for(i={__type__:"TimeRanges",length:t.length,start:[],end:[]},r=(n=xe(An(t))).next();!r.done;r=n.next()){var a=(r=r.value).end;i.start.push(r.start),i.end.push(a)}else i=t instanceof Uint8Array?{__type__:"Uint8Array",entries:Array.from(t)}:"number"==typeof t?isNaN(t)?"NaN":isFinite(t)?t:t<0?"-Infinity":"Infinity":t;return i}})}function ns(e){return JSON.parse(e,function(e,t){if("NaN"==t)var n=NaN;else if("-Infinity"==t)n=-1/0;else if("Infinity"==t)n=1/0;else if(t&&"object"==typeof t&&"TimeRanges"==t.__type__)n={length:(a=t).length,start:function(e){return a.start[e]},end:function(e){return a.end[e]}};else if(t&&"object"==typeof t&&"Uint8Array"==t.__type__)n=new Uint8Array(t.entries);else if(t&&"object"==typeof t&&"Error"==t.__type__){n=t.contents;var r,i=Error(n.message);for(r in n)i[r]=n[r];n=i}else n=t;var a;return n})}(t=zo.prototype).getDuration=function(){return this.c.getDuration()},t.getRemainingTime=function(){return this.a.getRemainingTime()},t.isPaused=function(){return this.f},t.isSkippable=function(){return 0<=this.c.getSkipTimeOffset()},t.getTimeUntilSkippable=function(){var e=this.c.getSkipTimeOffset(),e=this.getRemainingTime()-e;return Math.max(e,0)},t.canSkipNow=function(){return this.a.getAdSkippableState()},t.skip=function(){return this.a.skip()},t.pause=function(){return this.a.pause()},t.play=function(){return this.a.resume()},t.getVolume=function(){return this.a.getVolume()},t.setVolume=function(e){return this.a.setVolume(e)},t.isMuted=function(){return 0==this.a.getVolume()},t.resize=function(e,t){this.a.resize(e,t,document.fullscreenElement?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)},t.setMuted=function(e){e?(this.g=this.getVolume(),this.setVolume(0)):this.setVolume(this.g)},t.getSequenceLength=function(){var e=this.c.getAdPodInfo();return null==e?1:e.getTotalAds()},t.getPositionInSequence=function(){var e=this.c.getAdPodInfo();return null==e?1:e.getAdPosition()},t.release=function(){this.a=this.c=null},C("shaka.ads.ClientSideAd",zo),zo.prototype.release=zo.prototype.release,zo.prototype.getPositionInSequence=zo.prototype.getPositionInSequence,zo.prototype.getSequenceLength=zo.prototype.getSequenceLength,zo.prototype.setMuted=zo.prototype.setMuted,zo.prototype.resize=zo.prototype.resize,zo.prototype.isMuted=zo.prototype.isMuted,zo.prototype.setVolume=zo.prototype.setVolume,zo.prototype.getVolume=zo.prototype.getVolume,zo.prototype.play=zo.prototype.play,zo.prototype.pause=zo.prototype.pause,zo.prototype.skip=zo.prototype.skip,zo.prototype.canSkipNow=zo.prototype.canSkipNow,zo.prototype.getTimeUntilSkippable=zo.prototype.getTimeUntilSkippable,zo.prototype.isSkippable=zo.prototype.isSkippable,zo.prototype.isPaused=zo.prototype.isPaused,zo.prototype.getRemainingTime=zo.prototype.getRemainingTime,zo.prototype.getDuration=zo.prototype.getDuration,Xo.prototype.stop=function(){this.c.stop()},(t=Jo.prototype).getDuration=function(){return this.b?this.b.duration:-1},t.getRemainingTime=function(){return this.b?this.b.duration-this.b.currentTime:-1},t.isPaused=function(){return this.a.paused},t.isSkippable=function(){return this.c.isSkippable()},t.getTimeUntilSkippable=function(){var e=this.c.getSkipTimeOffset(),e=this.getRemainingTime()-e;return Math.max(e,0)},t.canSkipNow=function(){return 0==this.getTimeUntilSkippable()},t.skip=function(){this.a.currentTime+=this.getRemainingTime()},t.pause=function(){return this.a.pause()},t.play=function(){return this.a.play()},t.getVolume=function(){return this.a.volume},t.setVolume=function(e){this.a.volume=e},t.isMuted=function(){return this.a.muted},t.resize=function(){},t.setMuted=function(e){this.a.muted=e},t.getSequenceLength=function(){var e=this.c.getAdPodInfo();return null==e?1:e.getTotalAds()},t.getPositionInSequence=function(){var e=this.c.getAdPodInfo();return null==e?1:e.getAdPosition()},t.release=function(){this.a=this.b=this.c=null},C("shaka.ads.ServerSideAd",Jo),Jo.prototype.release=Jo.prototype.release,Jo.prototype.getPositionInSequence=Jo.prototype.getPositionInSequence,Jo.prototype.getSequenceLength=Jo.prototype.getSequenceLength,Jo.prototype.setMuted=Jo.prototype.setMuted,Jo.prototype.resize=Jo.prototype.resize,Jo.prototype.isMuted=Jo.prototype.isMuted,Jo.prototype.setVolume=Jo.prototype.setVolume,Jo.prototype.getVolume=Jo.prototype.getVolume,Jo.prototype.play=Jo.prototype.play,Jo.prototype.pause=Jo.prototype.pause,Jo.prototype.skip=Jo.prototype.skip,Jo.prototype.canSkipNow=Jo.prototype.canSkipNow,Jo.prototype.getTimeUntilSkippable=Jo.prototype.getTimeUntilSkippable,Jo.prototype.isSkippable=Jo.prototype.isSkippable,Jo.prototype.isPaused=Jo.prototype.isPaused,Jo.prototype.getRemainingTime=Jo.prototype.getRemainingTime,Jo.prototype.getDuration=Jo.prototype.getDuration,Qo.prototype.stop=function(){this.c.reset(),this.l="",this.j=null},Qo.prototype.onCueMetadataChange=function(e){var t;e.key&&e.data&&((t={})[e.key]=e.data,this.c.onTimedMetadata(t))},p(Zo,Fe),(t=Zo.prototype).setLocale=function(e){this.c=e},t.initClientSide=function(e,t){var n=this;if(!g.google||!google.ima||!google.ima.AdsLoader)throw new Re(De,10,1e4);this.b=new Xo(e,t,this.c,function(e){if(e&&e.type)switch(e.type){case"ads-loaded":n.f.a.push(e.loadTime);break;case"ad-started":n.f.c++;break;case"ad-complete":n.f.b++;break;case"ad-skipped":n.f.f++}n.dispatchEvent(e)})},t.onAssetUnload=function(){this.b&&this.b.stop(),this.dispatchEvent(new je("ad-stopped")),this.f=new Go},t.requestClientSideAds=function(e){if(!this.b)throw new Re(1,10,10001);var t=this.b;t.l=Date.now()/1e3,t.g.requestAds(e)},t.initServerSide=function(e,t){var n=this;if(!g.google||!google.ima||!google.ima.dai)throw new Re(De,10,10002);this.a=new Qo(e,t,this.c,function(e){if(e&&e.type)switch(e.type){case"ads-loaded":n.f.a.push(e.loadTime);break;case"ad-started":n.f.c++;break;case"ad-complete":n.f.b++;break;case"ad-skipped":n.f.f++}n.dispatchEvent(e)}),this.replaceServerSideAdTagParameters({mpt:"shaka",mpv:"v3.0.1"})},t.requestServerSideStream=function(e,t){if(!this.a)throw new Re(1,10,10003);var n=this.a,r=void 0===t?"":t;return n=n.g?Promise.reject(new Re(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.C=!0),n.g=new pe,n.c.requestStream(e),n.l=r||"",n.G=Date.now()/1e3,n.g)},t.replaceServerSideAdTagParameters=function(e){if(!this.a)throw new Re(1,10,10003);this.a.c.replaceAdTagParameters(e)},t.getStats=function(){var e=this.f;return{loadTimes:e.a,started:e.c,playedCompletely:e.b,skipped:e.f}},t.onDashTimedMetadata=function(e){var t,n;this.a&&"urn:google:dai:2018"==e.schemeIdUri&&(t=e.schemeIdUri,n=e.eventElement?e.eventElement.getAttribute("messageData"):null,this.a.c.processMetadata(t,n,e.startTime))},t.onHlsTimedMetadata=function(e,t){for(var n=xe(e),r=n.next();!r.done;r=n.next())r=r.value,this.a&&r.data&&r.cueTime&&this.a.c.processMetadata("ID3",r.data,r.cueTime+t)},t.onCueMetadataChange=function(e){this.a&&this.a.onCueMetadataChange(e)},C("shaka.ads.AdManager",Zo),Zo.prototype.onCueMetadataChange=Zo.prototype.onCueMetadataChange,Zo.prototype.onHlsTimedMetadata=Zo.prototype.onHlsTimedMetadata,Zo.prototype.onDashTimedMetadata=Zo.prototype.onDashTimedMetadata,Zo.prototype.getStats=Zo.prototype.getStats,Zo.prototype.replaceServerSideAdTagParameters=Zo.prototype.replaceServerSideAdTagParameters,Zo.prototype.requestServerSideStream=Zo.prototype.requestServerSideStream,Zo.prototype.initServerSide=Zo.prototype.initServerSide,Zo.prototype.requestClientSideAds=Zo.prototype.requestClientSideAds,Zo.prototype.onAssetUnload=Zo.prototype.onAssetUnload,Zo.prototype.initClientSide=Zo.prototype.initClientSide,Zo.prototype.setLocale=Zo.prototype.setLocale,Zo.ADS_LOADED="ads-loaded",Zo.AD_STARTED="ad-started",Zo.AD_FIRST_QUARTILE="ad-first-quartile",Zo.AD_MIDPOINT="ad-midpoint",Zo.AD_THIRD_QUARTILE="ad-third-quartile",Zo.AD_COMPLETE="ad-complete",Zo.AD_STOPPED="ad-stopped",Zo.AD_SKIPPED="ad-skipped",Zo.AD_VOLUME_CHANGED="ad-volume-changed",Zo.AD_MUTED="ad-muted",Zo.AD_PAUSED="ad-paused",Zo.AD_RESUMED="ad-resumed",Zo.AD_SKIP_STATE_CHANGED="ad-skip-state-changed",Zo.CUEPOINTS_CHANGED="ad-cue-points-changed",Zo.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded",Zo.AD_CLICKED="ad-clicked",qo=function(){return new Zo};var rs="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),is="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),as=["loop","playbackRate"],os=["pause","play"],ss={getAssetUri:2,getAudioLanguages:2,getAudioLanguagesAndRoles:2,getBufferedInfo:2,getConfiguration:2,getExpiration:2,getPlaybackRate:2,getTextLanguages:2,getTextLanguagesAndRoles:2,getTextTracks:2,getStats:5,getVariantTracks:2,isAudioOnly:10,isBuffering:1,isInProgress:1,isLive:10,isTextTrackVisible:1,keySystem:10,seekRange:1,getLoadMode:10},us={getPlayheadTimeAsDate:1,getPresentationStartTimeAsDate:20},cs=[["getConfiguration","configure"]],ls=[["isTextTrackVisible","setTextTrackVisibility"]],ds="addTextTrack cancelTrickPlay configure resetConfiguration retryStreaming selectAudioLanguage selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel setTextTrackVisibility trickPlay".split(" "),fs=["attach","detach","load","unload"];function ps(e,t,n,r,i,a){var o=this;this.T=e,this.f=new ae(t),this.W=n,this.l=!1,this.C=r,this.M=i,this.H=a,this.b=this.h=!1,this.I="",this.j=null,this.v=function(){return gs(o)},this.w=function(e,t){switch((n=ns(t)).type){case"event":var n,r=n.targetName;n=new je((n=n.event).type,n),o.C(r,n);break;case"update":for(var i in r=n.update)for(var a in n=o.a[i]||{},r[i])n[a]=r[i][a];o.l&&(o.W(),o.l=!1);break;case"asyncComplete":if(i=n.id,n=n.error,a=o.c[i],delete o.c[i],a)if(n){for(r in i=new Re(n.severity,n.category,n.code),n)i[r]=n[r];a.reject(i)}else a.resolve()}},this.a={video:{},player:{}},this.G=0,this.c={},this.g=null,Es.add(this)}function hs(e,t,n){(Ss=n).addUpdateListener(e.v),n.addMessageListener("urn:x-cast:com.google.shaka.v2",e.w),gs(e),ws(e,{type:"init",initState:t,appData:e.j}),e.g.resolve()}function ms(e,t){var n=8003;switch(t.code){case"cancel":n=8004;break;case"timeout":n=8005;break;case"receiver_unavailable":n=8006}e.g.reject(new Re(De,8,n,t))}function vs(e,t){var n=e.H();e.g=new pe,e.l=!0,hs(e,n,t)}function ys(e){var t=Ss;t.removeUpdateListener(e.v),t.removeMessageListener("urn:x-cast:com.google.shaka.v2",e.w)}function gs(e){var t=!!Ss&&"connected"==Ss.status;if(e.b&&!t){for(var n in e.M(),e.a)e.a[n]={};bs(e)}e.b=t,e.I=t?Ss.receiver.friendlyName:"",e.f.Ob()}function bs(e){for(var t in e.c){var n=e.c[t];delete e.c[t],n.reject(new Re(1,de,7e3))}}function ws(t,e){var n=ts(e),r=Ss;try{r.sendMessage("urn:x-cast:com.google.shaka.v2",n,function(){},O)}catch(e){throw r=new je("error",{detail:n=new Re(De,8,8005,e)}),t.C("player",r),t.gb(),n}}(t=ps.prototype).destroy=function(){return Es.delete(this),bs(this),Ss&&ys(this),this.f&&(this.f.stop(),this.f=null),this.M=this.C=null,this.b=this.h=!1,this.w=this.v=this.g=this.c=this.a=this.j=null,Promise.resolve()},t.fa=function(){return this.b},t.Yc=function(){return this.I},t.init=function(){var e;g.chrome&&chrome.cast&&chrome.cast.isAvailable&&this.T.length&&(this.h=!0,this.f.Ob(),e=new chrome.cast.SessionRequest(this.T),e=new chrome.cast.ApiConfig(e,function(e){for(var t=xe(Es),n=t.next();!n.done;n=t.next())vs(n.value,e)},function(e){for(var t=xe(Es),n=t.next();!n.done;n=t.next())n=n.value,xs="available"==e,n.f.Ob()},"origin_scoped"),chrome.cast.initialize(e,function(){},function(){}),xs&&this.f.R(Ts),(e=Ss)&&e.status!=chrome.cast.SessionStatus.STOPPED?vs(this,e):Ss=null)},t.dd=function(e){this.j=e,this.b&&ws(this,{type:"appData",appData:this.j})},t.cast=function(t){var n=this;return Me(function(e){if(!n.h)throw new Re(1,8,8e3);if(!xs)throw new Re(1,8,8001);if(n.b)throw new Re(1,8,8002);return n.g=new pe,chrome.cast.requestSession(function(e){return hs(n,t,e)},function(e){return ms(n,e)}),Se(e,n.g,0)})},t.gb=function(){if(this.b){if(bs(this),Ss){ys(this);try{Ss.stop(function(){},function(){})}catch(e){}Ss=null}gs(this)}},t.get=function(r,i){var a=this;if("video"==r){if(os.includes(i))return function(e){for(var t=[],n=0;nn.byteLength){n=[];break e}var a=Le(n,e,i);t.push({type:r,value:a}),e+=i}n=t}return n}(e=Xt(e.textContent)).filter(function(e){return 1===e.type})[0])&&(e=lu(e=jt(e.value,!0),"WRMHEADER"))?function(e){for(var t=(e=xe(e.getElementsByTagName("DATA"))).next();!t.done;t=e.next())for(var n=(t=xe(t.value.childNodes)).next();!n.done;n=t.next())if((n=n.value)instanceof Element&&"LA_URL"==n.tagName)return n.textContent;return""}(e):""});function vu(e,t,n,r,i){var a={RepresentationID:t,Number:n,Bandwidth:r,Time:i};return e.replace(/\$(RepresentationID|Number|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(e,t,n,r){if("$$"==e)return"$";var i=a[t];if(null==i)return e;switch("RepresentationID"==t&&n&&(n=void 0),"Time"==t&&(i=Math.round(i)),r){case void 0:case"d":case"i":case"u":e=i.toString();break;case"o":e=i.toString(8);break;case"x":e=i.toString(16);break;case"X":e=i.toString(16).toUpperCase();break;default:e=i.toString()}return n=g.parseInt(n,10)||1,Array(Math.max(0,n-e.length)+1).join("0")+e})}function yu(e,t){var n=gu(e,t,"timescale"),r=1;n&&(r=su(n)||1),(n=su((n=gu(e,t,"duration"))||""))&&(n/=r);var i=gu(e,t,"startNumber"),a=Number(gu(e,t,"presentationTimeOffset"))||0,o=uu(i||"");null!=i&&null!=o||(o=1);i=null;if(c=bu(e,t,"SegmentTimeline")){i=r;for(var s=e.O.duration||1/0,u=Qs(c,"S"),c=[],l=-a,d=(u=xe(Ne(u))).next();!d.done;d=u.next()){var f=(d=d.value).item,p=d.next,h=nu(f,"t",uu),d=nu(f,"d",uu),m=nu(f,"r",ou);if(null!=h&&(h-=a),!d)break;if(f=null!=h?h:l,(h=m||0)<0)if(p){if(null==(p=nu(p,"t",uu)))break;if(p<=f)break;h=Math.ceil((p-f)/d)-1}else{if(1/0==s)break;if(s<=f/i)break;h=Math.ceil((s*i-f)/d)-1}for(0>>31,f&=2147483647;var p=o.reader.J();if(o.reader.skip(4),1==l)throw new Re(De,3,3006);s.push(new ti(c/u+n,(c+p)/u+n,function(){return a},e,e+f-1,t,n,r,i)),c+=p,e+=f}return o.parser.stop(),s}(t,r,i,a,o,n,e)});if(e&&u.parse(e),s)return s;throw new Re(De,3,3004)}function xu(e){this.b=Oe(e),this.a=new Pi(this.b,0)}function Su(e){var t=Eu(e);if(7r.length||!(i.lengthr.length)return!0;if(i.length>=1;return e}}}return null}(c=Qs(e,"AudioChannelConfiguration"))||t.Tc,d=nu(e,"audioSamplingRate",uu)||t.audioSamplingRate,i=i||fc(a,o),{ma:wt(n,r),Lb:$s(e,"SegmentBase")||t.Lb,Ma:$s(e,"SegmentList")||t.Ma,Mb:$s(e,"SegmentTemplate")||t.Mb,width:nu(e,"width",uu)||t.width,height:nu(e,"height",uu)||t.height,contentType:i,mimeType:a,codecs:o,frameRate:s,pixelAspectRatio:u,emsgSchemeIdUris:l,id:e.getAttribute("id"),Tc:c,audioSamplingRate:d}}function lc(t,n,r,i){var a,o,s,u,c,l;return Me(function(e){if(1==e.a)return a=wt(n,[r]),(o=$e(a,t.i.retryParameters)).method=i,s=t.s.networkingEngine.request(4,o),Xe(t.c,s),Se(e,s.promise,2);if(u=e.b,"HEAD"==i){if(!u.headers||!u.headers.date)return e.return(0);c=u.headers.date}else c=Ut(u.data);return l=Date.parse(c),isNaN(l)?e.return(0):e.return(l-Date.now())})}function dc(e,t,n,r){for(var i=r.getAttribute("schemeIdUri")||"",a=r.getAttribute("value")||"",o=nu(r,"timescale",uu)||1,s=(r=xe(Qs(r,"Event"))).next();!s.done;s=r.next()){var u=nu(s=s.value,"presentationTime",uu)||0,c=(u=u/o+t)+(c=nu(s,"duration",uu)||0)/o;null!=n&&(u=Math.min(u,t+n),c=Math.min(c,t+n)),s={schemeIdUri:i,value:a,startTime:u,endTime:c,id:s.getAttribute("id")||"",eventElement:s},e.s.onTimelineRegionAdded(s)}}function fc(e,t){return Wn(It(e,t))?"text":e.split("/")[0]}function pc(e,t,n,r){this.a=e,this.type=t,this.V=n,this.segments=r||null}function hc(e,t,n,r){this.id=e,this.name=t,this.a=n,this.value=void 0===r?null:r}function mc(e,t,n){return(e=e.getAttribute(t))?e.value:n||null}function vc(e,t){var n=e.getAttribute(t);if(!n)throw new Re(De,4,4023,t);return n.value}function yc(e,t){this.V=t,this.a=e}function gc(e,t){this.name=e,this.value=t}function bc(e,t){return e.filter(function(e){return e.name==t})}function wc(e,t){return e.filter(function(e){return vc(e,"TYPE")==t})}function Tc(e,t){var n=bc(e,t);return n.length?n[0]:null}function xc(e,t,n){return n=void 0===n?0:n,(e=Tc(e,t))?Number(e.value):n}function Sc(e){this.b=e,this.a=0}function Ec(e){Ic(e,/[ \t]+/gm)}function Ic(e,t){t.lastIndex=e.a;var n=null==(n=t.exec(e.b))?null:{position:n.index,length:n[0].length,results:n};return e.a==e.b.length||null==n||n.position!=e.a?null:(e.a+=n.length,n.results)}function Ac(e){return e.a!=e.b.length&&(e=Ic(e,/[^ \t\n]*/gm))?e[0]:null}function kc(){this.a=0}function Mc(e,t,n){var r=(t=(t=Ut(t)).replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim()).split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(r[0]))throw new Re(De,4,4015);for(var i=!(t=0),a=xe(r),o=a.next();!o.done;o=a.next())if(o=o.value,/^#(?!EXT)/m.test(o)||i)i=!1;else{if(o=Cc(e.a++,o),--e.a,Nc.includes(o.name)){t=1;break}"EXT-X-STREAM-INF"==o.name&&(i=!0)}a=[],i=!0;for(var s=(o=xe(Ne(r))).next();!s.done;s=o.next()){var s=(c=s.value).Y,u=c.item,c=c.next;if(/^#(?!EXT)/m.test(u)||i)i=!1;else{if(u=Cc(e.a++,u),Rc.includes(u.name)){if(1!=t)throw new Re(De,4,4017);for(u=r.splice(s,r.length-s),r=n,i=[],o=[],s=null,c=(u=xe(u)).next();!c.done;c=u.next())c=c.value,/^(#EXT)/.test(c)?(c=Cc(e.a++,c),Nc.includes(c.name)?a.push(c):"EXT-X-MAP"==c.name?s=c:o.push(c)):/^#(?!EXT)/m.test(c)||(c=wt([r],[c.trim()])[0],s&&o.push(s),i.push(new yc(c,o)),o=[]);return new pc(n,t,a,i)}a.push(u),"EXT-X-STREAM-INF"==u.name&&(u.a.push(new gc("URI",c)),i=!0)}}return new pc(n,t,a)}function Cc(e,t){if(!(o=t.match(/^#(EXT[^:]*)(?::(.*))?$/)))throw new Re(De,4,4016,t);var n,r,i=o[1],a=o[2],o=[];if(a){(r=Ic(a=new Sc(a),/^([^,=]+)(?:,|$)/g))&&(n=r[1]);for(var s=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;r=Ic(a,s);)o.push(new gc(r[1],r[2]||r[3]))}return new hc(e,i,o,n)}(t=ic.prototype).configure=function(e){this.i=e},t.start=function(t,n){var r,i=this;return Me(function(e){if(1==e.a)return i.b=[t],i.s=n,Se(e,ac(i),2);if(r=e.b,i.s&&uc(i,r),!i.s)throw new Re(De,de,7001);return e.return(i.m)})},t.stop=function(){for(var e=xe(Object.values(this.f)),t=e.next();!t.done;t=e.next())t.value.release();return this.a&&this.a.release(),this.i=this.s=null,this.b=[],this.m=null,this.f={},(this.a=null)!=this.g&&(this.g.stop(),this.g=null),this.c.destroy()},t.update=function(){var t,n=this;return Me(function(e){return 1==e.a?(Ie(e,2),Se(e,ac(n),4)):2!=e.a?Ae(e,0):(t=ke(e),n.s&&t?(n.s.onError(t),void Ee(e)):e.return())})},t.onExpirationUpdated=function(){},t.Ib=function(){var t,n,r=this;return Me(function(e){switch(e.a){case 1:return t=0,Ie(e,2),Se(e,ac(r),4);case 4:t=e.b,Ae(e,3);break;case 2:n=ke(e),r.s&&(n.severity=1,r.s.onError(n));case 3:if(!r.s)return e.return();uc(r,t),Ee(e)}})},C("shaka.dash.DashParser",ic),Jr.mpd=function(){return new ic},$r["application/dash+xml"]=function(){return new ic},$r["video/vnd.mpeg.dash.mpd"]=function(){return new ic},hc.prototype.toString=function(){var e="#"+this.name,t=this.a?this.a.map(function(e){return e.name+"="+(isNaN(Number(e.value))?'"'+e.value+'"':e.value)}):[];return this.value&&t.unshift(this.value),0>4)&&2!=n||i(),3==n&&(n=a.na(),a.skip(n)),1==a.J()>>8){a.skip(3),0!=(n=a.na()>>6)&&1!=n||i(),0==a.na()&&i(),n=a.na();var u=a.Kb(),c=a.Kb();return(1073741824*((14&n)>>1)+((65534&u)<<14|(65534&c)>>1))/9e4}r()}else r()}(n,v.uri,v.data));case 4:throw new Re(De,4,4030,n)}})}function Wc(e,t){if(1==t.length)return t[0];var n=Yc(e,t);if(null!=n)return n;throw new Re(De,4,4025,t)}function Yc(e,t){for(var n=xe(el[e]),r=n.next();!r.done;r=n.next()){r=r.value;for(var i=xe(t),a=i.next();!a.done;a=i.next())if(a=a.value,r.test(a.trim()))return a.trim()}return"text"==e?"":null}function $c(e,t){var n=String(e).replace(/%7B/g,"{").replace(/%7D/g,"}"),r=n.match(/{\$\w*}/g);if(r)for(var i=(r=xe(r)).next();!i.done;i=r.next()){var a=(i=i.value).slice(2,i.length-1),o=t.get(a);if(!o)throw new Re(De,4,4039,a);n=n.replace(i,o)}return n}function Jc(e,t){var n=Tc(e,t);if(!n)throw new Re(De,4,4024,t);return n}function Qc(e,t){e.c=t,e.b&&e.b.Nb(e.c==il),e.c!=il||e.h.stop()}function Zc(e,t,n){if(!e.l)throw new Re(De,de,7001);return t=e.s.networkingEngine.request(n,t),Xe(e.l,t),t.promise}C("shaka.net.DataUriPlugin",Dc),Ye("data",Dc.parse=Pc),(t=Lc.prototype).configure=function(e){this.i=e},t.start=function(t,n){var r,i,a=this;return Me(function(e){return 1==e.a?(a.s=n,Se(e,Zc(a,$e([t],a.i.retryParameters),0),2)):3!=e.a?(r=e.b,a.I=r.uri,Se(e,(M=a,C=r.data,Me(function(e){switch(e.a){case 1:if(0!=(N=Mc(M.G,C,M.I)).type)throw new Re(De,4,4022);for(var t=xe(bc(N.V,"EXT-X-DEFINE")),n=t.next();!n.done;n=t.next()){var n=mc(r=n.value,"NAME"),r=mc(r,"VALUE");n&&r&&(M.j.has(n)||M.j.set(n,r))}for(R=bc(N.V,"EXT-X-MEDIA"),n=(t=xe(D=bc(N.V,"EXT-X-STREAM-INF"))).next();!n.done;n=t.next()){r=mc(o=n.value,"AUDIO"),n=mc(o,"VIDEO");var i,a=mc(o,"SUBTITLES"),o=jc(o);a&&(i=Yc("text",o),M.f.set(a,i),qe(o,i)),r&&(a=Wc("audio",o),M.f.set(r,a)),n&&(r=Wc("video",o),M.f.set(n,r))}return Se(e,(E=M,I=R,Me(function(e){return 1==e.a?(I=I.filter(function(e){var t=mc(e,"URI")||"";return"SUBTITLES"!=mc(e,"TYPE")&&""!=t})).length?Se(e,Fc(E,I[0]),2):e.u(2):(A=I.slice(1).map(function(e){return Fc(E,e)}),Se(e,Promise.all(A),0))})),2);case 2:for(n=(t=xe(t=wc(R,"CLOSED-CAPTIONS"))).next();!n.done;n=t.next())n=Bc(a=n.value),r=vc(a,"GROUP-ID"),a=vc(a,"INSTREAM-ID"),M.w.get(r)||M.w.set(r,new Map),M.w.get(r).set(a,n);return Se(e,(k=M,w=D,Me(function(e){return 1==e.a?(T=w.map(function(n){var r,i,a,o,s,u,c;return Me(function(e){return 1==e.a?(r=mc(n,"FRAME-RATE"),i=Number(vc(n,"BANDWIDTH")),a=mc(n,"RESOLUTION"),o=xe(a?a.split("x"):[null,null]),s=o.next().value,u=o.next().value,Se(e,(t=k,l=n,d=a,f=r,Me(function(e){if(1==e.a)return p=xt,h=jc(l),m=mc(l,"AUDIO"),v=mc(l,"VIDEO"),g=(y=m||v)&&t.g.has(y)?t.g.get(y):[],T=!(b={audio:m?g:[],video:v?g:[]}),x=vc(l,"URI"),S=b.audio.find(function(e){return e&&e.nc==x}),E=Yc(p.Ba,h),I=d||f||E,1!=h.length||I?!g.length&&1n,u&&c)return Se(e,a.updateManifestExpiration(r.key(),n),3);e.u(3);break;case 3:return $(e),Se(e,i.destroy(),10);case 10:J(e,0);break;case 2:ke(e),e.u(3)}})},$r["application/x-offline-manifest"]=function(){return new Yl},C("shaka.offline.OfflineScheme",$l),Ye("offline",$l.plugin=Jl),(t=rd.prototype).destroy=function(){return this.D.destroy()},t.configure=function(e,t){return 2==arguments.length&&"string"==typeof e&&(e=xa(e,t)),e.manifest&&e.manifest.dash&&"defaultPresentationDelay"in e.manifest.dash&&(ft("manifest.dash.defaultPresentationDelay configuration","Please Use manifest.defaultPresentationDelay instead."),e.manifest.defaultPresentationDelay=e.manifest.dash.defaultPresentationDelay,delete e.manifest.dash.defaultPresentationDelay),Ia(this.i,e)},t.getConfiguration=function(){var e=Ea();return Ia(e,this.i,Ea()),e},t.Db=function(){return this.N},t.store=function(n,e,r){var P,_,L,O,U,j,B,F,V,H,K,q,G,z,X,W,i=this,a=this.getConfiguration(),t=new wl(this.N);this.Wc.push(t),P=this,_=n,L=e||{},O=function(){var t;return Me(function(e){return 1==e.a?Se(e,Wr(n,i.N,a.manifest.retryParameters,r||null),2):(t=e.b,e.return(bt(t)))})},U=a,j=t;var o,s,u,c=new he(e=Me(function(e){switch(e.a){case 1:return ud(),F=B=null,V=new Pl,K=H=null,Ie(e,2,3),Se(e,O(),5);case 5:return B=e.b,Se(e,(t=P,n=_,r=B,k=U,Me(function(e){if(1==e.a)return M=null,C=t.N,N={networkingEngine:C,filter:function(){return Promise.resolve()},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){M=e}},r.configure(k.manifest),sd(t),Se(e,r.start(n,N),2);if(3!=e.a)return R=e.b,sd(t),D=ld(R),Se(e,Promise.all(Q(D,function(e){return e.createSegmentIndex()})),3);if(sd(t),M)throw M;return e.return(R)})),6);case 6:if(q=e.b,sd(P),q.presentationTimeline.S()||q.presentationTimeline.Sa())throw new Re(De,9,9005,_);return Se(e,(i=P,a=q,o=function(e){K=K||e},I=U,Me(function(e){switch(e.a){case 1:return(A=new Jt({lb:i.N,onError:o,hc:function(){},onExpirationUpdated:function(){},onEvent:function(){}})).configure(I.drm),Se(e,(t=A,n=a.variants,r=I.offline.usePersistentLicense,t.l=[],t.w=r,Zt(t,n)),2);case 2:return Se(e,en(A),3);case 3:return Se(e,tn(A),4);case 4:return e.return(A)}var t,n,r})),7);case 7:if(F=e.b,sd(P),K)throw K;return Se(e,P.fb(q,F,U),8);case 8:return Se(e,V.init(),9);case 9:return sd(P),Se(e,function(e){var r=null;if(e.a.forEach(function(e,n){e.getCells().forEach(function(e,t){e.hasFixedKeySpace()||r||(r={path:{ua:n,ba:t},ba:e})})}),r)return r;throw new Re(De,9,9013,"Could not find a cell that supports add-operations")}(V),10);case 10:return H=e.b,sd(P),Se(e,(s=P,u=H.ba,c=F,l=q,d=_,f=L,p=U,h=j,Me(function(e){switch(e.a){case 1:return o=f,m={offlineUri:null,originalManifestUri:d,duration:(a=l).presentationTimeline.getDuration(),size:0,expiration:1/0,tracks:a=ed(a),appMetadata:o},v=p.offline.progressCallback,r=function(e,t){m.size=t,v(m,e)},i=function(e,t){b&&p.offline.usePersistentLicense&&w==t&&nn(c,"cenc",e)},(n=h).Fd=r,n.Ed=i,y=l.variants.some(function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t}),g=l.variants.some(function(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]).some(function(e){return e.initData&&e.initData.length})}),w=null,(b=y&&!g)&&(T=c.c,w=dd.get(T.keySystem)),Y(e),S=x=function(e,t,n,r,i,a,o,s){for(var u=new td,c=xe(i.variants),l=c.next();!l.done;l=c.next()){var d,f,p=u,h=(l=l.value).audio,m=l.video;h&&!m&&(p.a[h.id]=h.bandwidth||l.bandwidth),!h&&m&&(p.a[m.id]=m.bandwidth||l.bandwidth),h&&m&&(d=h.bandwidth||393216,(f=m.bandwidth||l.bandwidth-d)<=0&&(f=l.bandwidth),p.a[h.id]=d,p.a[m.id]=f)}for(c=xe(i.textStreams),p=c.next();!p.done;p=c.next())u.a[p.value.id]=52;for(p=ld(i),c=new Map,p=xe(p),l=p.next();!l.done;l=p.next())l=l.value,h=od(e,t,n,u,i,l,s),c.set(l.id,h);for(e=xe(i.variants),l=e.next();!l.done;l=e.next())(t=l.value).audio&&c.get(t.audio.id).variantIds.push(t.id),t.video&&c.get(t.video.id).variantIds.push(t.id);return e=Array.from(c.values()),s=s.offline.usePersistentLicense,(t=r.c)&&s&&(t.initData=[]),{creationTime:Date.now(),originalManifestUri:a,duration:i.presentationTimeline.getDuration(),size:0,expiration:r.Cb(),streams:e,sessionIds:s?on(r):[],drmInfo:t,appMetadata:o}}(s,h,u,c,l,d,f,p),Se(e,(t=h,Me(function(e){return 1==e.a?Se(e,Promise.all(t.a.values()),2):e.return(t.Bb.a)})),4);case 4:if(S.size=e.b,x.expiration=c.Cb(),E=on(c),x.sessionIds=p.offline.usePersistentLicense?E:[],y&&p.offline.usePersistentLicense&&!E.length)throw new Re(De,9,9007);return e.return(x);case 2:return $(e),Se(e,h.destroy(),5);case 5:J(e,0)}var t,n,r,i,a,o})),11);case 11:if(G=e.b,sd(P),K)throw K;return Se(e,H.ba.addManifests([G]),12);case 12:return z=e.b,sd(P),X=new ql("manifest",H.path.ua,H.path.ba,z[0]),e.return(Zl(X,G));case 3:return $(e),P.lc=[],Se(e,V.destroy(),13);case 13:if(B)return Se(e,B.stop(),14);e.u(14);break;case 14:if(F)return Se(e,F.destroy(),16);e.u(16);break;case 16:J(e,0);break;case 2:if(W=ke(e),H)return Se(e,H.ba.removeSegments(P.lc,function(){}),18);e.u(18);break;case 18:throw K||W}var s,u,c,l,d,f,p,h,m,v,y,g,b,w,T,x,S,E,i,a,o,I,A,t,n,r,k,M,C,N,R,D}),function(){return Tl(t)});return c.finally(function(){qe(i.Wc,t)}),c.then=function(e){return ft("shaka.offline.Storage.store.then","Storage operations now return a shaka.util.AbortableOperation, rather than a promise. Please update to conform to this new API; you can use the |chain| method instead."),c.promise.then(e)},o=this,u=(s=c).promise,o.Jb.push(u),s.finally(function(){qe(o.Jb,u)})},t.we=function(){return ft("shaka.offline.Storage.getStoreInProgress","Multiple concurrent downloads are now supported."),!1},t.fb=function(s,u,c){var l,d,f,p,h,m,v,y,g,b,w,T,x,S,E;return Me(function(e){if(1==e.a){for(l={width:1/0,height:1/0},i=s,a=c.restrictions,o=l,i.variants=i.variants.filter(function(e){return Sr(e,a,o)}),(r=s).variants=r.variants.filter(function(e){var t=!0;return e.audio&&(t=t&&Qn(e.audio)),e.video&&(t=t&&Qn(e.video)),t}),n=u,(t=s).variants=t.variants.filter(function(e){return hn(n,e)}),d=[],f=c.preferredAudioChannelCount,xr(s,f),p=xe(s.variants),h=p.next();!h.done;h=p.next())m=h.value,d.push(Ir(m));for(v=xe(s.textStreams),y=v.next();!y.done;y=v.next())g=y.value,d.push(Ar(g));return Se(e,c.offline.trackSelectionCallback(d),2)}var t,n,r,i,a,o;for(b=e.b,w=new Set,T=new Set,x=xe(b),S=x.next();!S.done;S=x.next())"variant"==(E=S.value).type&&w.add(E.id),"text"==E.type&&T.add(E.id);s.variants=s.variants.filter(function(e){return w.has(e.id)}),s.textStreams=s.textStreams.filter(function(e){return T.has(e.id)}),function(e){e.variants.map(function(e){return e.video});var t=new Set(e.variants.map(function(e){return e.audio}));e=e.textStreams;for(var n=xe(t),r=n.next();!r.done;r=n.next())for(var i=(r=xe(t)).next();!i.done;i=r.next());for(t=xe(e),n=t.next();!n.done;n=t.next())for(n=xe(e),r=n.next();!r.done;r=n.next());}(s),Ee(e)})},t.remove=function(e){return cd(this,(o=this,s=e,Me(function(e){switch(e.a){case 1:if(ud(),null==(d=Gl(s))||"manifest"!=d.a)throw new Re(De,9,9004,s);return f=d,p=new Pl,Y(e),Se(e,p.init(),4);case 4:return Se(e,_l(p,f.ua(),f.ba()),5);case 5:return Se(e,(h=e.b).getManifests([f.key()]),6);case 6:return m=e.b,v=m[0],Se(e,Promise.all([(u=o,c=v,l=p,Me(function(e){return Se(e,(t=u.N,n=u.i.drm,r=l,i=c,Me(function(e){return 1==e.a?i.drmInfo?(a=function(e){var t=Array.from(e.a.keys());if(!t.length)throw new Re(De,9,9e3,"No supported storage mechanisms found");return e.a.get(t[0]).getEmeSessionCell()}(r),o=i.sessionIds.map(function(e){return{sessionId:e,keySystem:i.drmInfo.keySystem,licenseUri:i.drmInfo.licenseServerUri,serverCertificate:i.drmInfo.serverCertificate,audioCapabilities:ad(i,!1),videoCapabilities:ad(i,!0)}}),Se(e,Ql(n,t,o),2)):e.return():3!=e.a?(s=e.b,Se(e,a.remove(s),3)):Se(e,a.add(o.filter(function(e){return!s.includes(e.sessionId)})),0)})),0);var t,n,r,i,a,o,s})),(n=h,r=f,a=function(e){for(var t=[],n=(e=xe(e.streams)).next();!n.done;n=e.next())for(var r=(n=xe(n.value.segments)).next();!r.done;r=n.next())null!=(r=r.value).initSegmentKey&&t.push(r.initSegmentKey),t.push(r.dataKey);return t}(i=v),Zl(r,i),Promise.all([n.removeSegments(a,t),n.removeManifests([r.key()],t)]))]),2);case 2:return $(e),Se(e,p.destroy(),8);case 8:J(e,0)}function t(){}var n,r,i,a,u,c,l})));var o,s,d,f,p,h,m,v},t.Ne=function(){return cd(this,(n=this,Me(function(e){switch(e.a){case 1:return ud(),r=n.N,i=n.i.drm,a=new Pl,o=!1,Y(e),Se(e,a.init(),4);case 4:s=[],t=function(e){return s.push(e)},a.a.forEach(function(e){t(e.getEmeSessionCell())}),u=xe(s),c=u.next();case 5:if(c.done){e.u(2);break}return Se(e,(l=c.value).getAll(),8);case 8:return d=e.b,Se(e,Ql(i,r,d),9);case 9:return f=e.b,Se(e,l.remove(f),10);case 10:f.length!=d.length&&(o=!0),c=u.next(),e.u(5);break;case 2:return $(e),Se(e,a.destroy(),11);case 11:J(e,3);break;case 3:return e.return(!o)}var t})));var n,r,i,a,o,s,u,c,l,d,f},t.list=function(){return cd(this,Me(function(e){switch(e.a){case 1:return ud(),i=[],t=new Pl,Y(e),Se(e,t.init(),4);case 4:return n=Promise.resolve(),r=function(r,t){n=n.then(function(){return Me(function(e){if(1==e.a)return Se(e,t.getAllManifests(),2);e.b.forEach(function(e,t){var n=Zl(new ql("manifest",r.ua,r.ba,t),e);i.push(n)}),Ee(e)})})},t.a.forEach(function(e,n){e.getCells().forEach(function(e,t){r({ua:n,ba:t},e)})}),Se(e,n,2);case 2:return $(e),Se(e,t.destroy(),6);case 6:J(e,3);break;case 3:return e.return(i)}var r}));var i,t,n},C("shaka.offline.Storage",rd),rd.deleteAll=function(){var i;return Me(function(e){return 1==e.a?(i=new Pl,Y(e),Se(e,(t=i,Me(function(e){return 1==e.a?(n=Array.from(t.a.values()),(r=0 tag.");var o=eu(i,"http://www.w3.org/ns/ttml#parameter","frameRate"),s=eu(i,"http://www.w3.org/ns/ttml#parameter","subFrameRate"),u=eu(i,"http://www.w3.org/ns/ttml#parameter","frameRateMultiplier"),c=eu(i,"http://www.w3.org/ns/ttml#parameter","tickRate"),l=eu(i,"http://www.w3.org/ns/ttml#parameter","cellResolution"),a=i.getAttribute("xml:space")||"default",n=i.getAttribute("tts:extent");if("default"!=a&&"preserve"!=a)throw new Re(De,2,2005,"Invalid xml:space value: "+a);a="default"==a,o=new yf(o,s,u,c),l=(l=l&&/^(\d+) (\d+)$/.exec(l))?{columns:parseInt(l[1],10),rows:parseInt(l[2],10)}:null,s=uf(i.getElementsByTagName("metadata")[0]),u=uf(i.getElementsByTagName("styling")[0]);for(var d=[],f=xe(c=uf(i.getElementsByTagName("layout")[0])),p=f.next();!p.done;p=f.next()){var h,m,v=p.value,y=n,p=new qn,g=v.getAttribute("xml:id");g?(p.id=g,g=null,y&&(g=wf.exec(y)||Sf.exec(y)),y=g?Number(g[1]):null,g=g?Number(g[2]):null,!(h=ff(v,u,"extent"))||null!=(h=(m=wf.exec(h))||Sf.exec(h))&&(p.width=null!=y?100*Number(h[1])/y:Number(h[1]),p.height=null!=g?100*Number(h[2])/g:Number(h[2]),p.widthUnits=m||null!=y?Gn:0,p.heightUnits=m||null!=g?Gn:0),!(v=ff(v,u,"origin"))||null!=(h=(m=wf.exec(v))||Sf.exec(v))&&(p.viewportAnchorX=null!=g?100*Number(h[1])/g:Number(h[1]),p.viewportAnchorY=null!=y?100*Number(h[2])/y:Number(h[2]),p.viewportAnchorUnits=m||null!=y?Gn:0)):p=null,p&&d.push(p)}for(n=function e(t){if(!t)return[];var n=[];t=xe(t.childNodes);for(var r=t.next();!r.done;r=t.next())r=r.value,r instanceof Element&&(r.hasAttribute("begin")?n.push(r):n=n.concat(e(r)));return n}(i.getElementsByTagName("body")[0]),i=(n=xe(n)).next();!i.done;i=n.next())(i=cf(i.value,t.periodStart,o,s,u,c,d,a,!1,l))&&r.push(i)}return r},C("shaka.text.TtmlTextParser",sf),sf.prototype.parseMedia=sf.prototype.parseMedia,sf.prototype.parseInit=sf.prototype.parseInit;var gf,bf,wf=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Tf=/^(\d{1,2}(?:\.\d+)?|100)%$/,xf=/^(\d+px|\d+em|\d*\.?\d+c)$/,Sf=/^(\d+)px (\d+)px$/,Ef=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,If=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Af=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,kf=/^(\d*(?:\.\d*)?)f$/,Mf=/^(\d*(?:\.\d*)?)t$/,Cf=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Nf={left:Bn,center:"center",right:"end",start:Bn,end:"end"},Rf={left:"line-left",center:"center",right:"line-right"};function Df(){this.l=new sf}function Pf(){}function _f(e,t,n){var r,i,a,o;(r=/^align:(start|middle|center|end|left|right)$/.exec(t))?(t=r[1],e.textAlign="middle"==t?Dn:Pn[t.toUpperCase()]):(r=/^vertical:(lr|rl)$/.exec(t))?e.writingMode="lr"==r[1]?"vertical-lr":"vertical-rl":(r=/^size:([\d.]+)%$/.exec(t))?e.size=Number(r[1]):(r=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(t))?(e.position=Number(r[1]),r[2]&&(t=r[2],e.positionAlign="line-left"==t||"start"==t?"line-left":"line-right"==t||"end"==t?"line-right":"center")):(r=/^region:(.*)$/.exec(t))?(i=n,a=r[1],(t=(o=i.filter(function(e){return e.id==a})).length?o[0]:null)&&(e.region=t)):(n=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(t))?(e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=Fn[n[2].toUpperCase()])):(n=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(t))&&(e.lineInterpretation=jn,e.line=Number(n[1]),n[2]&&(e.lineAlign=Fn[n[2].toUpperCase()]))}function Lf(e){if(null==(e=Ic(e,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3})/g)))return null;var t=Number(e[2]),n=Number(e[3]);return 59