From ba91ce72cebeccae87756b1c796bf14ca3aade9d Mon Sep 17 00:00:00 2001 From: Bifeldy Date: Sun, 13 Aug 2023 18:12:47 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=20=F0=9F=A4=94=20=F0=9F=98=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...d0daa2e6891a16.js => 635.18f003abb5156e8f.js} | 2 +- dist/fansubid/browser/index.html | 2 +- ...4aa46a02fa196.js => main.752601e9332f73ef.js} | 2 +- dist/fansubid/browser/ngsw.json | 16 ++++++++-------- ...203fe11c95.js => runtime.3bde4ed73ae5d072.js} | 2 +- dist/fansubid/server/main.js | 2 +- src/api/controllers/attachment.controller.ts | 13 ++++++------- .../berkas-detail/berkas-detail.component.html | 10 +++++----- 8 files changed, 24 insertions(+), 25 deletions(-) rename dist/fansubid/browser/{635.7dd0daa2e6891a16.js => 635.18f003abb5156e8f.js} (82%) rename dist/fansubid/browser/{main.b2d4aa46a02fa196.js => main.752601e9332f73ef.js} (50%) rename dist/fansubid/browser/{runtime.051e60203fe11c95.js => runtime.3bde4ed73ae5d072.js} (57%) diff --git a/dist/fansubid/browser/635.7dd0daa2e6891a16.js b/dist/fansubid/browser/635.18f003abb5156e8f.js similarity index 82% rename from dist/fansubid/browser/635.7dd0daa2e6891a16.js rename to dist/fansubid/browser/635.18f003abb5156e8f.js index 9f7b78f3d..68c0db515 100644 --- a/dist/fansubid/browser/635.7dd0daa2e6891a16.js +++ b/dist/fansubid/browser/635.18f003abb5156e8f.js @@ -1 +1 @@ -(self.webpackChunkfansubid=self.webpackChunkfansubid||[]).push([[635],{8635:(je,we,j)=>{"use strict";j.r(we),j.d(we,{BerkasModule:()=>d0});var Q=j(9808),_e=j(8406),B=j(3075),Ae=j(9345),ve=j(1385),te=j(6271),Ce=j(4249),Ee=j(210),Te=j(6436),pe=j(8613),u=j(5e3);let se=(()=>{class s{}return s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=u.oAB({type:s}),s.\u0275inj=u.cJS({imports:[[Q.ez]]}),s})();var Ue=j(8764),Ve=j(4167),it=j(7355),yt=j(2777),ue=j(5861),Oe=j(520),me=j(8505),Le=j(7272),Ge=j(5934),ke=j(8696),Ne=j(3e3),He=j(8745),rt=j(8987),w=j(6382),D=j(4137),V=j(4327),ee=j(6925),Y=j(197);let de=(()=>{class s{constructor(t,r,e){this.gs=t,this.toast=r,this.dls=e,this.attachmentsDownload={}}getAttachmentDownloadFile(t){return this.attachmentsDownload[t.id]||(this.attachmentsDownload[t.id]={},this.attachmentsDownload[t.id].name=t.name,this.attachmentsDownload[t.id].size=t.size,this.attachmentsDownload[t.id].ext=t.ext,this.attachmentsDownload[t.id].download_count=t.download_count,this.attachmentsDownload[t.id].google_drive=t.google_drive,this.attachmentsDownload[t.id].discord=t.discord,this.attachmentsDownload[t.id].mode="indeterminate",this.attachmentsDownload[t.id].isDownloading=!1,this.attachmentsDownload[t.id].isCompleted=!1,this.attachmentsDownload[t.id].data=null,this.attachmentsDownload[t.id].handler=null,this.attachmentsDownload[t.id].toast=null,this.attachmentsDownload[t.id].totals=0,this.attachmentsDownload[t.id].percentage=0,this.attachmentsDownload[t.id].speed=0,this.attachmentsDownload[t.id].loaded=0),this.attachmentsDownload[t.id]}stopFail(t){t.isDownloading=!1,t.isCompleted=!1,t.toast&&this.toast.remove(t.toast.toastId)}onProgress(t,r){if(r.loaded){this.gs.log("[DOWNLOAD_PROGRESS]",r),t.mode="determinate";const e=r.loaded-t.loaded;t.totals+=e,t.speed=e/1e3,t.percentage=Math.round(t.totals/t.size*100),t.loaded=r.loaded,t.toast.toastRef.componentInstance.message=`${t.percentage}% @ ${t.speed} KB/s`}}startDownload(t,r=!0){var e=this;const i=this.attachmentsDownload[t];var a;i.toast=this.toast.warning(`${i.percentage}% @ ${i.speed} KB/s`,"Mengunduh ...",{closeButton:!1,timeOut:0,disableTimeOut:"extendedTimeOut",tapToDismiss:!1}),i.isCompleted?this.saveFileAs(t):(i.isDownloading=!0,i.discord?this.dls.getListDdl(t).subscribe({next:(a=(0,ue.Z)(function*(o){e.gs.log("[DOWNLOAD_LIST_DDL]",o);const l=o.results.sort((v,g)=>v.chunk_idx-g.chunk_idx),d=[];for(const v of l){let g=null;g=r?e.dls.downloadDdlDirect(v.url):e.dls.downloadDdlProxy(v.id),d.push(g)}const f=[];var v;i.handler=(0,Le.z)(...d).subscribe({next:(v=(0,ue.Z)(function*(g){if(g.type===Oe.dt.DownloadProgress&&e.onProgress(i,g),g.type===Oe.dt.Response){i.loaded=0;const E=yield g.body.arrayBuffer(),x=new Uint8Array(E);e.gs.log("[DOWNLOAD_CHUNK_APPEND]",E.byteLength),f.push(x)}if(g.type===Oe.dt.Response&&f.length===l.length){e.gs.log("[DOWNLOAD_CHUNK_COMPLETED]",f);const T=new Blob(f);i.mode="determinate",i.isDownloading=!1,i.isCompleted=!0,i.data=T,e.toast.remove(i.toast.toastId),e.saveFileAs(t)}}),function(T){return v.apply(this,arguments)}),error:v=>{e.gs.log("[DOWNLOAD_CHUNK_ERROR]",v,"error"),e.stopFail(i)}})}),function(l){return a.apply(this,arguments)}),error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(i)}}):i.handler=this.dls.downloadLampiran(t).subscribe({next:a=>{a.type===Oe.dt.DownloadProgress&&this.onProgress(i,a),a.type===Oe.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",a),i.mode="determinate",i.isDownloading=!1,i.isCompleted=!0,i.data=a.body,this.toast.remove(i.toast.toastId),this.saveFileAs(t))},error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(i)}}))}cancelDownload(t){const r=this.attachmentsDownload[t];r.mode="indeterminate",r.percentage=0,r.speed=0,r.totals=0,r.loaded=0,r.isDownloading=!1,r.isCompleted=!1,r.handler&&r.handler.unsubscribe(),r.toast&&this.toast.remove(r.toast.toastId)}saveFileAs(t){this.gs.log("[SAVE_FILE]",t);const r=this.attachmentsDownload[t];(0,V.saveAs)(r.data,`${r.name}.${r.ext}`)}}return s.\u0275fac=function(t){return new(t||s)(u.LFG(ke.U),u.LFG(ee.k),u.LFG(Y.v))},s.\u0275prov=u.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),s})();var le=j(8020),xe=j(8381),J=j(8616),re=j(4623),X=j(7423),oe=j(7238),De=j(5245),Ze=j(5899),qe=j(7322),We=j(4107),Me=j(508),Pt=j(9226),P=j.n(Pt),St=j(1421),K=j.n(St);function gt(){return gt=Object.assign||function(s){for(var n=1;n-1},n.trigger=function(r){var e=this.listeners[r];if(e)if(2===arguments.length)for(var i=e.length,a=0;a-1;i=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)},n}(Cr),Bn=String.fromCharCode(9),kr=function(n){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(n||""),r={};return t[1]&&(r.length=parseInt(t[1],10)),t[2]&&(r.offset=parseInt(t[2],10)),r},Ut=function(n){for(var i,t=n.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r={},e=t.length;e--;)""!==t[e]&&((i=/([^=]*)=(.*)/.exec(t[e]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),r[i[0]]=i[1]);return r},Vi=function(s){function n(){var r;return(r=s.call(this)||this).customParsers=[],r.tagMappers=[],r}ie(n,s);var t=n.prototype;return t.push=function(e){var a,o,i=this;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(d,f){var v=f(e);return v===e?d:d.concat([v])},[e]).forEach(function(d){for(var f=0;f0&&(a.duration=S.duration),0===S.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key:function(){if(S.attributes)if("NONE"!==S.attributes.METHOD)if(S.attributes.URI){if("com.apple.streamingkeydelivery"===S.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:S.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===S.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(S.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===S.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==S.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):S.attributes.KEYID&&"0x"===S.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:S.attributes.KEYFORMAT,keyId:S.attributes.KEYID.substring(2)},pssh:er(S.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));S.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:S.attributes.METHOD||"AES-128",uri:S.attributes.URI},void 0!==S.attributes.IV&&(l.iv=S.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else l=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(S.number)?this.manifest.mediaSequence=S.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+S.number})},"discontinuity-sequence":function(){isFinite(S.number)?(this.manifest.discontinuitySequence=S.number,T=S.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+S.number})},"playlist-type":function(){/VOD|EVENT/.test(S.playlistType)?this.manifest.playlistType=S.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+S.playlist})},map:function(){o={},S.uri&&(o.uri=S.uri),S.byterange&&(o.byterange=S.byterange),l&&(o.key=l)},"stream-inf":function(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes?(a.attributes||(a.attributes={}),gt(a.attributes,S.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes&&S.attributes.TYPE&&S.attributes["GROUP-ID"]&&S.attributes.NAME){var q=this.manifest.mediaGroups[S.attributes.TYPE];q[S.attributes["GROUP-ID"]]=q[S.attributes["GROUP-ID"]]||{},F=q[S.attributes["GROUP-ID"]],(U={default:/yes/i.test(S.attributes.DEFAULT)}).autoselect=!!U.default||/yes/i.test(S.attributes.AUTOSELECT),S.attributes.LANGUAGE&&(U.language=S.attributes.LANGUAGE),S.attributes.URI&&(U.uri=S.attributes.URI),S.attributes["INSTREAM-ID"]&&(U.instreamId=S.attributes["INSTREAM-ID"]),S.attributes.CHARACTERISTICS&&(U.characteristics=S.attributes.CHARACTERISTICS),S.attributes.FORCED&&(U.forced=/yes/i.test(S.attributes.FORCED)),F[S.attributes.NAME]=U}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){T+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=S.dateTimeString,this.manifest.dateTimeObject=S.dateTimeObject),a.dateTimeString=S.dateTimeString,a.dateTimeObject=S.dateTimeObject},targetduration:function(){!isFinite(S.duration)||S.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+S.duration}):(this.manifest.targetDuration=S.duration,Ar.call(this,this.manifest))},start:function(){S.attributes&&!isNaN(S.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:S.attributes["TIME-OFFSET"],precise:S.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=S.data},"cue-out-cont":function(){a.cueOutCont=S.data},"cue-in":function(){a.cueIn=S.data},skip:function(){this.manifest.skip=_i(S.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",S.attributes,["SKIPPED-SEGMENTS"])},part:function(){var q=this;d=!0;var ne=this.manifest.segments.length,he=_i(S.attributes);a.parts=a.parts||[],a.parts.push(he),he.byterange&&(he.byterange.hasOwnProperty("offset")||(he.byterange.offset=x),x=he.byterange.offset+he.byterange.length),this.warnOnMissingAttributes_("#EXT-X-PART #"+(a.parts.length-1)+" for segment #"+ne,S.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(ye,ge){ye.hasOwnProperty("lastPart")||q.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+ge+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var q=this.manifest.serverControl=_i(S.attributes);q.hasOwnProperty("canBlockReload")||(q.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ar.call(this,this.manifest),q.canSkipDateranges&&!q.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var q=this.manifest.segments.length,ne=_i(S.attributes),he=ne.type&&"PART"===ne.type;a.preloadHints=a.preloadHints||[],a.preloadHints.push(ne),ne.byterange&&(ne.byterange.hasOwnProperty("offset")||(ne.byterange.offset=he?x:0,he&&(x=ne.byterange.offset+ne.byterange.length)));var z=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+z+" for segment #"+q,S.attributes,["TYPE","URI"]),ne.type)for(var ye=0;yer.timeline?1:-1})},lu=function(n){var t=[];return function(n,t,r){t.forEach(function(e){for(var i in n.mediaGroups[e])for(var a in n.mediaGroups[e][i])r(n.mediaGroups[e][i][a])})}(n,uf,function(r,e,i,a){t=t.concat(r.playlists||[])}),t},du=function(n){var t=n.playlist;t.mediaSequence=n.mediaSequence,t.segments.forEach(function(e,i){e.number=t.mediaSequence+i})},Wn=function(n){return n&&n.uri+"-"+function(n){var t;return t="bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1,n.offset+"-"+t}(n.byterange)},os=function(n){return nu(n.reduce(function(r,e){var a,i=e.attributes.id+(e.attributes.lang||"");r[i]?(e.segments&&(e.segments[0]&&(e.segments[0].discontinuity=!0),(a=r[i].segments).push.apply(a,e.segments)),e.attributes.contentProtection&&(r[i].attributes.contentProtection=e.attributes.contentProtection)):(r[i]=e,r[i].attributes.timelineStarts=[]);return r[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),r},{})).map(function(r){return r.discontinuityStarts=function(n,t){return n.reduce(function(r,e,i){return e.discontinuity&&r.push(i),r},[])}(r.segments||[]),r})},us=function(n,t){var r=Wn(n.sidx),e=r&&t[r]&&t[r].sidx;return e&&ss(n,e,n.sidx.resolvedUri),n},hf=function(n,t){if(void 0===t&&(t={}),!Object.keys(t).length)return n;for(var r in n)n[r]=us(n[r],t);return n},yf=function(n){var t,r=n.attributes,e=n.segments,i=n.sidx,a=n.discontinuityStarts,o={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:e};return r.contentProtection&&(o.contentProtection=r.contentProtection),i&&(o.sidx=i),o},Tf=function(n){var t=n.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},bf=function(n){var t=n.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},xf=function(n){var t=n.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},cu=function(n){return n?Object.keys(n).reduce(function(t,r){return t.concat(n[r].playlists)},[]):[]},Ef=function(n){var t,r=n.dashPlaylists,e=n.locations,i=n.sidxMapping,a=void 0===i?{}:i,o=n.previousManifest;if(!r.length)return{};var l=r[0].attributes,d=l.sourceDuration,f=l.type,v=l.suggestedPresentationDelay,g=l.minimumUpdatePeriod,T=os(r.filter(Tf)).map(yf),E=os(r.filter(bf)),x=os(r.filter(xf)),S=r.map(function(he){return he.attributes.captionServices}).filter(Boolean),F={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:d,playlists:hf(T,a)};g>=0&&(F.minimumUpdatePeriod=1e3*g),e&&(F.locations=e),"dynamic"===f&&(F.suggestedPresentationDelay=v);var H=E.length?function(n,t,r){void 0===t&&(t={}),void 0===r&&(r=!1);var e,i=n.reduce(function(o,l){var d=l.attributes.role&&l.attributes.role.value||"",f=l.attributes.lang||"",v=l.attributes.label||"main";f&&!l.attributes.label&&(v=l.attributes.lang+(d?" ("+d+")":"")),o[v]||(o[v]={language:f,autoselect:!0,default:"main"===d,playlists:[],uri:""});var T=us(function(n,t){var r,e=n.attributes,i=n.segments,a=n.sidx,o=n.mediaSequence,l=n.discontinuitySequence,d=n.discontinuityStarts,f={attributes:(r={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:l,discontinuityStarts:d,timelineStarts:e.timelineStarts,mediaSequence:o,segments:i};return e.contentProtection&&(f.contentProtection=e.contentProtection),a&&(f.sidx=a),t&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs"),f}(l,r),t);return o[v].playlists.push(T),void 0===e&&"main"===d&&((e=l).default=!0),o},{});return e||(i[Object.keys(i)[0]].default=!0),i}(E,a,0===F.playlists.length):null,W=x.length?function(n,t){return void 0===t&&(t={}),n.reduce(function(r,e){var i=e.attributes.lang||"text";return r[i]||(r[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),r[i].playlists.push(us(function(n){var t,r=n.attributes,e=n.segments,i=n.mediaSequence,a=n.discontinuityStarts,o=n.discontinuitySequence;void 0===e&&(e=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var l=((t={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,t);return r.codecs&&(l.CODECS=r.codecs),{attributes:l,uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:i,segments:e}}(e),t)),r},{})}(x,a):null,q=T.concat(cu(H),cu(W)),ne=q.map(function(he){return he.timelineStarts});return F.timelineStarts=uu(ne),function(n,t){n.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=ns(t,function(e){return e.timeline===r.timeline}),r.segments&&r.segments.forEach(function(e,i){e.number=i})})}(q,F.timelineStarts),H&&(F.mediaGroups.AUDIO.audio=H),W&&(F.mediaGroups.SUBTITLES.subs=W),S.length&&(F.mediaGroups["CLOSED-CAPTIONS"].cc=function(n){return n.reduce(function(t,r){return r&&r.forEach(function(e){var a=e.language;t[a]={autoselect:!1,default:!1,instreamId:e.channel,language:a},e.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(t[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(t[a]["3D"]=e["3D"])}),t},{})}(S)),o?function(n){var t=n.oldManifest,r=n.newManifest,e=t.playlists.concat(lu(t)),i=r.playlists.concat(lu(r));return r.timelineStarts=uu([t.timelineStarts,r.timelineStarts]),function(n){var t=n.oldPlaylists,e=n.timelineStarts;n.newPlaylists.forEach(function(i){i.discontinuitySequence=ns(e,function(f){return f.timeline===i.timeline});var a=function(n,t){for(var r=0;ra.timeline||a.segments.length&&i.timeline>a.segments[a.segments.length-1].timeline)&&i.discontinuitySequence--);a.segments[l].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),du({playlist:i,mediaSequence:a.segments[l].number})}})}({oldPlaylists:e,newPlaylists:i,timelineStarts:r.timelineStarts}),r}({oldManifest:o,newManifest:F}):F},Cf=function(n,t,r){var o=n.timescale,d=n.periodStart,v=n.minimumUpdatePeriod;return Math.ceil((((n.NOW+n.clientOffset)/1e3+(void 0===v?0:v)-(n.availabilityStartTime+(void 0===d?0:d)))*(void 0===o?1:o)-t)/r)},fu=function(n,t){for(var r=n.type,e=n.minimumUpdatePeriod,i=void 0===e?0:e,a=n.media,o=void 0===a?"":a,l=n.sourceDuration,d=n.timescale,f=void 0===d?1:d,v=n.startNumber,g=void 0===v?1:v,T=n.periodStart,E=[],x=-1,S=0;Sx&&(x=W);var q=void 0;if(H<0){var ne=S+1;q=ne===t.length?"dynamic"===r&&i>0&&o.indexOf("$Number$")>0?Cf(n,x,U):(l*f-x)/U:(t[ne].t-x)/U}else q=H+1;for(var he=g+E.length+q,z=g+E.length;z=i)?a:""+new Array(i-a.length+1).join("0")+a}}(t))},If=function(n,t){var r={RepresentationID:n.id,Bandwidth:n.bandwidth||0},e=n.initialization,i=void 0===e?{sourceURL:"",range:""}:e,a=on({baseUrl:n.baseUrl,source:hu(i.sourceURL,r),range:i.range}),o=function(n,t){return n.duration||t?n.duration?as(n):fu(n,t):[{number:n.startNumber||1,duration:n.sourceDuration,time:0,timeline:n.periodStart}]}(n,t);return o.map(function(l){r.Number=l.number,r.Time=l.time;var d=hu(n.media||"",r),g=n.periodStart+(l.time-(n.presentationTimeOffset||0))/(n.timescale||1);return{uri:d,timeline:l.timeline,duration:l.duration,resolvedUri:Ji(n.baseUrl||"",d),map:a,number:l.number,presentationTime:g}})},Pf=function(n,t){var r=n.duration,e=n.segmentUrls,i=void 0===e?[]:e,a=n.periodStart;if(!r&&!t||r&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var l,o=i.map(function(f){return function(n,t){var r=n.baseUrl,e=n.initialization,i=void 0===e?{}:e,a=on({baseUrl:r,source:i.sourceURL,range:i.range}),o=on({baseUrl:r,source:t.media,range:t.mediaRange});return o.map=a,o}(n,f)});return r&&(l=as(n)),t&&(l=fu(n,t)),l.map(function(f,v){if(o[v]){var g=o[v],T=n.timescale||1,E=n.presentationTimeOffset||0;return g.timeline=f.timeline,g.duration=f.duration,g.number=f.number,g.presentationTime=a+(f.time-E)/T,g}}).filter(function(f){return f})},Lf=function(n){var e,i,t=n.attributes,r=n.segmentInfo;r.template?(i=If,e=Bt(t,r.template)):r.base?(i=ou,e=Bt(t,r.base)):r.list&&(i=Pf,e=Bt(t,r.list));var a={attributes:t};if(!i)return a;var o=i(e,r.segmentTimeline);if(e.duration){var f=e.timescale;e.duration=e.duration/(void 0===f?1:f)}else e.duration=o.length?o.reduce(function(g,T){return Math.max(g,Math.ceil(T.duration))},0):0;return a.attributes=e,a.segments=o,r.base&&e.indexRange&&(a.sidx=o[0],a.segments=[]),a},Tt=function(n,t){return au(n.childNodes).filter(function(r){return r.tagName===t})},ls=function(n){return n.textContent.trim()},Ir=function(n){var l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(n);if(!l)return 0;var d=l.slice(1),v=d[1],g=d[2],T=d[3],E=d[4],x=d[5];return 31536e3*parseFloat(d[0]||0)+2592e3*parseFloat(v||0)+86400*parseFloat(g||0)+3600*parseFloat(T||0)+60*parseFloat(E||0)+parseFloat(x||0)},pu={mediaPresentationDuration:function(n){return Ir(n)},availabilityStartTime:function(n){return function(n){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(n)&&(n+="Z"),Date.parse(n)}(n)/1e3},minimumUpdatePeriod:function(n){return Ir(n)},suggestedPresentationDelay:function(n){return Ir(n)},type:function(n){return n},timeShiftBufferDepth:function(n){return Ir(n)},start:function(n){return Ir(n)},width:function(n){return parseInt(n,10)},height:function(n){return parseInt(n,10)},bandwidth:function(n){return parseInt(n,10)},startNumber:function(n){return parseInt(n,10)},timescale:function(n){return parseInt(n,10)},presentationTimeOffset:function(n){return parseInt(n,10)},duration:function(n){var t=parseInt(n,10);return isNaN(t)?Ir(n):t},d:function(n){return parseInt(n,10)},t:function(n){return parseInt(n,10)},r:function(n){return parseInt(n,10)},DEFAULT:function(n){return n}},Mt=function(n){return n&&n.attributes?au(n.attributes).reduce(function(t,r){return t[r.name]=(pu[r.name]||pu.DEFAULT)(r.value),t},{}):{}},Mf={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Gn=function(n,t){return t.length?qn(n.map(function(r){return t.map(function(e){return Ji(r,ls(e))})})):n},ds=function(n){var t=Tt(n,"SegmentTemplate")[0],r=Tt(n,"SegmentList")[0],e=r&&Tt(r,"SegmentURL").map(function(g){return Bt({tag:"SegmentURL"},Mt(g))}),i=Tt(n,"SegmentBase")[0],a=r||t,o=a&&Tt(a,"SegmentTimeline")[0],l=r||i||t,d=l&&Tt(l,"Initialization")[0],f=t&&Mt(t);f&&d?f.initialization=d&&Mt(d):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});var v={template:f,segmentTimeline:o&&Tt(o,"S").map(function(g){return Mt(g)}),list:r&&Bt(Mt(r),{segmentUrls:e,initialization:Mt(d)}),base:i&&Bt(Mt(i),{initialization:Mt(d)})};return Object.keys(v).forEach(function(g){v[g]||delete v[g]}),v},Hf=function(n,t){return function(r,e){var i=Gn(t,Tt(r.node,"BaseURL")),a=Bt(n,{periodStart:r.attributes.start});"number"==typeof r.attributes.duration&&(a.periodDuration=r.attributes.duration);var o=Tt(r.node,"AdaptationSet"),l=ds(r.node);return qn(o.map(function(n,t,r){return function(e){var i=Mt(e),a=Gn(t,Tt(e,"BaseURL")),o=Tt(e,"Role")[0],l={role:Mt(o)},d=Bt(n,i,l),f=Tt(e,"Accessibility")[0],v=function(n){return"urn:scte:dash:cc:cea-608:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var i,a;if(a=e,/^CC\d=/.test(e)){var o=e.split("=");i=o[0],a=o[1]}else/^CC\d$/.test(e)&&(i=e);return{channel:i,language:a}}):"urn:scte:dash:cc:cea-708:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var a=e.split("="),l=a[1],d=void 0===l?"":l;i.channel=a[0],i.language=e,d.split(",").forEach(function(f){var v=f.split(":"),g=v[0],T=v[1];"lang"===g?i.language=T:"er"===g?i.easyReader=Number(T):"war"===g?i.aspectRatio=Number(T):"3D"===g&&(i["3D"]=Number(T))})}else i.language=e;return i.channel&&(i.channel="SERVICE"+i.channel),i}):void 0}(Mt(f));v&&(d=Bt(d,{captionServices:v}));var g=Tt(e,"Label")[0];if(g&&g.childNodes.length){var T=g.childNodes[0].nodeValue.trim();d=Bt(d,{label:T})}var E=function(n){return n.reduce(function(t,r){var e=Mt(r),i=Mf[e.schemeIdUri];if(i){t[i]={attributes:e};var a=Tt(r,"cenc:pssh")[0];if(a){var o=ls(a),l=o&&er(o);t[i].pssh=l}}return t},{})}(Tt(e,"ContentProtection"));Object.keys(E).length&&(d=Bt(d,{contentProtection:E}));var x=ds(e),S=Tt(e,"Representation"),F=Bt(r,x);return qn(S.map(function(n,t,r){return function(e){var i=Tt(e,"BaseURL"),a=Gn(t,i),o=Bt(n,Mt(e)),l=ds(e);return a.map(function(d){return{segmentInfo:Bt(r,l),attributes:Bt(o,{baseUrl:d})}})}}(d,a,F)))}}(a,i,l)))}},mu=function(n){if(""===n)throw new Error("DASH_EMPTY_MANIFEST");var r,e,t=new Vn.DOMParser;try{e=(r=t.parseFromString(n,"application/xml"))&&"MPD"===r.documentElement.tagName?r.documentElement:null}catch(i){}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return e},Zf=j(7459),zf=j.n(Zf),Re=function(n){return n instanceof Uint8Array?n:(!Array.isArray(n)&&!function(n){return function(n){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer}(n)}(n)&&!(n instanceof ArrayBuffer)&&(n="number"!=typeof n||"number"==typeof n&&n!=n?0:[n]),new Uint8Array(n&&n.buffer||n,n&&n.byteOffset||0,n&&n.byteLength||0))},Lt=P().BigInt||Number,cs=[Lt("0x1"),Lt("0x100"),Lt("0x10000"),Lt("0x1000000"),Lt("0x100000000"),Lt("0x10000000000"),Lt("0x1000000000000"),Lt("0x100000000000000"),Lt("0x10000000000000000")],Jf=(s=new Uint16Array([65484]),new Uint8Array(s.buffer,s.byteOffset,s.byteLength),function(n,t){var r=void 0===t?{}:t,e=r.signed,i=void 0!==e&&e,a=r.le,o=void 0!==a&&a;n=Re(n);var l=o?"reduce":"reduceRight",f=(n[l]?n[l]:Array.prototype[l]).call(n,function(g,T,E){var x=o?E:Math.abs(E+1-n.length);return g+Lt(T)*cs[x]},Lt(0));if(i){var v=cs[n.length]/Lt(2)-Lt(1);(f=Lt(f))>v&&(f-=v,f-=v,f-=Lt(2))}return Number(f)}),_u=function(n,t){if("string"!=typeof n&&n&&"function"==typeof n.toString&&(n=n.toString()),"string"!=typeof n)return new Uint8Array;t||(n=unescape(encodeURIComponent(n)));for(var r=new Uint8Array(n.length),e=0;e=t.length&&(t.every?t.every:Array.prototype.every).call(t,function(f,v){return f===(l[v]?l[v]&n[a+v]:n[a+v])})},rh=Re([73,68,51]),un=function s(n,t){return void 0===t&&(t=0),(n=Re(n)).length-t<10||!ht(n,rh,{offset:t})?t:(t+=function(n,t){void 0===t&&(t=0);var e=(n=Re(n))[t+6]<<21|n[t+7]<<14|n[t+8]<<7|n[t+9];return(16&n[t+5])>>4?e+20:e+10}(n,t),s(n,t))},fs=(new Uint8Array([79,112,117,115,72,101,97,100]),function(n){return"string"==typeof n?_u(n):n}),ps=function(n){n=Re(n);for(var t=[],r=0;n.length>r;){var e=n[r],i=0,a=0,o=n[++a];for(a++;128&o;)i=(127&o)<<7,o=n[a],a++;i+=127&o;for(var l=0;l>>0,o=n.subarray(i+4,i+8);if(0===a)break;var l=i+a;if(l>n.length){if(r)break;l=n.length}var d=n.subarray(i+8,l);ht(o,t[0])&&(1===t.length?e.push(d):e.push.apply(e,s(d,t.slice(1),r))),i=l}return e},dt={EBML:Re([26,69,223,163]),DocType:Re([66,130]),Segment:Re([24,83,128,103]),SegmentInfo:Re([21,73,169,102]),Tracks:Re([22,84,174,107]),Track:Re([174]),TrackNumber:Re([215]),DefaultDuration:Re([35,227,131]),TrackEntry:Re([174]),TrackType:Re([131]),FlagDefault:Re([136]),CodecID:Re([134]),CodecPrivate:Re([99,162]),VideoTrack:Re([224]),AudioTrack:Re([225]),Cluster:Re([31,67,182,117]),Timestamp:Re([231]),TimestampScale:Re([42,215,177]),BlockGroup:Re([160]),BlockDuration:Re([155]),Block:Re([161]),SimpleBlock:Re([163])},ms=[128,64,32,16,8,4,2,1],rr=function(n,t,r,e){void 0===r&&(r=!0),void 0===e&&(e=!1);var i=function(n){for(var t=1,r=0;r=t.length)return t.length;var e=rr(t,r,!1);if(ht(n.bytes,e.bytes))return r;var i=rr(t,r+e.length);return s(n,t,r+i.length+i.value+e.length)},pt=function s(n,t){t=function(n){return Array.isArray(n)?n.map(function(t){return yu(t)}):[yu(n)]}(t),n=Re(n);var r=[];if(!t.length)return r;for(var e=0;en.length?n.length:o+a.value);ht(t[0],i.bytes)&&(1===t.length?r.push(d):r=r.concat(s(d,t.slice(1)))),e+=i.length+a.length+d.length}return r},ph=Re([0,0,0,1]),mh=Re([0,0,1]),gh=Re([0,0,3]),vh=function(n){for(var t=[],r=1;r>1&63),-1!==r.indexOf(d)&&(a=i+l),i+=l+("h264"===t?1:2)}else i++}return n.subarray(0,0)},Ht={webm:Re([119,101,98,109]),matroska:Re([109,97,116,114,111,115,107,97]),flac:Re([102,76,97,67]),ogg:Re([79,103,103,83]),ac3:Re([11,119]),riff:Re([82,73,70,70]),avi:Re([65,86,73]),wav:Re([87,65,86,69]),"3gp":Re([102,116,121,112,51,103]),mp4:Re([102,116,121,112]),fmp4:Re([115,116,121,112]),mov:Re([102,116,121,112,113,116]),moov:Re([109,111,111,118]),moof:Re([109,111,111,102])},Pr={aac:function(n){var t=un(n);return ht(n,[255,16],{offset:t,mask:[255,22]})},mp3:function(n){var t=un(n);return ht(n,[255,2],{offset:t,mask:[255,6]})},webm:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,Ht.webm)},mkv:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,Ht.matroska)},mp4:function(n){return!Pr["3gp"](n)&&!Pr.mov(n)&&(!!(ht(n,Ht.mp4,{offset:4})||ht(n,Ht.fmp4,{offset:4})||ht(n,Ht.moof,{offset:4})||ht(n,Ht.moov,{offset:4}))||void 0)},mov:function(n){return ht(n,Ht.mov,{offset:4})},"3gp":function(n){return ht(n,Ht["3gp"],{offset:4})},ac3:function(n){var t=un(n);return ht(n,Ht.ac3,{offset:t})},ts:function(n){if(n.length<189&&n.length>=1)return 71===n[0];for(var t=0;t+1880?l:0)}if(P().console){var d=P().console[r];!d&&"debug"===r&&(d=P().console.info||P().console.log),d&&a&&o.test(r)&&d[Array.isArray(i)?"apply":"call"](P().console,i)}}}(s,r),r.createLogger=function(e){return Eu(s+": "+e)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return Kt?[].concat(Kt):[]}).filter=function(e){return(Kt||[]).filter(function(i){return new RegExp(".*"+e+".*").test(i[0])})},r.history.clear=function(){Kt&&(Kt.length=0)},r.history.disable=function(){null!==Kt&&(Kt.length=0,Kt=null)},r.history.enable=function(){null===Kt&&(Kt=[])},r.error=function(){for(var e=arguments.length,i=new Array(e),a=0;a1?n-1:0),r=1;r=0)throw new Error("class has illegal whitespace characters")}function Rr(){return K()===P().document}function Mr(s){return Ii(s)&&1===s.nodeType}function Mu(){try{return P().parent!==P().self}catch(s){return!0}}function Nu(s){return function(n,t){if(!Ou(n))return K()[s](null);Ou(t)&&(t=K().querySelector(t));var r=Mr(t)?t:K();return r[s]&&r[s](n)}}function $e(s,n,t,r){void 0===s&&(s="div"),void 0===n&&(n={}),void 0===t&&(t={});var e=K().createElement(s);return Object.getOwnPropertyNames(n).forEach(function(i){var a=n[i];-1!==i.indexOf("aria-")||"role"===i||"type"===i?(ze.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+i+" to "+a+"."),e.setAttribute(i,a)):"textContent"===i?nr(e,a):(e[i]!==a||"tabIndex"===i)&&(e[i]=a)}),Object.getOwnPropertyNames(t).forEach(function(i){e.setAttribute(i,t[i])}),r&&Es(e,r),e}function nr(s,n){return void 0===s.textContent?s.innerText=n:s.textContent=n,s}function xs(s,n){n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s)}function ar(s,n){return Ru(n),s.classList?s.classList.contains(n):function Dh(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}(n).test(s.className)}function Li(s,n){return s.classList?s.classList.add(n):ar(s,n)||(s.className=(s.className+" "+n).trim()),s}function mn(s,n){return s?(s.classList?s.classList.remove(n):(Ru(n),s.className=s.className.split(/\s+/).filter(function(t){return t!==n}).join(" ")),s):(ze.warn("removeClass was called with an element that doesn't exist"),null)}function Fu(s,n,t){var r=ar(s,n);if("function"==typeof t&&(t=t(s,n)),"boolean"!=typeof t&&(t=!r),t!==r)return t?Li(s,n):mn(s,n),s}function Uu(s,n){Object.getOwnPropertyNames(n).forEach(function(t){var r=n[t];null==r||!1===r?s.removeAttribute(t):s.setAttribute(t,!0===r?"":r)})}function Oi(s){var n={};if(s&&s.attributes&&s.attributes.length>0)for(var r=s.attributes,e=r.length-1;e>=0;e--){var i=r[e].name,a=r[e].value;("boolean"==typeof s[i]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+","))&&(a=null!==a),n[i]=a}return n}function Bu(s,n){return s.getAttribute(n)}function Nr(s,n,t){s.setAttribute(n,t)}function Qn(s,n){s.removeAttribute(n)}function Hu(){K().body.focus(),K().onselectstart=function(){return!1}}function ju(){K().onselectstart=function(){return!0}}function Fr(s){if(s&&s.getBoundingClientRect&&s.parentNode){var n=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(r){void 0!==n[r]&&(t[r]=n[r])}),t.height||(t.height=parseFloat(fn(s,"height"))),t.width||(t.width=parseFloat(fn(s,"width"))),t}}function gn(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var n=s.offsetWidth,t=s.offsetHeight,r=0,e=0;s.offsetParent&&s!==K()[zn.fullscreenElement];)r+=s.offsetLeft,e+=s.offsetTop,s=s.offsetParent;return{left:r,top:e,width:n,height:t}}function Jn(s,n){var t={x:0,y:0};if(jt)for(var r=s;r&&"html"!==r.nodeName.toLowerCase();){var e=fn(r,"transform");if(/^matrix/.test(e)){var i=e.slice(7,-1).split(/,\s/).map(Number);t.x+=i[4],t.y+=i[5]}else if(/^matrix3d/.test(e)){var a=e.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}r=r.parentNode}var o={},l=gn(n.target),d=gn(s),f=d.width,g=n.offsetY-(d.top-l.top),T=n.offsetX-(d.left-l.left);return n.changedTouches&&(T=n.changedTouches[0].pageX-d.left,g=n.changedTouches[0].pageY+d.top,jt&&(T-=t.x,g-=t.y)),o.y=1-Math.max(0,Math.min(1,g/d.height)),o.x=Math.max(0,Math.min(1,T/f)),o}function Vu(s){return Ii(s)&&3===s.nodeType}function Ss(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function qu(s){return"function"==typeof s&&(s=s()),(Array.isArray(s)?s:[s]).map(function(n){return"function"==typeof n&&(n=n()),Mr(n)||Vu(n)?n:"string"==typeof n&&/\S/.test(n)?K().createTextNode(n):void 0}).filter(function(n){return n})}function Es(s,n){return qu(n).forEach(function(t){return s.appendChild(t)}),s}function Wu(s,n){return Es(Ss(s),n)}function vn(s){return void 0===s.button&&void 0===s.buttons||0===s.button&&void 0===s.buttons||"mouseup"===s.type&&0===s.button&&0===s.buttons||!(0!==s.button||1!==s.buttons)}var Cs,Gi=Nu("querySelector"),Gu=Nu("querySelectorAll"),Zu=Object.freeze({__proto__:null,isReal:Rr,isEl:Mr,isInFrame:Mu,createEl:$e,textContent:nr,prependTo:xs,hasClass:ar,addClass:Li,removeClass:mn,toggleClass:Fu,setAttributes:Uu,getAttributes:Oi,getAttribute:Bu,setAttribute:Nr,removeAttribute:Qn,blockTextSelection:Hu,unblockTextSelection:ju,getBoundingClientRect:Fr,findPosition:gn,getPointerPosition:Jn,isTextNode:Vu,emptyEl:Ss,normalizeContent:qu,appendContent:Es,insertContent:Wu,isSingleLeftClick:vn,$:Gi,$$:Gu}),zu=!1,Ph=function(){if(!1!==Cs.options.autoSetup){var n=Array.prototype.slice.call(K().getElementsByTagName("video")),t=Array.prototype.slice.call(K().getElementsByTagName("audio")),r=Array.prototype.slice.call(K().getElementsByTagName("video-js")),e=n.concat(t,r);if(e&&e.length>0)for(var i=0,a=e.length;i-1&&(e={passive:!0}),s.addEventListener(n,r.dispatcher,e)}else s.attachEvent&&s.attachEvent("on"+n,r.dispatcher)}function Nt(s,n,t){if(Vt.has(s)){var r=Vt.get(s);if(r.handlers){if(Array.isArray(n))return ws(Nt,s,n,t);var e=function(d,f){r.handlers[f]=[],Xu(d,f)};if(void 0===n){for(var i in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},i)&&e(s,i);return}var a=r.handlers[n];if(a){if(!t)return void e(s,n);if(t.guid)for(var o=0;o=t&&(n.apply(void 0,arguments),r=a)}},It=function(){};It.prototype.allowedEvents_={},It.prototype.addEventListener=It.prototype.on=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Qt(this,s,n),this.addEventListener=t},It.prototype.removeEventListener=It.prototype.off=function(s,n){Nt(this,s,n)},It.prototype.one=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},ia(this,s,n),this.addEventListener=t},It.prototype.any=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Qu(this,s,n),this.addEventListener=t},It.prototype.dispatchEvent=It.prototype.trigger=function(s){var n=s.type||s;"string"==typeof s&&(s={type:n}),s=ea(s),this.allowedEvents_[n]&&this["on"+n]&&this["on"+n](s),Ur(this,s)},It.prototype.queueTrigger=function(s){var n=this;_n||(_n=new Map);var t=s.type||s,r=_n.get(this);r||_n.set(this,r=new Map);var e=r.get(t);r.delete(t),P().clearTimeout(e);var i=P().setTimeout(function(){0===r.size&&(r=null,_n.delete(n)),n.trigger(s)},0);r.set(t,i)};var ra=function(n){return"function"==typeof n.name?n.name():"string"==typeof n.name?n.name:n.name_?n.name_:n.constructor&&n.constructor.name?n.constructor.name:typeof n},Mi=function(n){return n instanceof It||!!n.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof n[t]})},Is=function(n){return"string"==typeof n&&/\S/.test(n)||Array.isArray(n)&&!!n.length},na=function(n,t,r){if(!n||!n.nodeName&&!Mi(n))throw new Error("Invalid target for "+ra(t)+"#"+r+"; must be a DOM node or evented object.")},Ju=function(n,t,r){if(!Is(n))throw new Error("Invalid event type for "+ra(t)+"#"+r+"; must be a non-empty string or array.")},el=function(n,t,r){if("function"!=typeof n)throw new Error("Invalid listener for "+ra(t)+"#"+r+"; must be a function.")},Ds=function(n,t,r){var i,a,o,e=t.length<3||t[0]===n||t[0]===n.eventBusEl_;return e?(i=n.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(i=t[0],a=t[1],o=t[2]),na(i,n,r),Ju(a,n,r),el(o,n,r),{isTargetingSelf:e,target:i,type:a,listener:o=at(n,o)}},sr=function(n,t,r,e){na(n,n,t),n.nodeName?Nh[t](n,r,e):n[t](r,e)},Bh={on:function(){for(var n=this,t=arguments.length,r=new Array(t),e=0;e=0;r--)this.children_[r].dispose&&this.children_[r].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},n.isDisposed=function(){return Boolean(this.isDisposed_)},n.player=function(){return this.player_},n.options=function(r){return r?(this.options_=ct(this.options_,r),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(r,e,i){return $e(r,e,i)},n.localize=function(r,e,i){void 0===i&&(i=r);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],d=a&&a.split("-")[0],f=o&&o[d],v=i;return l&&l[r]?v=l[r]:f&&f[r]&&(v=f[r]),e&&(v=v.replace(/\{(\d+)\}/g,function(g,T){var E=e[T-1],x=E;return void 0===E&&(x=g),x})),v},n.handleLanguagechange=function(){},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(r){return this.childIndex_[r]},n.getChild=function(r){if(r)return this.childNameIndex_[r]},n.getDescendant=function(){for(var r=arguments.length,e=new Array(r),i=0;i=0;i--)if(this.children_[i]===r){e=!0,this.children_.splice(i,1);break}if(e){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[bt(r.name())]=null,this.childNameIndex_[aa(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},n.initChildren=function(){var r=this,e=this.options_.children;if(e){var o,i=this.options_,l=s.getComponent("Tech");(o=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(d){return!o.some(function(f){return"string"==typeof f?d===f:d===f.name})})).map(function(d){var f,v;return"string"==typeof d?v=e[f=d]||r.options_[f]||{}:(f=d.name,v=d),{name:f,opts:v}}).filter(function(d){var f=s.getComponent(d.opts.componentClass||bt(d.name));return f&&!l.isTech(f)}).forEach(function(f){var v=f.name,g=f.opts;if(void 0!==i[v]&&(g=i[v]),!1!==g){!0===g&&(g={}),g.playerOptions=r.options_.playerOptions;var T=r.addChild(v,g);T&&(r[v]=T)}})}},n.buildCSSClass=function(){return""},n.ready=function(r,e){if(void 0===e&&(e=!1),r){if(!this.isReady_)return this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(r);e?r.call(this):this.setTimeout(r,1)}},n.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},n.$=function(r,e){return Gi(r,e||this.contentEl())},n.$$=function(r,e){return Gu(r,e||this.contentEl())},n.hasClass=function(r){return ar(this.el_,r)},n.addClass=function(r){Li(this.el_,r)},n.removeClass=function(r){mn(this.el_,r)},n.toggleClass=function(r,e){Fu(this.el_,r,e)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(r){return Bu(this.el_,r)},n.setAttribute=function(r,e){Nr(this.el_,r,e)},n.removeAttribute=function(r){Qn(this.el_,r)},n.width=function(r,e){return this.dimension("width",r,e)},n.height=function(r,e){return this.dimension("height",r,e)},n.dimensions=function(r,e){this.width(r,!0),this.height(e)},n.dimension=function(r,e,i){if(void 0!==e)return(null===e||e!=e)&&(e=0),this.el_.style[r]=-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?e:"auto"===e?"":e+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[r],o=a.indexOf("px");return parseInt(-1!==o?a.slice(0,o):this.el_["offset"+bt(r)],10)},n.currentDimension=function(r){var e=0;if("width"!==r&&"height"!==r)throw new Error("currentDimension only accepts width or height value");if(e=fn(this.el_,r),0===(e=parseFloat(e))||isNaN(e)){var i="offset"+bt(r);e=this.el_[i]}return e},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(r){this.player_&&(Ie().isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},n.handleKeyPress=function(r){this.handleKeyDown(r)},n.emitTapEvents=function(){var o,r=0,e=null;this.on("touchstart",function(d){1===d.touches.length&&(e={pageX:d.touches[0].pageX,pageY:d.touches[0].pageY},r=P().performance.now(),o=!0)}),this.on("touchmove",function(d){if(d.touches.length>1)o=!1;else if(e){var f=d.touches[0].pageX-e.pageX,v=d.touches[0].pageY-e.pageY;Math.sqrt(f*f+v*v)>10&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(d){e=null,!0===o&&P().performance.now()-r<200&&(d.preventDefault(),this.trigger("tap"))})},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,r=at(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)});var i=function(o){r(),this.clearInterval(e)};this.on("touchmove",r),this.on("touchend",i),this.on("touchcancel",i)}},n.setTimeout=function(r,e){var a,i=this;return r=at(this,r),this.clearTimersOnDispose_(),a=P().setTimeout(function(){i.setTimeoutIds_.has(a)&&i.setTimeoutIds_.delete(a),r()},e),this.setTimeoutIds_.add(a),a},n.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),P().clearTimeout(r)),r},n.setInterval=function(r,e){r=at(this,r),this.clearTimersOnDispose_();var i=P().setInterval(r,e);return this.setIntervalIds_.add(i),i},n.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),P().clearInterval(r)),r},n.requestAnimationFrame=function(r){var i,e=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),r=at(this,r),i=P().requestAnimationFrame(function(){e.rafIds_.has(i)&&e.rafIds_.delete(i),r()}),this.rafIds_.add(i),i):this.setTimeout(r,1e3/60)},n.requestNamedAnimationFrame=function(r,e){var i=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),e=at(this,e);var a=this.requestAnimationFrame(function(){e(),i.namedRafs_.has(r)&&i.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},n.cancelNamedAnimationFrame=function(r){!this.namedRafs_.has(r)||(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},n.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),P().cancelAnimationFrame(r)),r):this.clearTimeout(r)},n.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var a=e[1];r[e[0]].forEach(function(o,l){return r[a](l)})}),r.clearingTimersOnDispose_=!1}))},s.registerComponent=function(r,e){if("string"!=typeof r||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var i=s.getComponent("Tech"),a=i&&i.isTech(e),o=s===e||s.prototype.isPrototypeOf(e.prototype);if(a||!o)throw new Error('Illegal component, "'+r+'"; '+(a?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");r=bt(r),s.components_||(s.components_={});var d=s.getComponent("Player");if("Player"===r&&d&&d.players){var f=d.players,v=Object.keys(f);if(f&&v.length>0&&v.map(function(g){return f[g]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[r]=e,s.components_[aa(r)]=e,e},s.getComponent=function(r){if(r&&s.components_)return s.components_[r]},s}();function il(s,n,t,r){return function Gh(s,n,t){if("number"!=typeof n||n<0||n>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+n+") is non-numeric or out of bounds (0-"+t+").")}(s,r,t.length-1),t[r][n]}function Os(s){var n;return n=void 0===s||0===s.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:il.bind(null,"start",0,s),end:il.bind(null,"end",1,s)},P().Symbol&&P().Symbol.iterator&&(n[P().Symbol.iterator]=function(){return(s||[]).values()}),n}function or(s,n){return Array.isArray(s)?Os(s):void 0===s||void 0===n?Os():Os([[s,n]])}function rl(s,n){var r,e,t=0;if(!n)return 0;(!s||!s.length)&&(s=or(0,0));for(var i=0;in&&(e=n),t+=e-r;return t/n}function qt(s){if(s instanceof qt)return s;"number"==typeof s?this.code=s:"string"==typeof s?this.message=s:Ii(s)&&("number"==typeof s.code&&(this.code=s.code),_t(this,s)),this.message||(this.message=qt.defaultMessages[this.code]||"")}$.prototype.supportsRaf_="function"==typeof P().requestAnimationFrame&&"function"==typeof P().cancelAnimationFrame,$.registerComponent("Component",$),qt.prototype.code=0,qt.prototype.message="",qt.prototype.status=null,qt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],qt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Br=0;Br=0;i--)if(r[i].enabled){Ns(r,r[i]);break}return(e=s.call(this,r)||this).changing_=!1,e}ie(n,s);var t=n.prototype;return t.addTrack=function(e){var i=this;e.enabled&&Ns(this,e),s.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){i.changing_||(i.changing_=!0,Ns(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},n}(jr),Fs=function(n,t){for(var r=0;r=0;i--)if(r[i].selected){Fs(r,r[i]);break}return(e=s.call(this,r)||this).changing_=!1,Object.defineProperty(Fe(e),"selectedIndex",{get:function(){for(var o=0;o0&&(P().console&&P().console.groupCollapsed&&P().console.groupCollapsed("Text Track parsing errors for "+t.src),e.forEach(function(i){return ze.error(i)}),P().console&&P().console.groupEnd&&P().console.groupEnd()),r.flush()},dl=function(n,t){var r={uri:n},e=sa(n);e&&(r.cors=e);var i="use-credentials"===t.tech_.crossOrigin();i&&(r.withCredentials=i),ki()(r,at(this,function(a,o,l){if(a)return ze.error(a,o);t.loaded_=!0,"function"!=typeof P().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(d){if("vttjserror"!==d.type)return ll(l,t);ze.error("vttjs failed to load, stopping trying to process "+t.src)}):ll(l,t)}))},Tn=function(s){function n(r){var e;if(void 0===r&&(r={}),!r.tech)throw new Error("A tech was not provided.");var i=ct(r,{kind:ep[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=ol[i.mode]||"disabled",o=i.default;("metadata"===i.kind||"chapters"===i.kind)&&(a="hidden"),(e=s.call(this,i)||this).tech_=i.tech,e.cues_=[],e.activeCues_=[],e.preload_=!1!==e.tech_.preloadTextTracks;var l=new sl(e.cues_),d=new sl(e.activeCues_),f=!1,v=at(Fe(e),function(){!this.tech_.isReady_||this.tech_.isDisposed()||(this.activeCues=this.activeCues,f&&(this.trigger("cuechange"),f=!1))});return e.tech_.one("dispose",function(){e.tech_.off("timeupdate",v)}),"disabled"!==a&&e.tech_.on("timeupdate",v),Object.defineProperties(Fe(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(E){!ol[E]||a!==E&&(a=E,!this.preload_&&"disabled"!==a&&0===this.cues.length&&dl(this.src,this),this.tech_.off("timeupdate",v),"disabled"!==a&&this.tech_.on("timeupdate",v),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var E=this.tech_.currentTime(),x=[],S=0,F=this.cues.length;S=E||U.startTime===U.endTime&&U.startTime<=E&&U.startTime+.5>=E)&&x.push(U)}if(f=!1,x.length!==this.activeCues_.length)f=!0;else for(var H=0;H0)return void this.trigger("vttjsloaded");var i=K().createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",i.onload=function(){e.trigger("vttjsloaded")},i.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){i.onload=null,i.onerror=null}),P().WebVTT=!0,this.el().parentNode.appendChild(i)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var e=this,i=this.textTracks(),a=this.remoteTextTracks(),o=function(g){return i.addTrack(g.track)},l=function(g){return i.removeTrack(g.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var d=function(){return e.trigger("texttrackchange")},f=function(){d();for(var g=0;g=0;e--){var i=s[e];i[n]&&i[n](r,t)}}(s,t,o,a),o}var dp={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},cp={setCurrentTime:1,setMuted:1,setVolume:1},gl={play:1,pause:1};function Vs(s){return function(n,t){return n===oa?oa:t[s]?t[s](n):n}}function lr(s,n,t,r,e,i){void 0===s&&(s={}),void 0===n&&(n=[]),void 0===e&&(e=[]),void 0===i&&(i=!1);var o=n[0],l=n.slice(1);if("string"==typeof o)lr(s,ur[o],t,r,e,i);else if(o){var d=function pp(s,n){var t=js[s.id()],r=null;if(null==t)return r=n(s),js[s.id()]=[[n,r]],r;for(var e=0;e0;this.player_.tech(!0)&&!((pn||hn)&&i)&&this.player_.tech(!0).focus(),this.player_.paused()?yi(this.player_.play()):this.player_.pause()}},n}(la);$.registerComponent("PosterImage",yp);var ni="#222",Tp={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function qs(s,n){var t;if(4===s.length)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(7!==s.length)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+n+")"}function Ws(s,n,t){try{s.style[n]=t}catch(r){return}}var bp=function(s){function n(r,e,i){var a;a=s.call(this,r,e,i)||this;var o=function(d){return a.updateDisplay(d)};return r.on("loadstart",function(l){return a.toggleDisplay(l)}),r.on("texttrackchange",o),r.on("loadedmetadata",function(l){return a.preselectTrack(l)}),r.ready(at(Fe(a),function(){if(r.tech_&&r.tech_.featuresNativeTextTracks)this.hide();else{r.on("fullscreenchange",o),r.on("playerresize",o),P().addEventListener("orientationchange",o),r.on("dispose",function(){return P().removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],d=0;d0;return yi(i),void(this.player_.tech(!0)&&(!pn&&!hn||!a)&&this.player_.tech(!0).focus())}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(l){var d=function(){return l.focus()};yn(i)?i.then(d,function(){}):this.setTimeout(d,1)}else this.player_.tech(!0).focus()},t.handleKeyDown=function(e){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,e)},t.handleMouseDown=function(e){this.mouseused_=!0},n}(hi);yl.prototype.controlText_="Play Video",$.registerComponent("BigPlayButton",yl);var Sp=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).controlText(e&&e.controlText||i.localize("Close")),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(e){Ie().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,e)},n}(hi);$.registerComponent("CloseButton",Sp);var Tl=function(s){function n(r,e){var i;return void 0===e&&(e={}),i=s.call(this,r,e)||this,e.replay=void 0===e.replay||e.replay,i.on(r,"play",function(a){return i.handlePlay(a)}),i.on(r,"pause",function(a){return i.handlePause(a)}),e.replay&&i.on(r,"ended",function(a){return i.handleEnded(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.player_.paused()?yi(this.player_.play()):this.player_.pause()},t.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(e){var i=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return i.handleSeeked(a)})},n}(hi);Tl.prototype.controlText_="Play",$.registerComponent("PlayToggle",Tl);var bl=function(n,t){n=n<0?0:n;var r=Math.floor(n%60),e=Math.floor(n/60%60),i=Math.floor(n/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(n)||n===1/0)&&(i=e=r="-"),(i=i>0||o>0?i+":":"")+(e=((i||a>=10)&&e<10?"0"+e:e)+":")+(r<10?"0"+r:r)},Gs=bl;function Wr(s,n){return void 0===n&&(n=s),Gs(s,n)}var Gr=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,["timeupdate","ended"],function(a){return i.updateContent(a)}),i.updateTextNode_(),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=this.buildCSSClass(),i=s.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=$e("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return i.appendChild(a),this.contentEl_=$e("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(e){var i=this;void 0===e&&(e=0),e=Wr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(i.contentEl_){var a=i.textNode_;a&&i.contentEl_.firstChild!==a&&(a=null,ze.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),i.textNode_=K().createTextNode(i.formattedTime_),i.textNode_&&(a?i.contentEl_.replaceChild(i.textNode_,a):i.contentEl_.appendChild(i.textNode_))}}))},t.updateContent=function(e){},n}($);Gr.prototype.labelText_="Time",Gr.prototype.controlText_="Time",$.registerComponent("TimeDisplay",Gr);var Zs=function(s){function n(){return s.apply(this,arguments)||this}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(e){var i;i=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)},n}(Gr);Zs.prototype.labelText_="Current Time",Zs.prototype.controlText_="Current Time",$.registerComponent("CurrentTimeDisplay",Zs);var zs=function(s){function n(r,e){var i,a=function(l){return i.updateContent(l)};return(i=s.call(this,r,e)||this).on(r,"durationchange",a),i.on(r,"loadstart",a),i.on(r,"loadedmetadata",a),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var i=this.player_.duration();this.updateTextNode_(i)},n}(Gr);zs.prototype.labelText_="Duration",zs.prototype.controlText_="Duration",$.registerComponent("DurationDisplay",zs);var kp=function(s){function n(){return s.apply(this,arguments)||this}return ie(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(a),e.appendChild(i),e},n}($);$.registerComponent("TimeDivider",kp);var Ks=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,"durationchange",function(a){return i.updateContent(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=s.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&e.insertBefore($e("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){var i;"number"==typeof this.player_.duration()&&(i=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(i))},n}(Gr);Ks.prototype.labelText_="Remaining Time",Ks.prototype.controlText_="Remaining Time",$.registerComponent("RemainingTimeDisplay",Ks);var Ap=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).updateShowing(),i.on(i.player(),"durationchange",function(a){return i.updateShowing(a)}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=$e("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild($e("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(K().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},n}($);$.registerComponent("LiveDisplay",Ap);var xl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(a){return i.updateLiveEdgeStatus(a)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=$e("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},n}(hi);xl.prototype.controlText_="Seek to live, currently playing live",$.registerComponent("SeekToLive",xl);var da=function(n,t,r){return n=Number(n),Math.min(r,Math.max(t,isNaN(n)?t:n))},$s=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).handleMouseDown_=function(a){return i.handleMouseDown(a)},i.handleMouseUp_=function(a){return i.handleMouseUp(a)},i.handleKeyDown_=function(a){return i.handleKeyDown(a)},i.handleClick_=function(a){return i.handleClick(a)},i.handleMouseMove_=function(a){return i.handleMouseMove(a)},i.update_=function(a){return i.update(a)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}ie(n,s);var t=n.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(e,i,a){return void 0===i&&(i={}),void 0===a&&(a={}),i.className=i.className+" vjs-slider",i=_t({tabIndex:0},i),a=_t({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,e,i,a)},t.handleMouseDown=function(e){var i=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"===e.type&&!Pi&&e.preventDefault(),Hu(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},t.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;ju(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var e=this;if(this.el_&&this.bar){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*i).toFixed(2)+"%"})),i}},t.getProgress=function(){return Number(da(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(e){var i=Jn(this.el_,e);return this.vertical()?i.y:i.x},t.handleKeyDown=function(e){Ie().isEventKey(e,"Left")||Ie().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):Ie().isEventKey(e,"Right")||Ie().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.addClass(this.vertical_?"vjs-slider-vertical":"vjs-slider-horizontal")},n}($);$.registerComponent("Slider",$s);var Ys=function(n,t){return da(n/t*100,0,100).toFixed(2)+"%"},wp=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).partEls_=[],i.on(r,"progress",function(a){return i.update(a)}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=$e("span",{className:"vjs-control-text"}),a=$e("span",{textContent:this.localize("Loaded")}),o=K().createTextNode(": ");return this.percentageEl_=$e("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(a),i.appendChild(o),i.appendChild(this.percentageEl_),e},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(e){var i=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=i.player_.liveTracker,o=i.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():i.player_.duration(),d=i.player_.bufferedEnd(),f=i.partEls_,v=Ys(d,l);i.percent_!==v&&(i.el_.style.width=v,nr(i.percentageEl_,v),i.percent_=v);for(var g=0;go.length;S--)i.el_.removeChild(f[S-1]);f.length=o.length})},n}($);$.registerComponent("LoadProgressBar",wp);var Ip=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,i,a){var o=gn(this.el_),l=Fr(this.player_.el()),d=e.width*i;if(l&&o){var f=e.left-l.left+d,v=e.width-d+(l.right-e.right),g=o.width/2;fo.width&&(g=o.width),g=Math.round(g),this.el_.style.right="-"+g+"px",this.write(a)}},t.write=function(e){nr(this.el_,e)},t.updateTime=function(e,i,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var d,f=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var v=l.player_.liveTracker.liveWindow(),g=v-i*v;d=(g<1?"":"-")+Wr(g,v)}else d=Wr(a,f);l.update(e,i,d),o&&o()})},n}($);$.registerComponent("TimeTooltip",Ip);var Xs=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,i){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,i,o)}},n}($);Xs.prototype.options_={children:[]},!jt&&!Di&&Xs.prototype.options_.children.push("timeTooltip"),$.registerComponent("PlayProgressBar",Xs);var Sl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,i){var a=this,o=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,o,function(){a.el_.style.left=e.width*i+"px"})},n}($);Sl.prototype.options_={children:["timeTooltip"]},$.registerComponent("MouseTimeDisplay",Sl);var Qs=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).setEventHandlers_(),i}ie(n,s);var t=n.prototype;return t.setEventHandlers_=function(){var e=this;this.update_=at(this,this.update),this.update=Ri(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(i){return e.enableInterval_(i)},this.disableIntervalHandler_=function(i){return e.disableInterval_(i)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in K()&&"visibilityState"in K()&&this.on(K(),"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){"hidden"===K().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var i=this;if("hidden"!==K().visibilityState){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),l=i.player_.liveTracker,d=i.player_.duration();l&&l.isLive()&&(d=i.player_.liveTracker.liveCurrentTime()),i.percent_!==a&&(i.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),i.percent_=a),(i.currentTime_!==o||i.duration_!==d)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Wr(o,d),Wr(d,d)],"{1} of {2}")),i.currentTime_=o,i.duration_=d),i.bar&&i.bar.update(Fr(i.el()),i.getProgress())}),a}},t.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var i,e=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(i=(e-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i},t.handleMouseDown=function(e){!vn(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e,i){if(void 0===i&&(i=!1),vn(e)){!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(e),l=this.player_.liveTracker;if(l&&l.isLive()){if(o>=.99)return void l.seekToLiveEdge();var d=l.seekableStart(),f=l.liveCurrentTime();if((a=d+o*l.liveWindow())>=f&&(a=f),a<=d&&(a=d+.1),a===1/0)return}else(a=o*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.show()},t.disable=function(){s.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.hide()},t.handleMouseUp=function(e){s.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?yi(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){var i=this.player_.liveTracker;if(Ie().isEventKey(e,"Space")||Ie().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(Ie().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(Ie().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Ie()(e))){e.preventDefault(),e.stopPropagation();var a=10*(Ie().codes[Ie()(e)]-Ie().codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else Ie().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):Ie().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):s.prototype.handleKeyDown.call(this,e)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in K()&&"visibilityState"in K()&&this.off(K(),"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},n}($s);Qs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},!jt&&!Di&&Qs.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),$.registerComponent("SeekBar",Qs);var Cl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).handleMouseMove=Ri(at(Fe(i),i.handleMouseMove),30),i.throttledHandleMouseSeek=Ri(at(Fe(i),i.handleMouseSeek),30),i.handleMouseUpHandler_=function(a){return i.handleMouseUp(a)},i.handleMouseDownHandler_=function(a){return i.handleMouseDown(a)},i.enable(),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var i=this.getChild("seekBar");if(i){var a=i.getChild("playProgressBar"),o=i.getChild("mouseTimeDisplay");if(a||o){var l=i.el(),d=gn(l),f=Jn(l,e).x;f=da(f,0,1),o&&o.update(d,f),a&&a.update(d,i.getProgress())}}},t.handleMouseSeek=function(e){var i=this.getChild("seekBar");i&&i.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(i){return i.disable&&i.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&yi(this.player_.play())}},t.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(e){var i=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},n}($);Cl.prototype.options_={children:["seekBar"]},$.registerComponent("ProgressControl",Cl);var kl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,["enterpictureinpicture","leavepictureinpicture"],function(a){return i.handlePictureInPictureChange(a)}),i.on(r,["disablepictureinpicturechanged","loadedmetadata"],function(a){return i.handlePictureInPictureEnabledChange(a)}),i.disable(),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){K().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},t.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},n}(hi);kl.prototype.controlText_="Picture-in-Picture",$.registerComponent("PictureInPictureToggle",kl);var Al=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,"fullscreenchange",function(a){return i.handleFullscreenChange(a)}),!1===K()[r.fsApi_.fullscreenEnabled]&&i.disable(),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},n}(hi);Al.prototype.controlText_="Fullscreen",$.registerComponent("FullscreenToggle",Al);var Pp=function(s){function n(){return s.apply(this,arguments)||this}return ie(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},n}($);$.registerComponent("VolumeLevel",Pp);var Lp=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(e,i,a,o){if(!a){var l=Fr(this.el_),d=Fr(this.player_.el()),f=e.width*i;if(!d||!l)return;var v=e.left-d.left+f,g=e.width-f+(d.right-e.right),T=l.width/2;vl.width&&(T=l.width),this.el_.style.right="-"+T+"px"}this.write(o+"%")},t.write=function(e){nr(this.el_,e)},t.updateVolume=function(e,i,a,o,l){var d=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){d.update(e,i,a,o.toFixed(0)),l&&l()})},n}($);$.registerComponent("VolumeLevelTooltip",Lp);var wl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,i,a){var o=this,l=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,a,l,function(){a?o.el_.style.bottom=e.height*i+"px":o.el_.style.left=e.width*i+"px"})},n}($);wl.prototype.options_={children:["volumeLevelTooltip"]},$.registerComponent("MouseVolumeLevelDisplay",wl);var fa=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on("slideractive",function(a){return i.updateLastVolume_(a)}),i.on(r,"volumechange",function(a){return i.updateARIAAttributes(a)}),r.ready(function(){return i.updateARIAAttributes()}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){!vn(e)||s.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){var i=this.getChild("mouseVolumeLevelDisplay");if(i){var a=this.el(),o=Fr(a),l=this.vertical(),d=Jn(a,e);d=da(d=l?d.y:d.x,0,1),i.update(o,d,l)}!vn(e)||(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,i=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(i)})},n}($s);fa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!jt&&!Di&&fa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),fa.prototype.playerEvent="volumechange",$.registerComponent("VolumeBar",fa);var Il=function(s){function n(r,e){var i;return void 0===e&&(e={}),e.vertical=e.vertical||!1,(void 0===e.volumeBar||cn(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),function(n,t){t.tech_&&!t.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})}(Fe(i=s.call(this,r,e)||this),r),i.throttledHandleMouseMove=Ri(at(Fe(i),i.handleMouseMove),30),i.handleMouseUpHandler_=function(a){return i.handleMouseUp(a)},i.on("mousedown",function(a){return i.handleMouseDown(a)}),i.on("touchstart",function(a){return i.handleMouseDown(a)}),i.on("mousemove",function(a){return i.handleMouseMove(a)}),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},n}($);Il.prototype.options_={children:["volumeBar"]},$.registerComponent("VolumeControl",Il);var Dl=function(s){function n(r,e){var i;return function(n,t){t.tech_&&!t.tech_.featuresMuteControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresMuteControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})}(Fe(i=s.call(this,r,e)||this),r),i.on(r,["loadstart","volumechange"],function(a){return i.update(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var i=this.player_.volume(),a=this.player_.lastVolume_();0===i?(this.player_.volume(a<.1?.1:a),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),i=3;jt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?i=0:e<.33?i=1:e<.67&&(i=2);for(var a=0;a<4;a++)mn(this.el_,"vjs-vol-"+a);Li(this.el_,"vjs-vol-"+i)},t.updateControlText_=function(){var i=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)},n}(hi);Dl.prototype.controlText_="Mute",$.registerComponent("MuteToggle",Dl);var Pl=function(s){function n(r,e){var i;return void 0===e&&(e={}),e.inline=void 0===e.inline||e.inline,(void 0===e.volumeControl||cn(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),(i=s.call(this,r,e)||this).handleKeyPressHandler_=function(a){return i.handleKeyPress(a)},i.on(r,["loadstart"],function(a){return i.volumePanelState_(a)}),i.on(i.muteToggle,"keyup",function(a){return i.handleKeyPress(a)}),i.on(i.volumeControl,"keyup",function(a){return i.handleVolumeControlKeyUp(a)}),i.on("keydown",function(a){return i.handleKeyPress(a)}),i.on("mouseover",function(a){return i.handleMouseOver(a)}),i.on("mouseout",function(a){return i.handleMouseOut(a)}),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}ie(n,s);var t=n.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(e){Ie().isEventKey(e,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(e){this.addClass("vjs-hover"),Qt(K(),"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(e){this.removeClass("vjs-hover"),Nt(K(),"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(e){Ie().isEventKey(e,"Esc")&&this.handleMouseOut()},n}($);Pl.prototype.options_={children:["muteToggle","volumeControl"]},$.registerComponent("VolumePanel",Pl);var Ll=function(s){function n(r,e){var i;return i=s.call(this,r,e)||this,e&&(i.menuButton_=e.menuButton),i.focusedChild_=-1,i.on("keydown",function(a){return i.handleKeyDown(a)}),i.boundHandleBlur_=function(a){return i.handleBlur(a)},i.boundHandleTapClick_=function(a){return i.handleTapClick(a)},i}ie(n,s);var t=n.prototype;return t.addEventListenerForItem=function(e){e instanceof $&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof $&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),s.prototype.removeChild.call(this,e)},t.addItem=function(e){var i=this.addChild(e);i&&this.addEventListenerForItem(i)},t.createEl=function(){this.contentEl_=$e(this.options_.contentElType||"ul",{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Qt(i,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),i},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(e){var i=e.relatedTarget||K().activeElement;if(!this.children().some(function(o){return o.el()===i})){var a=this.menuButton_;a&&a.buttonPressed_&&i!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i))return;var a=i.filter(function(o){return o.el()===e.target})[0];if(!a)return;"CaptionSettingsMenuItem"!==a.name()&&this.menuButton_.focus()}},t.handleKeyDown=function(e){Ie().isEventKey(e,"Left")||Ie().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Ie().isEventKey(e,"Right")||Ie().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var i=this.children().slice();i.length&&i[0].hasClass("vjs-menu-title")&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())},n}($);$.registerComponent("Menu",Ll);var Js=function(s){function n(r,e){var i;void 0===e&&(e={}),(i=s.call(this,r,e)||this).menuButton_=new hi(r,e),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var a=hi.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+a,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var o=function(d){return i.handleClick(d)};return i.handleMenuKeyUp_=function(l){return i.handleMenuKeyUp(l)},i.on(i.menuButton_,"tap",o),i.on(i.menuButton_,"click",o),i.on(i.menuButton_,"keydown",function(l){return i.handleKeyDown(l)}),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),Qt(K(),"keyup",i.handleMenuKeyUp_)}),i.on("mouseleave",function(l){return i.handleMouseLeave(l)}),i.on("keydown",function(l){return i.handleSubmenuKeyDown(l)}),i}ie(n,s);var t=n.prototype;return t.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.createMenu=function(){var e=new Ll(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var i=$e("li",{className:"vjs-menu-title",textContent:bt(this.options_.title),tabIndex:-1}),a=new $(this.player_,{el:i});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o-1&&"showing"===d.mode){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(e){for(var i=this.player().textTracks(),a=!0,o=0,l=i.length;o-1&&"showing"===d.mode){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},n}(xn);$.registerComponent("OffTextTrackMenuItem",Ol);var Zr=function(s){function n(r,e){return void 0===e&&(e={}),e.tracks=r.textTracks(),s.call(this,r,e)||this}return ie(n,s),n.prototype.createItems=function(e,i){var a;void 0===e&&(e=[]),void 0===i&&(i=xn),this.label_&&(a=this.label_+" off"),e.push(new Ol(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l-1){var f=new i(this.player_,{track:d,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});f.addClass("vjs-"+d.kind+"-menu-item"),e.push(f)}}return e},n}(eo);$.registerComponent("TextTrackButton",Zr);var Rl=function(s){function n(r,e){var i,a=e.track,o=e.cue,l=r.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=l&&l=0;i--){var a=e[i];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(bt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var e=[];if(!this.track_)return e;var i=this.track_.cues;if(!i)return e;for(var a=0,o=i.length;a-1&&(i.label_="captions"),i.menuButton_.controlText(bt(i.label_)),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new no(this.player_,{kind:this.label_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,e,Ml)},n}(Zr);so.prototype.kinds_=["captions","subtitles"],so.prototype.controlText_="Subtitles",$.registerComponent("SubsCapsButton",so);var Nl=function(s){function n(r,e){var i,a=e.track,o=r.audioTracks();e.label=a.label||a.language||"Unknown",e.selected=a.enabled,(i=s.call(this,r,e)||this).track=a,i.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var f=arguments.length,v=new Array(f),g=0;g=0;a--)i.push(new oo(this.player(),{rate:e[a]+"x"}));return i},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(e){var i=this.player().playbackRate(),a=this.playbackRates(),l=(a.indexOf(i)+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(e){this.update()},t.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},n}(Js);Ul.prototype.controlText_="Playback Rate",$.registerComponent("PlaybackRateMenuButton",Ul);var Bl=function(s){function n(){return s.apply(this,arguments)||this}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(e,i,a){return void 0===e&&(e="div"),void 0===i&&(i={}),void 0===a&&(a={}),i.className||(i.className=this.buildCSSClass()),s.prototype.createEl.call(this,e,i,a)},n}($);$.registerComponent("Spacer",Bl);var Mp=function(s){function n(){return s.apply(this,arguments)||this}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xa0"})},n}(Bl);$.registerComponent("CustomControlSpacer",Mp);var ha=function(s){function n(){return s.apply(this,arguments)||this}return ie(n,s),n.prototype.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},n}($);ha.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in K()&&ha.prototype.options_.children.splice(ha.prototype.options_.children.length-1,0,"pictureInPictureToggle"),$.registerComponent("ControlBar",ha);var Hl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,"error",function(a){return i.open(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var e=this.player().error();return e?this.localize(e.message):""},n}(Hr);Hl.prototype.options_=gt({},Hr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),$.registerComponent("ErrorDisplay",Hl);var uo="vjs-text-track-settings",jl=["#000","Black"],Vl=["#00F","Blue"],ql=["#0FF","Cyan"],Wl=["#0F0","Green"],Gl=["#F0F","Magenta"],Zl=["#F00","Red"],zl=["#FFF","White"],Kl=["#FF0","Yellow"],lo=["1","Opaque"],co=["0.5","Semi-Transparent"],$l=["0","Transparent"],dr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[jl,zl,Zl,Wl,Vl,Kl,Gl,ql]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[lo,co,$l]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[zl,jl,Zl,Wl,Vl,Kl,Gl,ql]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(n){return"1.00"===n?null:Number(n)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[lo,co]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[$l,co,lo]}};function Yl(s,n){if(n&&(s=n(s)),s&&"none"!==s)return s}dr.windowColor.options=dr.backgroundColor.options;var Up=function(s){function n(r,e){var i;return e.temporary=!1,(i=s.call(this,r,e)||this).updateDisplay=i.updateDisplay.bind(Fe(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=$e("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===e.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",function(){i.saveSettings(),i.close()}),i.on(i.$(".vjs-default-button"),"click",function(){i.setDefaults(),i.updateDisplay()}),Lr(dr,function(a){i.on(i.$(a.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}ie(n,s);var t=n.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(e,i,a){var o=this;void 0===i&&(i=""),void 0===a&&(a="label");var l=dr[e],d=l.id.replace("%s",this.id_),f=[i,d].join(" ").trim();return["<"+a+' id="'+d+'" class="'+("label"===a?"vjs-label":"")+'">',this.localize(l.label),"",'").join("")},t.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},t.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},t.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},t.createElColors_=function(){return $e("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return $e("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},t.createElControls_=function(){var e=this.localize("restore all settings to the default values");return $e("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var e=this;return function kh(s,n,t){return void 0===t&&(t=0),ku(s).reduce(function(r,e){return n(r,s[e],e)},t)}(dr,function(i,a,o){var l=function Np(s,n){return Yl(s.options[s.options.selectedIndex].value,n)}(e.$(a.selector),a.parser);return void 0!==l&&(i[o]=l),i},{})},t.setValues=function(e){var i=this;Lr(dr,function(a,o){!function Fp(s,n,t){if(n)for(var r=0;rthis.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(d=!1),d!==this.behindLiveEdge_&&(this.behindLiveEdge_=d,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){!this.isTracking()||(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var e=this.player_.seekable(),i=[],a=e?e.length:0;a--;)i.push(e.end(a));return i.length?i.sort()[i.length-1]:1/0},t.seekableStart=function(){for(var e=this.player_.seekable(),i=[],a=e?e.length:0;a--;)i.push(e.start(a));return i.length?i.sort()[0]:0},t.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return"number"==typeof this.trackingInterval_},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(K(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},n}($);$.registerComponent("LiveTracker",jp);var pa,fo=function(n){var t=n.el();if(t.hasAttribute("src"))return n.triggerSourceset(t.src),!0;var r=n.$$("source"),e=[],i="";if(!r.length)return!1;for(var a=0;a=2&&l.push("loadeddata"),e.readyState>=3&&l.push("canplay"),e.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(d){this.trigger(d)},this)})}},t.setScrubbing=function(e){this.isScrubbing_=e},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Xn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){ze(i,"Video is not ready. (Video.js)")}},t.duration=function(){var e=this;return this.el_.duration===1/0&&Di&&Pi&&0===this.el_.currentTime?(this.on("timeupdate",function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))}),NaN):this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var i=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",i),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",i)})}},t.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=P().navigator&&P().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)yi(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},t.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.reset=function(){n.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(e){this.el_.controls=!!e},t.addTextTrack=function(e,i,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,a):s.prototype.addTextTrack.call(this,e,i,a)},t.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,e);var i=K().createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i},t.addRemoteTextTrack=function(e,i){var a=s.prototype.addRemoteTextTrack.call(this,e,i);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(e){if(s.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var i=this.$$("track"),a=i.length;a--;)(e===i[a]||e===i[a].track)&&this.el().removeChild(i[a])},t.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),P().performance&&"function"==typeof P().performance.now?e.creationTime=P().performance.now():P().performance&&P().performance.timing&&"number"==typeof P().performance.timing.navigationStart&&(e.creationTime=P().Date.now()-P().performance.timing.navigationStart),e},n}(st);ho(be,"TEST_VID",function(){if(Rr()){var s=K().createElement("video"),n=K().createElement("track");return n.kind="captions",n.srclang="en",n.label="English",s.appendChild(n),s}}),be.isSupported=function(){try{be.TEST_VID.volume=.5}catch(s){return!1}return!(!be.TEST_VID||!be.TEST_VID.canPlayType)},be.canPlayType=function(s){return be.TEST_VID.canPlayType(s)},be.canPlaySource=function(s,n){return be.canPlayType(s.type)},be.canControlVolume=function(){try{var s=be.TEST_VID.volume;be.TEST_VID.volume=s/2+.1;var n=s!==be.TEST_VID.volume;return n&&jt?(P().setTimeout(function(){be&&be.prototype&&(be.prototype.featuresVolumeControl=s!==be.TEST_VID.volume)}),!1):n}catch(t){return!1}},be.canMuteVolume=function(){try{var s=be.TEST_VID.muted;return be.TEST_VID.muted=!s,be.TEST_VID.muted?Nr(be.TEST_VID,"muted","muted"):Qn(be.TEST_VID,"muted"),s!==be.TEST_VID.muted}catch(n){return!1}},be.canControlPlaybackRate=function(){if(Di&&Pi&&Pu<58)return!1;try{var s=be.TEST_VID.playbackRate;return be.TEST_VID.playbackRate=s/2+.1,s!==be.TEST_VID.playbackRate}catch(n){return!1}},be.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(K().createElement("video"),"src",{get:s,set:s}),Object.defineProperty(K().createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(K().createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(K().createElement("audio"),"innerHTML",{get:s,set:s})}catch(n){return!1}return!0},be.supportsNativeTextTracks=function(){return Xn||jt&&Pi},be.supportsNativeVideoTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.videoTracks)},be.supportsNativeAudioTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.audioTracks)},be.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var t=s[1];ho(be.prototype,s[0],function(){return be[t]()},!0)}),be.prototype.featuresVolumeControl=be.canControlVolume(),be.prototype.movingMediaElementInDOM=!jt,be.prototype.featuresFullscreenResize=!0,be.prototype.featuresProgressEvents=!0,be.prototype.featuresTimeupdateEvents=!0,be.patchCanPlayType=function(){_s>=4&&!Du&&!Pi&&(pa=be.TEST_VID&&be.TEST_VID.constructor.prototype.canPlayType,be.TEST_VID.constructor.prototype.canPlayType=function(s){return s&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(s)?"maybe":pa.call(this,s)})},be.unpatchCanPlayType=function(){var s=be.TEST_VID.constructor.prototype.canPlayType;return pa&&(be.TEST_VID.constructor.prototype.canPlayType=pa),s},be.patchCanPlayType(),be.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch(n){}}()}},be.resetMediaElement=function(s){if(s){for(var n=s.querySelectorAll("source"),t=n.length;t--;)s.removeChild(n[t]);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch(r){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n,n?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n}}),["pause","load","play"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]()}}),st.withSourceHandlers(be),be.nativeSourceHandler={},be.nativeSourceHandler.canPlayType=function(s){try{return be.TEST_VID.canPlayType(s)}catch(n){return""}},be.nativeSourceHandler.canHandleSource=function(s,n){if(s.type)return be.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=Hs(s.src);return be.nativeSourceHandler.canPlayType("video/"+t)}return""},be.nativeSourceHandler.handleSource=function(s,n,t){n.setSrc(s.src)},be.nativeSourceHandler.dispose=function(){},be.registerSourceHandler(be.nativeSourceHandler),st.registerTech("Html5",be);var Jl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],po={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},mo=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};mo.forEach(function(s){var n="x"===s.charAt(0)?"x-"+s.substring(1):s;ma[s]="vjs-layout-"+n});var zp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Et=function(s){function n(r,e,i){var a;if(r.id=r.id||e.id||"vjs_video_"+Zi(),(e=_t(n.getTagSettings(r),e)).initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if("function"==typeof r.closest){var o=r.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var l=r;l&&1===l.nodeType;){if(Oi(l).hasOwnProperty("lang")){e.language=l.getAttribute("lang");break}l=l.parentNode}if((a=s.call(this,null,e,i)||this).boundDocumentFullscreenChange_=function(g){return a.documentFullscreenChange_(g)},a.boundFullWindowOnEscKey_=function(g){return a.fullWindowOnEscKey(g)},a.boundUpdateStyleEl_=function(g){return a.updateStyleEl_(g)},a.boundApplyInitTime_=function(g){return a.applyInitTime_(g)},a.boundUpdateCurrentBreakpoint_=function(g){return a.updateCurrentBreakpoint_(g)},a.boundHandleTechClick_=function(g){return a.handleTechClick_(g)},a.boundHandleTechDoubleClick_=function(g){return a.handleTechDoubleClick_(g)},a.boundHandleTechTouchStart_=function(g){return a.handleTechTouchStart_(g)},a.boundHandleTechTouchMove_=function(g){return a.handleTechTouchMove_(g)},a.boundHandleTechTouchEnd_=function(g){return a.handleTechTouchEnd_(g)},a.boundHandleTechTap_=function(g){return a.handleTechTap_(g)},a.isFullscreen_=!1,a.log=Cu(a.id_),a.fsApi_=zn,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=r,a.tagAttributes=r&&Oi(r),a.language(a.options_.language),e.languages){var d={};Object.getOwnPropertyNames(e.languages).forEach(function(g){d[g.toLowerCase()]=e.languages[g]}),a.languages_=d}else a.languages_=n.prototype.options_.languages;a.resetCache_(),a.poster_=e.poster||"",a.controls_=!!e.controls,r.controls=!1,r.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],r.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(g){if("function"!=typeof a[g])throw new Error('plugin "'+g+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),Ps(Fe(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Qt(K(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var f=ct(a.options_);e.plugins&&Object.keys(e.plugins).forEach(function(g){a[g](e.plugins[g])}),e.debug&&a.debug(!0),a.options_.playerOptions=f,a.middleware_=[],a.playbackRates(e.playbackRates),a.initChildren(),a.isAudio("audio"===r.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Or&&a.addClass("vjs-touch-enabled"),jt||a.addClass("vjs-workinghover"),n.players[a.id_]=Fe(a);var v="7.18.1".split(".")[0];return a.addClass("vjs-v"+v),a.userActive(!0),a.reportUserActivity(),a.one("play",function(g){return a.listenForUserActivity_(g)}),a.on("stageclick",function(g){return a.handleStageClick_(g)}),a.on("keydown",function(g){return a.handleKeyDown(g)}),a.on("languagechange",function(g){return a.handleLanguagechange(g)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}ie(n,s);var t=n.prototype;return t.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Nt(K(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Nt(K(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),n.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),function hp(s){js[s.id()]=null}(this),Wt.names.forEach(function(i){var o=e[Wt[i].getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this)},t.createEl=function(){var i,e=this.tag,a=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();a?i=this.el_=e.parentNode:o||(i=this.el_=s.prototype.createEl.call(this,"div"));var l=Oi(e);if(o){for(i=this.el_=e,e=this.tag=K().createElement("video");i.children.length;)e.appendChild(i.firstChild);ar(i,"video-js")||Li(i,"video-js"),i.appendChild(e),a=this.playerElIngest_=i,Object.keys(i).forEach(function(E){try{e[E]=i[E]}catch(x){}})}if(e.setAttribute("tabindex","-1"),l.tabindex="-1",(pn||Pi&&Lu)&&(e.setAttribute("role","application"),l.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(E){o&&"class"===E||i.setAttribute(E,l[E]),o&&e.setAttribute(E,l[E])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused"),!0!==P().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ku("vjs-styles-dimensions");var d=Gi(".vjs-styles-defaults"),f=Gi("head");f.insertBefore(this.styleEl_,d?d.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var v=e.getElementsByTagName("a"),g=0;g0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),g=v[1]/v[0];o=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/g:this.videoWidth()||300,l=void 0!==this.height_?this.height_:o*g,f=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(f),$u(this.styleEl_,"\n ."+f+" {\n width: "+o+"px;\n height: "+l+"px;\n }\n\n ."+f+".vjs-fluid {\n padding-top: "+100*g+"%;\n }\n ")}else{var e="number"==typeof this.width_?this.width_:this.options_.width,i="number"==typeof this.height_?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(e>=0&&(a.width=e),i>=0&&(a.height=i))}},t.loadTech_=function(e,i){var a=this;this.tech_&&this.unloadTech_();var o=bt(e),l=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==o&&this.tag&&(st.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var d=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(d=!1);var f={source:i,autoplay:d,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Wt.names.forEach(function(g){var T=Wt[g];f[T.getterName]=a[T.privateName]}),_t(f,this.options_[o]),_t(f,this.options_[l]),_t(f,this.options_[e.toLowerCase()]),this.tag&&(f.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(f.startTime=this.cache_.currentTime);var v=st.getTech(e);if(!v)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new v(f),this.tech_.ready(at(this,this.handleTechReady_),!0),function(n,t){n.forEach(function(r){var e=t.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(i){return e.addCue(i)})}),t.textTracks()}(this.textTracksJson_||[],this.tech_),Jl.forEach(function(g){a.on(a.tech_,g,function(T){return a["handleTech"+bt(g)+"_"](T)})}),Object.keys(po).forEach(function(g){a.on(a.tech_,g,function(T){0===a.tech_.playbackRate()&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+po[g]+"_"].bind(a),event:T}):a["handleTech"+po[g]+"_"](T)})}),this.on(this.tech_,"loadstart",function(g){return a.handleTechLoadStart_(g)}),this.on(this.tech_,"sourceset",function(g){return a.handleTechSourceset_(g)}),this.on(this.tech_,"waiting",function(g){return a.handleTechWaiting_(g)}),this.on(this.tech_,"ended",function(g){return a.handleTechEnded_(g)}),this.on(this.tech_,"seeking",function(g){return a.handleTechSeeking_(g)}),this.on(this.tech_,"play",function(g){return a.handleTechPlay_(g)}),this.on(this.tech_,"firstplay",function(g){return a.handleTechFirstPlay_(g)}),this.on(this.tech_,"pause",function(g){return a.handleTechPause_(g)}),this.on(this.tech_,"durationchange",function(g){return a.handleTechDurationChange_(g)}),this.on(this.tech_,"fullscreenchange",function(g,T){return a.handleTechFullscreenChange_(g,T)}),this.on(this.tech_,"fullscreenerror",function(g,T){return a.handleTechFullscreenError_(g,T)}),this.on(this.tech_,"enterpictureinpicture",function(g){return a.handleTechEnterPictureInPicture_(g)}),this.on(this.tech_,"leavepictureinpicture",function(g){return a.handleTechLeavePictureInPicture_(g)}),this.on(this.tech_,"error",function(g){return a.handleTechError_(g)}),this.on(this.tech_,"posterchange",function(g){return a.handleTechPosterChange_(g)}),this.on(this.tech_,"textdata",function(g){return a.handleTechTextData_(g)}),this.on(this.tech_,"ratechange",function(g){return a.handleTechRateChange_(g)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&("Html5"!==o||!this.tag)&&xs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var e=this;Wt.names.forEach(function(i){var a=Wt[i];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=function(n){var t=n.$$("track"),r=Array.prototype.map.call(t,function(i){return i.track});return Array.prototype.map.call(t,function(i){var a=Rs(i.track);return i.src&&(a.src=i.src),a}).concat(Array.prototype.filter.call(n.textTracks(),function(i){return-1===r.indexOf(i)}).map(Rs))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(e){return void 0===e&&ze.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(e){var i=this;if(this.tech_&&"string"==typeof e){var o,a=function(){var d=i.muted();i.muted(!0);var f=function(){i.muted(d)};i.playTerminatedQueue_.push(f);var v=i.play();if(yn(v))return v.catch(function(g){throw f(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(g||""))})};if("any"!==e||this.muted()?o="muted"!==e||this.muted()?this.play():a():yn(o=this.play())&&(o=o.catch(a)),yn(o))return o.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},t.updateSourceCaches_=function(e){void 0===e&&(e="");var i=e,a="";"string"!=typeof i&&(i=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!a&&(a=function(n,t){if(!t)return"";if(n.cache_.source.src===t&&n.cache_.source.type)return n.cache_.source.type;var r=n.cache_.sources.filter(function(o){return o.src===t});if(r.length)return r[0].type;for(var e=n.$$("source"),i=0;i0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime();this.on("timeupdate",function o(){i!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))})},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(ze.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(e){!this.controls_||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?yi(this.play()):this.pause())},t.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(e.target)})||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.doubleClick||!1!==this.options_.userActions.doubleClick)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(e){var i=e.target.player;if(!i||i===this){var a=this.el(),o=K()[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(e,i){var a=this;i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))},t.handleTechFullscreenError_=function(e,i){this.trigger("fullscreenerror",i)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(e,i){this.ready(function(){if(e in cp)return function lp(s,n,t,r){return n[t](s.reduce(Vs(t),r))}(this.middleware_,this.tech_,e,i);if(e in gl)return ml(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(a){throw ze(a),a}},!0)},t.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in dp)return function up(s,n,t){return s.reduceRight(Vs(t),n[t]())}(this.middleware_,this.tech_,e);if(e in gl)return ml(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw void 0===this.tech_[e]?(ze("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",i),i):"TypeError"===i.name?(ze("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",i),this.tech_.isReady_=!1,i):(ze(i),i)}}},t.play=function(){var e=this,i=this.options_.Promise||P().Promise;return i?new i(function(a){e.play_(a)}):this.play_()},t.play_=function(e){var i=this;void 0===e&&(e=yi),this.playCallbacks_.push(e);var a=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(l){i.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&(Xn||jt)&&this.load());var o=this.techGet_("play");null===o?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},t.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})},t.runPlayCallbacks_=function(e){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(a){a(e)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return!1!==this.techGet_("paused")},t.played=function(){return this.techGet_("played")||or(0,0)},t.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=or(0,0)),e},t.bufferedPercent=function(){return rl(this.buffered(),this.duration())},t.bufferedEnd=function(){var e=this.buffered(),i=this.duration(),a=e.end(e.length-1);return a>i&&(a=i),a},t.volume=function(e){var i;return void 0!==e?(i=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=i,this.techCall_("setVolume",i),void(i>0&&this.lastVolume_(i))):(i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i)},t.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(e){if(void 0!==e){var i=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},t.requestFullscreen=function(e){var i=this.options_.Promise||P().Promise;if(i){var a=this;return new i(function(o,l){function d(){a.off("fullscreenerror",v),a.off("fullscreenchange",f)}function f(){d(),o()}function v(T,E){d(),l(E)}a.one("fullscreenchange",f),a.one("fullscreenerror",v);var g=a.requestFullscreenHelper_(e);g&&(g.then(d,d),g.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(e){var a,i=this;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(a=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),o}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var e=this.options_.Promise||P().Promise;if(e){var i=this;return new e(function(a,o){function l(){i.off("fullscreenerror",f),i.off("fullscreenchange",d)}function d(){l(),a()}function f(g,T){l(),o(T)}i.one("fullscreenchange",d),i.one("fullscreenerror",f);var v=i.exitFullscreenHelper_();v&&(v.then(l,l),v.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var i=K()[this.fsApi_.exitFullscreen]();return i&&yi(i.then(function(){return e.isFullscreen(!1)})),i}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=K().documentElement.style.overflow,Qt(K(),"keydown",this.boundFullWindowOnEscKey_),K().documentElement.style.overflow="hidden",Li(K().body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(e){Ie().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Nt(K(),"keydown",this.boundFullWindowOnEscKey_),K().documentElement.style.overflow=this.docOrigOverflow,mn(K().body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in K()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in K())return K().exitPictureInPicture()},t.handleKeyDown=function(e){var l,d,i=this.options_.userActions;i&&i.hotkeys&&(d=(l=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),l.isContentEditable||("input"===d?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(l.type):-1!==["textarea"].indexOf(d))||("function"==typeof i.hotkeys?i.hotkeys.call(this,e):this.handleHotkeys(e)))},t.handleHotkeys=function(e){var i=this.options_.userActions?this.options_.userActions.hotkeys:{},a=i.fullscreenKey,l=i.muteKey,d=void 0===l?function(x){return Ie().isEventKey(x,"m")}:l,f=i.playPauseKey,v=void 0===f?function(x){return Ie().isEventKey(x,"k")||Ie().isEventKey(x,"Space")}:f;if((void 0===a?function(x){return Ie().isEventKey(x,"f")}:a).call(this,e)){e.preventDefault(),e.stopPropagation();var g=$.getComponent("FullscreenToggle");!1!==K()[this.fsApi_.fullscreenEnabled]&&g.prototype.handleClick.call(this,e)}else d.call(this,e)?(e.preventDefault(),e.stopPropagation(),$.getComponent("MuteToggle").prototype.handleClick.call(this,e)):v.call(this,e)&&(e.preventDefault(),e.stopPropagation(),$.getComponent("PlayToggle").prototype.handleClick.call(this,e))},t.canPlayType=function(e){for(var i,a=0,o=this.options_.techOrder;a1?a.handleSrc_(o.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void a.triggerReady());!function op(s,n){s.forEach(function(t){return t.setTech&&t.setTech(n)})}(v,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},d=function(){a.off("error",l)};this.one("error",l),this.one("playing",d),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",d)}}}else this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},t.src=function(e){return this.handleSrc_(e,!1)},t.src_=function(e){var i=this,a=this.selectSource([e]);return!a||(function(n,t){return bt(n)===bt(t)}(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){i.changingSrc_=!1}),!1))},t.load=function(){this.techCall_("load")},t.reset=function(){var e=this,i=this.options_.Promise||P().Promise;this.paused()||!i?this.doReset_():yi(this.play().then(function(){return e.doReset_()}))},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Mi(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,i=e.durationDisplay,a=e.remainingTimeDisplay;i&&i.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var e=this.currentSource(),i=[];return 0!==Object.keys(e).length&&i.push(e),this.cache_.sources||i},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var i;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),i=!1):this.options_.autoplay=!!e,i=void 0===i?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)},t.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(e){var i=this;if(void 0===e)return this.error_||null;if(Wi("beforeerror").forEach(function(o){var l=o(i,e);Ii(l)&&!Array.isArray(l)||"string"==typeof l||"number"==typeof l||null===l?e=l:i.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){var a=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new qt(e),this.addClass("vjs-error"),ze.error("(CODE:"+this.error_.code+" "+qt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Wi("error").forEach(function(o){return o(i,i.error_)})},t.reportUserActivity=function(e){this.userActivity_=!0},t.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var e,i,a,o=at(this,this.reportUserActivity),f=function(E){o(),this.clearInterval(e)};this.on("mousedown",function(){o(),this.clearInterval(e),e=this.setInterval(o,250)}),this.on("mousemove",function(E){(E.screenX!==i||E.screenY!==a)&&(i=E.screenX,a=E.screenY,o())}),this.on("mouseup",f),this.on("mouseleave",f);var g,v=this.getChild("controlBar");v&&!jt&&!Di&&(v.on("mouseenter",function(T){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),v.on("mouseleave",function(T){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);var T=this.options_.inactivityTimeout;T<=0||(g=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},T))}},250)},t.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.addTextTrack=function(e,i,a){if(this.tech_)return this.tech_.addTextTrack(e,i,a)},t.addRemoteTextTrack=function(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)},t.removeRemoteTextTrack=function(e){void 0===e&&(e={});var a=e.track;if(a||(a=e),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Mi(this)&&this.trigger("languagechange"))},t.languages=function(){return ct(n.prototype.options_.languages,this.languages_)},t.toJSON=function(){var e=ct(this.options_),i=e.tracks;e.tracks=[];for(var a=0;a"):function(){}},zi=1/30,bi=.1,rd=function(n,t){var e,r=[];if(n&&n.length)for(e=0;e=t})},xa=function(n,t){return rd(n,function(r){return r-zi>=t})},nd=function(n){var t=[];if(!n||!n.length)return"";for(var r=0;r "+n.end(r));return t.join(", ")},cr=function(n){for(var t=[],r=0;ra)){if(t>i&&t<=a){r+=a-t;continue}r+=a-i}}return r},sd=N.createTimeRange,_o=function(n,t){if(!t.preload)return t.duration;var r=0;return(t.parts||[]).forEach(function(e){r+=e.duration}),(t.preloadHints||[]).forEach(function(e){"PART"===e.type&&(r+=n.partTargetDuration)}),r},yo=function(n){return(n.segments||[]).reduce(function(t,r,e){return r.parts?r.parts.forEach(function(i,a){t.push({duration:i.duration,segmentIndex:e,partIndex:a,part:i,segment:r})}):t.push({duration:r.duration,segmentIndex:e,partIndex:null,segment:r,part:null}),t},[])},od=function(n){var t=n.segments&&n.segments.length&&n.segments[n.segments.length-1];return t&&t.parts||[]},ud=function(n){var t=n.preloadSegment;if(t){var r=t.parts;return(t.preloadHints||[]).reduce(function(a,o){return a+("PART"===o.type?1:0)},0)+(r&&r.length?r.length:0)}},ld=function(n,t){if(t.endList)return 0;if(n&&n.suggestedPresentationDelay)return n.suggestedPresentationDelay;var r=od(t).length>0;return r&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:r&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},dd=function(n,t,r){if(void 0===t&&(t=n.mediaSequence+n.segments.length),ti){var o=[i,e];e=o[0],i=o[1]}if(e<0){for(var l=e;lDate.now()},To=function(n){return n.excludeUntil&&n.excludeUntil===1/0},Sa=function(n){var t=hd(n);return!n.disabled&&!t},pd=function(n,t){return t.attributes&&t.attributes[n]},bo=function(n,t){if(1===n.playlists.length)return!0;var r=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===n.playlists.filter(function(e){return!!Sa(e)&&(e.attributes.BANDWIDTH||0)0)for(var T=f-1;T>=0;T--){var E=d[T];if(l+=E.duration,o){if(l<0)continue}else if(l+zi<=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a-En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:T})}}return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:r}}if(f<0){for(var x=f;x<0;x++)if((l-=t.targetDuration)<0)return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:r};f=0}for(var S=f;S0)continue}else if(l-zi>=0)continue;return{partIndex:F.partIndex,segmentIndex:F.segmentIndex,startTime:a+En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:S})}}return{segmentIndex:d[d.length-1].segmentIndex,partIndex:d[d.length-1].partIndex,startTime:r}},isEnabled:Sa,isDisabled:function(n){return n.disabled},isBlacklisted:hd,isIncompatible:To,playlistEnd:fd,isAes:function(n){for(var t=0;t-1&&o!==a.length-1&&(r._HLS_part=o),(o>-1||a.length)&&i--}r._HLS_msn=i}if(t.serverControl&&t.serverControl.canSkipUntil&&(r._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var l=new(P().URL)(n);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(d){!r.hasOwnProperty(d)||l.searchParams.set(d,r[d])}),n=l.toString()}return n}(a,i)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},t.playlistRequestError=function(e,i,a){var o=i.uri,l=i.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(e){var i=this,a=e.url;return function(n){var t=n.onwarn,r=n.oninfo,e=n.manifestString,i=n.customTagParsers,a=void 0===i?[]:i,o=n.customTagMappers,l=void 0===o?[]:o,d=n.experimentalLLHLS,f=new ef;t&&f.on("warn",t),r&&f.on("info",r),a.forEach(function(x){return f.addParser(x)}),l.forEach(function(x){return f.addTagMapper(x)}),f.push(e),f.end();var v=f.manifest;if(d||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(x){v.hasOwnProperty(x)&&delete v[x]}),v.segments&&v.segments.forEach(function(x){["parts","preloadHints"].forEach(function(S){x.hasOwnProperty(S)&&delete x[S]})})),!v.targetDuration){var g=10;v.segments&&v.segments.length&&(g=v.segments.reduce(function(x,S){return Math.max(x,S.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+g),v.targetDuration=g}var T=od(v);if(T.length&&!v.partTargetDuration){var E=T.reduce(function(x,S){return Math.max(x,S.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+E),gd.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),v.partTargetDuration=E}return v}({onwarn:function(d){return i.logger_("m3u8-parser warn for "+a+": "+d.message)},oninfo:function(d){return i.logger_("m3u8-parser info for "+a+": "+d.message)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(e){var i=e.playlistString,a=e.playlistObject,o=e.url,l=e.id;this.request=null,this.state="HAVE_METADATA";var d=a||this.parseManifest_({url:o,manifestString:i});d.lastRequest=Date.now(),vd({playlist:d,uri:o,id:l});var f=Eo(this.master,d);this.targetDuration=d.partTargetDuration||d.targetDuration,this.pendingMedia_=null,f?(this.master=f,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!f)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),P().clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e,i){var a=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(P().clearTimeout(this.finalRenditionTimeout),i){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=P().setTimeout(this.media.bind(this,e,!1),o)}else{var l=this.state,d=!this.media_||e.id!==this.media_.id,f=this.master.playlists[e.id];if(f&&f.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(d&&(this.trigger("mediachanging"),this.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),d){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(v,g){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=ba(a.handleManifestRedirects,e.resolvedUri,g),v)return a.playlistRequestError(a.request,e,l);a.haveMetadata({playlistString:g.responseText,url:e.uri,id:e.id}),a.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")}})}}},t.pause=function(){this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},t.load=function(e){var i=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){i.mediaUpdateTimeout=null,i.load()},o)}else this.started?this.trigger(a&&!a.endList?"mediaupdatetimeout":"loadedplaylist"):this.start()},t.updateMediaUpdateTimeout_=function(e){var i=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=P().setTimeout(function(){i.mediaUpdateTimeout=null,i.trigger("mediaupdatetimeout"),i.updateMediaUpdateTimeout_(e)},e))},t.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=P().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(i,a){if(e.request){if(e.request=null,i)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=ba(e.handleManifestRedirects,e.src,a);var o=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(o)}})},t.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},t.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,_d(this.master,this.srcUri()),e.playlists.forEach(function(a){a.segments=Td(a),a.segments.forEach(function(o){yd(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var i=this.srcUri()||P().location.href;this.master=function(n,t){var r=So(0,t),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:P().location.href,resolvedUri:P().location.href,playlists:[{uri:t,id:r,resolvedUri:t,attributes:{}}]};return e.playlists[r]=e.playlists[0],e.playlists[t]=e.playlists[0],e}(0,i),this.haveMetadata({playlistObject:e,url:i,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},n}(N.EventTarget),mm=N.xhr,gm=N.mergeOptions,ko=function(n,t,r,e){var i="arraybuffer"===n.responseType?n.response:n.responseText;!t&&i&&(n.responseTime=Date.now(),n.roundTripTime=n.responseTime-n.requestTime,n.bytesReceived=i.byteLength||i.length,n.bandwidth||(n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3))),r.headers&&(n.responseHeaders=r.headers),t&&"ETIMEDOUT"===t.code&&(n.timedout=!0),!t&&!n.aborted&&200!==r.statusCode&&206!==r.statusCode&&0!==r.statusCode&&(t=new Error("XHR Failed with a response of: "+(n&&(i||n.responseText)))),e(t,n)},xd=function(){var n=function t(r,e){r=gm({timeout:45e3},r);var i=t.beforeRequest||N.Vhs.xhr.beforeRequest;if(i&&"function"==typeof i){var a=i(r);a&&(r=a)}var l=(!0===N.Vhs.xhr.original?mm:N.Vhs.xhr)(r,function(f,v){return ko(l,f,v,e)}),d=l.abort;return l.abort=function(){return l.aborted=!0,d.apply(l,arguments)},l.uri=r.uri,l.requestTime=Date.now(),l};return n.original=!0,n},Ao=function(n){var t={};return n.byterange&&(t.Range=function(n){return"bytes="+n.offset+"-"+("bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1)}(n.byterange)),t},_m=function(n,t){return n.start(t)+"-"+n.end(t)},ym=function(n,t){var r=n.toString(16);return"00".substring(0,2-r.length)+r+(t%2?" ":"")},Tm=function(n){return n>=32&&n<126?String.fromCharCode(n):"."},Sd=function(n){var t={};return Object.keys(n).forEach(function(r){var e=n[r];t[r]=ArrayBuffer.isView(e)?{bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:e}),t},Ca=function(n){var t=n.byterange||{length:1/0,offset:0};return[t.length,t.offset,n.resolvedUri].join(",")},Ed=function(n){return n.resolvedUri},Cd=function(n){for(var t=Array.prototype.slice.call(n),r=16,e="",o=0;onew Date(l.getTime()+1e3*d)?null:(r>l&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:$t.duration(t,t.mediaSequence+t.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})}(t,r);if(!v)return f({message:t+" was not found in the stream"});var g=v.segment,T=function(n,t){var r,e;try{r=new Date(n),e=new Date(t)}catch(o){}var i=r.getTime();return(e.getTime()-i)/1e3}(g.dateTimeObject,t);if("estimate"===v.type)return 0===i?f({message:t+" is not buffered yet. Try again"}):(a(v.estimatedStart+T),void d.one("seeked",function(){s({programTime:t,playlist:r,retryCount:i-1,seekTo:a,pauseAfterSeek:l,tech:d,callback:f})}));var E=g.start+T;d.one("seeked",function(){return f(null,d.currentTime())}),l&&d.pause(),a(E)},wo=function(n,t){if(4===n.readyState)return t()},Ad=N.mergeOptions,wd=function(n,t){if(!bd(n,t)||n.sidx&&t.sidx&&(n.sidx.offset!==t.sidx.offset||n.sidx.length!==t.sidx.length))return!1;if(!n.sidx&&t.sidx||n.sidx&&!t.sidx||n.segments&&!t.segments||!n.segments&&t.segments)return!1;if(!n.segments&&!t.segments)return!0;for(var r=0;r=F+S)return f(v,{response:E.subarray(S,S+F),status:g.status,uri:g.uri});o.request=o.vhs_.xhr({uri:d,responseType:"arraybuffer",headers:Ao({byterange:e.sidx.byterange})},f)})}else this.mediaRequest_=P().setTimeout(function(){return a(!1)},0)},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},P().clearTimeout(this.minimumUpdatePeriodTimeout_),P().clearTimeout(this.mediaRequest_),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var o=!this.media_||e.id!==this.media_.id;if(o&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(o&&(this.trigger("mediachanging"),this.trigger("mediachange")));!o||(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,a,function(l){i.haveMetadata({startingState:a,playlist:e})}))},t.haveMetadata=function(e){var i=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),this.trigger("HAVE_MASTER"===i?"loadedmetadata":"mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(P().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},t.load=function(e){var i=this;P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){return i.load()},o)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},t.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(i,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=P().setTimeout(function(){return e.haveMaster_()},0)},t.requestMaster_=function(e){var i=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(!i.requestErrored_(a,o)){var l=o.responseText!==i.masterPlaylistLoader_.masterXml_;return i.masterPlaylistLoader_.masterXml_=o.responseText,i.masterLoaded_=o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):Date.now(),i.masterPlaylistLoader_.srcUrl=ba(i.handleManifestRedirects,i.masterPlaylistLoader_.srcUrl,o),l?(i.handleMaster_(),void i.syncClientServerClock_(function(){return e(o,l)})):e(o,l)}"HAVE_NOTHING"===i.state&&(i.started=!1)})},t.syncClientServerClock_=function(e){var i=this,a=function(n){return function(n){var t=Tt(n,"UTCTiming")[0];if(!t)return null;var r=Mt(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return r}(mu(n))}(this.masterPlaylistLoader_.masterXml_);return null===a?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===a.method?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:pi(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(i.request){if(o)return i.masterPlaylistLoader_.clientOffset_=i.masterLoaded_-Date.now(),e();var d;d="HEAD"===a.method?l.responseHeaders&&l.responseHeaders.date?Date.parse(l.responseHeaders.date):i.masterLoaded_:Date.parse(l.responseText),i.masterPlaylistLoader_.clientOffset_=d-Date.now(),e()}}))},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,i=function(n){var r=n.srcUrl,o=function(n,t){void 0===t&&(t={});var r=function(n,t){void 0===t&&(t={});var r=t,e=r.manifestUri,i=void 0===e?"":e,a=r.NOW,o=void 0===a?Date.now():a,l=r.clientOffset,d=void 0===l?0:l,f=Tt(n,"Period");if(!f.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var v=Tt(n,"Location"),g=Mt(n),T=Gn([i],Tt(n,"BaseURL"));g.type=g.type||"static",g.sourceDuration=g.mediaPresentationDuration||0,g.NOW=o,g.clientOffset=d,v.length&&(g.locations=v.map(ls));var E=[];return f.forEach(function(x,S){var F=Mt(x),U=E[S-1];F.start=function(n){var t=n.attributes,r=n.priorPeriodAttributes;return"number"==typeof t.start?t.start:r&&"number"==typeof r.start&&"number"==typeof r.duration?r.start+r.duration:r||"static"!==n.mpdType?null:0}({attributes:F,priorPeriodAttributes:U?U.attributes:null,mpdType:g.type}),E.push({node:x,attributes:F})}),{locations:g.locations,representationInfo:qn(E.map(Hf(g,T)))}}(mu(n),t),e=function(n){return n.map(Lf)}(r.representationInfo);return Ef({dashPlaylists:e,locations:r.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}(n.masterXml,{manifestUri:r,clientOffset:n.clientOffset,sidxMapping:n.sidxMapping,previousManifest:n.previousManifest});return _d(o,r),o}({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(i=function(n,t,r){for(var e=!0,i=Ad(n,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a-1)},this.trigger=function(p){var h,m,_,y;if(h=c[p])if(2===arguments.length)for(_=h.length,m=0;m<_;++m)h[m].call(this,arguments[1]);else{for(y=[],m=arguments.length,m=1;m>>1,c.samplingfrequencyindex<<7|c.channelcount<<3,6,1,2]))},d=function(){return a(Pe.ftyp,ot,Ft,ot,Je)},q=function(c){return a(Pe.hdlr,si[c])},f=function(c){return a(Pe.mdat,c)},W=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,c.duration>>>24&255,c.duration>>>16&255,c.duration>>>8&255,255&c.duration,85,196,0,0]);return c.samplerate&&(p[12]=c.samplerate>>>24&255,p[13]=c.samplerate>>>16&255,p[14]=c.samplerate>>>8&255,p[15]=255&c.samplerate),a(Pe.mdhd,p)},H=function(c){return a(Pe.mdia,W(c),q(c.type),g(c))},v=function(c){return a(Pe.mfhd,new Uint8Array([0,0,0,0,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c]))},g=function(c){return a(Pe.minf,"video"===c.type?a(Pe.vmhd,Ei):a(Pe.smhd,Ui),o(),he(c))},T=function(c,p){for(var h=[],m=p.length;m--;)h[m]=ye(p[m]);return a.apply(null,[Pe.moof,v(c)].concat(h))},E=function(c){for(var p=c.length,h=[];p--;)h[p]=F(c[p]);return a.apply(null,[Pe.moov,S(4294967295)].concat(h).concat(x(c)))},x=function(c){for(var p=c.length,h=[];p--;)h[p]=ge(c[p]);return a.apply(null,[Pe.mvex].concat(h))},S=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(Pe.mvhd,p)},ne=function(c){var m,_,p=c.samples||[],h=new Uint8Array(4+p.length);for(_=0;_>>8),y.push(255&m[I].byteLength),y=y.concat(Array.prototype.slice.call(m[I]));for(I=0;I<_.length;I++)k.push((65280&_[I].byteLength)>>>8),k.push(255&_[I].byteLength),k=k.concat(Array.prototype.slice.call(_[I]));if(O=[Pe.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&h.width)>>8,255&h.width,(65280&h.height)>>8,255&h.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(Pe.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([m.length],y,[_.length],k))),a(Pe.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var L=h.sarRatio[0],M=h.sarRatio[1];O.push(a(Pe.pasp,new Uint8Array([(4278190080&L)>>24,(16711680&L)>>16,(65280&L)>>8,255&L,(4278190080&M)>>24,(16711680&M)>>16,(65280&M)>>8,255&M])))}return a.apply(null,O)},c=function(h){return a(Pe.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&h.channelcount)>>8,255&h.channelcount,(65280&h.samplesize)>>8,255&h.samplesize,0,0,0,0,(65280&h.samplerate)>>8,255&h.samplerate,0,0]),l(h))},U=function(c){var p=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,0,(4278190080&c.duration)>>24,(16711680&c.duration)>>16,(65280&c.duration)>>8,255&c.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&c.width)>>8,255&c.width,0,0,(65280&c.height)>>8,255&c.height,0,0]);return a(Pe.tkhd,p)},ye=function(c){var p,h,m,_,k,I;return p=a(Pe.tfhd,new Uint8Array([0,0,0,58,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),k=Math.floor(c.baseMediaDecodeTime/i),I=Math.floor(c.baseMediaDecodeTime%i),h=a(Pe.tfdt,new Uint8Array([1,0,0,0,k>>>24&255,k>>>16&255,k>>>8&255,255&k,I>>>24&255,I>>>16&255,I>>>8&255,255&I])),"audio"===c.type?(m=Ye(c,92),a(Pe.traf,p,h,m)):(_=ne(c),m=Ye(c,_.length+92),a(Pe.traf,p,h,m,_))},F=function(c){return c.duration=c.duration||4294967295,a(Pe.trak,U(c),H(c))},ge=function(c){var p=new Uint8Array([0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==c.type&&(p[p.length-1]=0),a(Pe.trex,p)},function(){var b,c,p;p=function(m,_){var y=0,k=0,I=0,O=0;return m.length&&(void 0!==m[0].duration&&(y=1),void 0!==m[0].size&&(k=2),void 0!==m[0].flags&&(I=4),void 0!==m[0].compositionTimeOffset&&(O=8)),[0,0,y|k|I|O,1,(4278190080&m.length)>>>24,(16711680&m.length)>>>16,(65280&m.length)>>>8,255&m.length,(4278190080&_)>>>24,(16711680&_)>>>16,(65280&_)>>>8,255&_]},c=function(m,_){var y,k,I,O,L,M;for(I=p(O=m.samples||[],_+=20+16*O.length),(k=new Uint8Array(I.length+16*O.length)).set(I),y=I.length,M=0;M>>24,k[y++]=(16711680&L.duration)>>>16,k[y++]=(65280&L.duration)>>>8,k[y++]=255&L.duration,k[y++]=(4278190080&L.size)>>>24,k[y++]=(16711680&L.size)>>>16,k[y++]=(65280&L.size)>>>8,k[y++]=255&L.size,k[y++]=L.flags.isLeading<<2|L.flags.dependsOn,k[y++]=L.flags.isDependedOn<<6|L.flags.hasRedundancy<<4|L.flags.paddingValue<<1|L.flags.isNonSyncSample,k[y++]=61440&L.flags.degradationPriority,k[y++]=15&L.flags.degradationPriority,k[y++]=(4278190080&L.compositionTimeOffset)>>>24,k[y++]=(16711680&L.compositionTimeOffset)>>>16,k[y++]=(65280&L.compositionTimeOffset)>>>8,k[y++]=255&L.compositionTimeOffset;return a(Pe.trun,k)},b=function(m,_){var y,k,I,O,L,M;for(I=p(O=m.samples||[],_+=20+8*O.length),(y=new Uint8Array(I.length+8*O.length)).set(I),k=I.length,M=0;M>>24,y[k++]=(16711680&L.duration)>>>16,y[k++]=(65280&L.duration)>>>8,y[k++]=255&L.duration,y[k++]=(4278190080&L.size)>>>24,y[k++]=(16711680&L.size)>>>16,y[k++]=(65280&L.size)>>>8,y[k++]=255&L.size;return a(Pe.trun,y)},Ye=function(m,_){return"audio"===m.type?b(m,_):c(m,_)}}();var Vo,Wo,Go,Fa,Zo,vc,_c,yc,Dn_mdat=f,Dn_moof=T,gc=function(c,p){var h={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return h.dataOffset=p,h.compositionTimeOffset=c.pts-c.dts,h.duration=c.duration,h.size=4*c.length,h.size+=c.byteLength,c.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},Ki=[33,16,5,32,164,27],jo=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],et=function(c){for(var p=[];c--;)p.push(0);return p};Wo=function(c){return 9e4*c},Go=function(c,p){return c*p},Fa=function(c){return c/9e4},Zo=function(c,p){return c/p},vc=function(c,p){return Wo(Zo(c,p))},_c=function(c,p){return Go(Fa(c),p)},yc=function(c,p,h){return Fa(h?c:c-p)};var Xe_secondsToVideoTs=Wo,Xe_videoTsToSeconds=Fa,Xe_audioTsToVideoTs=vc,Xe_videoTsToAudioTs=_c,Xe_metadataTsToSeconds=yc,Ua_prefixWithSilence=function(c,p,h,m){var _,L,M,G,y=0,k=0,I=0,O=0;if(p.length&&(_=Xe_audioTsToVideoTs(c.baseMediaDecodeTime,c.samplerate),y=Math.ceil(9e4/(c.samplerate/1024)),h&&m&&(k=_-Math.max(h,m),O=(I=Math.floor(k/y))*y),!(I<1||O>45e3))){for((L=function(){if(!Vo){var c={96e3:[Ki,[227,64],et(154),[56]],88200:[Ki,[231],et(170),[56]],64e3:[Ki,[248,192],et(240),[56]],48e3:[Ki,[255,192],et(268),[55,148,128],et(54),[112]],44100:[Ki,[255,192],et(268),[55,163,128],et(84),[112]],32e3:[Ki,[255,192],et(268),[55,234],et(226),[112]],24e3:[Ki,[255,192],et(268),[55,255,128],et(268),[111,112],et(126),[224]],16e3:[Ki,[255,192],et(268),[55,255,128],et(268),[111,255],et(269),[223,108],et(195),[1,192]],12e3:[jo,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,253,128],et(259),[56]],11025:[jo,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,255,192],et(268),[55,175,128],et(108),[112]],8e3:[jo,et(268),[3,121,16],et(47),[7]]};Vo=function(c){return Object.keys(c).reduce(function(p,h){return p[h]=new Uint8Array(c[h].reduce(function(m,_){return m.concat(_)},[])),p},{})}(c)}return Vo}()[c.samplerate])||(L=p[0].data),M=0;M=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(b),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Hi.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Hi.prototype.addText=function(b){this.rows[this.rowIdx]+=b},Hi.prototype.backspace=function(){if(!this.isEmpty()){var b=this.rows[this.rowIdx];this.rows[this.rowIdx]=b.substr(0,b.length-1)}};var Ha=function(c,p,h){this.serviceNum=c,this.text="",this.currentWindow=new Hi(-1),this.windows=[],this.stream=h,"string"==typeof p&&this.createTextDecoder(p)};Ha.prototype.init=function(b,c){this.startPts=b;for(var p=0;p<8;p++)this.windows[p]=new Hi(p),"function"==typeof c&&(this.windows[p].beforeRowOverflow=c)},Ha.prototype.setCurrentWindow=function(b){this.currentWindow=this.windows[b]},Ha.prototype.createTextDecoder=function(b){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(b)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+b+" encoding. "+c})}};var ut=function b(c){c=c||{},b.prototype.init.call(this);var _,p=this,h=c.captionServices||{},m={};Object.keys(h).forEach(function(y){_=h[y],/^SERVICE/.test(y)&&(m[y]=_.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(y){3===y.type?(p.new708Packet(),p.add708Bytes(y)):(null===p.current708Packet&&p.new708Packet(),p.add708Bytes(y))}};ut.prototype=new n,ut.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ut.prototype.add708Bytes=function(b){var c=b.ccData,p=c>>>8,h=255&c;this.current708Packet.ptsVals.push(b.pts),this.current708Packet.data.push(p),this.current708Packet.data.push(h)},ut.prototype.push708Packet=function(){var b=this.current708Packet,c=b.data,p=null,h=null,m=0,_=c[m++];for(b.seq=_>>6,b.sizeCode=63&_;m>5)&&h>0&&(p=_=c[m++]),this.pushServiceBlock(p,m,h),h>0&&(m+=h-1)},ut.prototype.pushServiceBlock=function(b,c,p){var h,m=c,_=this.current708Packet.data,y=this.services[b];for(y||(y=this.initService(b,m));m>5,_.rowLock=(16&h)>>4,_.columnLock=(8&h)>>3,_.priority=7&h,h=p[++b],_.relativePositioning=(128&h)>>7,_.anchorVertical=127&h,h=p[++b],_.anchorHorizontal=h,h=p[++b],_.anchorPoint=(240&h)>>4,_.rowCount=15&h,h=p[++b],_.columnCount=63&h,h=p[++b],_.windowStyle=(56&h)>>3,_.penStyle=7&h,_.virtualRowCount=_.rowCount+1,b},ut.prototype.setWindowAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.winAttr;return h=p[++b],m.fillOpacity=(192&h)>>6,m.fillRed=(48&h)>>4,m.fillGreen=(12&h)>>2,m.fillBlue=3&h,h=p[++b],m.borderType=(192&h)>>6,m.borderRed=(48&h)>>4,m.borderGreen=(12&h)>>2,m.borderBlue=3&h,h=p[++b],m.borderType+=(128&h)>>5,m.wordWrap=(64&h)>>6,m.printDirection=(48&h)>>4,m.scrollDirection=(12&h)>>2,m.justify=3&h,h=p[++b],m.effectSpeed=(240&h)>>4,m.effectDirection=(12&h)>>2,m.displayEffect=3&h,b},ut.prototype.flushDisplayed=function(b,c){for(var p=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&p.push(c.windows[h].getText());c.endPts=b,c.text=p.join("\n\n"),this.pushCaption(c),c.startPts=b},ut.prototype.pushCaption=function(b){""!==b.text&&(this.trigger("data",{startPts:b.startPts,endPts:b.endPts,text:b.text,stream:"cc708_"+b.serviceNum}),b.text="",b.startPts=b.endPts)},ut.prototype.displayWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=1);return b},ut.prototype.hideWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=0);return b},ut.prototype.toggleWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible^=1);return b},ut.prototype.clearWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].clearText();return b},ut.prototype.deleteWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].reset();return b},ut.prototype.setPenAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penAttr;return h=p[++b],m.textTag=(240&h)>>4,m.offset=(12&h)>>2,m.penSize=3&h,h=p[++b],m.italics=(128&h)>>7,m.underline=(64&h)>>6,m.edgeType=(56&h)>>3,m.fontStyle=7&h,b},ut.prototype.setPenColor=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penColor;return h=p[++b],m.fgOpacity=(192&h)>>6,m.fgRed=(48&h)>>4,m.fgGreen=(12&h)>>2,m.fgBlue=3&h,h=p[++b],m.bgOpacity=(192&h)>>6,m.bgRed=(48&h)>>4,m.bgGreen=(12&h)>>2,m.bgBlue=3&h,h=p[++b],m.edgeRed=(48&h)>>4,m.edgeGreen=(12&h)>>2,m.edgeBlue=3&h,b},ut.prototype.setPenLocation=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=p[++b],m.row=15&h,h=p[++b],m.column=63&h,b},ut.prototype.reset=function(b,c){var p=this.getPts(b);return this.flushDisplayed(p,c),this.initService(c.serviceNum,b)};var F0={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},ja=function(c){return null===c?"":(c=F0[c]||c,String.fromCharCode(c))},U0=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],gr=function(){for(var c=[],p=15;p--;)c.push("");return c},mt=function b(c,p){b.prototype.init.call(this),this.field_=c||0,this.dataChannel_=p||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(h){var m,_,y,k,I;if((m=32639&h.ccData)!==this.lastControlCode_){if(4096==(61440&m)?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),y=m>>>8,k=255&m,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),_=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=_,this.startPts_=h.pts;else if(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(m===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=gr();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=gr();else if(m===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(h.pts),this.displayed_=gr()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(y,k))I=ja((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isExtCharacter(y,k))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),I=ja((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isMidRowCode(y,k))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,14==(14&k)&&this.addFormatting(h.pts,["i"]),1==(1&k)&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(y,k))this.column_+=3&k;else if(this.isPAC(y,k)){var O=U0.indexOf(7968&m);"rollUp"===this.mode_&&(O-this.rollUpRows_+1<0&&(O=this.rollUpRows_-1),this.setRollUp(h.pts,O)),O!==this.row_&&(this.clearFormatting(h.pts),this.row_=O),1&k&&-1===this.formatting_.indexOf("u")&&this.addFormatting(h.pts,["u"]),16==(16&m)&&(this.column_=4*((14&m)>>1)),this.isColorPAC(k)&&14==(14&k)&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(y)&&(0===k&&(k=null),I=ja(y),I+=ja(k),this[this.mode_](h.pts,I),this.column_+=I.length)}else this.lastControlCode_=null}};mt.prototype=new n,mt.prototype.flushDisplayed=function(b){var c=this.displayed_.map(function(p,h){try{return p.trim()}catch(m){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");c.length&&this.trigger("data",{startPts:this.startPts_,endPts:b,text:c,stream:this.name_})},mt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=gr(),this.nonDisplayed_=gr(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},mt.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},mt.prototype.isSpecialCharacter=function(b,c){return b===this.EXT_&&c>=48&&c<=63},mt.prototype.isExtCharacter=function(b,c){return(b===this.EXT_+1||b===this.EXT_+2)&&c>=32&&c<=63},mt.prototype.isMidRowCode=function(b,c){return b===this.EXT_&&c>=32&&c<=47},mt.prototype.isOffsetControlCode=function(b,c){return b===this.OFFSET_&&c>=33&&c<=35},mt.prototype.isPAC=function(b,c){return b>=this.BASE_&&b=64&&c<=127},mt.prototype.isColorPAC=function(b){return b>=64&&b<=79||b>=96&&b<=127},mt.prototype.isNormalChar=function(b){return b>=32&&b<=127},mt.prototype.setRollUp=function(b,c){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(b),this.nonDisplayed_=gr(),this.displayed_=gr()),void 0!==c&&c!==this.row_)for(var p=0;p"},"");this[this.mode_](b,p)},mt.prototype.clearFormatting=function(b){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(p,h){return p+""},"");this.formatting_=[],this[this.mode_](b,c)}},mt.prototype.popOn=function(b,c){var p=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=p+=c},mt.prototype.rollUp=function(b,c){var p=this.displayed_[this.row_];this.displayed_[this.row_]=p+=c},mt.prototype.shiftRowsUp_=function(){var b;for(b=0;bp&&(h=-1);Math.abs(p-c)>4294967296;)c+=8589934592*h;return c},xc=function b(c){var p,h;b.prototype.init.call(this),this.type_=c||"shared",this.push=function(m){"shared"!==this.type_&&m.type!==this.type_||(void 0===h&&(h=m.dts),m.dts=zo(m.dts,h),m.pts=zo(m.pts,h),p=m.dts,this.trigger("data",m))},this.flush=function(){h=p,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,p=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};xc.prototype=new n;var Za,Sc_TimestampRolloverStream=xc,Sc_handleRollover=zo,Ec=function(c,p,h){var m,_="";for(m=p;m>>2;ae*=4,M.timeStamp=ae+=3&Se[7],void 0===I.pts&&void 0===I.dts&&(I.pts=M.timeStamp,I.dts=M.timeStamp),this.trigger("timestamp",M)}I.frames.push(M),O+=10,O+=L}while(O>>4>1&&(k+=_[k]+1),0===y.pid)y.type="pat",c(_.subarray(k),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",c(_.subarray(k),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([_,k,y]):this.processPes_(_,k,y)},this.processPes_=function(_,y,k){k.streamType=k.pid===this.programMapTable.video?Rt.H264_STREAM_TYPE:k.pid===this.programMapTable.audio?Rt.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][k.pid],k.type="pes",k.data=_.subarray(y),this.trigger("data",k)}},On.prototype=new n,On.STREAM_TYPES={h264:27,adts:15},Ka=function(){var y,c=this,p=!1,h={data:[],size:0},m={data:[],size:0},_={data:[],size:0},I=function(L,M,G){var Zt,fe=new Uint8Array(L.size),Se={type:M},ae=0,Be=0,kt=!1;if(L.data.length&&!(L.size<9)){for(Se.trackId=L.data[0].pid,ae=0;ae>>3,M.pts*=4,M.pts+=(6&L[13])>>>1,M.dts=M.pts,64&G&&(M.dts=(14&L[14])<<27|(255&L[15])<<20|(254&L[16])<<12|(255&L[17])<<5|(254&L[18])>>>3,M.dts*=4,M.dts+=(6&L[18])>>>1)),M.data=L.subarray(9+L[8]))})(fe,Se),kt="video"===M||Se.packetLength<=L.size,(G||kt)&&(L.size=0,L.data.length=0),kt&&c.trigger("data",Se)}};Ka.prototype.init.call(this),this.push=function(O){({pat:function(){},pes:function(){var M,G;switch(O.streamType){case Rt.H264_STREAM_TYPE:M=h,G="video";break;case Rt.ADTS_STREAM_TYPE:M=m,G="audio";break;case Rt.METADATA_STREAM_TYPE:M=_,G="timed-metadata";break;default:return}O.payloadUnitStartIndicator&&I(M,G,!0),M.data.push(O),M.size+=O.data.byteLength},pmt:function(){var M={type:"metadata",tracks:[]};null!==(y=O.programMapTable).video&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),p=!0,c.trigger("data",M)}})[O.type]()},this.reset=function(){h.size=0,h.data.length=0,m.size=0,m.data.length=0,this.trigger("reset")},this.flushStreams_=function(){I(h,"video"),I(m,"audio"),I(_,"timed-metadata")},this.flush=function(){if(!p&&y){var O={type:"metadata",tracks:[]};null!==y.video&&O.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&O.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),c.trigger("data",O)}p=!1,this.flushStreams_(),this.trigger("done")}},Ka.prototype=new n;var kc={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:za,TransportParseStream:On,ElementaryStream:Ka,TimestampRolloverStream:q0,CaptionStream:qa.CaptionStream,Cea608Stream:qa.Cea608Stream,Cea708Stream:qa.Cea708Stream,MetadataStream:V0};for(var $o in Rt)Rt.hasOwnProperty($o)&&(kc[$o]=Rt[$o]);var $a,ji=kc,Ac=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];$a=function(c){var p,h=0;$a.prototype.init.call(this),this.skipWarn_=function(m,_){this.trigger("log",{level:"warn",message:"adts skiping bytes "+m+" to "+_+" in frame "+h+" outside syncword"})},this.push=function(m){var y,k,I,O,L,_=0;if(c||(h=0),"audio"===m.type){p&&p.length?(I=p,(p=new Uint8Array(I.byteLength+m.data.byteLength)).set(I),p.set(m.data,I.byteLength)):p=m.data;for(var M;_+7>>2],p.byteLength-_<(y=(3&p[_+3])<<11|p[_+4]<<3|(224&p[_+5])>>5))break;this.trigger("data",{pts:m.pts+h*L,dts:m.dts+h*L,sampleCount:O,audioobjecttype:1+(p[_+2]>>>6&3),channelcount:(1&p[_+2])<<2|(192&p[_+3])>>>6,samplerate:Ac[(60&p[_+2])>>>2],samplingfrequencyindex:(60&p[_+2])>>>2,samplesize:16,data:p.subarray(_+7+k,_+y)}),h++,_+=y}else"number"!=typeof M&&(M=_),_++;"number"==typeof M&&(this.skipWarn_(M,_),M=null),p=p.subarray(_)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){p=void 0,this.trigger("reset")},this.endTimeline=function(){p=void 0,this.trigger("endedtimeline")}},$a.prototype=new n;var Ic,wc=$a;Ic=function(c){var p=c.byteLength,h=0,m=0;this.length=function(){return 8*p},this.bitsAvailable=function(){return 8*p+m},this.loadWord=function(){var _=c.byteLength-p,y=new Uint8Array(4),k=Math.min(4,p);if(0===k)throw new Error("no bytes available");y.set(c.subarray(_,_+k)),h=new DataView(y.buffer).getUint32(0),m=8*k,p-=k},this.skipBits=function(_){var y;m>_?(h<<=_,m-=_):(_-=m,_-=8*(y=Math.floor(_/8)),p-=y,this.loadWord(),h<<=_,m-=_)},this.readBits=function(_){var y=Math.min(m,_),k=h>>>32-y;return(m-=y)>0?h<<=y:p>0&&this.loadWord(),(y=_-y)>0?k<>>_))return h<<=_,m-=_,_;return this.loadWord(),_+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var _=this.skipLeadingZeros();return this.readBits(_+1)-1},this.readExpGolomb=function(){var _=this.readUnsignedExpGolomb();return 1&_?1+_>>>1:-1*(_>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ya,Rn,Dc,G0=Ic;Rn=function(){var p,h,c=0;Rn.prototype.init.call(this),this.push=function(m){var _;h?((_=new Uint8Array(h.byteLength+m.data.byteLength)).set(h),_.set(m.data,h.byteLength),h=_):h=m.data;for(var y=h.byteLength;c3&&this.trigger("data",h.subarray(c+3)),h=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Rn.prototype=new n,Dc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ya=function(){var p,h,m,_,y,k,I,c=new Rn;Ya.prototype.init.call(this),p=this,this.push=function(O){"video"===O.type&&(h=O.trackId,m=O.pts,_=O.dts,c.push(O))},c.on("data",function(O){var L={trackId:h,pts:m,dts:_,data:O,nalUnitTypeCode:31&O[0]};switch(L.nalUnitTypeCode){case 5:L.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:L.nalUnitType="sei_rbsp",L.escapedRBSP=y(O.subarray(1));break;case 7:L.nalUnitType="seq_parameter_set_rbsp",L.escapedRBSP=y(O.subarray(1)),L.config=k(L.escapedRBSP);break;case 8:L.nalUnitType="pic_parameter_set_rbsp";break;case 9:L.nalUnitType="access_unit_delimiter_rbsp"}p.trigger("data",L)}),c.on("done",function(){p.trigger("done")}),c.on("partialdone",function(){p.trigger("partialdone")}),c.on("reset",function(){p.trigger("reset")}),c.on("endedtimeline",function(){p.trigger("endedtimeline")}),this.flush=function(){c.flush()},this.partialFlush=function(){c.partialFlush()},this.reset=function(){c.reset()},this.endTimeline=function(){c.endTimeline()},I=function(L,M){var Se,G=8,fe=8;for(Se=0;Se=0?h:0,(16&c[p+5])>>4?h+20:h+10},K0=function b(c,p){return c.length-p<10||c[p]!=="I".charCodeAt(0)||c[p+1]!=="D".charCodeAt(0)||c[p+2]!=="3".charCodeAt(0)?p:b(c,p+=Pc(c,p))},Lc=function(c){return c[0]<<21|c[1]<<14|c[2]<<7|c[3]},X0=function(c,p,h){return unescape(function(c,p,h){var m,_="";for(m=p;m=p+2&&255==(255&c[p])&&240==(240&c[p+1])&&16==(22&c[p+1])},parseId3TagSize:Pc,parseAdtsSize:function(c,p){return 6144&c[p+3]|c[p+4]<<3|(224&c[p+5])>>5},parseType:function(c,p){return c[p]==="I".charCodeAt(0)&&c[p+1]==="D".charCodeAt(0)&&c[p+2]==="3".charCodeAt(0)?"timed-metadata":!0&c[p]&&240==(240&c[p+1])?"audio":null},parseSampleRate:function(c){for(var p=0;p+5>>2];p++}return null},parseAacTimestamp:function(c){var p,h,m;p=10,64&c[5]&&(p+=4,p+=Lc(c.subarray(10,14)));do{if((h=Lc(c.subarray(p+4,p+8)))<1)return null;if("PRIV"===String.fromCharCode(c[p],c[p+1],c[p+2],c[p+3])){m=c.subarray(p+10,p+h+10);for(var y=0;y>>2;return(O*=4)+(3&I[7])}break}}p+=10,p+=h}while(p=3;)if(c[_]!=="I".charCodeAt(0)||c[_+1]!=="D".charCodeAt(0)||c[_+2]!=="3".charCodeAt(0))if(255!=(255&c[_])||240!=(240&c[_+1]))_++;else{if(c.length-_<7||_+(m=Xa.parseAdtsSize(c,_))>c.length)break;I={type:"audio",data:c.subarray(_,_+m),pts:p,dts:p},this.trigger("data",I),_+=m}else{if(c.length-_<10||_+(m=Xa.parseId3TagSize(c,_))>c.length)break;k={type:"timed-metadata",data:c.subarray(_,_+m)},this.trigger("data",k),_+=m}c=c.length-_>0?c.subarray(_):new Uint8Array},this.reset=function(){c=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){c=new Uint8Array,this.trigger("endedtimeline")}},Qa.prototype=new n;var Mn,en,Ja,vr,iy=Qa,Yo=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Xo=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ay=Z0.H264Stream,sy=Xa.isLikelyAacData,uy=function(c,p){p.stream=c,this.trigger("log",p)},Oc=function(c,p){for(var h=Object.keys(p),m=0;m=h?c:(p.minSegmentDts=1/0,c.filter(function(m){return m.dts>=h&&(p.minSegmentDts=Math.min(p.minSegmentDts,m.dts),p.minSegmentPts=p.minSegmentDts,!0)}))}(h,c,_),c.baseMediaDecodeTime=gi_calculateTrackBaseMediaDecodeTime(c,p.keepOriginalTimestamps),Se=Ua_prefixWithSilence(c,I,y,k),c.samples=function(c){var p,m=[];for(p=0;p1&&(p=c.shift(),c.byteLength-=p.byteLength,c.nalCount-=p.nalCount,c[0][0].dts=p.dts,c[0][0].pts=p.pts,c[0][0].duration+=p.duration),c}(L)),_.length){var kt;if(!(kt=p.alignGopsAtEnd?this.alignGopsAtEnd_(L):this.alignGopsAtStart_(L)))return this.gopCache_.unshift({gop:L.pop(),pps:c.pps,sps:c.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),m=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");gi_clearDtsInfo(c),L=kt}gi_collectDtsInfo(c,L),c.samples=function(c,p){var h,m,_,y,I=p||0,O=[];for(h=0;h=-1e4&&G<=45e3&&(!fe||M>G)&&(fe=ae,M=G));return fe?fe.gop:null},this.alignGopsAtStart_=function(I){var O,L,M,G,fe,Se,ae,Be;for(fe=I.byteLength,Se=I.nalCount,ae=I.duration,O=L=0;O<_.length&&LM.pts?O++:(L++,fe-=G.byteLength,Se-=G.nalCount,ae-=G.duration);return 0===L?I:L===I.length?null:((Be=I.slice(L)).byteLength=fe,Be.duration=ae,Be.nalCount=Se,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be)},this.alignGopsAtEnd_=function(I){var O,L,M,G,fe,Se,ae;for(O=_.length-1,L=I.length-1,fe=null,Se=!1;O>=0&&L>=0;){if((M=_[O]).pts===(G=I[L]).pts){Se=!0;break}M.pts>G.pts?O--:(O===_.length-1&&(fe=L),L--)}if(!Se&&null===fe)return null;if(0===(ae=Se?L:fe))return I;var Be=I.slice(ae),kt=Be.reduce(function(Zt,Tr){return Zt.byteLength+=Tr.byteLength,Zt.duration+=Tr.duration,Zt.nalCount+=Tr.nalCount,Zt},{byteLength:0,duration:0,nalCount:0});return Be.byteLength=kt.byteLength,Be.duration=kt.duration,Be.nalCount=kt.nalCount,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be},this.alignGopsWith=function(I){_=I}},Mn.prototype=new n,vr=function(c,p){this.numberOfTracks=0,this.metadataStream=p,this.remuxTracks=void 0===(c=c||{}).remux||!!c.remux,this.keepOriginalTimestamps="boolean"==typeof c.keepOriginalTimestamps&&c.keepOriginalTimestamps,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vr.prototype.init.call(this),this.push=function(h){return h.text?this.pendingCaptions.push(h):h.frames?this.pendingMetadata.push(h):(this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,"video"===h.track.type&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),void("audio"===h.track.type&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))))}},vr.prototype=new n,vr.prototype.flush=function(b){var h,m,_,k,c=0,p={captions:[],captionStreams:{},metadata:[],info:{}},y=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,Xo.forEach(function(I){p.info[I]=this.videoTrack[I]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,Yo.forEach(function(I){p.info[I]=this.audioTrack[I]},this)),this.videoTrack||this.audioTrack){for(p.type=1===this.pendingTracks.length?this.pendingTracks[0].type:"combined",this.emittedTracks+=this.pendingTracks.length,_=function(c){var m,p=d(),h=E(c);return(m=new Uint8Array(p.byteLength+h.byteLength)).set(p),m.set(h,p.byteLength),m}(this.pendingTracks),p.initSegment=new Uint8Array(_.byteLength),p.initSegment.set(_),p.data=new Uint8Array(this.pendingBytes),k=0;k=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vr.prototype.setRemux=function(b){this.remuxTracks=b},Ja=function(c){var m,_,p=this,h=!0;Ja.prototype.init.call(this),this.baseMediaDecodeTime=(c=c||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new ji.MetadataStream,y.aacStream=new iy,y.audioTimestampRolloverStream=new ji.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new ji.TimestampRolloverStream("timed-metadata"),y.adtsStream=new wc,y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(k){y.aacStream.setTimestamp(k.timeStamp)}),y.aacStream.on("data",function(k){"timed-metadata"!==k.type&&"audio"!==k.type||y.audioSegmentStream||(_=_||{timelineStartInfo:{baseMediaDecodeTime:p.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Oc(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new ji.MetadataStream,y.packetStream=new ji.TransportPacketStream,y.parseStream=new ji.TransportParseStream,y.elementaryStream=new ji.ElementaryStream,y.timestampRolloverStream=new ji.TimestampRolloverStream,y.adtsStream=new wc,y.h264Stream=new ay,y.captionStream=new ji.CaptionStream(c),y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(k){var I;if("metadata"===k.type){for(I=k.tracks.length;I--;)m||"video"!==k.tracks[I].type?!_&&"audio"===k.tracks[I].type&&((_=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime):(m=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime;m&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new Mn(m,c),y.videoSegmentStream.on("log",p.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(O){_&&!c.keepOriginalTimestamps&&(_.timelineStartInfo=O,y.audioSegmentStream.setEarliestDts(O.dts-p.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",p.trigger.bind(p,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(O){_&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(O)}),y.videoSegmentStream.on("timingInfo",p.trigger.bind(p,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),_&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(k){k.dispatchType=y.metadataStream.dispatchType,p.trigger("id3Frame",k)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Oc(this,y)},this.setBaseMediaDecodeTime=function(y){var k=this.transmuxPipeline_;c.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),_&&(_.timelineStartInfo.dts=void 0,_.timelineStartInfo.pts=void 0,gi_clearDtsInfo(_),k.audioTimestampRolloverStream&&k.audioTimestampRolloverStream.discontinuity()),m&&(k.videoSegmentStream&&(k.videoSegmentStream.gopCache_=[]),m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,gi_clearDtsInfo(m),k.captionStream.reset()),k.timestampRolloverStream&&k.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){_&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var k=this.transmuxPipeline_;c.remux=y,k&&k.coalesceStream&&k.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){m&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var k=this;return function(I){I.stream=y,k.trigger("log",I)}},this.push=function(y){if(h){var k=sy(y);k&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():!k&&"ts"!==this.transmuxPipeline_.type&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ja.prototype=new n;var jc,Wc,Jo,ly={Transmuxer:Ja,VideoSegmentStream:Mn,AudioSegmentStream:en,AUDIO_PROPERTIES:Yo,VIDEO_PROPERTIES:Xo,generateSegmentTimingInfo:Qo},es_toUnsigned=function(c){return c>>>0},_r=function(c){var p="";return p+=String.fromCharCode(c[0]),p+=String.fromCharCode(c[1]),(p+=String.fromCharCode(c[2]))+String.fromCharCode(c[3])},hy=es_toUnsigned,ft=function b(c,p){var m,_,y,k,I,h=[];if(!p.length)return null;for(m=0;m1?m+_:c.byteLength,y===p[0]&&(1===p.length?h.push(c.subarray(m+8,k)):(I=b(c.subarray(m+8,k),p.slice(1))).length&&(h=h.concat(I))),m=k;return h},my=es_toUnsigned,gy=e.getUint64,Nc=function(c){return{isLeading:(12&c[0])>>>2,dependsOn:3&c[0],isDependedOn:(192&c[1])>>>6,hasRedundancy:(48&c[1])>>>4,paddingValue:(14&c[1])>>>1,isNonSyncSample:1&c[1],degradationPriority:c[2]<<8|c[3]}},Bc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Fn="undefined"!=typeof window?window:void 0!==Bc?Bc:"undefined"!=typeof self?self:{},by=function(c){for(var _,y,p=c.byteLength,h=[],m=1;m0?function(c){var p={version:c[0],flags:new Uint8Array(c.subarray(1,4))};return p.baseMediaDecodeTime=1===p.version?gy(c.subarray(4)):my(c[4]<<24|c[5]<<16|c[6]<<8|c[7]),p}(fe[0]).baseMediaDecodeTime:0,ae=ft(O,["trun"]);p===G&&ae.length>0&&(Be=function(c,p,h){var m=p,_=h.defaultSampleDuration||0,y=h.defaultSampleSize||0,k=h.trackId,I=[];return c.forEach(function(O){var M=function(c){var G,p={version:c[0],flags:new Uint8Array(c.subarray(1,4)),samples:[]},h=new DataView(c.buffer,c.byteOffset,c.byteLength),m=1&p.flags[2],_=4&p.flags[2],y=1&p.flags[1],k=2&p.flags[1],I=4&p.flags[1],O=8&p.flags[1],L=h.getUint32(4),M=8;for(m&&(p.dataOffset=h.getInt32(M),M+=4),_&&L&&(G={flags:Nc(c.subarray(M,M+4))},M+=4,y&&(G.duration=h.getUint32(M),M+=4),k&&(G.size=h.getUint32(M),M+=4),O&&(G.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(G),L--);L--;)G={},y&&(G.duration=h.getUint32(M),M+=4),k&&(G.size=h.getUint32(M),M+=4),I&&(G.flags=Nc(c.subarray(M,M+4)),M+=4),O&&(G.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(G);return p}(O).samples;M.forEach(function(G){void 0===G.duration&&(G.duration=_),void 0===G.size&&(G.size=y),G.trackId=k,G.dts=m,void 0===G.compositionTimeOffset&&(G.compositionTimeOffset=0),"bigint"==typeof m?(G.pts=m+Fn.BigInt(G.compositionTimeOffset),m+=Fn.BigInt(G.duration)):(G.pts=m+G.compositionTimeOffset,m+=G.duration)}),I=I.concat(M)}),I}(ae,Se,M),kt=function(c,p,h){var y,k,I,O,m=new DataView(c.buffer,c.byteOffset,c.byteLength),_={logs:[],seiNals:[]};for(k=0;k+40;){var G=h.shift();this.parse(G,O,L)}return M=function(c,p,h){if(null===p)return null;var _=ky(c,p)[p]||{};return{seiNals:_.seiNals,logs:_.logs,timescale:h}}(I,m,_),M&&M.logs&&(y.logs=y.logs.concat(M.logs)),null!==M&&M.seiNals?(this.pushNals(M.seiNals),this.flushStream(),y):y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(I){if(!this.isInitialized()||!I||0===I.length)return null;I.forEach(function(O){p.push(O)})},this.flushStream=function(){if(!this.isInitialized())return null;k?p.partialFlush():p.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;p.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],m=null,_=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},ts=es_toUnsigned,Un=function(c){return("00"+c.toString(16)).slice(-2)},Dy=e.getUint64;jc=function(c,p){var m=ft(p,["moof","traf"]).reduce(function(_,y){var G,fe,k=ft(y,["tfhd"])[0],I=ts(k[4]<<24|k[5]<<16|k[6]<<8|k[7]),O=c[I]||9e4,L=ft(y,["tfdt"])[0],M=new DataView(L.buffer,L.byteOffset,L.byteLength);return"bigint"==typeof(G=1===L[0]?Dy(L.subarray(4,12)):M.getUint32(4))?fe=G/Fn.BigInt(O):"number"==typeof G&&!isNaN(G)&&(fe=G/O),fe11?(_.codec+=".",_.codec+=Un(Se[9]),_.codec+=Un(Se[10]),_.codec+=Un(Se[11])):_.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(_.codec)?(Se=fe.subarray(28),"esds"===_r(Se.subarray(4,8))&&Se.length>20&&0!==Se[19]?(_.codec+="."+Un(Se[19]),_.codec+="."+Un(Se[20]>>>2&63).replace(/^0/,"")):_.codec="mp4a.40.2"):_.codec=_.codec.toLowerCase())}var Be=ft(m,["mdia","mdhd"])[0];Be&&(_.timescale=Jo(Be)),h.push(_)}),h};var Gc_startTime=jc,Gc_tracks=Wc,Zc=function(c){var p=31&c[1];return(p<<=8)|c[2]},is=function(c){return!!(64&c[1])},rs=function(c){var p=0;return(48&c[3])>>>4>1&&(p+=c[4]+1),p},eu=function(c){switch(c){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Fy={parseType:function(c,p){var h=Zc(c);return 0===h?"pat":h===p?"pmt":p?"pes":null},parsePat:function(c){var p=is(c),h=4+rs(c);return p&&(h+=c[h]+1),(31&c[h+10])<<8|c[h+11]},parsePmt:function(c){var p={},h=is(c),m=4+rs(c);if(h&&(m+=c[m]+1),1&c[m+5]){var y;y=3+((15&c[m+1])<<8|c[m+2])-4;for(var I=12+((15&c[m+10])<<8|c[m+11]);I=c.byteLength)return null;var _,m=null;return 192&(_=c[h+7])&&((m={}).pts=(14&c[h+9])<<27|(255&c[h+10])<<20|(254&c[h+11])<<12|(255&c[h+12])<<5|(254&c[h+13])>>>3,m.pts*=4,m.pts+=(6&c[h+13])>>>1,m.dts=m.pts,64&_&&(m.dts=(14&c[h+14])<<27|(255&c[h+15])<<20|(254&c[h+16])<<12|(255&c[h+17])<<5|(254&c[h+18])>>>3,m.dts*=4,m.dts+=(6&c[h+18])>>>1)),m},videoPacketContainsKeyFrame:function(c){for(var p=4+rs(c),h=c.subarray(p),m=0,_=0,y=!1;_3&&"slice_layer_without_partitioning_rbsp_idr"===eu(31&h[_+3])&&(y=!0),y}},tn=Sc_handleRollover,tt={};tt.ts=Fy,tt.aac=Xa;var yr=9e4,Gt=188,zc=function(c,p,h){for(var y,I,O,L,m=0,_=Gt,M=!1;_<=c.byteLength;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m++,_++;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),O=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&O&&(L=tt.ts.parsePesTime(y))&&(L.type="audio",h.audio.push(L),M=!0)),M)break;m+=Gt,_+=Gt}for(m=(_=c.byteLength)-Gt,M=!1;m>=0;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),O=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&O&&(L=tt.ts.parsePesTime(y))&&(L.type="audio",h.audio.push(L),M=!0)),M)break;m-=Gt,_-=Gt}},By=function(c,p,h){for(var y,I,O,L,M,G,fe,m=0,_=Gt,Se=!1,ae={data:[],size:0};_=0;)if(71!==c[m]||71!==c[_])m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),O=tt.ts.parsePayloadUnitStartIndicator(y),"video"===I&&O&&(L=tt.ts.parsePesTime(y))&&(L.type="video",h.video.push(L),Se=!0)),Se)break;m-=Gt,_-=Gt}},Wy_inspect=function(c,p){var m;return m=tt.aac.isLikelyAacData(c)?function(c){for(var I,p=!1,h=0,m=null,_=null,y=0,k=0;c.length-k>=3;){switch(tt.aac.parseType(c,k)){case"timed-metadata":if(c.length-k<10){p=!0;break}if((y=tt.aac.parseId3TagSize(c,k))>c.length){p=!0;break}null===_&&(I=c.subarray(k,k+y),_=tt.aac.parseAacTimestamp(I)),k+=y;break;case"audio":if(c.length-k<7){p=!0;break}if((y=tt.aac.parseAdtsSize(c,k))>c.length){p=!0;break}null===m&&(I=c.subarray(k,k+y),m=tt.aac.parseSampleRate(I)),h++,k+=y;break;default:k++}if(p)return null}if(null===m||null===_)return null;var L=yr/m;return{audio:[{type:"audio",dts:_,pts:_},{type:"audio",dts:_+1024*h*L,pts:_+1024*h*L}]}}(c):function(c){var p={pid:null,table:null},h={};for(var m in function(c,p){for(var _,h=0,m=Gt;m0}(x)){t.isFmp4=!0;var S=t.map.tracks,F={isFmp4:!0,hasVideo:!!S.video,hasAudio:!!S.audio};S.audio&&S.audio.codec&&"enca"!==S.audio.codec&&(F.audioCodec=S.audio.codec),S.video&&S.video.codec&&"encv"!==S.video.codec&&(F.videoCodec=S.video.codec),S.video&&S.audio&&(F.isMuxed=!0),e(t,F);var U=function(W){g(t,{data:x,type:F.hasAudio&&!F.isMuxed?"audio":"video"}),W&&W.length&&d(t,W),T(null,t,{})};ka({action:"probeMp4StartTime",timescales:t.map.timescales,data:x,transmuxer:t.transmuxer,callback:function(W){var q=W.data,ne=W.startTime;r=q.buffer,t.bytes=x=q,F.hasAudio&&!F.isMuxed&&i(t,"audio","start",ne),F.hasVideo&&i(t,"video","start",ne),S.video&&q.byteLength&&t.transmuxer?ka({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:x,timescales:t.map.timescales,trackIds:[S.video.id],callback:function(z){r=z.data.buffer,t.bytes=x=z.data,z.logs.forEach(function(ye){E(N.mergeOptions(ye,{stream:"mp4CaptionParser"}))}),U(z.captions)}}):U()}})}else{if(t.transmuxer)return void 0===t.container&&(t.container=vs(x)),"ts"!==t.container&&"aac"!==t.container?(e(t,{hasAudio:!1,hasVideo:!1}),void T(null,t,{})):void Qm({segment:t,bytes:r,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});T(null,t,{})}},Vd=function(n,t){var l,r=n.id,e=n.key,i=n.encryptedBytes,a=n.decryptionWorker;a.addEventListener("message",function d(f){if(f.data.source===r){a.removeEventListener("message",d);var v=f.data.decrypted;t(new Uint8Array(v.bytes,v.byteOffset,v.byteLength))}}),l=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),a.postMessage(Sd({source:r,encrypted:i,key:l,iv:e.iv}),[i.buffer,l.buffer])},rg=function(n){var t=n.xhr,r=n.xhrOptions,i=n.segment,a=n.abortFn,o=n.progressFn,l=n.trackInfoFn,d=n.timingInfoFn,f=n.videoSegmentTimingInfoFn,v=n.audioSegmentTimingInfoFn,g=n.id3Fn,T=n.captionsFn,E=n.isEndOfTimeline,x=n.endedTimelineFn,S=n.dataFn,H=[],W=function(n){var t=n.activeXhrs,r=n.decryptionWorker,e=n.trackInfoFn,i=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog,x=0,S=!1;return function(F,U){if(!S){if(F)return S=!0,Po(t),T(F,U);if((x+=1)===t.length){var H=function(){if(U.encryptedBytes)return function(n){var r=n.segment,e=n.trackInfoFn,i=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog;Vd({id:r.requestId,key:r.key,encryptedBytes:r.encryptedBytes,decryptionWorker:n.decryptionWorker},function(x){r.bytes=x,jd({segment:r,bytes:r.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})})}({decryptionWorker:r,segment:U,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});jd({segment:U,bytes:U.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})};if(U.endOfAllRequests=Date.now(),U.map&&U.map.encryptedBytes&&!U.map.bytes)return Vd({decryptionWorker:r,id:U.requestId+"-init",encryptedBytes:U.map.encryptedBytes,key:U.map.key},function(W){U.map.bytes=W,Hd(U,function(q){if(q)return Po(t),T(q,U);H()})});H()}}}}({activeXhrs:H,decryptionWorker:n.decryptionWorker,trackInfoFn:l,timingInfoFn:d,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:v,id3Fn:g,captionsFn:T,isEndOfTimeline:E,endedTimelineFn:x,dataFn:S,doneFn:n.doneFn,onTransmuxerLog:n.onTransmuxerLog});if(i.key&&!i.key.bytes){var q=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&q.push(i.map.key);var z=t(N.mergeOptions(r,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),Bd(i,q,W));H.push(z)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){var Pe=t(N.mergeOptions(r,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),Bd(i,[i.map.key],W));H.push(Pe)}var ot=N.mergeOptions(r,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Ao(i.map)}),Ft=function(n){var t=n.segment,r=n.finishProcessingFn;return function(e,i){var a=Lo(e,i);if(a)return r(a,t);var o=new Uint8Array(i.response);if(t.map.key)return t.map.encryptedBytes=o,r(null,t);t.map.bytes=o,Hd(t,function(l){if(l)return l.xhr=i,l.status=i.status,r(l,t);r(null,t)})}}({segment:i,finishProcessingFn:W}),Je=t(ot,Ft);H.push(Je)}var fr=N.mergeOptions(r,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Ao(i)}),si=t(fr,function(n){var t=n.segment,r=n.finishProcessingFn,e=n.responseType;return function(i,a){var o=Lo(i,a);if(o)return r(o,t);var l="arraybuffer"!==e&&a.responseText?function(n){for(var t=new Uint8Array(new ArrayBuffer(n.length)),r=0;r1)return ng("multiple "+r+" codecs found as attributes: "+t[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[r]=null);t[r]=t[r][0]}),t},Wd=function(n){var t=0;return n.audio&&t++,n.video&&t++,t},An=function(n,t){var r=t.attributes||{},e=Aa(function(n){var t=n.attributes||{};if(t.CODECS)return Qe(t.CODECS)}(t)||[]);if(qd(n,t)&&!e.audio&&!function(n,t){if(!qd(n,t))return!0;var e=n.mediaGroups.AUDIO[(t.attributes||{}).AUDIO];for(var i in e)if(!e[i].uri&&!e[i].playlists)return!0;return!1}(n,t)){var i=Aa(function(n,t){if(!n.mediaGroups.AUDIO||!t)return null;var r=n.mediaGroups.AUDIO[t];if(!r)return null;for(var e in r){var i=r[e];if(i.default&&i.playlists)return Qe(i.playlists[0].attributes.CODECS)}return null}(n,r.AUDIO)||[]);i.audio&&(e.audio=i.audio)}return e},wa=mi("PlaylistSelector"),Gd=function(n){if(n&&n.playlist){var t=n.playlist;return JSON.stringify({id:t.id,bandwidth:n.bandwidth,width:n.width,height:n.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Ia=function(n,t){if(!n)return"";var r=P().getComputedStyle(n);return r?r[t]:""},Xr=function(n,t){var r=n.slice();n.sort(function(e,i){var a=t(e,i);return 0===a?r.indexOf(e)-r.indexOf(i):a})},Oo=function(n,t){var r,e;return n.attributes.BANDWIDTH&&(r=n.attributes.BANDWIDTH),r=r||P().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(e=t.attributes.BANDWIDTH),r-(e||P().Number.MAX_VALUE)},Zd=function(n,t,r,e,i,a){if(n){var o={bandwidth:t,width:r,height:e,limitRenditionByPlayerDimensions:i},l=n.playlists;$t.isAudioOnly(n)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var d=l.map(function(ge){var Pe=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.width,ot=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.height;return{bandwidth:ge.attributes&&ge.attributes.BANDWIDTH||P().Number.MAX_VALUE,width:Pe,height:ot,playlist:ge}});Xr(d,function(ge,Ye){return ge.bandwidth-Ye.bandwidth});var f=(d=d.filter(function(ge){return!$t.isIncompatible(ge.playlist)})).filter(function(ge){return $t.isEnabled(ge.playlist)});f.length||(f=d.filter(function(ge){return!$t.isDisabled(ge.playlist)}));var v=f.filter(function(ge){return ge.bandwidth*Dt.BANDWIDTH_VARIANCEr||ge.height>e})).filter(function(ge){return ge.width===H[0].width&&ge.height===H[0].height}),g=W[W.length-1],q=W.filter(function(ge){return ge.bandwidth===g.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var he=S.map(function(ge){return ge.pixelDiff=Math.abs(ge.width-r)+Math.abs(ge.height-e),ge});Xr(he,function(ge,Ye){return ge.pixelDiff===Ye.pixelDiff?Ye.bandwidth-ge.bandwidth:ge.pixelDiff-Ye.pixelDiff}),ne=he[0]}var z=ne||q||U||T||f[0]||d[0];if(z&&z.playlist){var ye="sortedPlaylistReps";return ne?ye="leastPixelDiffRep":q?ye="resolutionPlusOneRep":U?ye="resolutionBestRep":T?ye="bandwidthBestRep":f[0]&&(ye="enabledPlaylistReps"),wa("choosing "+Gd(z)+" using "+ye+" with options",o),z.playlist}return wa("could not choose a playlist with options",o),null}},zd=function(){var n=this.useDevicePixelRatio&&P().devicePixelRatio||1;return Zd(this.playlists.master,this.systemBandwidth,parseInt(Ia(this.tech_.el(),"width"),10)*n,parseInt(Ia(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},wn=function(n,t,r){var e,i;if(r&&r.cues)for(e=r.cues.length;e--;)(i=r.cues[e]).startTime>=n&&i.endTime<=t&&r.removeCue(i)},$d=function(n){return"number"==typeof n&&isFinite(n)},Da=1/60,Qr=function(n){var t=n.startOfSegment,r=n.duration,e=n.segment,i=n.part,a=n.playlist,o=a.mediaSequence,l=a.id,d=a.segments,v=n.mediaIndex,g=n.partIndex,T=n.timeline,E=(void 0===d?[]:d).length-1,x="mediaIndex/partIndex increment";n.getMediaInfoForTime?x="getMediaInfoForTime ("+n.getMediaInfoForTime+")":n.isSyncRequest&&(x="getSyncSegmentCandidate (isSyncRequest)"),n.independent&&(x+=" with independent "+n.independent);var S="number"==typeof g,F=n.segment.uri?"segment":"pre-segment",U=S?ud({preloadSegment:e})-1:0;return F+" ["+(o+v)+"/"+(o+E)+"]"+(S?" part ["+g+"/"+U+"]":"")+" segment start/end ["+e.start+" => "+e.end+"]"+(S?" part start/end ["+i.start+" => "+i.end+"]":"")+" startOfSegment ["+t+"] duration ["+r+"] timeline ["+T+"] selected by ["+x+"] playlist ["+l+"]"},Yd=function(n){return n+"TimingInfo"},Xd=function(n){var t=n.timelineChangeController,e=n.segmentTimeline,i=n.loaderType,a=n.audioDisabled;if(n.currentTimeline===e)return!1;if("audio"===i){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==e}if("main"===i&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===e)}return!1},Qd=function(n){var t=n.segmentDuration,r=n.maxDuration;return!!t&&Math.round(t)>r+zi},Ro=function(s){function n(r,e){var i;if(i=s.call(this)||this,!r)throw new TypeError("Initialization settings are required");if("function"!=typeof r.currentTime)throw new TypeError("No currentTime getter specified");if(!r.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=r.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=r.hasPlayed,i.currentTime_=r.currentTime,i.seekable_=r.seekable,i.seeking_=r.seeking,i.duration_=r.duration,i.mediaSource_=r.mediaSource,i.vhs_=r.vhs,i.loaderType_=r.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=r.segmentMetadataTrack,i.goalBufferLength_=r.goalBufferLength,i.sourceType_=r.sourceType,i.sourceUpdater_=r.sourceUpdater,i.inbandTextTracks_=r.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=r.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=r.parse708captions,i.captionServices_=r.captionServices,i.experimentalExactManifestTimings=r.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=N.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=r.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=r.decrypter,i.syncController_=r.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=mi("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(Fe(i),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}ie(n,s);var t=n.prototype;return t.createTransmuxer_=function(){return function(n){var t=new jm;t.currentTransmux=null,t.transmuxQueue=[];var r=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,r.call(t)},t.postMessage({action:"init",options:n}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},t.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,P().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},t.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Do_reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return N.createTimeRanges();if("main"===this.loaderType_){var a=e.hasVideo;if(a&&e.hasAudio&&!this.audioDisabled_&&!e.isMuxed)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(e,i){if(void 0===i&&(i=!1),!e)return null;var a=Ca(e),o=this.initSegments_[a];return i&&!o&&e.bytes&&(this.initSegments_[a]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},t.segmentKey=function(e,i){if(void 0===i&&(i=!1),!e)return null;var a=Ed(e),o=this.keyCache_[a];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[a]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var l={resolvedUri:(o||e).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(e,i){if(void 0===i&&(i={}),e){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var d=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+d+"]"),null!==this.mediaIndex)if(this.mediaIndex-=d,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var f=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!f.parts||!f.parts.length||!f.parts[this.partIndex])){var v=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=v}}o&&(o.mediaIndex-=d,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}},t.pause=function(){this.checkBufferTimeout_&&(P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return null===this.checkBufferTimeout_},t.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&Do_reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(e,i,a,o){if(void 0===a&&(a=function(){}),void 0===o&&(o=!1),i===1/0&&(i=this.duration_()),i<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var l=1,d=function(){0==--l&&a()};for(var f in(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,i,d)),(o||"main"===this.loaderType_)&&(this.gopBuffer_=function(n,t,r,e){for(var i=Math.ceil((t-e)*Zn.ONE_SECOND_IN_TS),a=Math.ceil((r-e)*Zn.ONE_SECOND_IN_TS),o=n.slice(),l=n.length;l--&&!(n[l].pts<=a););if(-1===l)return o;for(var d=l+1;d--&&!(n[d].pts<=i););return d=Math.max(d,0),o.splice(d,l-d+1),o}(this.gopBuffer_,e,i,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,i,d)),this.inbandTextTracks_)wn(e,i,this.inbandTextTracks_[f]);wn(e,i,this.segmentMetadataTrack_),d()}else this.logger_("skipping remove because no source updater or starting media info")},t.monitorBuffer_=function(){this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),500)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();!e||("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},t.isEndOfStream_=function(e,i,a){if(void 0===e&&(e=this.mediaIndex),void 0===i&&(i=this.playlist_),void 0===a&&(a=this.partIndex),!i||!this.mediaSource_)return!1;var o="number"==typeof e&&i.segments[e];return i.endList&&"open"===this.mediaSource_.readyState&&e+1===i.segments.length&&(!o||!o.parts||a+1===o.parts.length)},t.chooseNextRequest_=function(){var e=this.buffered_(),i=ad(e)||0,a=vo(e,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),d=this.playlist_.segments;if(!d.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var f={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(f.isSyncRequest)f.mediaIndex=function(n,t,r){t=t||[];for(var e=[],i=0,a=0;ar))return a}return 0===e.length?0:e[e.length-1]}(this.currentTimeline_,d,i);else if(null!==this.mediaIndex){var v=d[this.mediaIndex],g="number"==typeof this.partIndex?this.partIndex:-1;f.startOfSegment=v.end?v.end:i,v.parts&&v.parts[g+1]?(f.mediaIndex=this.mediaIndex,f.partIndex=g+1):f.mediaIndex=this.mediaIndex+1}else{var T=$t.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?i:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),E=T.segmentIndex,x=T.startTime,S=T.partIndex;f.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+i:"currentTime "+this.currentTime_(),f.mediaIndex=E,f.startOfSegment=x,f.partIndex=S}var F=d[f.mediaIndex],U=F&&"number"==typeof f.partIndex&&F.parts&&F.parts[f.partIndex];if(!F||"number"==typeof f.partIndex&&!U)return null;if("number"!=typeof f.partIndex&&F.parts&&(f.partIndex=0,U=F.parts[0]),!a&&U&&!U.independent)if(0===f.partIndex){var H=d[f.mediaIndex-1],W=H.parts&&H.parts.length&&H.parts[H.parts.length-1];W&&W.independent&&(f.mediaIndex-=1,f.partIndex=H.parts.length-1,f.independent="previous segment")}else F.parts[f.partIndex-1].independent&&(f.partIndex-=1,f.independent="previous part");return f.mediaIndex>=d.length-1&&this.mediaSource_&&"ended"===this.mediaSource_.readyState&&!this.seeking_()?null:this.generateSegmentInfo_(f)},t.generateSegmentInfo_=function(e){var i=e.independent,a=e.playlist,o=e.mediaIndex,l=e.startOfSegment,d=e.isSyncRequest,f=e.partIndex,v=e.forceTimestampOffset,g=e.getMediaInfoForTime,T=a.segments[o],E="number"==typeof f&&T.parts[f],x={requestId:"segment-loader-"+Math.random(),uri:E&&E.resolvedUri||T.resolvedUri,mediaIndex:o,partIndex:E?f:null,isSyncRequest:d,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:T.timeline,duration:E&&E.duration||T.duration,segment:T,part:E,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:g,independent:i},S=void 0!==v?v:this.isPendingTimestampOffset_;x.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:T.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:S});var F=ad(this.sourceUpdater_.audioBuffered());return"number"==typeof F&&(x.audioAppendStart=F-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(x.gopsToAlignWith=function(n,t,r){if(null==t||!n.length)return[];var i,e=Math.ceil((t-r+3)*Zn.ONE_SECOND_IN_TS);for(i=0;ie);i++);return n.slice(i)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),x},t.timestampOffsetForSegment_=function(e){return function(n){var t=n.segmentTimeline,r=n.currentTimeline,e=n.startOfSegment,i=n.buffered;return n.overrideCheck||t!==r?t "+T+" for "+f),function(n,t,r){if(!n[r]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var e=r;/^cc708_/.test(r)&&(e="SERVICE"+r.split("_")[1]);var i=t.textTracks().getTrackById(e);if(i)n[r]=i;else{var o=r,l=r,d=!1,f=(t.options_.vhs&&t.options_.vhs.captionServices||{})[e];f&&(o=f.label,l=f.language,d=f.default),n[r]=t.addRemoteTextTrack({kind:"captions",id:e,default:d,label:o,language:l},!1).track}}}(x,a.vhs_.tech_,f),wn(g,T,x[f]),function(n){var t=n.inbandTextTracks,r=n.captionArray,e=n.timestampOffset;if(r){var i=P().WebKitDataCue||P().VTTCue;r.forEach(function(a){t[a.stream].addCue(new i(a.startTime+e,a.endTime+e,a.text))})}}({captionArray:E,inbandTextTracks:x,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(e,i,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,a));var l=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();(function(n,t,r){n.metadataTrack_||(n.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,n.metadataTrack_.inBandMetadataTrackDispatchType=t)})(this.inbandTextTracks_,a,this.vhs_.tech_),function(n){var t=n.inbandTextTracks,r=n.metadataArray,e=n.timestampOffset,i=n.videoDuration;if(r){var a=P().WebKitDataCue||P().VTTCue,o=t.metadataTrack_;if(o&&(r.forEach(function(T){var E=T.cueTime+e;"number"!=typeof E||P().isNaN(E)||E<0||!(E<1/0)||T.frames.forEach(function(x){var S=new a(E,E,x.value||x.url||x.data||"");S.frame=x,S.value=x,function(n){Object.defineProperties(n.frame,{id:{get:function(){return N.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get:function(){return N.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get:function(){return N.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),n.value.data}}})}(S),o.addCue(S)})}),o.cues&&o.cues.length)){for(var l=o.cues,d=[],f=0;f1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+cr(f).join(", ")),v.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+cr(v).join(", "));var g=f.length?f.start(0):0,T=f.length?f.end(f.length-1):0,E=v.length?v.start(0):0,x=v.length?v.end(v.length-1):0;if(T-g<=1&&x-E<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+d.byteLength+", audio buffer: "+cr(f).join(", ")+", video buffer: "+cr(v).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:d}));var F=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+F),this.remove(0,F,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=P().setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3)},!0)},t.handleAppendError_=function(e,i){var a=e.segmentInfo,o=e.type,l=e.bytes;if(i){if(22===i.code)return void this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(o+" append of "+l.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(e){var i=e.segmentInfo,a=e.type,o=e.initSegment,l=e.data,d=e.bytes;if(!d){var f=[l],v=l.byteLength;o&&(f.unshift(o),v+=o.byteLength),d=function(n){var r,t=0;return n.bytes&&(r=new Uint8Array(n.bytes),n.segments.forEach(function(e){r.set(e,t),t+=e.byteLength})),r}({bytes:v,segments:f})}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:a,bytes:d},this.handleAppendError_.bind(this,{segmentInfo:i,type:a,bytes:d}))},t.handleSegmentTimingInfo_=function(e,i,a){if(this.pendingSegment_&&i===this.pendingSegment_.requestId){var o=this.pendingSegment_.segment,l=e+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(e,i){var a=i.type,o=i.data;if(o&&o.byteLength&&("audio"!==a||!this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:l,data:o})}},t.loadSegment_=function(e){var i=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var a=gt({},e,{forceTimestampOffset:!0});gt(e,i.generateSegmentInfo_(a)),i.isPendingTimestampOffset_=!1,i.updateTransmuxerAndRequestSegment_(e)})},t.updateTransmuxerAndRequestSegment_=function(e){var i=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var a=this.createSimplifiedSegmentObj_(e),f=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)||null!==this.mediaIndex&&e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_("Requesting "+Qr(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=rg({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:f,endedTimelineFn:function(){i.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(g){var T=g.message,E=g.level,x=g.stream;i.logger_(Qr(e)+" logged from transmuxer stream "+x+" as a "+E+": "+T)}})},t.trimBackBuffer_=function(e){var i=function(n,t,r){var e=t-Dt.BACK_BUFFER_LENGTH;return n.length&&(e=Math.max(e,n.start(0))),Math.min(t-r,e)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)},t.createSimplifiedSegmentObj_=function(e){var i=e.segment,a=e.part,o={resolvedUri:a?a.resolvedUri:i.resolvedUri,byterange:a?a.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===i.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),i.key){var d=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(i.key),o.key.iv=d}return i.map&&(o.map=this.initSegmentForMap(i.map)),o},t.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},t.saveBandwidthRelatedStats_=function(e,i){this.pendingSegment_.byteLength=i.bytesReceived,e=e);i++);return n.slice(0,i).concat(t)}(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(e){var i=this.syncController_.mappingForTimeline(e);null!==i&&(this.timeMapping_=i)},t.updateMediaSecondsLoaded_=function(e){this.mediaSecondsLoaded+="number"==typeof e.start&&"number"==typeof e.end?e.end-e.start:e.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},t.trueSegmentStart_=function(e){var i=e.currentStart,o=e.mediaIndex,l=e.firstVideoFrameTimeForData;if(void 0!==i)return i;if(!e.useVideoTimingInfo)return e.audioTimingInfo.start;var T=e.playlist.segments[o-1];return 0!==o&&T&&void 0!==T.start&&T.end===l+e.currentVideoTimestampOffset?e.videoTimingInfo.start:l},t.waitForAppendsToComplete_=function(e){var i=this.getCurrentMediaInfo_(e);if(!i)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var d="main"===this.loaderType_&&i.hasVideo,f=!this.audioDisabled_&&i.hasAudio&&!i.isMuxed;if(e.waitingOnAppends=0,!e.hasAppendedData_)return!e.timingInfo&&"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);d&&e.waitingOnAppends++,f&&e.waitingOnAppends++,d&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),f&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},t.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(e){var i=function(n,t,r){return"main"===n&&t&&r?r.hasAudio||r.hasVideo?t.hasVideo&&!r.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&r.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!i&&(this.error({message:i,blacklistDuration:1/0}),this.trigger("error"),!0)},t.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var i=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}},t.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var i=this.getMediaInfo_(),o="main"===this.loaderType_&&i&&i.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;!o||(e.timingInfo.end="number"==typeof o.end?o.end:o.start+e.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var i=function(n,t){if("hls"!==t)return null;var r=function(n){var t=0;return["video","audio"].forEach(function(r){var e=n[r+"TimingInfo"];if(e){var o,i=e.start,a=e.end;"bigint"==typeof i||"bigint"==typeof a?o=P().BigInt(a)-P().BigInt(i):"number"==typeof i&&"number"==typeof a&&(o=a-i),void 0!==o&&o>t&&(t=o)}}),"bigint"==typeof t&&t3*e.playlist.targetDuration,d=o&&o.end&&this.currentTime_()-o.end>3*e.playlist.partTargetDuration;if(l||d)return this.logger_("bad "+(l?"segment":"part")+" "+Qr(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Qr(e))},t.recordThroughput_=function(e){if(e.duration=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},t.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(e,i,a){var o=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(i.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return-101===e.code&&this.handleTimeout_(),-102===e.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,i.stats),this.state="APPENDING",this.trigger("appending");var d=l.segment;if(d.map&&(d.map.bytes=i.map.bytes),l.bytes=i.bytes,"function"!=typeof P().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var f,v=function(){o.subtitlesTrack_.tech_.off("vttjsloaded",f),o.stopForError({message:"Error loading vtt.js"})};return f=function(){o.subtitlesTrack_.tech_.off("vttjserror",v),o.segmentRequestFinished_(e,i,a)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",f),void this.subtitlesTrack_.tech_.one("vttjserror",v)}d.requested=!0;try{this.parseVTTCues_(l)}catch(g){return void this.stopForError({message:g.message})}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.timingInfo=l.cues.length?{start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:{start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=d.duration,l.cues.forEach(function(g){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new(P().VTTCue)(g.startTime,g.endTime,g.text):g)}),function(n){var t=n.cues;if(t)for(var r=0;r1&&e.push(t[a]);e.length&&e.forEach(function(o){return n.removeCue(o)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(e){var i,a=!1;"function"==typeof P().TextDecoder?i=new(P().TextDecoder)("utf8"):(i=P().WebVTT.StringDecoder(),a=!0);var o=new(P().WebVTT.Parser)(P(),P().vttjs,i);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(f){e.timestampmap=f},o.onparsingerror=function(f){N.log.warn("Error encountered when parsing cues: "+f.message)},e.segment.map){var l=e.segment.map.bytes;a&&(l=rc(l)),o.parse(l)}var d=e.bytes;a&&(d=rc(d)),o.parse(d),o.flush()},t.updateTimeMapping_=function(e,i,a){var o=e.segment;if(i){if(!e.cues.length)return void(o.empty=!0);var l=e.timestampmap,d=l.MPEGTS/Zn.ONE_SECOND_IN_TS-l.LOCAL+i.mapping;e.cues.forEach(function(g){g.startTime+=d,g.endTime+=d}),a.syncInfo||(a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(e.cues[0].startTime,e.cues[e.cues.length-1].startTime-o.duration)})}},n}(Ro),Lg=function(n,t){for(var r=n.cues,e=0;e=i.adStartTime&&t<=i.adEndTime)return i}return null},ac=[{name:"VOD",run:function(n,t,r,e,i){return r!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(n,t,r,e,i){if(!Object.keys(n.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=yo(t);i=i||0;for(var d=0;d=E)&&(o=E,a={time:T,segmentIndex:v.segmentIndex,partIndex:v.partIndex})}}return a}},{name:"Discontinuity",run:function(n,t,r,e,i){var a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l=g)&&(o=g,a={time:v.time,segmentIndex:d,partIndex:null})}}return a}},{name:"Playlist",run:function(n,t,r,e,i){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Mg=function(s){function n(r){var e;return(e=s.call(this)||this).timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=mi("SyncController"),e}ie(n,s);var t=n.prototype;return t.getSyncPoint=function(e,i,a,o){var l=this.runStrategies_(e,i,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(e,i){if(!e||!e.segments)return null;var a=this.runStrategies_(e,i,e.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+En({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(e,i,a,o){for(var l=[],d=0;d86400)N.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var o=a-1;o>=0;o--){var l=e.segments[o];if(l&&void 0!==l.start){i.syncInfo={mediaSequence:e.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+", mediaSequence: "+i.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var i=e.segments[0],a=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-a}},t.saveSegmentTimingInfo=function(e){var i=e.segmentInfo,a=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(i,i.timingInfo,a),l=i.segment;o&&(this.saveDiscontinuitySyncInfo_(i),i.playlist.syncInfo||(i.playlist.syncInfo={mediaSequence:i.playlist.mediaSequence+i.mediaIndex,time:l.start}));var d=l.dateTimeObject;l.discontinuity&&a&&d&&(this.timelineToDatetimeMappings[l.timeline]=-d.getTime()/1e3)},t.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},t.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},t.calculateSegmentTimeMapping_=function(e,i,a){var f,v,o=e.segment,l=e.part,d=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)d={time:e.startOfSegment,mapping:e.startOfSegment-i.start},a&&(this.timelines[e.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),f=e.startOfSegment,v=i.end+d.mapping;else{if(!d)return!1;f=i.start+d.mapping,v=i.end+d.mapping}return l&&(l.start=f,l.end=v),(!o.start||fv){var g;g=f<0?a.start-En({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:l}):a.end+En({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[d]={time:g,accuracy:v}}}},t.dispose=function(){this.trigger("dispose"),this.off()},n}(N.EventTarget),Ng=function(s){function n(){var r;return(r=s.call(this)||this).pendingTimelineChanges_={},r.lastTimelineChanges_={},r}ie(n,s);var t=n.prototype;return t.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(e){var i=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.pendingTimelineChanges_[i]={type:i,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[i]},t.lastTimelineChange=function(e){var i=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.lastTimelineChanges_[i]={type:i,from:a,to:o},delete this.pendingTimelineChanges_[i],this.trigger("timelinechange")),this.lastTimelineChanges_[i]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},n}(N.EventTarget),Fg=Ld(Od(function(){function s(x,S,F){return x(F={path:S,exports:{},require:function(H,W){return function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},F.exports),F.exports}var t=s(function(x){function S(U,H){for(var W=0;W-1},S.trigger=function(U){var H=this.listeners[U];if(H)if(2===arguments.length)for(var W=H.length,q=0;q>7))^q]=q;for(ne=he=0;!H[ne];ne^=ge||1,he=ye[he]||1)for(H[ne]=ot=(ot=he^he<<1^he<<2^he<<3^he<<4)>>8^255&ot^99,W[ot]=ne,Je=16843009*z[Ye=z[ge=z[ne]]]^65537*Ye^257*ge^16843008*ne,Ft=257*z[ot]^16843008*ot,q=0;q<4;q++)F[q][ne]=Ft=Ft<<24^Ft>>>8,U[q][ot]=Je=Je<<24^Je>>>8;for(q=0;q<5;q++)F[q]=F[q].slice(0),U[q]=U[q].slice(0);return S}()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var U,H,W,q=this._tables[0][4],ne=this._tables[1],he=F.length,z=1;if(4!==he&&6!==he&&8!==he)throw new Error("Invalid aes key size");var ye=F.slice(0),ge=[];for(this._key=[ye,ge],U=he;U<4*he+28;U++)W=ye[U-1],(U%he==0||8===he&&U%he==4)&&(W=q[W>>>24]<<24^q[W>>16&255]<<16^q[W>>8&255]<<8^q[255&W],U%he==0&&(W=W<<8^W>>>24^z<<24,z=z<<1^283*(z>>7))),ye[U]=ye[U-he]^W;for(H=0;U;H++,U--)W=ye[3&H?U:U-4],ge[H]=U<=4||H<4?W:ne[0][q[W>>>24]]^ne[1][q[W>>16&255]]^ne[2][q[W>>8&255]]^ne[3][q[255&W]]}return x.prototype.decrypt=function(U,H,W,q,ne,he){var ot,Ft,Je,ai,z=this._key[1],ye=U^z[0],ge=q^z[1],Ye=W^z[2],Pe=H^z[3],fr=z.length/4-2,si=4,Ei=this._tables[1],Ui=Ei[0],hr=Ei[1],Bi=Ei[2],pr=Ei[3],mr=Ei[4];for(ai=0;ai>>24]^hr[ge>>16&255]^Bi[Ye>>8&255]^pr[255&Pe]^z[si],Ft=Ui[ge>>>24]^hr[Ye>>16&255]^Bi[Pe>>8&255]^pr[255&ye]^z[si+1],Je=Ui[Ye>>>24]^hr[Pe>>16&255]^Bi[ye>>8&255]^pr[255&ge]^z[si+2],Pe=Ui[Pe>>>24]^hr[ye>>16&255]^Bi[ge>>8&255]^pr[255&Ye]^z[si+3],si+=4,ye=ot,ge=Ft,Ye=Je;for(ai=0;ai<4;ai++)ne[(3&-ai)+he]=mr[ye>>>24]<<24^mr[ge>>16&255]<<16^mr[Ye>>8&255]<<8^mr[255&Pe]^z[si++],ot=ye,ye=ge,ge=Ye,Ye=Pe,Pe=ot},x}(),f=function(x){function S(){var U;return(U=x.call(this,i)||this).jobs=[],U.delay=1,U.timeout_=null,U}e(S,x);var F=S.prototype;return F.processJob_=function(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null},F.push=function(H){this.jobs.push(H),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},S}(i),v=function(S){return S<<24|(65280&S)<<8|(16711680&S)>>8|S>>>24},T=function(){function x(F,U,H,W){var q=x.STEP,ne=new Int32Array(F.buffer),he=new Uint8Array(F.byteLength),z=0;for(this.asyncStream_=new f,this.asyncStream_.push(this.decryptChunk_(ne.subarray(z,z+q),U,H,he)),z=q;z>2),W=new d(Array.prototype.slice.call(F)),q=new Uint8Array(S.byteLength),ne=new Int32Array(q.buffer);for(he=U[0],z=U[1],ye=U[2],ge=U[3],Je=0;Je=0&&(t="main-desc"),t},Pa=function(n,t){n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Fo=function(n,t){t.activePlaylistLoader=n,n.load()},La={AUDIO:function(n,t){return function(){var e=t.mediaTypes[n],i=t.blacklistCurrentPlaylist;Pa(t.segmentLoaders[n],e);var a=e.activeTrack(),o=e.activeGroup(),l=(o.filter(function(v){return v.default})[0]||o[0]).id,d=e.tracks[l];if(a!==d){for(var f in N.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[f].enabled=e.tracks[f]===d;e.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(n,t){return function(){var r=t.segmentLoaders[n],e=t.mediaTypes[n];N.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Pa(r,e);var i=e.activeTrack();i&&(i.mode="disabled"),e.onTrackChanged()}}},sc={AUDIO:function(n,t,r){if(t){var e=r.tech,i=r.requestOptions,a=r.segmentLoaders[n];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,i),(!e.paused()||o.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),i),e.paused()||a.load()}),t.on("error",La[n](n,r))}},SUBTITLES:function(n,t,r){var e=r.tech,i=r.requestOptions,a=r.segmentLoaders[n],o=r.mediaTypes[n];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,i),a.track(o.activeTrack()),(!e.paused()||l.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),i),e.paused()||a.load()}),t.on("error",La[n](n,r))}},qg={AUDIO:function(n,t){var r=t.vhs,e=t.sourceType,i=t.segmentLoaders[n],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[n],d=l.groups,f=l.tracks,v=l.logger_,g=t.masterPlaylistLoader,T=Cn(g.master);for(var E in(!o[n]||0===Object.keys(o[n]).length)&&(o[n]={main:{default:{default:!0}}},T&&(o[n].main.default.playlists=g.master.playlists)),o[n])for(var x in d[E]||(d[E]=[]),o[n][E]){var S=o[n][E][x],F=void 0;if(T?(v("AUDIO group '"+E+"' label '"+x+"' is a master playlist"),S.isMasterPlaylist=!0,F=null):F="vhs-json"===e&&S.playlists?new Yr(S.playlists[0],r,a):S.resolvedUri?new Yr(S.resolvedUri,r,a):S.playlists&&"dash"===e?new Io(S.playlists[0],r,a,g):null,S=N.mergeOptions({id:x,playlistLoader:F},S),sc[n](n,S.playlistLoader,t),d[E].push(S),void 0===f[x]){var U=new N.AudioTrack({id:x,kind:Bg(S),enabled:!1,language:S.language,default:S.default,label:x});f[x]=U}}i.on("error",La[n](n,t))},SUBTITLES:function(n,t){var r=t.tech,e=t.vhs,i=t.sourceType,a=t.segmentLoaders[n],o=t.requestOptions,l=t.master.mediaGroups,d=t.mediaTypes[n],f=d.groups,v=d.tracks,g=t.masterPlaylistLoader;for(var T in l[n])for(var E in f[T]||(f[T]=[]),l[n][T])if(!l[n][T][E].forced){var x=l[n][T][E],S=void 0;if("hls"===i)S=new Yr(x.resolvedUri,e,o);else if("dash"===i){if(!x.playlists.filter(function(H){return H.excludeUntil!==1/0}).length)return;S=new Io(x.playlists[0],e,o,g)}else"vhs-json"===i&&(S=new Yr(x.playlists?x.playlists[0]:x.resolvedUri,e,o));if(x=N.mergeOptions({id:E,playlistLoader:S},x),sc[n](n,x.playlistLoader,t),f[T].push(x),void 0===v[E]){var U=r.addRemoteTextTrack({id:E,kind:"subtitles",default:x.default&&x.autoselect,language:x.language,label:E},!1).track;v[E]=U}}a.on("error",La[n](n,t))},"CLOSED-CAPTIONS":function(n,t){var r=t.tech,e=t.master.mediaGroups,i=t.mediaTypes[n],a=i.groups,o=i.tracks;for(var l in e[n])for(var d in a[l]||(a[l]=[]),e[n][l]){var f=e[n][l][d];if(/^(?:CC|SERVICE)/.test(f.instreamId)){var v=r.options_.vhs&&r.options_.vhs.captionServices||{},g={label:d,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(v[g.instreamId]&&(g=N.mergeOptions(g,v[g.instreamId])),void 0===g.default&&delete g.default,a[l].push(N.mergeOptions({id:d},f)),void 0===o[d]){var T=r.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;o[d]=T}}}}},Wg=function s(n,t){for(var r=0;r "+d+" from "+i),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+i})),this.masterPlaylistLoader_.media(e,a)},t.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=P().setInterval(function(){return e.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(P().clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var e=this.master(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;var l,a=e.mediaGroups.AUDIO,o=Object.keys(a);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var d=a.main||o.length&&a[o[0]];for(var f in d)if(d[f].default){l={label:f};break}}if(!l)return i;var v=[];for(var g in a)if(a[g][l.label]){var T=a[g][l.label];if(T.playlists&&T.playlists.length)v.push.apply(v,T.playlists);else if(T.uri)v.push(T);else if(e.playlists.length)for(var E=0;E1&&Cn(t.master))for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(e){var i=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine();return function(n){var t=n.currentPlaylist,r=n.buffered,e=n.currentTime,i=n.nextPlaylist,a=n.bufferLowWaterLine,o=n.bufferHighWaterLine,l=n.duration,d=n.experimentalBufferBasedABR,f=n.log;if(!i)return N.log.warn("We received no playlist to switch to. Please check your stream."),!1;var v="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return f(v+" as current playlist is not set"),!0;if(i.id===t.id)return!1;var g=Boolean($r(r,e).length);if(!t.endList)return g||"number"!=typeof t.partTargetDuration?(f(v+" as current playlist is live"),!0):(f("not "+v+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var T=vo(r,e),E=d?Dt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Dt.MAX_BUFFER_LOW_WATER_LINE;if(lS)&&T>=a){var U=v+" as forwardBuffer >= bufferLowWaterLine ("+T+" >= "+a+")";return d&&(U+=" and next bandwidth > current bandwidth ("+x+" > "+S+")"),f(U),!0}return f("not "+v+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:a,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var a=e.selectPlaylist();e.shouldSwitchToMedia_(a)&&e.switchMedia_(a,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var i=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();!o||e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",i),this.audioSegmentLoader_.on("trackinfo",i),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},t.fastQualityChange_=function(e){var i=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){i.tech_.setCurrentTime(N.browser.IE_VERSION||N.browser.IS_EDGE?i.tech_.currentTime()+.04:i.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*i,a.excludeUntil=v,e.reason&&(a.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var g=this.selectPlaylist();if(!g)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");(e.internal?this.logger_:N.log.warn)((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(e.message?" "+e.message:"")+" Switching to playlist "+g.id+"."),g.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),g.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var x=g.targetDuration/2*1e3||5e3,S="number"==typeof g.lastRequest&&Date.now()-g.lastRequest<=x;return this.switchMedia_(g,"exclude",d||S)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(e,i){var a=this,o=[],l="all"===e;(l||"main"===e)&&o.push(this.masterPlaylistLoader_);var d=[];(l||"audio"===e)&&d.push("AUDIO"),(l||"subtitle"===e)&&(d.push("CLOSED-CAPTIONS"),d.push("SUBTITLES")),d.forEach(function(f){var v=a.mediaTypes_[f]&&a.mediaTypes_[f].activePlaylistLoader;v&&o.push(v)}),["main","audio","subtitle"].forEach(function(f){var v=a[f+"SegmentLoader_"];v&&(e===f||"all"===e)&&o.push(v)}),o.forEach(function(f){return i.forEach(function(v){"function"==typeof f[v]&&f[v]()})})},t.setCurrentTime=function(e){var i=$r(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?i&&i.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Fi.Playlist.duration(e):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var a=this.syncController_.getExpiredTime(i,this.duration());if(null!==a){var d,f,o=this.masterPlaylistLoader_.master,l=Fi.Playlist.seekable(i,a,Fi.Playlist.liveEdgeDelay(o,i));0===l.length||this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(a=this.syncController_.getExpiredTime(i,this.duration()))||0===(e=Fi.Playlist.seekable(i,a,Fi.Playlist.liveEdgeDelay(o,i))).length)||(this.seekable_&&this.seekable_.length&&(d=this.seekable_.end(0),f=this.seekable_.start(0)),this.seekable_=e?e.start(0)>l.end(0)||l.start(0)>e.end(0)?l:N.createTimeRanges([[e.start(0)>l.start(0)?e.start(0):l.start(0),e.end(0)0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)}},t.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(i){var a=e.mediaTypes_[i].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!i||!a)},t.getCodecsOrExclude_=function(){var e=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};i.video=i.main;var a=An(this.master(),this.media()),o={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(o.video=a.video||i.main.videoCodec||"avc1.4d400d"),i.main.isMuxed&&(o.video+=","+(a.audio||i.main.audioCodec||Xt)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||l)&&(o.audio=a.audio||i.main.audioCodec||i.audio.audioCodec||Xt,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),o.audio||o.video){var v,f={};if(["video","audio"].forEach(function(x){if(o.hasOwnProperty(x)&&!function(S,F){return S?ii(F):ci(F)}(i[x].isFmp4,o[x])){var S=i[x].isFmp4?"browser":"muxer";f[S]=f[S]||[],f[S].push(o[x]),"audio"===x&&(v=S)}}),l&&v&&this.media().attributes.AUDIO){var g=this.media().attributes.AUDIO;this.master().playlists.forEach(function(x){(x.attributes&&x.attributes.AUDIO)===g&&x!==e.media()&&(x.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+v+' does not support codec(s): "'+o.audio+'"')}if(!Object.keys(f).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var E=[];if(["video","audio"].forEach(function(x){var S=(Qe(e.sourceUpdater_.codecs[x]||"")[0]||{}).type,F=(Qe(o[x]||"")[0]||{}).type;S&&F&&S.toLowerCase()!==F.toLowerCase()&&E.push('"'+e.sourceUpdater_.codecs[x]+'" -> "'+o[x]+'"')}),E.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+E.join(", ")+".",blacklistDuration:1/0,internal:!0})}return o}var T=Object.keys(f).reduce(function(x,S){return x&&(x+=", "),x+(S+' does not support codec(s): "')+f[S].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:T,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},t.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}}},t.excludeUnsupportedVariants_=function(){var e=this,i=this.master().playlists,a=[];Object.keys(i).forEach(function(o){var l=i[o];if(-1===a.indexOf(l.id)){a.push(l.id);var d=An(e.master,l),f=[];d.audio&&!ci(d.audio)&&!ii(d.audio)&&f.push("audio codec "+d.audio),d.video&&!ci(d.video)&&!ii(d.video)&&f.push("video codec "+d.video),d.text&&"stpp.ttml.im1t"===d.text&&f.push("text codec "+d.text),f.length&&(l.excludeUntil=1/0,e.logger_("excluding "+l.id+" for unsupported: "+f.join(", ")))}})},t.excludeIncompatibleVariants_=function(e){var i=this,a=[],o=this.master().playlists,l=Aa(Qe(e)),d=Wd(l),f=l.video&&Qe(l.video)[0]||null,v=l.audio&&Qe(l.audio)[0]||null;Object.keys(o).forEach(function(g){var T=o[g];if(-1===a.indexOf(T.id)&&T.excludeUntil!==1/0){a.push(T.id);var E=[],x=An(i.masterPlaylistLoader_.master,T),S=Wd(x);if(x.audio||x.video){if(S!==d&&E.push('codec count "'+S+'" !== "'+d+'"'),!i.sourceUpdater_.canChangeType()){var F=x.video&&Qe(x.video)[0]||null,U=x.audio&&Qe(x.audio)[0]||null;F&&f&&F.type.toLowerCase()!==f.type.toLowerCase()&&E.push('video codec "'+F.type+'" !== "'+f.type+'"'),U&&v&&U.type.toLowerCase()!==v.type.toLowerCase()&&E.push('audio codec "'+U.type+'" !== "'+v.type+'"')}E.length&&(T.excludeUntil=1/0,i.logger_("blacklisting "+T.id+": "+E.join(" && ")))}}})},t.updateAdCues_=function(e){var i=0,a=this.seekable();a.length&&(i=a.start(0)),function(n,t,r){if(void 0===r&&(r=0),n.segments)for(var i,e=r,a=0;a0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=e.buffered_()},n.checkSegmentDownloads_=function(r){var e=this.masterPlaylistController_,i=e[r+"SegmentLoader_"],a=i.buffered_(),o=function(n,t){if(n===t)return!1;if(!n&&t||!t&&n||n.length!==t.length)return!0;for(var r=0;r=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},n.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},n.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var o,e=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(o=e.end(e.length-1)),this.beforeSeekableWindow_(e,i)){var d=e.start(0);o=d+(d===e.end(0)?0:bi)}if(void 0!==o)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+nd(e)+". Seeking to "+o+"."),this.tech_.setCurrentTime(o),!0;for(var f=this.masterPlaylistController_.sourceUpdater_,v=this.tech_.buffered(),g=f.audioBuffer?f.audioBuffered():null,T=f.videoBuffer?f.videoBuffered():null,E=this.media(),x=E.partTargetDuration?E.partTargetDuration:2*(E.targetDuration-zi),S=[g,T],F=0;F "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}},n.techWaiting_=function(){var r=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(r,e)){var i=r.end(r.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var d=xa(o,e);if(d.length>0){var f=d.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+f+", seeking to "+d.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*f,e),!0}return!1},n.afterSeekableWindow_=function(r,e,i,a){if(void 0===a&&(a=!1),!r.length)return!1;var o=r.end(r.length-1)+bi;return!i.endList&&a&&(o=r.end(r.length-1)+3*i.targetDuration),e>o},n.beforeSeekableWindow_=function(r,e){return!!(r.length&&r.start(0)>0&&e2)return{start:o,end:l}}return null},s}(),av={errorInterval:30,getSource:function(n){return n(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},sv=function s(n,t){var r=0,e=0,i=N.mergeOptions(av,t);n.ready(function(){n.trigger({type:"usage",name:"vhs-error-reload-initialized"}),n.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){e&&n.currentTime(e)},o=function(g){null!=g&&(e=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",a),n.src(g),n.trigger({type:"usage",name:"vhs-error-reload"}),n.trigger({type:"usage",name:"hls-error-reload"}),n.play())},l=function(){return Date.now()-r<1e3*i.errorInterval?(n.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void n.trigger({type:"usage",name:"hls-error-reload-canceled"})):i.getSource&&"function"==typeof i.getSource?(r=Date.now(),i.getSource.call(n,o)):void N.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},d=function v(){n.off("loadedmetadata",a),n.off("error",l),n.off("dispose",v)};n.on("error",l),n.on("dispose",d),n.reloadSourceOnError=function(g){d(),s(n,g)}},Ot={PlaylistLoader:Yr,Playlist:$t,utils:Sm,STANDARD_PLAYLIST_SELECTOR:zd,INITIAL_PLAYLIST_SELECTOR:function(){var n=this,t=this.playlists.master.playlists.filter($t.isEnabled);return Xr(t,function(e,i){return Oo(e,i)}),t.filter(function(e){return!!An(n.playlists.master,e).video})[0]||null},lastBandwidthSelector:zd,movingAverageBandwidthSelector:function(n){var t=-1,r=-1;if(n<0||n>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&P().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(t=n*this.systemBandwidth+(1-n)*t,r=this.systemBandwidth),Zd(this.playlists.master,t,parseInt(Ia(this.tech_.el(),"width"),10)*e,parseInt(Ia(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Oo,comparePlaylistResolution:function(n,t){var r,e;return n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(r=n.attributes.RESOLUTION.width),r=r||P().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(e=t.attributes.RESOLUTION.width),r===(e=e||P().Number.MAX_VALUE)&&n.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?n.attributes.BANDWIDTH-t.attributes.BANDWIDTH:r-e},xhr:xd()};Object.keys(Dt).forEach(function(s){Object.defineProperty(Ot,s,{get:function(){return N.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Dt[s]},set:function(t){N.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?N.log.warn("value of Vhs."+s+" must be greater than or equal to 0"):Dt[s]=t}})});var lc="videojs-vhs",dc=function(n,t){for(var r=t.media(),e=-1,i=0;i=g&&f>=g?Math.max(f,T):T}return f},set:function(f){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=f,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set:function(){N.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return cr(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return cr(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&function(n){if(!P().localStorage)return!1;var t=cc();t=t?N.mergeOptions(t,n):n;try{P().localStorage.setItem(lc,JSON.stringify(t))}catch(r){return!1}}({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n){n.representations=function(){var t=n.masterPlaylistController_.master(),r=Cn(t)?n.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return r?r.filter(function(e){return!To(e)}).map(function(e,i){return new iv(n,e,e.id)}):[]}}(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=P().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(n){var t=n.player,r=n.sourceKeySystems,e=n.audioMedia,i=n.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var o=function(n,t){return n.reduce(function(r,e){if(!e.contentProtection)return r;var i=t.reduce(function(a,o){var l=e.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(i).length&&r.push(i),r},[])}(e?i.concat([e]):i,Object.keys(r)),l=[],d=[];return o.forEach(function(f){d.push(new Promise(function(v,g){t.tech_.one("keysessioncreated",v)})),l.push(new Promise(function(v,g){t.eme.initializeMediaKeys({keySystems:f},function(T){T?g(T):v()})}))}),Promise.race([Promise.all(l),Promise.race(d)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=function(n){var t=n.player,a=function(n,t,r){if(!n)return n;var e={};t&&t.attributes&&t.attributes.CODECS&&(e=Aa(Qe(t.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(e.audio=r.attributes.CODECS);var i=Yt(e.video),a=Yt(e.audio),o={};for(var l in n)o[l]={},a&&(o[l].audioContentType=a),i&&(o[l].videoContentType=i),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),"string"==typeof n[l]&&(o[l].url=n[l]);return N.mergeOptions(n,o)}(n.sourceKeySystems,n.media,n.audioMedia);return!(!a||(t.currentSource().keySystems=a,a&&!t.eme&&(N.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))}({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()});this.player_.tech_.on("keystatuschange",function(o){"output-restricted"===o.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+o.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==N.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},t.setupQualityLevels_=function(){var e=this,i=N.players[this.tech_.options_.playerId];!i||!i.qualityLevels||this.qualityLevels_||(this.qualityLevels_=i.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n,t){t.representations().forEach(function(r){n.addQualityLevel(r)}),dc(n,t.playlists)}(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){dc(e.qualityLevels_,e.playlists)}))},n.version=function(){return{"@videojs/http-streaming":"2.13.1","mux.js":"6.0.1","mpd-parser":"0.21.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return ic.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&P().URL.revokeObjectURL&&(P().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(e,i){return function(n){var t=n.playlist,r=n.time,e=void 0===r?void 0:r,i=n.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===e)return i({message:"getProgramTime: playlist and time must be provided"});var a=function(n,t){if(!t||!t.segments||0===t.segments.length)return null;for(var e,r=0,i=0;ir){if(n>r+.25*a.duration)return null;e=a}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:r-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}}(e,t);if(!a)return i({message:"valid programTime was not found"});if("estimate"===a.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:e},l=function(n,t){if(!t.dateTimeObject)return null;var a=n-(t.videoTimingInfo.transmuxedPresentationStart+t.videoTimingInfo.transmuxerPrependedSeconds);return new Date(t.dateTimeObject.getTime()+1e3*a)}(e,a.segment);return l&&(o.programDateTime=l.toISOString()),i(null,o)}({playlist:this.masterPlaylistController_.media(),time:e,callback:i})},t.seekToProgramTime=function(e,i,a,o){return void 0===a&&(a=!0),void 0===o&&(o=2),Pm({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})},n}(N.getComponent("Component")),Oa={name:"videojs-http-streaming",VERSION:"2.13.1",canHandleSource:function(n,t){void 0===t&&(t={});var r=N.mergeOptions(N.options,t);return Oa.canPlayType(n.type,r)},handleSource:function(n,t,r){void 0===r&&(r={});var e=N.mergeOptions(N.options,r);return t.vhs=new Uo(n,t,e),N.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return N.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=xd(),t.vhs.src(n.src,n.type),t.vhs},canPlayType:function(n,t){void 0===t&&(t={});var r=N.mergeOptions(N.options,t),e=r.vhs,i=(e=void 0===e?{}:e).overrideNative,a=void 0===i?!N.browser.IS_ANY_SAFARI:i,o=r.hls,l=(o=void 0===o?{}:o).overrideNative,d=void 0!==l&&l,f=sn(n);return f&&(!Ot.supportsTypeNatively(f)||d||a)?"maybe":""}};ii("avc1.4d400d,mp4a.40.2")&&N.getTech("Html5").registerSourceHandler(Oa,0),N.VhsHandler=Uo,Object.defineProperty(N,"HlsHandler",{get:function(){return N.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Uo},configurable:!0}),N.VhsSourceHandler=Oa,Object.defineProperty(N,"HlsSourceHandler",{get:function(){return N.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Oa},configurable:!0}),N.Vhs=Ot,Object.defineProperty(N,"Hls",{get:function(){return N.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ot},configurable:!0}),N.use||(N.registerComponent("Hls",Ot),N.registerComponent("Vhs",Ot)),N.options.vhs=N.options.vhs||{},N.options.hls=N.options.hls||{},N.getPlugin&&N.getPlugin("reloadSourceOnError")||(N.registerPlugin||N.plugin)("reloadSourceOnError",function(n){sv(this,n)});const xv=N,Sv=["target"];let Ev=(()=>{class s{constructor(t){this.gs=t,this.subtitlesOctopus=null,this.videoUrl=null,this.videoThumb=null,this.subtitleUrl=null,this.subtitleFonts=[]}ngOnInit(){this.gs.isBrowser&&this.target&&this.videoUrl&&(this.gs.log("[VIDEO-JS_INIT_URL]",this.videoUrl),this.player=xv(this.target.nativeElement,{autoplay:!1,controls:!0,fluid:!0,muted:!1,sources:[{src:this.videoUrl,type:"video/mp4"}],poster:this.videoThumb},()=>{this.gs.log("[VIDEO-JS_READY]",this.player),this.initSubtitle()}))}ngOnDestroy(){var t,r;null===(t=this.subtitlesOctopus)||void 0===t||t.dispose(),null===(r=this.player)||void 0===r||r.dispose()}ngOnChanges(){this.subtitlesOctopus?this.subtitleUrl&&this.subtitlesOctopus.setTrackByUrl(this.subtitleUrl):this.initSubtitle()}initSubtitle(){this.subtitleUrl&&(this.subtitlesOctopus=new SubtitlesOctopus({video:this.target.nativeElement,subUrl:this.subtitleUrl,fonts:this.subtitleFonts,workerUrl:"/assets/lib/subtitles-octopus-worker.js",legacyWorkerUrl:"/assets/lib/subtitles-octopus-worker-legacy.js"}),this.gs.log("[SUBTITLE_INIT]",this.subtitlesOctopus))}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(ke.U))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-vjs-player"]],viewQuery:function(t,r){if(1&t&&u.Gf(Sv,7),2&t){let e;u.iGM(e=u.CRH())&&(r.target=e.first)}},inputs:{videoUrl:"videoUrl",videoThumb:"videoThumb",subtitleUrl:"subtitleUrl",subtitleFonts:"subtitleFonts"},features:[u.TTD],decls:2,vars:0,consts:[["controls","","muted","","playsinline","","preload","none",1,"video-js","w-100"],["target",""]],template:function(t,r){1&t&&u._UZ(0,"video",0,1)},styles:[""]}),s})();var Cv=j(325),kv=j(9461),fc=j(3626);function Av(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",22),u._UZ(1,"img",23),u.TgZ(2,"h4"),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.hYB("routerLink","/anime/",t.berkasData.anime_.id,"-",t.animeName,""),u.xp6(1),u.s9C("src",t.berkasData.anime_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.anime_.name)}}function wv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",22),u._UZ(1,"img",23),u.TgZ(2,"h4"),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.MGl("routerLink","/dorama/",t.berkasData.dorama_.slug,""),u.xp6(1),u.s9C("src",t.berkasData.dorama_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.dorama_.name)}}function Iv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",22),u._UZ(1,"img",23),u.TgZ(2,"h4"),u._uU(3),u.qZA()()),2&s){const t=n.$implicit;u.MGl("routerLink","/fansub/",t.slug,""),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.Oqu(t.name)}}function Dv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return e.ddl(e.berkasData.attachment_.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"movie"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.ALo(5,"bytes"),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.name," :: ",t.lampiran.download_count,"x"),u.xp6(3),u.lnq(" ",u.Dn7(4,5,t.lampiran.name,0,5),".....",t.lampiran.ext," (",u.lcZ(5,9,t.lampiran.size),") ")}}function Pv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return e.cancel_dl(e.berkasData.attachment_.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"close"),u.qZA(),u._uU(3," Batal Unduh "),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.name," :: ",t.lampiran.download_count,"x")}}function Lv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return e.saveFileAs(e.berkasData.attachment_.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"save"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.qZA()}if(2&s){const t=u.oxw(4);u.hYB("matTooltip","",t.lampiran.name," :: ",t.lampiran.download_count,"x"),u.xp6(3),u.AsE(" ",u.Dn7(4,4,t.lampiran.name,0,5),".....",t.lampiran.ext," ")}}function Ov(s,n){if(1&s&&(u.TgZ(0,"div",31),u._uU(1),u._UZ(2,"br"),u._uU(3),u._UZ(4,"br")(5,"mat-progress-bar",38),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.AsE(" ",t.lampiran.percentage>=100?"Selesai Mengunduh ... ":"Sedang Mengunduh ... "," ",t.lampiran.totals," Bytes "),u.xp6(2),u.AsE(" ",t.lampiran.percentage,"% @ ",t.lampiran.speed," KB/s "),u.xp6(2),u.Q6J("mode",t.lampiran.mode)("value",t.lampiran.percentage)}}function Rv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(5);return e.standardDdlVideo(e.berkasData.attachment_.id)}),u._uU(1," Unduhan Macet? "),u.TgZ(2,"i")(3,"u"),u._uU(4,"Coba Gunakan Unduhan Biasa~"),u.qZA()()()}}function Mv(s,n){if(1&s&&(u.TgZ(0,"div",13),u.YNc(1,Rv,5,0,"div",39),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Q6J("ngIf",t.lampiran.isDownloading)}}function Nv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).standardDdlSubsFont(i.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"notes"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.ALo(5,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.s9C("matTooltip",t.name),u.xp6(3),u.lnq(" ",u.Dn7(4,4,t.name,0,5),".....",t.ext," (",u.lcZ(5,8,t.size),") ")}}function Fv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).standardDdlSubsFont(i.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"font_download"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.ALo(5,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.s9C("matTooltip",t.name),u.xp6(3),u.lnq(" ",u.Dn7(4,4,t.name,0,5),".....",t.ext," (",u.lcZ(5,8,t.size),") ")}}function Uv(s,n){if(1&s&&(u.TgZ(0,"div",30)(1,"div",31),u.YNc(2,Dv,6,11,"button",32),u.YNc(3,Pv,4,2,"button",32),u.YNc(4,Lv,5,8,"button",32),u.TgZ(5,"div",13),u.YNc(6,Ov,6,6,"div",33),u.qZA(),u.YNc(7,Mv,2,1,"div",34),u.YNc(8,Nv,6,10,"button",35),u.YNc(9,Fv,6,10,"button",35),u.qZA()()),2&s){const t=u.oxw(3);u.xp6(2),u.Q6J("ngIf",!t.lampiran.data&&!t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",!t.lampiran.data&&t.lampiran.isDownloading),u.xp6(1),u.Q6J("ngIf",t.lampiran.data),u.xp6(2),u.Q6J("ngIf",t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.isDiscord),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.subtitles_),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.fonts_)}}function Bv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",30)(1,"div",31)(2,"button",41),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).verify()}),u.TgZ(3,"mat-icon",37),u._uU(4,"enhanced_encryption"),u.qZA(),u._uU(5),u.qZA()()()}if(2&s){const t=u.oxw(3);u.xp6(5),u.hij(" ",t.berkasData.attachment_," ")}}function Hv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17)(4,"i"),u._uU(5,"Direct Download"),u.qZA()()()(),u.YNc(6,Uv,10,7,"div",29),u.YNc(7,Bv,6,1,"div",29),u.qZA()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("ngIf",t.isHaveDDL),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function jv(s,n){if(1&s&&(u.TgZ(0,"a",43)(1,"mat-icon",37),u._uU(2,"cloud_download"),u.qZA(),u._uU(3),u.qZA()),2&s){const t=n.$implicit;u.s9C("href",t.url,u.LSH),u.xp6(3),u.hij(" ",t.name," ")}}function Vv(s,n){if(1&s&&(u.TgZ(0,"div",30),u.YNc(1,jv,4,2,"a",42),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.berkasData.download_url)}}function qv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",30)(1,"button",44),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).login()}),u.TgZ(2,"mat-icon",37),u._uU(3,"vpn_key"),u.qZA(),u._uU(4," Klik Untuk Login "),u.qZA()()}}function Wv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4),u.qZA()()(),u.YNc(5,Vv,2,1,"div",29),u.YNc(6,qv,5,0,"div",29),u.qZA()),2&s){const t=u.oxw(2);u.xp6(4),u.hij("Tautan Unduhan ",null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value?"External":"",""),u.xp6(1),u.Q6J("ngIf",null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value))}}function Gv(s,n){if(1&s&&(u.TgZ(0,"mat-option",56),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.url),u.xp6(1),u.Oqu(t.name)}}function Zv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",53)(1,"mat-label"),u._uU(2,"Pilih Subtitle / Takarir (.ASS Saja)"),u.qZA(),u.TgZ(3,"mat-select",54),u.NdJ("valueChange",function(e){return u.CHM(t),u.oxw(3).selectedSubsUrl=e}),u.YNc(4,Gv,2,2,"mat-option",55),u.qZA()()}if(2&s){const t=u.oxw(3);u.Q6J("color","accent"),u.xp6(3),u.Q6J("value",t.selectedSubsUrl),u.xp6(1),u.Q6J("ngForOf",t.subtitles)}}function zv(s,n){1&s&&u._UZ(0,"mat-progress-bar",57)}function Kv(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1,"Mulai Streaming Video"),u.qZA())}function $v(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1," Loading ... "),u.qZA())}function Yv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",58),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).watchDdl()}),u.TgZ(1,"mat-icon",37),u._uU(2,"play_arrow"),u.qZA(),u.YNc(3,Kv,2,0,"span",59),u.YNc(4,$v,2,0,"span",59),u.qZA()}if(2&s){const t=u.oxw(3);u.Q6J("disabled",t.vjsInit),u.xp6(3),u.Q6J("ngIf",!t.vjsInit),u.xp6(1),u.Q6J("ngIf",t.vjsInit)}}function Xv(s,n){if(1&s&&u._UZ(0,"app-vjs-player",60),2&s){const t=u.oxw(3);u.Q6J("videoUrl",t.ddlVideo)("videoThumb",t.videoThumb)("subtitleUrl",t.selectedSubsUrl)("subtitleFonts",t.ddlFonts)}}function Qv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",61),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).verify()}),u.TgZ(1,"mat-icon",37),u._uU(2,"enhanced_encryption"),u.qZA(),u._uU(3),u.qZA()}if(2&s){const t=u.oxw(3);u.xp6(3),u.hij(" ",t.berkasData.attachment_," ")}}function Jv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Video Stream (Browser Tertentu T.T)"),u.qZA()()(),u.TgZ(5,"div",18)(6,"div",45),u._uU(7," Dapat digunakan sebagai referensi untuk pratinjau namun kemungkinan jenis huruf tulisan gagal dimuat sehingga nantinya akan muncul huruf dengan gambar \u{1f533} misalnya kanji. Lalu juga memungkinkan terjadinya gerakan patah - patah jika browser tidak kuat untuk render .ASS subtitle dengan efek yang terlalu banyak. "),u.TgZ(8,"span",46)(9,"i"),u._uU(10,"Player"),u.qZA(),u._uU(11," ini mungkin tidak dapat memutar video HEVC-x265 (belum support semua "),u.TgZ(12,"i"),u._uU(13,"web browser"),u.qZA(),u._uU(14,") dan audio AC3 (atau ekstensi lain yang masih memiliki lisensi paten belum "),u.TgZ(15,"i"),u._uU(16,"open source"),u.qZA(),u._uU(17,"). Takarir / "),u.TgZ(18,"i"),u._uU(19,"subtitle"),u.qZA(),u._uU(20," yang dapat ditampilkan jenis .ASS saja, itupun jika tersedia di dalam video internalnya. "),u.qZA(),u.TgZ(21,"a",47),u._uU(22," * Browser Firefox sudah pasti tidak bisa memutar video "),u.qZA()(),u.TgZ(23,"div",31),u.YNc(24,Zv,5,3,"mat-form-field",48),u.YNc(25,zv,1,0,"mat-progress-bar",49),u.YNc(26,Yv,5,3,"button",50),u.YNc(27,Xv,1,4,"app-vjs-player",51),u.YNc(28,Qv,4,1,"button",52),u.qZA()()()),2&s){const t=u.oxw(2);u.xp6(24),u.Q6J("ngIf",t.subtitles.length>0),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&t.vjsReady),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function e_(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Deskripsi & Informasi"),u.qZA()()(),u.TgZ(5,"div",18),u._UZ(6,"div",62),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("innerHTML",t.berkasData.description,u.oJD)}}function t_(s,n){1&s&&(u.TgZ(0,"div",14)(1,"div",18),u._UZ(2,"app-report"),u.qZA()())}function i_(s,n){if(1&s&&(u.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"ul",4),u._UZ(4,"li")(5,"li")(6,"li")(7,"li")(8,"li")(9,"li")(10,"li")(11,"li")(12,"li")(13,"li"),u.TgZ(14,"div",5)(15,"h2",6),u._uU(16),u.qZA(),u.TgZ(17,"p",7),u._uU(18),u.qZA(),u.TgZ(19,"p",8),u._uU(20),u.ALo(21,"date"),u.qZA()()()()(),u._UZ(22,"app-notifications"),u.TgZ(23,"div",9)(24,"div",10)(25,"div",11)(26,"div",12)(27,"div",13)(28,"div",14)(29,"div",15)(30,"h2",16)(31,"b",17),u._uU(32,"Rujukan"),u.qZA()()(),u.TgZ(33,"div",18)(34,"mat-selection-list",19),u.YNc(35,Av,4,4,"mat-list-option",20),u.YNc(36,wv,4,3,"mat-list-option",20),u.YNc(37,Iv,4,3,"mat-list-option",21),u.TgZ(38,"mat-list-option",22),u._UZ(39,"img",23),u.TgZ(40,"h4"),u._uU(41),u.qZA()()()()(),u.YNc(42,Hv,8,2,"div",24),u.YNc(43,Wv,7,3,"div",24),u.qZA()()(),u.TgZ(44,"div",25)(45,"div",12)(46,"div",13),u.YNc(47,Jv,29,5,"div",24),u.YNc(48,e_,7,1,"div",24),u.YNc(49,t_,3,0,"div",24),u.TgZ(50,"div",14)(51,"div",26)(52,"h2",27)(53,"b",17),u._uU(54,"Komentar"),u.qZA()()(),u.TgZ(55,"div",18)(56,"div",28),u._UZ(57,"app-discussion"),u.qZA()()()()()()()()()),2&s){const t=u.oxw();u.xp6(2),u.Udp("background","url(/assets/img/banner/berkas-detail.png), linear-gradient(to bottom, "+(t.GS.isDarkMode?"#673ab7":"#3f51b5")+" 0%, #ee0dfd 100%)"),u.xp6(14),u.hij(" ",t.berkasData.name," "),u.xp6(2),u.AsE(" ",t.berkasData.view_count,"x Dilihat :: ",t.berkasData.like_count," Orang Suka "),u.xp6(2),u.hij(" ",u.xi3(21,18,t.berkasData.created_at,"d MMMM y, hh:mm:ss a z")," "),u.xp6(14),u.Q6J("multiple",!1),u.xp6(1),u.Q6J("ngIf",t.berkasData.anime_),u.xp6(1),u.Q6J("ngIf",t.berkasData.dorama_),u.xp6(1),u.Q6J("ngForOf",t.berkasData.fansub_),u.xp6(1),u.MGl("routerLink","/user/",t.berkasData.user_.username,""),u.xp6(1),u.s9C("src",t.berkasData.user_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.user_.username),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&t.berkasData.attachment_),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value)||(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.berkasData.download_url?null:t.berkasData.download_url.length)>0),u.xp6(4),u.Q6J("ngIf",t.berkasData.attachment_&&t.isStreamable),u.xp6(1),u.Q6J("ngIf",t.berkasData.description),u.xp6(1),u.Q6J("ngIf",null==t.SS.mySocket?null:t.SS.mySocket.id)}}let r_=(()=>{class s{constructor(t,r,e,i,a,o,l,d,f,v,g,T){this.router=t,this.activatedRoute=r,this.gs=e,this.bs=i,this.pi=a,this.berkas=o,this.fs=l,this.as=d,this.dm=f,this.wb=v,this.ss=g,this.dls=T,this.berkasId="",this.berkasData=null,this.subsBerkas=null,this.subsParam=null,this.subsDialog=null,this.subsSubtitlesFonts=null,this.subtitles=[],this.fonts=[],this.selectedSubsUrl=null,this.vjsInit=!1,this.vjsReady=!1,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get AS(){return this.as}get SS(){return this.ss}ngOnDestroy(){var t,r,e,i;null===(t=this.subsBerkas)||void 0===t||t.unsubscribe(),null===(r=this.subsParam)||void 0===r||r.unsubscribe(),null===(e=this.subsDialog)||void 0===e||e.unsubscribe(),null===(i=this.subsSubtitlesFonts)||void 0===i||i.unsubscribe()}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:t=>{this.berkasId=t.berkasId,this.bs.busy(),this.subsBerkas=this.berkas.getBerkas(this.berkasId).subscribe({next:r=>{this.gs.log("[BERKAS_DETAIL_SUCCESS]",r),this.berkasData=r.result,this.pi.updatePageMetaData(`${this.berkasData.name}`,`${this.berkasData.description}`,`${this.berkasData.name}`,this.berkasData.image_url,this.berkasData.user_.username),this.pi.updatePageHeader(this.berkasData.project_type_.name),this.bs.idle(),this.gs.isBrowser&&this.fs.initializeFab("edit",null,"Ubah Data Berkas",`/berkas/${this.berkasId}/edit`,!1)},error:r=>{this.gs.log("[BERKAS_DETAIL_ERROR]",r,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/berkas"}})}})}})}watchDdl(){this.vjsInit=!0,this.setupVjs()}login(){this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}get animeName(){return this.berkasData.anime_.name.replace(/[^a-zA-Z0-9]/g,"-")}get lampiran(){return this.dm.getAttachmentDownloadFile(this.berkasData.attachment_)}get ddlVideo(){return this.ddlUrlLinkVideo(this.berkasData.attachment_.id)}get videoThumb(){return this.berkasData.image_url}get ddlFonts(){return this.fonts.length>0?this.fonts:[]}get isHaveDDL(){return!(!("attachment_"in this.berkasData)||!this.berkasData.attachment_)&&"string"!=typeof this.berkasData.attachment_}get isDiscord(){var t;return this.isHaveDDL&&(null===(t=this.berkasData.attachment_)||void 0===t?void 0:t.discord)}get isStreamable(){var t;return this.isHaveDDL&&this.gs.includesOneOf(null===(t=this.berkasData.attachment_)||void 0===t?void 0:t.ext,te.t.fileTypeAttachmentStreamable)}ddl(t){var r=this;return(0,ue.Z)(function*(){r.isDiscord?r.dm.startDownload(t,!1):r.dm.startDownload(t)})()}cancel_dl(t){this.dm.cancelDownload(t)}saveFileAs(t){this.dm.saveFileAs(t)}standardDdlVideo(t){this.wb.winboxOpenUri(this.ddlUrlLinkVideo(t))}ddlUrlLinkVideo(t){return this.isDiscord?`${Ge.N.apiUrl}/ddl-seek/${t}?ngsw-bypass=true`:`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}standardDdlSubsFont(t){this.wb.winboxOpenUri(this.ddlUrlLinkSubsFont(t))}ddlUrlLinkSubsFont(t){return`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}setupVjs(){if(this.isHaveDDL){const t=[],r=[],e=[];if("subtitles_"in this.berkasData.attachment_&&this.berkasData.attachment_.subtitles_)for(const i of this.berkasData.attachment_.subtitles_){const a=this.dls.downloadLampiran(i.id).pipe((0,me.b)(o=>{o.type===Oe.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),r.push({name:i.name,url:URL.createObjectURL(new Blob([o.body]))}))}));t.push(a)}if("fonts_"in this.berkasData.attachment_&&this.berkasData.attachment_.fonts_)for(const i of this.berkasData.attachment_.fonts_){const a=this.dls.downloadLampiran(i.id).pipe((0,me.b)(o=>{o.type===Oe.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),e.push(URL.createObjectURL(new Blob([o.body]))))}));t.push(a)}this.subsSubtitlesFonts=(0,Le.z)(...t).subscribe({next:i=>{i.type===Oe.dt.DownloadProgress&&this.gs.log("[DOWNLOAD_PROGRESS]",i),i.type===Oe.dt.Response&&this.gs.log("[DOWNLOAD_COMPLETED]",i)},error:i=>{this.gs.log("[DOWNLOAD_ERROR]",i,"error")},complete:()=>{this.subtitles=r,this.fonts=e,this.vjsReady=!0}})}}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(ke.U),u.Y36(Ne.z),u.Y36(He.Z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e),u.Y36(de),u.Y36(le.N),u.Y36(xe.R),u.Y36(Y.v))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-detail"]],decls:1,vars:1,consts:[["class","p-0 m-0",4,"ngIf"],[1,"p-0","m-0"],[1,"container-fluid","p-0"],[1,"wrapper"],[1,"bg-bubbles","align-items-center","p-0"],[1,"container","align-items-center","h-100","p-3","text-light",2,"overflow-y","auto"],["_ngcontent-serverapp-c311","",1,"mb-0",2,"line-height","normal"],[1,"mt-3","mb-0"],[1,"mb-0"],[1,"container"],[1,"row"],[1,"col-md-5","col-xl-4","p-3"],[1,"row","sticky-top"],[1,"col"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12"],[3,"multiple"],[3,"routerLink",4,"ngIf"],[3,"routerLink",4,"ngFor","ngForOf"],[3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],["class","row py-3",4,"ngIf"],[1,"col-md-7","col-xl-8","p-3","sticky-top"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"p-3"],["class","col-12 text-center",4,"ngIf"],[1,"col-12","text-center"],[1,"px-3"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngIf"],["class","px-3",4,"ngIf"],["class","col",4,"ngIf"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","color","accent",1,"m-1","w-100",3,"matTooltip","click"],[1,"me-1"],["color","accent",3,"mode","value"],["class","px-3 text-danger","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"px-3","text-danger",2,"cursor","pointer",3,"click"],["type","button","mat-stroked-button","","color","accent","matTooltip","Direct Download Link Berkas",1,"m-1",3,"click"],["class","m-1","target","_blank","mat-stroked-button","","color","accent",3,"href",4,"ngFor","ngForOf"],["target","_blank","mat-stroked-button","","color","accent",1,"m-1",3,"href"],["type","button","mat-stroked-button","","color","accent",1,"m-1",3,"click"],[1,"py-2","px-3"],[1,"text-success"],["href","https://bugzilla.mozilla.org/show_bug.cgi?id=1422891",1,"text-warning","text-decoration-none"],["appearance","outline","class","pt-3 col-12",3,"color",4,"ngIf"],["color","warn","mode","buffer","class","mb-3",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","warn",3,"disabled","click",4,"ngIf"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","accent",3,"click",4,"ngIf"],["appearance","outline",1,"pt-3","col-12",3,"color"],["placeholder","Pilih Salah Satu",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["color","warn","mode","buffer",1,"mb-3"],["type","button","mat-stroked-button","","color","warn",1,"w-100",3,"disabled","click"],[4,"ngIf"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"],[1,"py-2","px-3",2,"white-space","pre-line !important",3,"innerHTML"]],template:function(t,r){1&t&&u.YNc(0,i_,58,21,"div",0),2&t&&u.Q6J("ngIf",r.berkasData)},directives:[Q.O5,J.t,re.Ub,re.vS,_e.rH,re.eA,Q.sg,X.lW,oe.gM,De.Hw,Ze.pW,X.zs,qe.KE,qe.hX,We.gD,Me.ey,Ev,Cv.Y,kv.S],pipes:[Q.uU,Q.OU,fc.$],styles:[".wrapper[_ngcontent-%COMP%]{position:sticky;left:0;width:100%;height:128px;overflow:hidden;background-size:168px,auto!important;background-repeat:no-repeat,repeat!important;background-position-x:100%,0%!important}.bg-bubbles[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:#ffffff26;bottom:-160px;animation:square 25s infinite;transition-timing-function:linear}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(1){left:10%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:#ffffff40}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(5){left:70%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:#fff3}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:#ffffff4d}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes square{0%{transform:translateY(0)}to{transform:translateY(-512px) rotate(512deg)}}"]}),s})();var Ra=j(8372),Ma=j(9094),Bo=j(3900),Ho=j(8746),Na=j(5625),n_=j(519),a_=j(8439),s_=j(5679),o_=j(6781),u_=j(7902),hc=j(2368),l_=j(7531),pc=j(1079),d_=j(4834);function c_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"bytes"),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.hij("Ukuran Upload Melebihi Batas ",u.lcZ(2,1,t.imageLimitExceeded)," !")}}function f_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.Oqu(t.imageErrorText)}}function h_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",28)(1,"button",30),u.NdJ("click",function(){return u.CHM(t),u.oxw(2).submitImage()}),u.TgZ(2,"mat-icon",31),u._uU(3,"add_photo_alternate"),u.qZA(),u._uU(4," Unggah "),u.qZA()()}if(2&s){const t=u.oxw(2);u.xp6(1),u.Q6J("disabled",t.submitted)}}function p_(s,n){1&s&&(u.TgZ(0,"div",20)(1,"mat-slide-toggle",46)(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Akses Hanya Dengan URL "),u.qZA()())}function m_(s,n){if(1&s&&(u.TgZ(0,"mat-option",47),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.Oqu(t.name)}}function g_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Tidak Boleh Kosong"),u.qZA())}function v_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function __(s,n){1&s&&(u.TgZ(0,"mat-option",53),u._UZ(1,"mat-progress-bar",54),u.qZA())}function y_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",56),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).filterAnimeSelected(i)}),u._UZ(1,"img",57),u.TgZ(2,"span",45),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.lnq("",t.id," :: ",null==t.media_type?null:t.media_type.toUpperCase()," :: ",t.title,"")}}function T_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,y_,4,5,"mat-option",55),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredAnime)}}function b_(s,n){if(1&s&&(u.TgZ(0,"small",58),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.fg.get("anime_name").value)}}function x_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Tidak Boleh Kosong"),u.qZA())}function S_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Hanya Boleh Angka"),u.qZA())}function E_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",48)(1,"mat-label"),u._uU(2,"Anime Terkait"),u.qZA(),u.TgZ(3,"input",49),u.NdJ("keyup",function(){return u.CHM(t),u.oxw(2).resetSelectedAnime()}),u.qZA(),u.TgZ(4,"mat-icon",15),u._uU(5,"short_text"),u.qZA(),u.TgZ(6,"mat-autocomplete",null,50),u.YNc(8,__,2,0,"mat-option",51),u.YNc(9,T_,2,1,"ng-container",17),u.qZA(),u.YNc(10,b_,2,1,"small",52),u.TgZ(11,"mat-error"),u.YNc(12,x_,2,0,"div",17),u.YNc(13,S_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(7),r=u.oxw(2);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(5),u.Q6J("ngIf",r.isLoading),u.xp6(1),u.Q6J("ngIf",!r.isLoading),u.xp6(1),u.Q6J("ngIf",r.fg.get("anime_name").value),u.xp6(2),u.Q6J("ngIf",r.fg.get("anime_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",r.fg.get("anime_id").hasError("pattern"))}}function C_(s,n){1&s&&(u.TgZ(0,"mat-option",53),u._UZ(1,"mat-progress-bar",54),u.qZA())}function k_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",56),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).filterDoramaSelected(i)}),u._UZ(1,"img",57),u.TgZ(2,"span",45),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.mdl_id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.mdl_id," :: ",t.title,"")}}function A_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,k_,4,4,"mat-option",55),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredDorama)}}function w_(s,n){if(1&s&&(u.TgZ(0,"small",58),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.fg.get("dorama_name").value)}}function I_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Tidak Boleh Kosong"),u.qZA())}function D_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Hanya Boleh Angka"),u.qZA())}function P_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",48)(1,"mat-label"),u._uU(2,"Dorama Terkait"),u.qZA(),u.TgZ(3,"input",59),u.NdJ("keyup",function(){return u.CHM(t),u.oxw(2).resetSelectedDorama()}),u.qZA(),u.TgZ(4,"mat-icon",15),u._uU(5,"short_text"),u.qZA(),u.TgZ(6,"mat-autocomplete",null,60),u.YNc(8,C_,2,0,"mat-option",51),u.YNc(9,A_,2,1,"ng-container",17),u.qZA(),u.YNc(10,w_,2,1,"small",52),u.TgZ(11,"mat-error"),u.YNc(12,I_,2,0,"div",17),u.YNc(13,D_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(7),r=u.oxw(2);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(5),u.Q6J("ngIf",r.isLoading),u.xp6(1),u.Q6J("ngIf",!r.isLoading),u.xp6(1),u.Q6J("ngIf",r.fg.get("dorama_name").value),u.xp6(2),u.Q6J("ngIf",r.fg.get("dorama_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",r.fg.get("dorama_id").hasError("pattern"))}}function L_(s,n){1&s&&(u.TgZ(0,"mat-icon",15),u._uU(1,"short_text"),u.qZA())}function O_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",67),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index;return u.oxw(2).removeFansub(e)}),u.TgZ(1,"mat-icon"),u._uU(2,"close"),u.qZA()()}}function R_(s,n){1&s&&(u.TgZ(0,"mat-option",53),u._UZ(1,"mat-progress-bar",54),u.qZA())}function M_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",56),u.NdJ("click",function(){const i=u.CHM(t).$implicit,a=u.oxw(2).index;return u.oxw(2).filterFansubSelected(i,a)}),u._UZ(1,"img",68),u.TgZ(2,"span",45),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.slug," :: ",t.name,"")}}function N_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,M_,4,4,"mat-option",55),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredFansub)}}function F_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Tidak Boleh Kosong"),u.qZA())}function U_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Hanya Boleh Angka"),u.qZA())}function B_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div")(1,"div",61)(2,"mat-form-field",62)(3,"mat-label"),u._uU(4,"Fansub Terkait"),u.qZA(),u.TgZ(5,"input",63),u.NdJ("keyup",function(){const i=u.CHM(t).index;return u.oxw(2).resetSelectedFansub(i)}),u.qZA(),u.YNc(6,L_,2,0,"mat-icon",64),u.YNc(7,O_,3,0,"button",65),u.TgZ(8,"mat-autocomplete",null,66),u.YNc(10,R_,2,0,"mat-option",51),u.YNc(11,N_,2,1,"ng-container",17),u.qZA(),u.TgZ(12,"small",58),u._uU(13),u.qZA(),u.TgZ(14,"mat-error"),u.YNc(15,F_,2,0,"div",17),u.YNc(16,U_,2,0,"div",17),u.qZA()()()()}if(2&s){const t=n.$implicit,r=n.index,e=u.MAs(9),i=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",r),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",e),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").value||0===r),u.xp6(1),u.Q6J("ngIf",!t.get("fansub_id").value&&r>0),u.xp6(3),u.Q6J("ngIf",i.isLoading),u.xp6(1),u.Q6J("ngIf",!i.isLoading),u.xp6(2),u.Oqu(t.get("fansub_name").value),u.xp6(2),u.Q6J("ngIf",t.get("fansub_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").hasError("pattern"))}}function H_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Tidak Boleh Kosong"),u.qZA())}function j_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function V_(s,n){1&s&&(u.TgZ(0,"div",9)(1,"div",20),u._UZ(2,"mat-divider"),u.qZA()())}function q_(s,n){if(1&s&&(u.TgZ(0,"p",73),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.attachmentFontSubtitle.join(", ").toLowerCase())}}function W_(s,n){if(1&s&&(u.TgZ(0,"div",9)(1,"mat-list")(2,"div",69),u._uU(3,"Berkas yang terlampir tidak boleh diubah."),u.qZA(),u.TgZ(4,"mat-list-item")(5,"mat-icon",70),u._uU(6,"attach_file"),u.qZA(),u.TgZ(7,"div",71),u._uU(8),u.qZA(),u.TgZ(9,"div",71),u._uU(10),u.ALo(11,"bytes"),u.qZA()(),u.YNc(12,q_,2,1,"p",72),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(8),u.AsE("",t.attachmentFile.name,".",t.attachmentFile.ext,""),u.xp6(2),u.Oqu(u.lcZ(11,4,t.attachmentFile.size)),u.xp6(2),u.Q6J("ngIf",t.attachmentFontSubtitle.length>0)}}function G_(s,n){1&s&&(u.TgZ(0,"div",80)(1,"small",81),u._uU(2,"* "),u.TgZ(3,"i"),u._uU(4,"Gunakan tombol (X) untuk menghapus URL Eksternal jika ingin hanya menggunakan lampiran "),u.TgZ(5,"i"),u._uU(6,"upload"),u.qZA(),u._uU(7," DDL saja"),u.qZA()()())}function Z_(s,n){1&s&&(u.TgZ(0,"mat-icon",15),u._uU(1,"web"),u.qZA())}function z_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",67),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index;return u.oxw(2).removeDownloadLink(e)}),u.TgZ(1,"mat-icon"),u._uU(2,"close"),u.qZA()()}}function K_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Tidak Boleh Kosong"),u.qZA())}function $_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function Y_(s,n){1&s&&(u.TgZ(0,"mat-icon",15),u._uU(1,"link"),u.qZA())}function X_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",67),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index;return u.oxw(2).removeDownloadLink(e)}),u.TgZ(1,"mat-icon"),u._uU(2,"close"),u.qZA()()}}function Q_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Tidak Boleh Kosong"),u.qZA())}function J_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Link Tidak Valid"),u.qZA())}function e0(s,n){if(1&s&&(u.ynx(0),u.TgZ(1,"div",74),u.YNc(2,G_,8,0,"div",75),u.TgZ(3,"mat-form-field",76)(4,"mat-label"),u._uU(5,"Nama Website"),u.qZA(),u._UZ(6,"input",77),u.YNc(7,Z_,2,0,"mat-icon",64),u.YNc(8,z_,3,0,"button",65),u.TgZ(9,"mat-error"),u.YNc(10,K_,2,0,"div",17),u.YNc(11,$_,2,0,"div",17),u.qZA()(),u.TgZ(12,"mat-form-field",78)(13,"mat-label"),u._uU(14,"Tautan Link"),u.qZA(),u._UZ(15,"input",79),u.YNc(16,Y_,2,0,"mat-icon",64),u.YNc(17,X_,3,0,"button",65),u.TgZ(18,"mat-error"),u.YNc(19,Q_,2,0,"div",17),u.YNc(20,J_,2,0,"div",17),u.qZA()()(),u.BQk()),2&s){const t=n.$implicit,r=n.index,e=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",r),u.xp6(1),u.Q6J("ngIf",(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified)&&0===r),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("name").value||0===r&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("name").value&&(r>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("name").hasError("pattern")),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("url").value||0===r&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("url").value&&(r>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("url").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("url").hasError("pattern"))}}function t0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"form",4),u.NdJ("submit",function(){return u.CHM(t),u.oxw().onSubmit()}),u.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),u._uU(5,"Ubah Berkas"),u.qZA()()(),u.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),u._UZ(11,"img",11),u.TgZ(12,"mat-form-field",12)(13,"mat-label"),u._uU(14,"Gambar Untuk Embed SEO"),u.qZA(),u.TgZ(15,"ngx-mat-file-input",13,14),u.NdJ("change",function(e){u.CHM(t);const i=u.MAs(16);return u.oxw().uploadImage(e,i)}),u.qZA(),u.TgZ(17,"mat-icon",15),u._uU(18,"image"),u.qZA()(),u.TgZ(19,"mat-error",16)(20,"small"),u.YNc(21,c_,3,3,"div",17),u.YNc(22,f_,2,1,"div",17),u.qZA()()(),u.YNc(23,h_,5,1,"div",18),u.YNc(24,p_,5,0,"div",19),u.TgZ(25,"div",20)(26,"mat-slide-toggle",21),u._uU(27," R-18+ Konten Eksplisit "),u.qZA()(),u.TgZ(28,"mat-form-field",22)(29,"mat-label"),u._uU(30,"Jenis Proyek"),u.qZA(),u.TgZ(31,"mat-select",23),u.YNc(32,m_,2,2,"mat-option",24),u.qZA(),u.TgZ(33,"mat-error"),u.YNc(34,g_,2,0,"div",17),u.YNc(35,v_,2,0,"div",17),u.qZA()(),u.YNc(36,E_,14,7,"mat-form-field",25),u.YNc(37,P_,14,7,"mat-form-field",25),u.TgZ(38,"div",20),u._UZ(39,"mat-divider"),u.qZA(),u.TgZ(40,"div",26),u.YNc(41,B_,17,10,"div",27),u.qZA(),u.TgZ(42,"div",28)(43,"div",9),u._UZ(44,"div",29),u.TgZ(45,"div",29)(46,"button",30),u.NdJ("click",function(){return u.CHM(t),u.oxw().addFansub()}),u.TgZ(47,"mat-icon",31),u._uU(48,"add"),u.qZA(),u._uU(49," Tambah Fansub "),u.qZA()()()()()(),u.TgZ(50,"div",32)(51,"div",9)(52,"mat-form-field",33)(53,"mat-label"),u._uU(54,"Nama Berkas"),u.qZA(),u._UZ(55,"input",34),u.TgZ(56,"mat-icon",15),u._uU(57,"wysiwyg"),u.qZA(),u.TgZ(58,"mat-error"),u.YNc(59,H_,2,0,"div",17),u.YNc(60,j_,2,0,"div",17),u.qZA()(),u._UZ(61,"angular-editor",35),u.qZA(),u.YNc(62,V_,3,0,"div",36),u.YNc(63,W_,13,6,"div",36),u.TgZ(64,"div",9)(65,"div",20),u._UZ(66,"mat-divider"),u.qZA()(),u.ynx(67,37),u.YNc(68,e0,21,12,"ng-container",27),u.BQk(),u.TgZ(69,"div",38),u._UZ(70,"div",29)(71,"div",29)(72,"div",29),u.TgZ(73,"div",29)(74,"button",30),u.NdJ("click",function(){return u.CHM(t),u.oxw().addDownloadLink()}),u.TgZ(75,"mat-icon",31),u._uU(76,"add"),u.qZA(),u._uU(77," Tambah URL "),u.qZA()()()()(),u.TgZ(78,"div",9)(79,"div",39)(80,"div",40),u._UZ(81,"div",41),u.TgZ(82,"div",42)(83,"a",43)(84,"mat-icon",31),u._uU(85,"undo"),u.qZA(),u._uU(86," Batal "),u.qZA()(),u.TgZ(87,"div",42)(88,"button",44),u._uU(89," Simpan "),u.TgZ(90,"mat-icon",45),u._uU(91,"save"),u.qZA()()()()()()()()()}if(2&s){const t=u.oxw();u.Q6J("formGroup",t.fg),u.xp6(11),u.Q6J("src",t.image_url,u.LSH),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("disabled",t.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),u.xp6(6),u.Q6J("ngIf",t.imageLimitExceeded),u.xp6(1),u.Q6J("ngIf",t.imageErrorText),u.xp6(1),u.Q6J("ngIf",t.image&&!t.fg.value.image),u.xp6(1),u.Q6J("ngIf",null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified),u.xp6(4),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngForOf",t.projectList),u.xp6(2),u.Q6J("ngIf",t.fg.get("projectType_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.fg.get("projectType_id").hasError("pattern")),u.xp6(1),u.Q6J("ngIf",t.berkasType.toLowerCase().includes("anime")),u.xp6(1),u.Q6J("ngIf",t.berkasType.toLowerCase().includes("dorama")),u.xp6(4),u.Q6J("ngForOf",t.getFansubControl.controls),u.xp6(5),u.Q6J("disabled",t.submitted),u.xp6(6),u.Q6J("color","accent"),u.xp6(7),u.Q6J("ngIf",t.fg.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.fg.get("name").hasError("pattern")),u.xp6(1),u.Q6J("config",t.GS.angularEditorConfig),u.xp6(1),u.Q6J("ngIf",t.attachmentFile),u.xp6(1),u.Q6J("ngIf",t.attachmentFile),u.xp6(5),u.Q6J("ngForOf",t.getDownloadUrlControl.controls),u.xp6(6),u.Q6J("disabled",t.submitted),u.xp6(9),u.Q6J("disabled",t.submitted),u.xp6(5),u.Q6J("disabled",t.submitted||t.fg.invalid||!t.fg.dirty)}}let i0=(()=>{class s{constructor(t,r,e,i,a,o,l,d,f,v,g,T,E,x){this.router=t,this.activatedRoute=r,this.fb=e,this.bs=i,this.pi=a,this.anime=o,this.dorama=l,this.project=d,this.fansub=f,this.berkas=v,this.toast=g,this.imgbb=T,this.gs=E,this.as=x,this.berkasId="",this.submitted=!1,this.projectList=[],this.uploadToast=null,this.gambar=null,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.filteredAnime=[],this.filteredDorama=[],this.filteredFansub=[],this.isLoading=!1,this.animeCheckOrAddResponse=null,this.doramaCheckOrAddResponse=null,this.attachmentFile=null,this.attachmentFontSubtitle=[],this.subsProject=null,this.subsFansub=null,this.subsAnimeDetail=null,this.subsDoramaDetail=null,this.subsProjectDetail=null,this.subsFansubDetail=[],this.subsAnimeNew=null,this.subsDoramaNew=null,this.subsImgbb=null,this.subsBerkasDetail=null,this.subsBerkasUpdate=null,this.berkasType="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get GS(){return this.gs}ngOnInit(){this.pi.updatePageMetaData("Berkas - Ubah Berkas","Halaman Pembaharuan Data Berkas","Ubah Berkas"),this.gs.isBrowser&&(this.berkasId=this.activatedRoute.snapshot.paramMap.get("berkasId"),this.bs.busy(),this.subsBerkasDetail=this.berkas.getBerkas(this.berkasId).subscribe({next:t=>{var r,e,i,a;this.gs.log("[BERKAS_DETAIL_SUCCESS]",t),this.bs.idle(),(null===(e=null===(r=this.as.currentUserSubject)||void 0===r?void 0:r.value)||void 0===e?void 0:e.id)!==t.result.user_.id&&(this.toast.warning("Berkas Ini Bukan Milikmu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)),!(null===(a=null===(i=this.as.currentUserSubject)||void 0===i?void 0:i.value)||void 0===a?void 0:a.verified)&&t.result.attachment_?(this.toast.warning("string"==typeof t.result.attachment_?t.result.attachment_:"Harap Verifikasi Akun Terlebih Dahulu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)):(this.loadProjectList(),this.initForm(t.result))},error:t=>{this.gs.log("[BERKAS_DETAIL_ERROR]",t,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/berkas/${this.berkasId}`}})}}))}ngOnDestroy(){var t,r,e,i,a,o,l,d,f,v;this.uploadToast&&this.toast.remove(this.uploadToast.toastId),null===(t=this.subsProject)||void 0===t||t.unsubscribe(),null===(r=this.subsFansub)||void 0===r||r.unsubscribe(),null===(e=this.subsAnimeDetail)||void 0===e||e.unsubscribe(),null===(i=this.subsDoramaDetail)||void 0===i||i.unsubscribe(),null===(a=this.subsProjectDetail)||void 0===a||a.unsubscribe();for(const g of this.subsFansubDetail)null==g||g.unsubscribe();null===(o=this.subsAnimeNew)||void 0===o||o.unsubscribe(),null===(l=this.subsDoramaNew)||void 0===l||l.unsubscribe(),null===(d=this.subsImgbb)||void 0===d||d.unsubscribe(),null===(f=this.subsBerkasDetail)||void 0===f||f.unsubscribe(),null===(v=this.subsBerkasUpdate)||void 0===v||v.unsubscribe()}loadProjectList(){this.bs.busy(),this.subsProject=this.project.getProject().subscribe({next:t=>{this.gs.log("[PROJECT_LOAD_SUCCESS]",t),this.projectList=t.results,this.bs.idle()},error:t=>{this.gs.log("[PROJECT_LOAD_ERROR]",t,"error"),this.bs.idle()}})}hasRequiredField(t,r){return t.get(r).hasValidator(B.kI.required)}initForm(t){var r,e,i,a;"attachment_"in t&&t.attachment_&&(this.attachmentFile=t.attachment_,t.attachment_.fonts_&&t.attachment_.fonts_.forEach(o=>{this.attachmentFontSubtitle.push(`${o.name}.${o.ext}`)}),t.attachment_.subtitles_&&t.attachment_.subtitles_.forEach(o=>{this.attachmentFontSubtitle.push(`${o.name}.${o.ext}`)})),this.fg=this.fb.group({name:[t.name,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],description:[t.description,B.kI.compose([B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],projectType_id:[t.project_type_.id,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],anime_id:[(null===(r=t.anime_)||void 0===r?void 0:r.id)||null,B.kI.compose([])],anime_name:[(null===(e=t.anime_)||void 0===e?void 0:e.name)||null,B.kI.compose([])],dorama_id:[(null===(i=t.dorama_)||void 0===i?void 0:i.id)||null,B.kI.compose([])],dorama_name:[(null===(a=t.dorama_)||void 0===a?void 0:a.name)||null,B.kI.compose([])],fansub_list:this.fb.array([]),image:[null,B.kI.compose([B.kI.pattern(te.t.regexUrl)])],download_url:this.fb.array([]),private:[t.private,B.kI.compose([B.kI.required])],r18:[t.r18,B.kI.compose([B.kI.required])]}),this.image_url=t.image_url,this.image_url_original=this.image_url,this.berkasType=t.project_type_.name,t.anime_&&(this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required])),t.dorama_&&(this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required]));for(const o of t.download_url)this.addDownloadLink(o);for(const o of t.fansub_)this.addFansub(o);this.subsAnimeDetail=this.fg.get("anime_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(o=>this.anime.searchAnime(o).pipe((0,Ho.x)(()=>this.isLoading=!1))),(0,Na.X)(-1)).subscribe({next:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_SUCCESS]",o),this.filteredAnime=o.results},error:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_ERROR]",o,"error")}}),this.subsDoramaDetail=this.fg.get("dorama_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(o=>this.dorama.searchDorama(o).pipe((0,Ho.x)(()=>this.isLoading=!1))),(0,Na.X)(-1)).subscribe({next:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_SUCCESS]",o);for(const l of o.results)l.mdl_id=l.mdl_id.split("-")[1],l.image_url=l.thumb;this.filteredDorama=o.results},error:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_ERROR]",o,"error")}}),this.subsProjectDetail=this.fg.get("projectType_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,Na.X)(-1)).subscribe({next:o=>{this.gs.log("[BERKAS_EDIT_PROJECT_CHANGED]",o);const l=this.projectList.find(d=>d.id===o);this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null),this.fg.controls.anime_id.setErrors(null),this.fg.controls.anime_name.setErrors(null),this.fg.controls.dorama_id.setErrors(null),this.fg.controls.dorama_name.setErrors(null),this.fg.controls.anime_id.clearValidators(),this.fg.controls.anime_name.clearValidators(),this.fg.controls.dorama_id.clearValidators(),this.fg.controls.dorama_name.clearValidators(),this.fg.controls.anime_id.markAsPristine(),this.fg.controls.anime_name.markAsPristine(),this.fg.controls.dorama_id.markAsPristine(),this.fg.controls.dorama_name.markAsPristine(),this.fg.controls.anime_id.markAsUntouched(),this.fg.controls.anime_name.markAsUntouched(),this.fg.controls.dorama_id.markAsUntouched(),this.fg.controls.dorama_name.markAsUntouched(),l.name.toLowerCase().includes("anime")?(this.berkasType=l.name,this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required])):l.name.toLowerCase().includes("dorama")?(this.berkasType=l.name,this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required])):this.berkasType="",this.fg.controls.anime_id.updateValueAndValidity(),this.fg.controls.anime_name.updateValueAndValidity(),this.fg.controls.dorama_id.updateValueAndValidity(),this.fg.controls.dorama_name.updateValueAndValidity()}})}get getDownloadUrlControl(){return this.fg.get("download_url")}createDownloadLink(t=null,r=null){return this.fb.group({name:[t,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],url:[r,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexUrl)])]})}addDownloadLink(t=null){this.getDownloadUrlControl.push(t?this.createDownloadLink(t.name,t.url):this.createDownloadLink())}removeDownloadLink(t){this.getDownloadUrlControl.removeAt(t)}get getFansubControl(){return this.fg.get("fansub_list")}createFansub(t=null){const r=this.fb.group({fansub_id:[(null==t?void 0:t.id)||null,B.kI.compose([B.kI.required,B.kI.pattern(/^\d+$/)])],fansub_name:[(null==t?void 0:t.name)||null,B.kI.compose([B.kI.required])]});return this.subsFansubDetail.push(r.get("fansub_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(e=>this.fansub.searchFansub(e).pipe((0,Ho.x)(()=>this.isLoading=!1))),(0,Na.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_EDIT_SEARCH_FANSUB_RESULT]",e),this.filteredFansub=e.results}})),r}removeFansub(t){var r;this.getFansubControl.removeAt(t),null===(r=this.subsFansubDetail[t])||void 0===r||r.unsubscribe(),this.subsFansubDetail.splice(t,1)}addFansub(t=null){this.getFansubControl.push(t?this.createFansub(t):this.createFansub())}resetSelectedAnime(){this.fg.controls.anime_name.patchValue(null)}resetSelectedDorama(){this.fg.controls.dorama_name.patchValue(null)}resetSelectedFansub(t){this.getFansubControl.controls[t].get("fansub_name").patchValue(null)}filterAnimeSelected(t){var r;this.gs.log("[ANIME_FILTER_CLICK]",t),this.submitted=!0,this.subsAnimeNew=this.anime.addNewAnime({id:t.id,name:t.title,image_url:t.image_url,type:null===(r=t.media_type)||void 0===r?void 0:r.toUpperCase()}).subscribe({next:e=>{this.gs.log("[ANIME_CHECK_ADD_SUCCESS]",e),this.animeCheckOrAddResponse=e.result,this.submitted=!1,this.fg.controls.anime_id.patchValue(e.result.id),this.fg.controls.anime_name.patchValue(e.result.name)},error:e=>{this.gs.log("[ANIME_CHECK_ADD_ERROR]",e,"error"),this.submitted=!1,this.resetSelectedAnime(),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null)}})}filterDoramaSelected(t){this.gs.log("[DORAMA_FILTER_CLICK]",t),this.submitted=!0,this.subsDoramaNew=this.dorama.addNewDorama({id:parseInt(t.mdl_id,10),slug:t.slug,name:t.title,image_url:t.image_url,type:t.type}).subscribe({next:r=>{this.gs.log("[DORAMA_CHECK_ADD_SUCCESS]",r),this.doramaCheckOrAddResponse=r.result,this.submitted=!1,this.fg.controls.dorama_id.patchValue(r.result.id),this.fg.controls.dorama_name.patchValue(r.result.name)},error:r=>{this.gs.log("[DORAMA_CHECK_ADD_ERROR]",r,"error"),this.submitted=!1,this.resetSelectedDorama(),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null)}})}filterFansubSelected(t,r){this.gs.log("[FANSUB_FILTER_CLICK]",t),this.getFansubControl.controls[r].get("fansub_id").patchValue(t.id),this.getFansubControl.controls[r].get("fansub_name").patchValue(t.name)}uploadImage(t,r){this.gambar=r,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const e=t.target.files[0];try{const i=new FileReader;i.readAsDataURL(e),i.onload=a=>{if(this.gs.log("[IMAGE_SELECTED]",a),e.size<=te.t.fileSizeImageLimit){const o=this.gs.document.createElement("img");o.onload=()=>{this.image=e,this.image_url=i.result.toString()},o.src=i.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=te.t.fileSizeImageLimit,this.gambar.clear(t)}}catch(i){this.image=null,this.image_url=this.image_url_original,this.gambar.clear(t)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:t=>{this.gs.log("[IMAGE_SUCCESS]",t),this.fg.controls.image.patchValue(t.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:t=>{var r;this.gs.log("[IMAGE_ERROR]",t,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=(null===(r=t.result)||void 0===r?void 0:r.message)||t.info}})}onSubmit(){this.bs.busy();const t=this.gs.getDirtyValues(this.fg);if("fansub_list"in t){const r=[];for(const e of this.fg.value.fansub_list)r.push(e.fansub_id);t.fansub_id=r,delete t.fansub_list}return null===this.attachmentFile&&0===this.fg.value.download_url.lenth?(this.submitted=!1,this.uploadToast=this.toast.warning("Lampiran DDL / URL Eksternal!","Harap Mengisi Setidaknya Salah Satu ..."),void this.bs.idle()):(this.gs.log("[BERKAS_EDIT_DIRTY]",t),this.submitted=!0,this.fg.invalid?(this.submitted=!1,void this.bs.idle()):void(this.subsBerkasUpdate=this.berkas.updateBerkas(this.berkasId,{...t}).subscribe({next:r=>{this.gs.log("[BERKAS_EDIT_SUCCESS]",r),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/berkas/${this.berkasId}`)},error:r=>{this.gs.log("[BERKAS_EDIT_ERROR]",r,"error"),this.submitted=!1,this.bs.idle()}})))}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(B.qu),u.Y36(Ne.z),u.Y36(He.Z),u.Y36(n_.o),u.Y36(a_.X),u.Y36(s_.Y),u.Y36(o_.T),u.Y36(rt.A),u.Y36(ee.k),u.Y36(u_.X),u.Y36(ke.U),u.Y36(D.e))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-edit"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],["class","col-12 p-3",4,"ngIf"],[1,"col-12","p-3"],["formControlName","r18","matTooltip","Konten Eksplisit"],["appearance","outline",1,"px-3","pt-3","col-12",3,"color"],["formControlName","projectType_id","placeholder","Anime / Drama"],[3,"value",4,"ngFor","ngForOf"],["appearance","outline","class","p-3 w-100",3,"color",4,"ngIf"],["formArrayName","fansub_list","matTooltip","Silahkan Buat Terlebih Dahulu Jika Tidak Ada"],[4,"ngFor","ngForOf"],[1,"col-12","mb-4"],[1,"col"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],[1,"me-1"],[1,"col-12","col-md-7","col-xl-8","pt-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","[Fansub] Judul Anime - 00 [BD 4K x265 FLAC][CRC32].mkv"],["formControlName","description",1,"p-3","w-100",3,"config"],["class","row",4,"ngIf"],["formArrayName","download_url"],[1,"row","mb-4"],[1,"col-12","py-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],[1,"ms-1"],["formControlName","private","matTooltip","Hanya Dapat Di Akses Melalui URL"],[3,"value"],["appearance","outline",1,"p-3","w-100",3,"color"],["matInput","","formControlName","anime_id","placeholder","Full Metal Alchemist",3,"matAutocomplete","keyup"],["autoCompleteAnime","matAutocomplete"],["class","is-loading",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"is-loading"],["mode","indeterminate"],["class","px-1",3,"value","click",4,"ngFor","ngForOf"],[1,"px-1",3,"value","click"],[1,"me-1",2,"height","40px","width","30px","object-fit","cover",3,"src"],[1,"text-warning"],["matInput","","formControlName","dorama_id","placeholder","Flying Colors",3,"matAutocomplete","keyup"],["autoCompleteDorama","matAutocomplete"],[1,"row",3,"formGroupName"],["appearance","outline",1,"px-3","pt-3","w-100",3,"color"],["matInput","","formControlName","fansub_id","placeholder","NamaFansub",3,"matAutocomplete","keyup"],["matSuffix","",4,"ngIf"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click",4,"ngIf"],["autoCompleteFansub","matAutocomplete"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click"],[1,"me-1",2,"height","40px","width","40px","object-fit","cover",3,"src"],["mat-subheader","",1,"text-warning"],["mat-list-icon",""],["mat-line",""],["class","p-3 m-0",4,"ngIf"],[1,"p-3","m-0"],["matTooltip","Silahkan Isi Alamat Website Kamu Jika Ingin Mendapatkan Traffic Pengunjung",1,"row",3,"formGroupName"],["class","col-12 px-3",4,"ngIf"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","name","placeholder","Web Shit","required",""],["appearance","outline",1,"px-3","pt-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","url","placeholder","https://drive.google.com/drive/u/2/folders/1KYTJZsmH9dyyHBXnQD4N0SjSBXcs8qD-","required",""],[1,"col-12","px-3"],[1,"text-success"]],template:function(t,r){1&t&&(u._UZ(0,"app-notifications"),u.TgZ(1,"div",0)(2,"div",1)(3,"div",2),u.YNc(4,t0,92,27,"form",3),u.qZA()()()),2&t&&(u.xp6(4),u.Q6J("ngIf",r.fg))},directives:[J.t,Q.O5,B._Y,B.JL,B.sg,qe.KE,qe.hX,ve.Yh,De.Hw,qe.R9,qe.TO,X.lW,hc.Rr,B.JJ,B.u,oe.gM,We.gD,Q.sg,Me.ey,l_.Nt,B.Fj,pc.ZL,pc.XC,Ze.pW,d_.d,B.CE,B.x0,Ae.s6,re.i$,re.gs,re.Tg,re.Nh,Me.X2,B.Q7,X.zs,_e.yS],pipes:[fc.$],styles:[""]}),s})();var r0=j(8757);function n0(s,n){1&s&&(u.TgZ(0,"div",10),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Seluruh Pengguna Tidak Di Tampilkan "),u.qZA())}function a0(s,n){1&s&&(u.TgZ(0,"div",10),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Pengguna "),u.TgZ(5,"i"),u._uU(6,"Private"),u.qZA(),u._uU(7," Tidak Di Tampilkan "),u.qZA())}function s0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",1)(1,"div",2)(2,"div",3),u.YNc(3,n0,5,0,"div",4),u.YNc(4,a0,8,0,"div",4),u.TgZ(5,"div",5),u._uU(6," * Berkas Dari Anggota Fansub => Warna - Warni "),u.qZA()()(),u.TgZ(7,"div",2)(8,"div",6)(9,"mat-slide-toggle",7),u.NdJ("ngModelChange",function(e){return u.CHM(t),u.oxw().r18=e})("change",function(){return u.CHM(t),u.oxw().getBerkas()}),u._uU(10," Tampilkan R-18+ "),u.qZA()()(),u.TgZ(11,"div",8)(12,"app-material-tab",9),u.NdJ("tableRowClicked",function(e){return u.CHM(t),u.oxw().openBerkas(e)})("paginatorClicked",function(e){return u.CHM(t),u.oxw().onPaginatorClicked(e)})("serverSideFilter",function(e){return u.CHM(t),u.oxw().onServerSideFilter(e)})("serverSideOrder",function(e){return u.CHM(t),u.oxw().onServerSideOrder(e)}),u.qZA()()()}if(2&s){const t=u.oxw();u.xp6(3),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&null!=t.AS.currentUserSubject.value&&t.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified)&&!t.showTruelyPrivate),u.xp6(5),u.Q6J("ngModel",t.r18),u.xp6(3),u.Q6J("tablePageSizeOptions",t.tablePageSizeOptions)("tabData",t.tabData)("count",t.count)("serverSide",!0)}}let o0=(()=>{class s{constructor(t,r,e,i,a,o){this.router=t,this.gs=r,this.bs=e,this.berkas=i,this.fs=a,this.as=o,this.allBerkasId=[],this.berkasData=[],this.tabData=[{name:"Berkas Terkini",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Kunjungan","Pemilik"],row:[]}}],this.count=0,this.page=1,this.row=50,this.tablePageSizeOptions=[50,75,100,125,150],this.q="",this.sort="",this.order="",this.subsBerkas=null,this.subsTrusted=null,this.r18=!1,this.gs.bannerImg="/assets/img/banner/berkas.jpg",this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get showTruelyPrivate(){var t,r,e,i,a,o;return(null===(r=null===(t=this.as.currentUserSubject)||void 0===t?void 0:t.value)||void 0===r?void 0:r.role)===Ce.yS.ADMIN||(null===(i=null===(e=this.as.currentUserSubject)||void 0===e?void 0:e.value)||void 0===i?void 0:i.role)===Ce.yS.MODERATOR||(null===(o=null===(a=this.as.currentUserSubject)||void 0===a?void 0:a.value)||void 0===o?void 0:o.role)===Ce.yS.FANSUBBER}ngOnDestroy(){var t,r;null===(t=this.subsBerkas)||void 0===t||t.unsubscribe(),null===(r=this.subsTrusted)||void 0===r||r.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.gs.isDesktop||(this.tablePageSizeOptions=[10,25,50,75,100]),this.row=this.tablePageSizeOptions[0],this.getBerkas())}getBerkas(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.berkas.getAllBerkas(this.q,this.page,this.row,this.sort,this.order,this.r18).subscribe({next:t=>{this.gs.log("[BERKAS_LIST_SUCCESS]",t),this.count=t.count,this.berkasData=[];for(const r of t.results)this.allBerkasId.push(r.id),this.berkasData.push({id:r.id,private:r.private,foto:r.user_.image_url,Proyek:r.project_type_.name,Tanggal:r.created_at,Kunjungan:r.view_count,Pemilik:r.user_.username,"Nama Berkas":r.name});this.tabData[0].data.row=this.berkasData,this.allBerkasId.length>0&&this.checkTrusted(),this.fs.initializeFab("add",null,"Tambah Berkas Baru","/create/berkas",!1),this.bs.idle()},error:t=>{this.gs.log("[BERKAS_LIST_ERROR]",t,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasId).subscribe({next:t=>{this.gs.log("[BERKAS_TRUSTED_SUCCESS]",t);for(const r of this.berkasData)r.trusted=t.results[r.id];this.bs.idle()},error:t=>{this.gs.log("[BERKAS_TRUSTED_ERROR]",t,"error"),this.bs.idle()}})}openBerkas(t){this.gs.log("[BERKAS_LIST_CLICK_BERKAS]",t),this.router.navigateByUrl(`/berkas/${t.id}`)}onPaginatorClicked(t){this.gs.log("[BERKAS_LIST_CLICK_PAGINATOR]",t),this.page=t.pageIndex+1,this.row=t.pageSize,this.getBerkas()}onServerSideFilter(t){this.gs.log("[BERKAS_LIST_ENTER_FILTER]",t),this.q=t,this.getBerkas()}onServerSideOrder(t){this.gs.log("[BERKAS_LIST_CLICK_ORDER]",t),this.q=t.q,this.sort=t.active,this.order=t.direction,this.getBerkas()}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(_e.F0),u.Y36(ke.U),u.Y36(Ne.z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-list"]],decls:2,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","my-4"],[1,"col-12"],["class","text-danger text-end",4,"ngIf"],[1,"text-success","text-end"],[1,"col-12","text-end","text-warning"],["labelPosition","before",3,"ngModel","ngModelChange","change"],[1,"row"],[3,"tablePageSizeOptions","tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"text-danger","text-end"]],template:function(t,r){1&t&&(u._UZ(0,"app-notifications"),u.YNc(1,s0,13,7,"div",0)),2&t&&(u.xp6(1),u.Q6J("ngIf",r.berkasData))},directives:[J.t,Q.O5,hc.Rr,B.JJ,B.On,r0.H],styles:[""]}),s})();var u0=j(2438);const l0=[{path:"",pathMatch:"full",component:o0},{path:":berkasId",children:[{path:"",pathMatch:"full",component:r_},{path:"edit",component:i0,canActivate:[yt.t],data:{title:"Berkas - Ubah Data",description:"Halaman Pembaharuan Data Fansub",keywords:"Ubah Berkas",[te.t.decoratorRoles]:[Ce.yS.ADMIN,Ce.yS.MODERATOR,Ce.yS.FANSUBBER,Ce.yS.USER]}}]}];let d0=(()=>{class s{}return s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=u.oAB({type:s}),s.\u0275inj=u.cJS({imports:[[Q.ez,_e.Bz.forChild(l0),Ee.m,Te.L,B.u5,B.UX,ve.Ad,pe.F,Ae.UM,se,Ue.R,Ve.b,it.T,u0.d]]}),s})()},3992:(je,we,j)=>{"use strict";var Q=j(9226);je.exports=function(ve,te){return void 0===te&&(te=!1),function(Ce,Ee,Te){if(Ce)ve(Ce);else if(Ee.statusCode>=400&&Ee.statusCode<=599){var pe=Te;if(te)if(Q.TextDecoder){var u=function B(Ae){return void 0===Ae&&(Ae=""),Ae.toLowerCase().split(";").reduce(function(ve,te){var Ce=te.split("="),Te=Ce[1];return"charset"===Ce[0].trim()?Te.trim():ve},"utf-8")}(Ee.headers&&Ee.headers["content-type"]);try{pe=new TextDecoder(u).decode(Te)}catch(se){}}else pe=String.fromCharCode.apply(null,new Uint8Array(Te));ve({cause:pe})}else ve(null,Te)}}},745:(je,we,j)=>{"use strict";var Q=j(9226),_e=j(7154),B=j(2703);function Ce(se,Ue,Ve){var it=se;return B(Ue)?(Ve=Ue,"string"==typeof se&&(it={uri:se})):it=_e({},Ue,{uri:se}),it.callback=Ve,it}function Ee(se,Ue,Ve){return Te(Ue=Ce(se,Ue,Ve))}function Te(se){if(void 0===se.callback)throw new Error("callback argument missing");var Ue=!1,Ve=function(de,le,xe){Ue||(Ue=!0,se.callback(de,le,xe))};function yt(){var Y=void 0;if(Y=me.response?me.response:me.responseText||function pe(se){try{if("document"===se.responseType)return se.responseXML;if(""===se.responseType&&(!se.responseXML||"parsererror"!==se.responseXML.documentElement.nodeName))return se.responseXML}catch(Ve){}return null}(me),D)try{Y=JSON.parse(Y)}catch(de){}return Y}function ue(Y){return clearTimeout(V),Y instanceof Error||(Y=new Error(""+(Y||"Unknown XMLHttpRequest Error"))),Y.statusCode=0,Ve(Y,ee)}function Oe(){if(!Ge){var Y;clearTimeout(V);var de=ee,le=null;return 0!==(Y=se.useXDR&&void 0===me.status?200:1223===me.status?204:me.status)?(de={body:yt(),statusCode:Y,method:Ne,headers:{},url:ke,rawRequest:me},me.getAllResponseHeaders&&(de.headers=function(Ue){var Ve={};return Ue&&Ue.trim().split("\n").forEach(function(it){var yt=it.indexOf(":"),ue=it.slice(0,yt).trim().toLowerCase(),Oe=it.slice(yt+1).trim();void 0===Ve[ue]?Ve[ue]=Oe:Array.isArray(Ve[ue])?Ve[ue].push(Oe):Ve[ue]=[Ve[ue],Oe]}),Ve}(me.getAllResponseHeaders()))):le=new Error("Internal XMLHttpRequest Error"),Ve(le,de,de.body)}}var me=se.xhr||null;me||(me=se.cors||se.useXDR?new Ee.XDomainRequest:new Ee.XMLHttpRequest);var Le,Ge,V,ke=me.url=se.uri||se.url,Ne=me.method=se.method||"GET",He=se.body||se.data,rt=me.headers=se.headers||{},w=!!se.sync,D=!1,ee={body:void 0,headers:{},statusCode:0,method:Ne,url:ke,rawRequest:me};if("json"in se&&!1!==se.json&&(D=!0,rt.accept||rt.Accept||(rt.Accept="application/json"),"GET"!==Ne&&"HEAD"!==Ne&&(rt["content-type"]||rt["Content-Type"]||(rt["Content-Type"]="application/json"),He=JSON.stringify(!0===se.json?He:se.json))),me.onreadystatechange=function it(){4===me.readyState&&setTimeout(Oe,0)},me.onload=Oe,me.onerror=ue,me.onprogress=function(){},me.onabort=function(){Ge=!0},me.ontimeout=ue,me.open(Ne,ke,!w,se.username,se.password),w||(me.withCredentials=!!se.withCredentials),!w&&se.timeout>0&&(V=setTimeout(function(){if(!Ge){Ge=!0,me.abort("timeout");var Y=new Error("XMLHttpRequest timeout");Y.code="ETIMEDOUT",ue(Y)}},se.timeout)),me.setRequestHeader)for(Le in rt)rt.hasOwnProperty(Le)&&me.setRequestHeader(Le,rt[Le]);else if(se.headers&&!function te(se){for(var Ue in se)if(se.hasOwnProperty(Ue))return!1;return!0}(se.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in se&&(me.responseType=se.responseType),"beforeSend"in se&&"function"==typeof se.beforeSend&&se.beforeSend(me),me.send(He||null),me}Ee.httpHandler=j(3992),je.exports=Ee,je.exports.default=Ee,Ee.XMLHttpRequest=Q.XMLHttpRequest||function u(){},Ee.XDomainRequest="withCredentials"in new Ee.XMLHttpRequest?Ee.XMLHttpRequest:Q.XDomainRequest,function ve(se,Ue){for(var Ve=0;Ve{"use strict";function j(B,Ae){return void 0===Ae&&(Ae=Object),Ae&&"function"==typeof Ae.freeze?Ae.freeze(B):B}var Q=j({HTML:"text/html",isHTML:function(B){return B===Q.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_e=j({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(B){return B===_e.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});we.freeze=j,we.MIME_TYPE=Q,we.NAMESPACE=_e},1991:(je,we,j)=>{var _e=j(9401),B=j(6853),Ae=j(4436),ve=j(8702),te=B.DOMImplementation,Ce=_e.NAMESPACE,Ee=ve.ParseError,Te=ve.XMLReader;function pe(ue){this.options=ue||{locator:{}}}function se(){this.cdata=!1}function Ue(ue,Oe){Oe.lineNumber=ue.lineNumber,Oe.columnNumber=ue.columnNumber}function Ve(ue){if(ue)return"\n@"+(ue.systemId||"")+"#[line:"+ue.lineNumber+",col:"+ue.columnNumber+"]"}function it(ue,Oe,me){return"string"==typeof ue?ue.substr(Oe,me):ue.length>=Oe+me||Oe?new java.lang.String(ue,Oe,me)+"":ue}function yt(ue,Oe){ue.currentElement?ue.currentElement.appendChild(Oe):ue.doc.appendChild(Oe)}pe.prototype.parseFromString=function(ue,Oe){var me=this.options,Le=new Te,Ge=me.domBuilder||new se,ke=me.errorHandler,Ne=me.locator,He=me.xmlns||{},rt=/\/x?html?$/.test(Oe),w=rt?Ae.HTML_ENTITIES:Ae.XML_ENTITIES;return Ne&&Ge.setDocumentLocator(Ne),Le.errorHandler=function u(ue,Oe,me){if(!ue){if(Oe instanceof se)return Oe;ue=Oe}var Le={},Ge=ue instanceof Function;function ke(Ne){var He=ue[Ne];!He&&Ge&&(He=2==ue.length?function(rt){ue(Ne,rt)}:ue),Le[Ne]=He&&function(rt){He("[xmldom "+Ne+"]\t"+rt+Ve(me))}||function(){}}return me=me||{},ke("warning"),ke("error"),ke("fatalError"),Le}(ke,Ge,Ne),Le.domBuilder=me.domBuilder||Ge,rt&&(He[""]=Ce.HTML),He.xml=He.xml||Ce.XML,ue&&"string"==typeof ue?Le.parse(ue,He,w):Le.errorHandler.error("invalid doc source"),Ge.doc},se.prototype={startDocument:function(){this.doc=(new te).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(ue,Oe,me,Le){var Ge=this.doc,ke=Ge.createElementNS(ue,me||Oe),Ne=Le.length;yt(this,ke),this.currentElement=ke,this.locator&&Ue(this.locator,ke);for(var He=0;He{var _e=j(9401).NAMESPACE;function B(C){return""!==C}function ve(C,A){return C.hasOwnProperty(A)||(C[A]=!0),C}function te(C){if(!C)return[];var A=function Ae(C){return C?C.split(/[\t\n\f\r ]+/).filter(B):[]}(C);return Object.keys(A.reduce(ve,{}))}function Ee(C,A){for(var R in C)A[R]=C[R]}function Te(C,A){var R=C.prototype;if(!(R instanceof A)){let ce=function(){};ce.prototype=A.prototype,ce=new ce,Ee(R,ce),C.prototype=R=ce}R.constructor!=C&&("function"!=typeof C&&console.error("unknown Class:"+C),R.constructor=C)}var pe={},u=pe.ELEMENT_NODE=1,se=pe.ATTRIBUTE_NODE=2,Ue=pe.TEXT_NODE=3,Ve=pe.CDATA_SECTION_NODE=4,it=pe.ENTITY_REFERENCE_NODE=5,yt=pe.ENTITY_NODE=6,ue=pe.PROCESSING_INSTRUCTION_NODE=7,Oe=pe.COMMENT_NODE=8,me=pe.DOCUMENT_NODE=9,Le=pe.DOCUMENT_TYPE_NODE=10,Ge=pe.DOCUMENT_FRAGMENT_NODE=11,ke=pe.NOTATION_NODE=12,Ne={},He={},D=(Ne.INDEX_SIZE_ERR=(He[1]="Index size error",1),Ne.DOMSTRING_SIZE_ERR=(He[2]="DOMString size error",2),Ne.HIERARCHY_REQUEST_ERR=(He[3]="Hierarchy request error",3)),le=(Ne.WRONG_DOCUMENT_ERR=(He[4]="Wrong document",4),Ne.INVALID_CHARACTER_ERR=(He[5]="Invalid character",5),Ne.NO_DATA_ALLOWED_ERR=(He[6]="No data allowed",6),Ne.NO_MODIFICATION_ALLOWED_ERR=(He[7]="No modification allowed",7),Ne.NOT_FOUND_ERR=(He[8]="Not found",8)),J=(Ne.NOT_SUPPORTED_ERR=(He[9]="Not supported",9),Ne.INUSE_ATTRIBUTE_ERR=(He[10]="Attribute in use",10));function qe(C,A){if(A instanceof Error)var R=A;else R=this,Error.call(this,He[C]),this.message=He[C],Error.captureStackTrace&&Error.captureStackTrace(this,qe);return R.code=C,A&&(this.message=this.message+": "+A),R}function We(){}function Me(C,A){this._node=C,this._refresh=A,Pt(this)}function Pt(C){var A=C._node._inc||C._node.ownerDocument._inc;if(C._inc!=A){var R=C._refresh(C._node);Ar(C,"length",R.length),Ee(R,C),C._inc=A}}function P(){}function St(C,A){for(var R=C.length;R--;)if(C[R]===A)return R}function K(C,A,R,Z){if(Z?A[St(A,Z)]=R:A[A.length++]=R,C){R.ownerElement=C;var ce=C.ownerDocument;ce&&(Z&&$i(ce,C,Z),function Ct(C,A,R){C&&C._inc++,R.namespaceURI===_e.XMLNS&&(A._nsMap[R.prefix?R.localName:""]=R.value)}(ce,C,R))}}function gt(C,A,R){var Z=St(A,R);if(!(Z>=0))throw qe(le,new Error(C.tagName+"@"+R));for(var ce=A.length-1;Z"==C&&">")||"&"==C&&"&"||'"'==C&&"""||"&#"+C.charCodeAt()+";"}function lt(C,A){if(A(C))return!0;if(C=C.firstChild)do{if(lt(C,A))return!0}while(C=C.nextSibling)}function ie(){}function $i(C,A,R,Z){C&&C._inc++,R.namespaceURI===_e.XMLNS&&delete A._nsMap[R.prefix?R.localName:""]}function Yi(C,A,R){if(C&&C._inc){C._inc++;var Z=A.childNodes;if(R)Z[Z.length++]=R;else{for(var ce=A.firstChild,Ke=0;ce;)Z[Ke++]=ce,ce=ce.nextSibling;Z.length=Ke}}}function ki(C,A){var R=A.previousSibling,Z=A.nextSibling;return R?R.nextSibling=Z:C.firstChild=Z,Z?Z.previousSibling=R:C.lastChild=R,Yi(C.ownerDocument,C),A}function Xi(C,A,R){var Z=A.parentNode;if(Z&&Z.removeChild(A),A.nodeType===Ge){var ce=A.firstChild;if(null==ce)return A;var Ke=A.lastChild}else ce=Ke=A;var Qe=R?R.previousSibling:C.lastChild;ce.previousSibling=Qe,Ke.nextSibling=R,Qe?Qe.nextSibling=ce:C.firstChild=ce,null==R?C.lastChild=Ke:R.previousSibling=Ke;do{ce.parentNode=C}while(ce!==Ke&&(ce=ce.nextSibling));return Yi(C.ownerDocument||C,C),A.nodeType==Ge&&(A.firstChild=A.lastChild=null),A}function vt(){this._nsMap={}}function oi(){}function Qi(){}function rn(){}function xr(){}function Sr(){}function Er(){}function Ji(){}function Cr(){}function nn(){}function er(){}function an(){}function Bn(){}function kr(C,A){var R=[],Z=9==this.nodeType&&this.documentElement||this,ce=Z.prefix,Ke=Z.namespaceURI;if(Ke&&null==ce&&null==(ce=Z.lookupPrefix(Ke)))var Qe=[{namespace:Ke,prefix:null}];return Vi(this,R,C,A,Qe),R.join("")}function Hn(C,A,R){var Z=C.prefix||"",ce=C.namespaceURI;if(!ce||"xml"===Z&&ce===_e.XML||ce===_e.XMLNS)return!1;for(var Ke=R.length;Ke--;){var Qe=R[Ke];if(Qe.prefix===Z)return Qe.namespace!==ce}return!0}function Ut(C,A,R){C.push(" ",A,'="',R.replace(/[<&"]/g,Fe),'"')}function Vi(C,A,R,Z,ce){if(ce||(ce=[]),Z){if(!(C=Z(C)))return;if("string"==typeof C)return void A.push(C)}switch(C.nodeType){case u:var Ke=C.attributes,Qe=Ke.length,At=C.firstChild,ui=C.tagName,tr=ui;if(!(R=_e.isHTML(C.namespaceURI)||R)&&!C.prefix&&C.namespaceURI){for(var li,di=0;di=0;Yt--)if(""===(ii=ce[Yt]).prefix&&ii.namespace===C.namespaceURI){li=ii.namespace;break}if(li!==C.namespaceURI)for(Yt=ce.length-1;Yt>=0;Yt--){var ii;if((ii=ce[Yt]).namespace===C.namespaceURI){ii.prefix&&(tr=ii.prefix+":"+ui);break}}}A.push("<",tr);for(var ci=0;ci"),R&&/^script$/i.test(ui))for(;At;)At.data?A.push(At.data):Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;else for(;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;A.push("")}else A.push("/>");return;case me:case Ge:for(At=C.firstChild;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;return;case se:return Ut(A,C.name,C.value);case Ue:return A.push(C.data.replace(/[<&]/g,Fe).replace(/]]>/g,"]]>"));case Ve:return A.push("");case Oe:return A.push("\x3c!--",C.data,"--\x3e");case Le:var sn=C.publicId,qi=C.systemId;if(A.push("");else if(qi&&"."!=qi)A.push(" SYSTEM ",qi,">");else{var Vn=C.internalSubset;Vn&&A.push(" [",Vn,"]"),A.push(">")}return;case ue:return A.push("");case it:return A.push("&",C.nodeName,";");default:A.push("??",C.nodeName)}}function jn(C,A,R){var Z;switch(A.nodeType){case u:(Z=A.cloneNode(!1)).ownerDocument=C;case Ge:break;case se:R=!0}if(Z||(Z=A.cloneNode(!1)),Z.ownerDocument=C,Z.parentNode=null,R)for(var ce=A.firstChild;ce;)Z.appendChild(jn(C,ce,R)),ce=ce.nextSibling;return Z}function _i(C,A,R){var Z=new A.constructor;for(var ce in A){var Ke=A[ce];"object"!=typeof Ke&&Ke!=Z[ce]&&(Z[ce]=Ke)}switch(A.childNodes&&(Z.childNodes=new We),Z.ownerDocument=C,Z.nodeType){case u:var Qe=A.attributes,ui=Z.attributes=new P,tr=Qe.length;ui._ownerElement=Z;for(var li=0;li0},lookupPrefix:function(C){for(var A=this;A;){var R=A._nsMap;if(R)for(var Z in R)if(R[Z]==C)return Z;A=A.nodeType==se?A.ownerDocument:A.parentNode}return null},lookupNamespaceURI:function(C){for(var A=this;A;){var R=A._nsMap;if(R&&C in R)return R[C];A=A.nodeType==se?A.ownerDocument:A.parentNode}return null},isDefaultNamespace:function(C){return null==this.lookupPrefix(C)}},Ee(pe,Ie),Ee(pe,Ie.prototype),ie.prototype={nodeName:"#document",nodeType:me,doctype:null,documentElement:null,_inc:1,insertBefore:function(C,A){if(C.nodeType==Ge){for(var R=C.firstChild;R;){var Z=R.nextSibling;this.insertBefore(R,A),R=Z}return C}return null==this.documentElement&&C.nodeType==u&&(this.documentElement=C),Xi(this,C,A),C.ownerDocument=this,C},removeChild:function(C){return this.documentElement==C&&(this.documentElement=null),ki(this,C)},importNode:function(C,A){return jn(this,C,A)},getElementById:function(C){var A=null;return lt(this.documentElement,function(R){if(R.nodeType==u&&R.getAttribute("id")==C)return A=R,!0}),A},getElementsByClassName:function(C){var A=te(C);return new Me(this,function(R){var Z=[];return A.length>0&<(R.documentElement,function(ce){if(ce!==R&&ce.nodeType===u){var Ke=ce.getAttribute("class");if(Ke){var Qe=C===Ke;if(!Qe){var ui=te(Ke);Qe=A.every(function Ce(C){return function(A){return C&&-1!==C.indexOf(A)}}(ui))}Qe&&Z.push(ce)}}}),Z})},createElement:function(C){var A=new vt;return A.ownerDocument=this,A.nodeName=C,A.tagName=C,A.localName=C,A.childNodes=new We,(A.attributes=new P)._ownerElement=A,A},createDocumentFragment:function(){var C=new er;return C.ownerDocument=this,C.childNodes=new We,C},createTextNode:function(C){var A=new rn;return A.ownerDocument=this,A.appendData(C),A},createComment:function(C){var A=new xr;return A.ownerDocument=this,A.appendData(C),A},createCDATASection:function(C){var A=new Sr;return A.ownerDocument=this,A.appendData(C),A},createProcessingInstruction:function(C,A){var R=new an;return R.ownerDocument=this,R.tagName=R.target=C,R.nodeValue=R.data=A,R},createAttribute:function(C){var A=new oi;return A.ownerDocument=this,A.name=C,A.nodeName=C,A.localName=C,A.specified=!0,A},createEntityReference:function(C){var A=new nn;return A.ownerDocument=this,A.nodeName=C,A},createElementNS:function(C,A){var R=new vt,Z=A.split(":"),ce=R.attributes=new P;return R.childNodes=new We,R.ownerDocument=this,R.nodeName=A,R.tagName=A,R.namespaceURI=C,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,ce._ownerElement=R,R},createAttributeNS:function(C,A){var R=new oi,Z=A.split(":");return R.ownerDocument=this,R.nodeName=A,R.name=A,R.namespaceURI=C,R.specified=!0,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,R}},Te(ie,Ie),ie.prototype.getElementsByTagName=(vt.prototype={nodeType:u,hasAttribute:function(C){return null!=this.getAttributeNode(C)},getAttribute:function(C){var A=this.getAttributeNode(C);return A&&A.value||""},getAttributeNode:function(C){return this.attributes.getNamedItem(C)},setAttribute:function(C,A){var R=this.ownerDocument.createAttribute(C);R.value=R.nodeValue=""+A,this.setAttributeNode(R)},removeAttribute:function(C){var A=this.getAttributeNode(C);A&&this.removeAttributeNode(A)},appendChild:function(C){return C.nodeType===Ge?this.insertBefore(C,null):function nt(C,A){var R=A.parentNode;if(R){var Z=C.lastChild;R.removeChild(A),Z=C.lastChild}return Z=C.lastChild,A.parentNode=C,A.previousSibling=Z,A.nextSibling=null,Z?Z.nextSibling=A:C.firstChild=A,C.lastChild=A,Yi(C.ownerDocument,C,A),A}(this,C)},setAttributeNode:function(C){return this.attributes.setNamedItem(C)},setAttributeNodeNS:function(C){return this.attributes.setNamedItemNS(C)},removeAttributeNode:function(C){return this.attributes.removeNamedItem(C.nodeName)},removeAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);R&&this.removeAttributeNode(R)},hasAttributeNS:function(C,A){return null!=this.getAttributeNodeNS(C,A)},getAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);return R&&R.value||""},setAttributeNS:function(C,A,R){var Z=this.ownerDocument.createAttributeNS(C,A);Z.value=Z.nodeValue=""+R,this.setAttributeNode(Z)},getAttributeNodeNS:function(C,A){return this.attributes.getNamedItemNS(C,A)},getElementsByTagName:function(C){return new Me(this,function(A){var R=[];return lt(A,function(Z){Z!==A&&Z.nodeType==u&&("*"===C||Z.tagName==C)&&R.push(Z)}),R})},getElementsByTagNameNS:function(C,A){return new Me(this,function(R){var Z=[];return lt(R,function(ce){ce!==R&&ce.nodeType===u&&("*"===C||ce.namespaceURI===C)&&("*"===A||ce.localName==A)&&Z.push(ce)}),Z})}}).getElementsByTagName,ie.prototype.getElementsByTagNameNS=vt.prototype.getElementsByTagNameNS,Te(vt,Ie),oi.prototype.nodeType=se,Te(oi,Ie),Qi.prototype={data:"",substringData:function(C,A){return this.data.substring(C,C+A)},appendData:function(C){this.nodeValue=this.data=C=this.data+C,this.length=C.length},insertData:function(C,A){this.replaceData(C,0,A)},appendChild:function(C){throw new Error(He[D])},deleteData:function(C,A){this.replaceData(C,A,"")},replaceData:function(C,A,R){var Z=this.data.substring(0,C),ce=this.data.substring(C+A);this.nodeValue=this.data=R=Z+R+ce,this.length=R.length}},Te(Qi,Ie),rn.prototype={nodeName:"#text",nodeType:Ue,splitText:function(C){var A=this.data,R=A.substring(C);A=A.substring(0,C),this.data=this.nodeValue=A,this.length=A.length;var Z=this.ownerDocument.createTextNode(R);return this.parentNode&&this.parentNode.insertBefore(Z,this.nextSibling),Z}},Te(rn,Qi),xr.prototype={nodeName:"#comment",nodeType:Oe},Te(xr,Qi),Sr.prototype={nodeName:"#cdata-section",nodeType:Ve},Te(Sr,Qi),Er.prototype.nodeType=Le,Te(Er,Ie),Ji.prototype.nodeType=ke,Te(Ji,Ie),Cr.prototype.nodeType=yt,Te(Cr,Ie),nn.prototype.nodeType=it,Te(nn,Ie),er.prototype.nodeName="#document-fragment",er.prototype.nodeType=Ge,Te(er,Ie),an.prototype.nodeType=ue,Te(an,Ie),Bn.prototype.serializeToString=function(C,A,R){return kr.call(C,A,R)},Ie.prototype.toString=kr;try{if(Object.defineProperty){let C=function(A){switch(A.nodeType){case u:case Ge:var R=[];for(A=A.firstChild;A;)7!==A.nodeType&&8!==A.nodeType&&R.push(C(A)),A=A.nextSibling;return R.join("");default:return A.nodeValue}};Object.defineProperty(Me.prototype,"length",{get:function(){return Pt(this),this.$$length}}),Object.defineProperty(Ie.prototype,"textContent",{get:function(){return C(this)},set:function(A){switch(this.nodeType){case u:case Ge:for(;this.firstChild;)this.removeChild(this.firstChild);(A||String(A))&&this.appendChild(this.ownerDocument.createTextNode(A));break;default:this.data=A,this.value=A,this.nodeValue=A}}}),Ar=function(A,R,Z){A["$$"+R]=Z}}}catch(C){}we.DocumentType=Er,we.DOMException=qe,we.DOMImplementation=vi,we.Element=vt,we.Node=Ie,we.NodeList=We,we.XMLSerializer=Bn},4436:(je,we,j)=>{var Q=j(9401).freeze;we.XML_ENTITIES=Q({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),we.HTML_ENTITIES=Q({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),we.entityMap=we.HTML_ENTITIES},978:(je,we,j)=>{j(6853);we.DOMParser=j(1991).DOMParser},8702:(je,we,j)=>{var Q=j(9401).NAMESPACE,_e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,B=new RegExp("[\\-\\.0-9"+_e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Ae=new RegExp("^"+_e.source+B.source+"*(?::"+_e.source+B.source+"*)?$");function Ue(w,D){this.message=w,this.locator=D,Error.captureStackTrace&&Error.captureStackTrace(this,Ue)}function Ve(){}function yt(w,D){return D.lineNumber=w.lineNumber,D.columnNumber=w.columnNumber,D}function ue(w,D,V,ee,Y,de){function le(Ze,qe,We){V.attributeNames.hasOwnProperty(Ze)&&de.fatalError("Attribute "+Ze+" redefined"),V.addValue(Ze,qe,We)}for(var xe,re=++D,X=0;;){var oe=w.charAt(re);switch(oe){case"=":if(1===X)xe=w.slice(D,re),X=3;else{if(2!==X)throw new Error("attribute equal must after attrName");X=3}break;case"'":case'"':if(3===X||1===X){if(1===X&&(de.warning('attribute value must after "="'),xe=w.slice(D,re)),!((re=w.indexOf(oe,D=re+1))>0))throw new Error("attribute value no end '"+oe+"' match");le(xe,J=w.slice(D,re).replace(/&#?\w+;/g,Y),D-1),X=5}else{if(4!=X)throw new Error('attribute value must after "="');le(xe,J=w.slice(D,re).replace(/&#?\w+;/g,Y),D),de.warning('attribute "'+xe+'" missed start quot('+oe+")!!"),D=re+1,X=5}break;case"/":switch(X){case 0:V.setTagName(w.slice(D,re));case 5:case 6:case 7:X=7,V.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return de.error("unexpected end of input"),0==X&&V.setTagName(w.slice(D,re)),re;case">":switch(X){case 0:V.setTagName(w.slice(D,re));case 5:case 6:case 7:break;case 4:case 1:"/"===(J=w.slice(D,re)).slice(-1)&&(V.closed=!0,J=J.slice(0,-1));case 2:2===X&&(J=xe),4==X?(de.warning('attribute "'+J+'" missed quot(")!'),le(xe,J.replace(/&#?\w+;/g,Y),D)):((!Q.isHTML(ee[""])||!J.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+J+'" missed value!! "'+J+'" instead!!'),le(J,J,D));break;case 3:throw new Error("attribute value missed!!")}return re;case"\x80":oe=" ";default:if(oe<=" ")switch(X){case 0:V.setTagName(w.slice(D,re)),X=6;break;case 1:xe=w.slice(D,re),X=2;break;case 4:var J=w.slice(D,re).replace(/&#?\w+;/g,Y);de.warning('attribute "'+J+'" missed quot(")!!'),le(xe,J,D);case 5:X=6}else switch(X){case 2:(!Q.isHTML(ee[""])||!xe.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+xe+'" missed value!! "'+xe+'" instead2!!'),le(xe,xe,D),D=re,X=1;break;case 5:de.warning('attribute space is required"'+xe+'"!!');case 6:X=1,D=re;break;case 3:X=4,D=re;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}re++}}function Oe(w,D,V){for(var ee=w.tagName,Y=null,oe=w.length;oe--;){var de=w[oe],le=de.qName,xe=de.value;if((De=le.indexOf(":"))>0)var J=de.prefix=le.slice(0,De),re=le.slice(De+1),X="xmlns"===J&&re;else re=le,J=null,X="xmlns"===le&&"";de.localName=re,!1!==X&&(null==Y&&(Y={},Ge(V,V={})),V[X]=Y[X]=xe,de.uri=Q.XMLNS,D.startPrefixMapping(X,xe))}for(oe=w.length;oe--;)(J=(de=w[oe]).prefix)&&("xml"===J&&(de.uri=Q.XML),"xmlns"!==J&&(de.uri=V[J||""]));var De;(De=ee.indexOf(":"))>0?(J=w.prefix=ee.slice(0,De),re=w.localName=ee.slice(De+1)):(J=null,re=w.localName=ee);var Ze=w.uri=V[J||""];if(D.startElement(Ze,re,ee,w),!w.closed)return w.currentNSMap=V,w.localNSMap=Y,!0;if(D.endElement(Ze,re,ee),Y)for(J in Y)D.endPrefixMapping(J)}function me(w,D,V,ee,Y){if(/^(?:script|textarea)$/i.test(V)){var de=w.indexOf("",D),le=w.substring(D+1,de);if(/[&<]/.test(le))return/^script$/i.test(V)?(Y.characters(le,0,le.length),de):(le=le.replace(/&#?\w+;/g,ee),Y.characters(le,0,le.length),de)}return D+1}function Le(w,D,V,ee){var Y=ee[V];return null==Y&&((Y=w.lastIndexOf(""))D?(V.comment(w,D+4,de-D-4),de+3):(ee.error("Unclosed comment"),-1):-1;if("CDATA["==w.substr(D+3,6)){var de=w.indexOf("]]>",D+9);return V.startCDATA(),V.characters(w,D+9,de-D-9),V.endCDATA(),de+3}var le=function rt(w,D){var V,ee=[],Y=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Y.lastIndex=D,Y.exec(w);V=Y.exec(w);)if(ee.push(V),V[1])return ee}(w,D),xe=le.length;if(xe>1&&/!doctype/i.test(le[0][0])){var J=le[1][0],re=!1,X=!1;xe>3&&(/^public$/i.test(le[2][0])?(re=le[3][0],X=xe>4&&le[4][0]):/^system$/i.test(le[2][0])&&(X=le[3][0]));var oe=le[xe-1];return V.startDTD(J,re,X),V.endDTD(),oe.index+oe[0].length}return-1}function Ne(w,D,V){var ee=w.indexOf("?>",D);if(ee){var Y=w.substring(D,ee).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Y?(V.processingInstruction(Y[1],Y[2]),ee+2):-1}return-1}function He(){this.attributeNames={}}(Ue.prototype=new Error).name=Ue.name,Ve.prototype={parse:function(w,D,V){var ee=this.domBuilder;ee.startDocument(),Ge(D,D={}),function it(w,D,V,ee,Y){function le(nt){var vt=nt.slice(1,-1);return vt in V?V[vt]:"#"===vt.charAt(0)?function de(nt){return nt>65535?(nt-=65536,String.fromCharCode(55296+(nt>>10),56320+(1023&nt))):String.fromCharCode(nt)}(parseInt(vt.substr(1).replace("x","0x"))):(Y.error("entity not found:"+nt),nt)}function xe(nt){if(nt>We){var vt=w.substring(We,nt).replace(/&#?\w+;/g,le);De&&J(We),ee.characters(vt,0,nt-We),We=nt}}function J(nt,vt){for(;nt>=X&&(vt=oe.exec(w));)X=(re=vt.index)+vt[0].length,De.lineNumber++;De.columnNumber=nt-re+1}for(var re=0,X=0,oe=/.*(?:\r\n?|\n)|.*$/g,De=ee.locator,Ze=[{currentNSMap:D}],qe={},We=0;;){try{var Me=w.indexOf("<",We);if(Me<0){if(!w.substr(We).match(/^\s*$/)){var Pt=ee.doc,P=Pt.createTextNode(w.substr(We));Pt.appendChild(P),ee.currentElement=P}return}switch(Me>We&&xe(Me),w.charAt(Me+1)){case"/":var Ct=w.indexOf(">",Me+3),St=w.substring(Me+2,Ct).replace(/[ \t\n\r]+$/g,""),K=Ze.pop();Ct<0?(St=w.substring(Me+2).replace(/[\s<].*/,""),Y.error("end tag name: "+St+" is not complete:"+K.tagName),Ct=Me+1+St.length):St.match(/\sWe?We=Ct:xe(Math.max(Me,We)+1)}}(w,D,V,ee,this.errorHandler),ee.endDocument()}},He.prototype={setTagName:function(w){if(!Ae.test(w))throw new Error("invalid tagName:"+w);this.tagName=w},addValue:function(w,D,V){if(!Ae.test(w))throw new Error("invalid attribute:"+w);this.attributeNames[w]=this.length,this[this.length++]={qName:w,value:D,offset:V}},length:0,getLocalName:function(w){return this[w].localName},getLocator:function(w){return this[w].locator},getQName:function(w){return this[w].qName},getURI:function(w){return this[w].uri},getValue:function(w){return this[w].value}},we.XMLReader=Ve,we.ParseError=Ue},1421:(je,we,j)=>{var B,Q="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},_e=j(5893);"undefined"!=typeof document?B=document:(B=Q["__GLOBAL_DOCUMENT_CACHE@4"])||(B=Q["__GLOBAL_DOCUMENT_CACHE@4"]=_e),je.exports=B},9226:je=>{var we;we="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},je.exports=we},2703:je=>{je.exports=function j(Q){if(!Q)return!1;var _e=we.call(Q);return"[object Function]"===_e||"function"==typeof Q&&"[object RegExp]"!==_e||"undefined"!=typeof window&&(Q===window.setTimeout||Q===window.alert||Q===window.confirm||Q===window.prompt)};var we=Object.prototype.toString},1234:(je,we)=>{function j(te){if(te&&"object"==typeof te){var Ce=te.which||te.keyCode||te.charCode;Ce&&(te=Ce)}if("number"==typeof te)return Ae[te];var Te,Ee=String(te);return(Te=Q[Ee.toLowerCase()])?Te:(Te=_e[Ee.toLowerCase()])||(1===Ee.length?Ee.charCodeAt(0):void 0)}j.isEventKey=function(Ce,Ee){if(Ce&&"object"==typeof Ce){var Te=Ce.which||Ce.keyCode||Ce.charCode;if(null==Te)return!1;if("string"==typeof Ee){var pe;if(pe=Q[Ee.toLowerCase()])return pe===Te;if(pe=_e[Ee.toLowerCase()])return pe===Te}else if("number"==typeof Ee)return Ee===Te;return!1}};var Q=(we=je.exports=j).code=we.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},_e=we.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(B=97;B<123;B++)Q[String.fromCharCode(B)]=B-32;for(var B=48;B<58;B++)Q[B-48]=B;for(B=1;B<13;B++)Q["f"+B]=B+111;for(B=0;B<10;B++)Q["numpad "+B]=B+96;var Ae=we.names=we.title={};for(B in Q)Ae[Q[B]]=B;for(var ve in _e)Q[ve]=_e[ve]},7459:(je,we,j)=>{var Q=j(3357).getUint64;je.exports=function(B){var Ae=new DataView(B.buffer,B.byteOffset,B.byteLength),ve={version:B[0],flags:new Uint8Array(B.subarray(1,4)),references:[],referenceId:Ae.getUint32(4),timescale:Ae.getUint32(8)},te=12;0===ve.version?(ve.earliestPresentationTime=Ae.getUint32(te),ve.firstOffset=Ae.getUint32(te+4),te+=8):(ve.earliestPresentationTime=Q(B.subarray(te)),ve.firstOffset=Q(B.subarray(te+8)),te+=16);var Ce=Ae.getUint16(te+=2);for(te+=2;Ce>0;te+=12,Ce--)ve.references.push({referenceType:(128&B[te])>>>7,referencedSize:2147483647&Ae.getUint32(te),subsegmentDuration:Ae.getUint32(te+4),startsWithSap:!!(128&B[te+8]),sapType:(112&B[te+8])>>>4,sapDeltaTime:268435455&Ae.getUint32(te+8)});return ve}},6277:je=>{var j,Q,_e,B,Ae,ve,te;Ae=function(Ce,Ee){return j(B(Ce,Ee))},ve=function(Ce,Ee){return Q(_e(Ce),Ee)},te=function(Ce,Ee,Te){return _e(Te?Ce:Ce-Ee)},je.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:j=function(Ce){return 9e4*Ce},secondsToAudioTs:Q=function(Ce,Ee){return Ce*Ee},videoTsToSeconds:_e=function(Ce){return Ce/9e4},audioTsToSeconds:B=function(Ce,Ee){return Ce/Ee},audioTsToVideoTs:Ae,videoTsToAudioTs:ve,metadataTsToSeconds:te}},3357:je=>{var we=Math.pow(2,32);je.exports={getUint64:function(Q){var B,_e=new DataView(Q.buffer,Q.byteOffset,Q.byteLength);return _e.getBigUint64?(B=_e.getBigUint64(0)){je.exports=function we(j,Q){var _e,B=null;try{_e=JSON.parse(j,Q)}catch(Ae){B=Ae}return[B,_e]}},3871:function(je){var j,Q,_e,B,Ae;j=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Q=/^(?=([^\/?#]*))\1([^]*)$/,_e=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,je.exports=Ae={buildAbsoluteURL:function(ve,te,Ce){if(Ce=Ce||{},ve=ve.trim(),!(te=te.trim())){if(!Ce.alwaysNormalize)return ve;var Ee=Ae.parseURL(ve);if(!Ee)throw new Error("Error trying to parse base URL.");return Ee.path=Ae.normalizePath(Ee.path),Ae.buildURLFromParts(Ee)}var Te=Ae.parseURL(te);if(!Te)throw new Error("Error trying to parse relative URL.");if(Te.scheme)return Ce.alwaysNormalize?(Te.path=Ae.normalizePath(Te.path),Ae.buildURLFromParts(Te)):te;var pe=Ae.parseURL(ve);if(!pe)throw new Error("Error trying to parse base URL.");if(!pe.netLoc&&pe.path&&"/"!==pe.path[0]){var u=Q.exec(pe.path);pe.netLoc=u[1],pe.path=u[2]}pe.netLoc&&!pe.path&&(pe.path="/");var se={scheme:pe.scheme,netLoc:Te.netLoc,path:null,params:Te.params,query:Te.query,fragment:Te.fragment};if(!Te.netLoc&&(se.netLoc=pe.netLoc,"/"!==Te.path[0]))if(Te.path){var Ue=pe.path,Ve=Ue.substring(0,Ue.lastIndexOf("/")+1)+Te.path;se.path=Ae.normalizePath(Ve)}else se.path=pe.path,Te.params||(se.params=pe.params,Te.query||(se.query=pe.query));return null===se.path&&(se.path=Ce.alwaysNormalize?Ae.normalizePath(Te.path):Te.path),Ae.buildURLFromParts(se)},parseURL:function(ve){var te=j.exec(ve);return te?{scheme:te[1]||"",netLoc:te[2]||"",path:te[3]||"",params:te[4]||"",query:te[5]||"",fragment:te[6]||""}:null},normalizePath:function(ve){for(ve=ve.split("").reverse().join("").replace(_e,"");ve.length!==(ve=ve.replace(B,"")).length;);return ve.split("").reverse().join("")},buildURLFromParts:function(ve){return ve.scheme+ve.netLoc+ve.path+ve.params+ve.query+ve.fragment}}},3629:(je,we,j)=>{var Q=j(9226),_e=je.exports={WebVTT:j(8318),VTTCue:j(5713),VTTRegion:j(3872)};Q.vttjs=_e,Q.WebVTT=_e.WebVTT;var B=_e.VTTCue,Ae=_e.VTTRegion,ve=Q.VTTCue,te=Q.VTTRegion;_e.shim=function(){Q.VTTCue=B,Q.VTTRegion=Ae},_e.restore=function(){Q.VTTCue=ve,Q.VTTRegion=te},Q.VTTCue||_e.shim()},8318:(je,we,j)=>{var Q=j(1421),_e=Object.create||function(){function w(){}return function(D){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return w.prototype=D,new w}}();function B(w,D){this.name="ParsingError",this.code=w.code,this.message=D||w.message}function Ae(w){function D(ee,Y,de,le){return 3600*(0|ee)+60*(0|Y)+(0|de)+(0|le)/1e3}var V=w.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return V?V[3]?D(V[1],V[2],V[3].replace(":",""),V[4]):V[1]>59?D(V[1],V[2],0,V[4]):D(0,V[1],V[2],V[4]):null}function ve(){this.values=_e(null)}function te(w,D,V,ee){var Y=ee?w.split(ee):[w];for(var de in Y)if("string"==typeof Y[de]){var le=Y[de].split(V);2===le.length&&D(le[0],le[1])}}function Ce(w,D,V){var ee=w;function Y(){var xe=Ae(w);if(null===xe)throw new B(B.Errors.BadTimeStamp,"Malformed timestamp: "+ee);return w=w.replace(/^[^\sa-zA-Z-]+/,""),xe}function le(){w=w.replace(/^\s+/,"")}if(le(),D.startTime=Y(),le(),"--\x3e"!==w.substr(0,3))throw new B(B.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+ee);w=w.substr(3),le(),D.endTime=Y(),le(),function de(xe,J){var re=new ve;te(xe,function(X,oe){switch(X){case"region":for(var De=V.length-1;De>=0;De--)if(V[De].id===oe){re.set(X,V[De].region);break}break;case"vertical":re.alt(X,oe,["rl","lr"]);break;case"line":var Ze=oe.split(","),qe=Ze[0];re.integer(X,qe),re.percent(X,qe)&&re.set("snapToLines",!1),re.alt(X,qe,["auto"]),2===Ze.length&&re.alt("lineAlign",Ze[1],["start","center","end"]);break;case"position":Ze=oe.split(","),re.percent(X,Ze[0]),2===Ze.length&&re.alt("positionAlign",Ze[1],["start","center","end"]);break;case"size":re.percent(X,oe);break;case"align":re.alt(X,oe,["start","center","end","left","right"])}},/:/,/\s/),J.region=re.get("region",null),J.vertical=re.get("vertical","");try{J.line=re.get("line","auto")}catch(X){}J.lineAlign=re.get("lineAlign","start"),J.snapToLines=re.get("snapToLines",!0),J.size=re.get("size",100);try{J.align=re.get("align","center")}catch(X){J.align=re.get("align","middle")}try{J.position=re.get("position","auto")}catch(X){J.position=re.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},J.align)}J.positionAlign=re.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},J.align)}(w,D)}(B.prototype=_e(Error.prototype)).constructor=B,B.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ve.prototype={set:function(w,D){!this.get(w)&&""!==D&&(this.values[w]=D)},get:function(w,D,V){return V?this.has(w)?this.values[w]:D[V]:this.has(w)?this.values[w]:D},has:function(w){return w in this.values},alt:function(w,D,V){for(var ee=0;ee=0&&D<=100))&&(this.set(w,D),!0)}};var Ee=Q.createElement&&Q.createElement("textarea"),Te={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},pe={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},u={v:"title",lang:"lang"},se={rt:"ruby"};function Ue(w,D){function V(){if(!D)return null;var We=D.match(/^([^<]*)(<[^>]*>?)?/);return function qe(Me){return D=D.substr(Me.length),Me}(We[1]?We[1]:We[2])}function ee(qe){return Ee.innerHTML=qe,qe=Ee.textContent,Ee.textContent="",qe}function de(qe,We){var Me=Te[qe];if(!Me)return null;var Pt=w.document.createElement(Me),P=u[qe];return P&&We&&(Pt[P]=We.trim()),Pt}for(var J,le=w.document.createElement("div"),xe=le,re=[];null!==(J=V());)if("<"!==J[0])xe.appendChild(w.document.createTextNode(ee(J)));else{if("/"===J[1]){re.length&&re[re.length-1]===J.substr(2).replace(">","")&&(re.pop(),xe=xe.parentNode);continue}var oe,X=Ae(J.substr(1,J.length-2));if(X){oe=w.document.createProcessingInstruction("timestamp",X),xe.appendChild(oe);continue}var De=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!De||!(oe=de(De[1],De[3]))||se[(We=oe).localName]&&se[We.localName]!==xe.localName)continue;if(De[2]){var Ze=De[2].split(".");Ze.forEach(function(qe){var We=/^bg_/.test(qe),Me=We?qe.slice(3):qe;pe.hasOwnProperty(Me)&&(oe.style[We?"background-color":"color"]=pe[Me])}),oe.className=Ze.join(" ")}re.push(De[1]),xe.appendChild(oe),xe=oe}var We;return le}var Ve=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function it(w){for(var D=0;D=V[0]&&w<=V[1])return!0}return!1}function yt(w){var D=[],V="";if(!w||!w.childNodes)return"ltr";function Y(xe,J){for(var re=J.childNodes.length-1;re>=0;re--)xe.push(J.childNodes[re])}function de(xe){if(!xe||!xe.length)return null;var J=xe.pop(),re=J.textContent||J.innerText;if(re){var X=re.match(/^.*(\n|\r)/);return X?(xe.length=0,X[0]):re}return"ruby"===J.tagName?de(xe):J.childNodes?(Y(xe,J),de(xe)):void 0}for(Y(D,w);V=de(D);)for(var le=0;le=0&&w.line<=100))return w.line;if(!w.track||!w.track.textTrackList||!w.track.textTrackList.mediaElement)return-1;for(var D=w.track,V=D.textTrackList,ee=0,Y=0;YDe&&(oe=oe<0?-1:1,oe*=Math.ceil(De/X)*X),xe<0&&(oe+=""===le.vertical?V.height:V.width,J=J.reverse()),de.move(Ze,oe)}else{var qe=de.lineHeight/V.height*100;switch(le.lineAlign){case"center":xe-=qe/2;break;case"end":xe-=qe}switch(le.vertical){case"":D.applyStyles({top:D.formatStyle(xe,"%")});break;case"rl":D.applyStyles({left:D.formatStyle(xe,"%")});break;case"lr":D.applyStyles({right:D.formatStyle(xe,"%")})}J=["+y","-x","+x","-y"],de=new Le(D)}var We=function Y(Me,Pt){for(var P,St=new Le(Me),K=1,gt=0;gtvi&&(P=new Le(Me),K=vi),Me=new Le(St)}return P||St}(de,J);D.move(We.toCSSCompatValues(V))}function ke(){}Oe.prototype.applyStyles=function(w,D){for(var V in D=D||this.div,w)w.hasOwnProperty(V)&&(D.style[V]=w[V])},Oe.prototype.formatStyle=function(w,D){return 0===w?0:w+D},(me.prototype=_e(Oe.prototype)).constructor=me,Le.prototype.move=function(w,D){switch(D=void 0!==D?D:this.lineHeight,w){case"+x":this.left+=D,this.right+=D;break;case"-x":this.left-=D,this.right-=D;break;case"+y":this.top+=D,this.bottom+=D;break;case"-y":this.top-=D,this.bottom-=D}},Le.prototype.overlaps=function(w){return this.leftw.left&&this.topw.top},Le.prototype.overlapsAny=function(w){for(var D=0;D=w.top&&this.bottom<=w.bottom&&this.left>=w.left&&this.right<=w.right},Le.prototype.overlapsOppositeAxis=function(w,D){switch(D){case"+x":return this.leftw.right;case"+y":return this.topw.bottom}},Le.prototype.intersectPercentage=function(w){return Math.max(0,Math.min(this.right,w.right)-Math.max(this.left,w.left))*Math.max(0,Math.min(this.bottom,w.bottom)-Math.max(this.top,w.top))/(this.height*this.width)},Le.prototype.toCSSCompatValues=function(w){return{top:this.top-w.top,bottom:w.bottom-this.bottom,left:this.left-w.left,right:w.right-this.right,height:this.height,width:this.width}},Le.getSimpleBoxPosition=function(w){var D=w.div?w.div.offsetHeight:w.tagName?w.offsetHeight:0,V=w.div?w.div.offsetWidth:w.tagName?w.offsetWidth:0,ee=w.div?w.div.offsetTop:w.tagName?w.offsetTop:0;return{left:(w=w.div?w.div.getBoundingClientRect():w.tagName?w.getBoundingClientRect():w).left,right:w.right,top:w.top||ee,height:w.height||D,bottom:w.bottom||ee+(w.height||D),width:w.width||V}},ke.StringDecoder=function(){return{decode:function(w){if(!w)return"";if("string"!=typeof w)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(w))}}},ke.convertCueToDOMTree=function(w,D){return w&&D?Ue(w,D):null},ke.processCues=function(w,D,V){if(!w||!D||!V)return null;for(;V.firstChild;)V.removeChild(V.firstChild);var ee=w.document.createElement("div");if(ee.style.position="absolute",ee.style.left="0",ee.style.right="0",ee.style.top="0",ee.style.bottom="0",ee.style.margin="1.5%",V.appendChild(ee),function Y(X){for(var oe=0;oe{var j={"":1,lr:1,rl:1},Q={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function B(ve){return"string"==typeof ve&&!!Q[ve.toLowerCase()]&&ve.toLowerCase()}function Ae(ve,te,Ce){this.hasBeenReset=!1;var Ee="",Te=!1,pe=ve,u=te,se=Ce,Ue=null,Ve="",it=!0,yt="auto",ue="start",Oe="auto",me="auto",Le=100,Ge="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return Ee},set:function(ke){Ee=""+ke}},pauseOnExit:{enumerable:!0,get:function(){return Te},set:function(ke){Te=!!ke}},startTime:{enumerable:!0,get:function(){return pe},set:function(ke){if("number"!=typeof ke)throw new TypeError("Start time must be set to a number.");pe=ke,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(ke){if("number"!=typeof ke)throw new TypeError("End time must be set to a number.");u=ke,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return se},set:function(ke){se=""+ke,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return Ue},set:function(ke){Ue=ke,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return Ve},set:function(ke){var Ne=function _e(ve){return"string"==typeof ve&&!!j[ve.toLowerCase()]&&ve.toLowerCase()}(ke);if(!1===Ne)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");Ve=Ne,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return it},set:function(ke){it=!!ke,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return yt},set:function(ke){if("number"!=typeof ke&&"auto"!==ke)throw new SyntaxError("Line: an invalid number or illegal string was specified.");yt=ke,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return ue},set:function(ke){var Ne=B(ke);Ne?(ue=Ne,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return Oe},set:function(ke){if(ke<0||ke>100)throw new Error("Position must be between 0 and 100.");Oe=ke,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return me},set:function(ke){var Ne=B(ke);Ne?(me=Ne,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return Le},set:function(ke){if(ke<0||ke>100)throw new Error("Size must be between 0 and 100.");Le=ke,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return Ge},set:function(ke){var Ne=B(ke);if(!Ne)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");Ge=Ne,this.hasBeenReset=!0}}}),this.displayState=void 0}Ae.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},je.exports=Ae},3872:je=>{var we={"":!0,up:!0};function Q(B){return"number"==typeof B&&B>=0&&B<=100}je.exports=function _e(){var B=100,Ae=3,ve=0,te=100,Ce=0,Ee=100,Te="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return B},set:function(pe){if(!Q(pe))throw new Error("Width must be between 0 and 100.");B=pe}},lines:{enumerable:!0,get:function(){return Ae},set:function(pe){if("number"!=typeof pe)throw new TypeError("Lines must be set to a number.");Ae=pe}},regionAnchorY:{enumerable:!0,get:function(){return te},set:function(pe){if(!Q(pe))throw new Error("RegionAnchorX must be between 0 and 100.");te=pe}},regionAnchorX:{enumerable:!0,get:function(){return ve},set:function(pe){if(!Q(pe))throw new Error("RegionAnchorY must be between 0 and 100.");ve=pe}},viewportAnchorY:{enumerable:!0,get:function(){return Ee},set:function(pe){if(!Q(pe))throw new Error("ViewportAnchorY must be between 0 and 100.");Ee=pe}},viewportAnchorX:{enumerable:!0,get:function(){return Ce},set:function(pe){if(!Q(pe))throw new Error("ViewportAnchorX must be between 0 and 100.");Ce=pe}},scroll:{enumerable:!0,get:function(){return Te},set:function(pe){var u=function j(B){return"string"==typeof B&&!!we[B.toLowerCase()]&&B.toLowerCase()}(pe);!1===u?console.warn("Scroll: an invalid or illegal string was specified."):Te=u}}})}},7154:je=>{function we(){return je.exports=we=Object.assign||function(j){for(var Q=1;Q{}}]); \ No newline at end of file +(self.webpackChunkfansubid=self.webpackChunkfansubid||[]).push([[635],{8635:(je,we,j)=>{"use strict";j.r(we),j.d(we,{BerkasModule:()=>d0});var Q=j(9808),_e=j(8406),B=j(3075),Ae=j(9345),ve=j(1385),te=j(6271),Ce=j(4249),Ee=j(210),Te=j(6436),pe=j(8613),u=j(5e3);let se=(()=>{class s{}return s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=u.oAB({type:s}),s.\u0275inj=u.cJS({imports:[[Q.ez]]}),s})();var Ue=j(8764),Ve=j(4167),it=j(7355),yt=j(2777),ue=j(5861),Oe=j(520),me=j(8505),Le=j(7272),Ge=j(5934),ke=j(8696),Ne=j(3e3),He=j(8745),rt=j(8987),w=j(6382),D=j(4137),V=j(4327),ee=j(6925),Y=j(197);let de=(()=>{class s{constructor(t,r,e){this.gs=t,this.toast=r,this.dls=e,this.attachmentsDownload={}}getAttachmentDownloadFile(t){return this.attachmentsDownload[t.id]||(this.attachmentsDownload[t.id]={},this.attachmentsDownload[t.id].name=t.name,this.attachmentsDownload[t.id].size=t.size,this.attachmentsDownload[t.id].ext=t.ext,this.attachmentsDownload[t.id].download_count=t.download_count,this.attachmentsDownload[t.id].google_drive=t.google_drive,this.attachmentsDownload[t.id].discord=t.discord,this.attachmentsDownload[t.id].mode="indeterminate",this.attachmentsDownload[t.id].isDownloading=!1,this.attachmentsDownload[t.id].isCompleted=!1,this.attachmentsDownload[t.id].data=null,this.attachmentsDownload[t.id].handler=null,this.attachmentsDownload[t.id].toast=null,this.attachmentsDownload[t.id].totals=0,this.attachmentsDownload[t.id].percentage=0,this.attachmentsDownload[t.id].speed=0,this.attachmentsDownload[t.id].loaded=0),this.attachmentsDownload[t.id]}stopFail(t){t.isDownloading=!1,t.isCompleted=!1,t.toast&&this.toast.remove(t.toast.toastId)}onProgress(t,r){if(r.loaded){this.gs.log("[DOWNLOAD_PROGRESS]",r),t.mode="determinate";const e=r.loaded-t.loaded;t.totals+=e,t.speed=e/1e3,t.percentage=Math.round(t.totals/t.size*100),t.loaded=r.loaded,t.toast.toastRef.componentInstance.message=`${t.percentage}% @ ${t.speed} KB/s`}}startDownload(t,r=!0){var e=this;const i=this.attachmentsDownload[t];var a;i.toast=this.toast.warning(`${i.percentage}% @ ${i.speed} KB/s`,"Mengunduh ...",{closeButton:!1,timeOut:0,disableTimeOut:"extendedTimeOut",tapToDismiss:!1}),i.isCompleted?this.saveFileAs(t):(i.isDownloading=!0,i.discord?this.dls.getListDdl(t).subscribe({next:(a=(0,ue.Z)(function*(o){e.gs.log("[DOWNLOAD_LIST_DDL]",o);const l=o.results.sort((v,g)=>v.chunk_idx-g.chunk_idx),d=[];for(const v of l){let g=null;g=r?e.dls.downloadDdlDirect(v.url):e.dls.downloadDdlProxy(v.id),d.push(g)}const f=[];var v;i.handler=(0,Le.z)(...d).subscribe({next:(v=(0,ue.Z)(function*(g){if(g.type===Oe.dt.DownloadProgress&&e.onProgress(i,g),g.type===Oe.dt.Response){i.loaded=0;const E=yield g.body.arrayBuffer(),x=new Uint8Array(E);e.gs.log("[DOWNLOAD_CHUNK_APPEND]",E.byteLength),f.push(x)}if(g.type===Oe.dt.Response&&f.length===l.length){e.gs.log("[DOWNLOAD_CHUNK_COMPLETED]",f);const T=new Blob(f);i.mode="determinate",i.isDownloading=!1,i.isCompleted=!0,i.data=T,e.toast.remove(i.toast.toastId),e.saveFileAs(t)}}),function(T){return v.apply(this,arguments)}),error:v=>{e.gs.log("[DOWNLOAD_CHUNK_ERROR]",v,"error"),e.stopFail(i)}})}),function(l){return a.apply(this,arguments)}),error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(i)}}):i.handler=this.dls.downloadLampiran(t).subscribe({next:a=>{a.type===Oe.dt.DownloadProgress&&this.onProgress(i,a),a.type===Oe.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",a),i.mode="determinate",i.isDownloading=!1,i.isCompleted=!0,i.data=a.body,this.toast.remove(i.toast.toastId),this.saveFileAs(t))},error:a=>{this.gs.log("[DOWNLOAD_ERROR]",a,"error"),this.stopFail(i)}}))}cancelDownload(t){const r=this.attachmentsDownload[t];r.mode="indeterminate",r.percentage=0,r.speed=0,r.totals=0,r.loaded=0,r.isDownloading=!1,r.isCompleted=!1,r.handler&&r.handler.unsubscribe(),r.toast&&this.toast.remove(r.toast.toastId)}saveFileAs(t){this.gs.log("[SAVE_FILE]",t);const r=this.attachmentsDownload[t];(0,V.saveAs)(r.data,`${r.name}.${r.ext}`)}}return s.\u0275fac=function(t){return new(t||s)(u.LFG(ke.U),u.LFG(ee.k),u.LFG(Y.v))},s.\u0275prov=u.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),s})();var le=j(8020),xe=j(8381),J=j(8616),re=j(4623),X=j(7423),oe=j(7238),De=j(5245),Ze=j(5899),qe=j(7322),We=j(4107),Me=j(508),Pt=j(9226),P=j.n(Pt),St=j(1421),K=j.n(St);function gt(){return gt=Object.assign||function(s){for(var n=1;n-1},n.trigger=function(r){var e=this.listeners[r];if(e)if(2===arguments.length)for(var i=e.length,a=0;a-1;i=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)},n}(Cr),Bn=String.fromCharCode(9),kr=function(n){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(n||""),r={};return t[1]&&(r.length=parseInt(t[1],10)),t[2]&&(r.offset=parseInt(t[2],10)),r},Ut=function(n){for(var i,t=n.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r={},e=t.length;e--;)""!==t[e]&&((i=/([^=]*)=(.*)/.exec(t[e]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),r[i[0]]=i[1]);return r},Vi=function(s){function n(){var r;return(r=s.call(this)||this).customParsers=[],r.tagMappers=[],r}ie(n,s);var t=n.prototype;return t.push=function(e){var a,o,i=this;if(0!==(e=e.trim()).length){if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(d,f){var v=f(e);return v===e?d:d.concat([v])},[e]).forEach(function(d){for(var f=0;f0&&(a.duration=S.duration),0===S.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key:function(){if(S.attributes)if("NONE"!==S.attributes.METHOD)if(S.attributes.URI){if("com.apple.streamingkeydelivery"===S.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:S.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===S.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(S.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===S.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==S.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):S.attributes.KEYID&&"0x"===S.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:S.attributes.KEYFORMAT,keyId:S.attributes.KEYID.substring(2)},pssh:er(S.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));S.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:S.attributes.METHOD||"AES-128",uri:S.attributes.URI},void 0!==S.attributes.IV&&(l.iv=S.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else l=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(S.number)?this.manifest.mediaSequence=S.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+S.number})},"discontinuity-sequence":function(){isFinite(S.number)?(this.manifest.discontinuitySequence=S.number,T=S.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+S.number})},"playlist-type":function(){/VOD|EVENT/.test(S.playlistType)?this.manifest.playlistType=S.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+S.playlist})},map:function(){o={},S.uri&&(o.uri=S.uri),S.byterange&&(o.byterange=S.byterange),l&&(o.key=l)},"stream-inf":function(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes?(a.attributes||(a.attributes={}),gt(a.attributes,S.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||v,S.attributes&&S.attributes.TYPE&&S.attributes["GROUP-ID"]&&S.attributes.NAME){var q=this.manifest.mediaGroups[S.attributes.TYPE];q[S.attributes["GROUP-ID"]]=q[S.attributes["GROUP-ID"]]||{},F=q[S.attributes["GROUP-ID"]],(U={default:/yes/i.test(S.attributes.DEFAULT)}).autoselect=!!U.default||/yes/i.test(S.attributes.AUTOSELECT),S.attributes.LANGUAGE&&(U.language=S.attributes.LANGUAGE),S.attributes.URI&&(U.uri=S.attributes.URI),S.attributes["INSTREAM-ID"]&&(U.instreamId=S.attributes["INSTREAM-ID"]),S.attributes.CHARACTERISTICS&&(U.characteristics=S.attributes.CHARACTERISTICS),S.attributes.FORCED&&(U.forced=/yes/i.test(S.attributes.FORCED)),F[S.attributes.NAME]=U}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){T+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=S.dateTimeString,this.manifest.dateTimeObject=S.dateTimeObject),a.dateTimeString=S.dateTimeString,a.dateTimeObject=S.dateTimeObject},targetduration:function(){!isFinite(S.duration)||S.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+S.duration}):(this.manifest.targetDuration=S.duration,Ar.call(this,this.manifest))},start:function(){S.attributes&&!isNaN(S.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:S.attributes["TIME-OFFSET"],precise:S.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=S.data},"cue-out-cont":function(){a.cueOutCont=S.data},"cue-in":function(){a.cueIn=S.data},skip:function(){this.manifest.skip=_i(S.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",S.attributes,["SKIPPED-SEGMENTS"])},part:function(){var q=this;d=!0;var ne=this.manifest.segments.length,he=_i(S.attributes);a.parts=a.parts||[],a.parts.push(he),he.byterange&&(he.byterange.hasOwnProperty("offset")||(he.byterange.offset=x),x=he.byterange.offset+he.byterange.length),this.warnOnMissingAttributes_("#EXT-X-PART #"+(a.parts.length-1)+" for segment #"+ne,S.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(ye,ge){ye.hasOwnProperty("lastPart")||q.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+ge+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var q=this.manifest.serverControl=_i(S.attributes);q.hasOwnProperty("canBlockReload")||(q.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ar.call(this,this.manifest),q.canSkipDateranges&&!q.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var q=this.manifest.segments.length,ne=_i(S.attributes),he=ne.type&&"PART"===ne.type;a.preloadHints=a.preloadHints||[],a.preloadHints.push(ne),ne.byterange&&(ne.byterange.hasOwnProperty("offset")||(ne.byterange.offset=he?x:0,he&&(x=ne.byterange.offset+ne.byterange.length)));var z=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+z+" for segment #"+q,S.attributes,["TYPE","URI"]),ne.type)for(var ye=0;yer.timeline?1:-1})},lu=function(n){var t=[];return function(n,t,r){t.forEach(function(e){for(var i in n.mediaGroups[e])for(var a in n.mediaGroups[e][i])r(n.mediaGroups[e][i][a])})}(n,uf,function(r,e,i,a){t=t.concat(r.playlists||[])}),t},du=function(n){var t=n.playlist;t.mediaSequence=n.mediaSequence,t.segments.forEach(function(e,i){e.number=t.mediaSequence+i})},Wn=function(n){return n&&n.uri+"-"+function(n){var t;return t="bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1,n.offset+"-"+t}(n.byterange)},os=function(n){return nu(n.reduce(function(r,e){var a,i=e.attributes.id+(e.attributes.lang||"");r[i]?(e.segments&&(e.segments[0]&&(e.segments[0].discontinuity=!0),(a=r[i].segments).push.apply(a,e.segments)),e.attributes.contentProtection&&(r[i].attributes.contentProtection=e.attributes.contentProtection)):(r[i]=e,r[i].attributes.timelineStarts=[]);return r[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),r},{})).map(function(r){return r.discontinuityStarts=function(n,t){return n.reduce(function(r,e,i){return e.discontinuity&&r.push(i),r},[])}(r.segments||[]),r})},us=function(n,t){var r=Wn(n.sidx),e=r&&t[r]&&t[r].sidx;return e&&ss(n,e,n.sidx.resolvedUri),n},hf=function(n,t){if(void 0===t&&(t={}),!Object.keys(t).length)return n;for(var r in n)n[r]=us(n[r],t);return n},yf=function(n){var t,r=n.attributes,e=n.segments,i=n.sidx,a=n.discontinuityStarts,o={attributes:(t={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:e};return r.contentProtection&&(o.contentProtection=r.contentProtection),i&&(o.sidx=i),o},Tf=function(n){var t=n.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},bf=function(n){var t=n.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},xf=function(n){var t=n.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},cu=function(n){return n?Object.keys(n).reduce(function(t,r){return t.concat(n[r].playlists)},[]):[]},Ef=function(n){var t,r=n.dashPlaylists,e=n.locations,i=n.sidxMapping,a=void 0===i?{}:i,o=n.previousManifest;if(!r.length)return{};var l=r[0].attributes,d=l.sourceDuration,f=l.type,v=l.suggestedPresentationDelay,g=l.minimumUpdatePeriod,T=os(r.filter(Tf)).map(yf),E=os(r.filter(bf)),x=os(r.filter(xf)),S=r.map(function(he){return he.attributes.captionServices}).filter(Boolean),F={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:d,playlists:hf(T,a)};g>=0&&(F.minimumUpdatePeriod=1e3*g),e&&(F.locations=e),"dynamic"===f&&(F.suggestedPresentationDelay=v);var H=E.length?function(n,t,r){void 0===t&&(t={}),void 0===r&&(r=!1);var e,i=n.reduce(function(o,l){var d=l.attributes.role&&l.attributes.role.value||"",f=l.attributes.lang||"",v=l.attributes.label||"main";f&&!l.attributes.label&&(v=l.attributes.lang+(d?" ("+d+")":"")),o[v]||(o[v]={language:f,autoselect:!0,default:"main"===d,playlists:[],uri:""});var T=us(function(n,t){var r,e=n.attributes,i=n.segments,a=n.sidx,o=n.mediaSequence,l=n.discontinuitySequence,d=n.discontinuityStarts,f={attributes:(r={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:l,discontinuityStarts:d,timelineStarts:e.timelineStarts,mediaSequence:o,segments:i};return e.contentProtection&&(f.contentProtection=e.contentProtection),a&&(f.sidx=a),t&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs"),f}(l,r),t);return o[v].playlists.push(T),void 0===e&&"main"===d&&((e=l).default=!0),o},{});return e||(i[Object.keys(i)[0]].default=!0),i}(E,a,0===F.playlists.length):null,W=x.length?function(n,t){return void 0===t&&(t={}),n.reduce(function(r,e){var i=e.attributes.lang||"text";return r[i]||(r[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),r[i].playlists.push(us(function(n){var t,r=n.attributes,e=n.segments,i=n.mediaSequence,a=n.discontinuityStarts,o=n.discontinuitySequence;void 0===e&&(e=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var l=((t={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,t);return r.codecs&&(l.CODECS=r.codecs),{attributes:l,uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:i,segments:e}}(e),t)),r},{})}(x,a):null,q=T.concat(cu(H),cu(W)),ne=q.map(function(he){return he.timelineStarts});return F.timelineStarts=uu(ne),function(n,t){n.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=ns(t,function(e){return e.timeline===r.timeline}),r.segments&&r.segments.forEach(function(e,i){e.number=i})})}(q,F.timelineStarts),H&&(F.mediaGroups.AUDIO.audio=H),W&&(F.mediaGroups.SUBTITLES.subs=W),S.length&&(F.mediaGroups["CLOSED-CAPTIONS"].cc=function(n){return n.reduce(function(t,r){return r&&r.forEach(function(e){var a=e.language;t[a]={autoselect:!1,default:!1,instreamId:e.channel,language:a},e.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(t[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(t[a]["3D"]=e["3D"])}),t},{})}(S)),o?function(n){var t=n.oldManifest,r=n.newManifest,e=t.playlists.concat(lu(t)),i=r.playlists.concat(lu(r));return r.timelineStarts=uu([t.timelineStarts,r.timelineStarts]),function(n){var t=n.oldPlaylists,e=n.timelineStarts;n.newPlaylists.forEach(function(i){i.discontinuitySequence=ns(e,function(f){return f.timeline===i.timeline});var a=function(n,t){for(var r=0;ra.timeline||a.segments.length&&i.timeline>a.segments[a.segments.length-1].timeline)&&i.discontinuitySequence--);a.segments[l].discontinuity&&!o.discontinuity&&(o.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),du({playlist:i,mediaSequence:a.segments[l].number})}})}({oldPlaylists:e,newPlaylists:i,timelineStarts:r.timelineStarts}),r}({oldManifest:o,newManifest:F}):F},Cf=function(n,t,r){var o=n.timescale,d=n.periodStart,v=n.minimumUpdatePeriod;return Math.ceil((((n.NOW+n.clientOffset)/1e3+(void 0===v?0:v)-(n.availabilityStartTime+(void 0===d?0:d)))*(void 0===o?1:o)-t)/r)},fu=function(n,t){for(var r=n.type,e=n.minimumUpdatePeriod,i=void 0===e?0:e,a=n.media,o=void 0===a?"":a,l=n.sourceDuration,d=n.timescale,f=void 0===d?1:d,v=n.startNumber,g=void 0===v?1:v,T=n.periodStart,E=[],x=-1,S=0;Sx&&(x=W);var q=void 0;if(H<0){var ne=S+1;q=ne===t.length?"dynamic"===r&&i>0&&o.indexOf("$Number$")>0?Cf(n,x,U):(l*f-x)/U:(t[ne].t-x)/U}else q=H+1;for(var he=g+E.length+q,z=g+E.length;z=i)?a:""+new Array(i-a.length+1).join("0")+a}}(t))},If=function(n,t){var r={RepresentationID:n.id,Bandwidth:n.bandwidth||0},e=n.initialization,i=void 0===e?{sourceURL:"",range:""}:e,a=on({baseUrl:n.baseUrl,source:hu(i.sourceURL,r),range:i.range}),o=function(n,t){return n.duration||t?n.duration?as(n):fu(n,t):[{number:n.startNumber||1,duration:n.sourceDuration,time:0,timeline:n.periodStart}]}(n,t);return o.map(function(l){r.Number=l.number,r.Time=l.time;var d=hu(n.media||"",r),g=n.periodStart+(l.time-(n.presentationTimeOffset||0))/(n.timescale||1);return{uri:d,timeline:l.timeline,duration:l.duration,resolvedUri:Ji(n.baseUrl||"",d),map:a,number:l.number,presentationTime:g}})},Pf=function(n,t){var r=n.duration,e=n.segmentUrls,i=void 0===e?[]:e,a=n.periodStart;if(!r&&!t||r&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var l,o=i.map(function(f){return function(n,t){var r=n.baseUrl,e=n.initialization,i=void 0===e?{}:e,a=on({baseUrl:r,source:i.sourceURL,range:i.range}),o=on({baseUrl:r,source:t.media,range:t.mediaRange});return o.map=a,o}(n,f)});return r&&(l=as(n)),t&&(l=fu(n,t)),l.map(function(f,v){if(o[v]){var g=o[v],T=n.timescale||1,E=n.presentationTimeOffset||0;return g.timeline=f.timeline,g.duration=f.duration,g.number=f.number,g.presentationTime=a+(f.time-E)/T,g}}).filter(function(f){return f})},Lf=function(n){var e,i,t=n.attributes,r=n.segmentInfo;r.template?(i=If,e=Bt(t,r.template)):r.base?(i=ou,e=Bt(t,r.base)):r.list&&(i=Pf,e=Bt(t,r.list));var a={attributes:t};if(!i)return a;var o=i(e,r.segmentTimeline);if(e.duration){var f=e.timescale;e.duration=e.duration/(void 0===f?1:f)}else e.duration=o.length?o.reduce(function(g,T){return Math.max(g,Math.ceil(T.duration))},0):0;return a.attributes=e,a.segments=o,r.base&&e.indexRange&&(a.sidx=o[0],a.segments=[]),a},Tt=function(n,t){return au(n.childNodes).filter(function(r){return r.tagName===t})},ls=function(n){return n.textContent.trim()},Ir=function(n){var l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(n);if(!l)return 0;var d=l.slice(1),v=d[1],g=d[2],T=d[3],E=d[4],x=d[5];return 31536e3*parseFloat(d[0]||0)+2592e3*parseFloat(v||0)+86400*parseFloat(g||0)+3600*parseFloat(T||0)+60*parseFloat(E||0)+parseFloat(x||0)},pu={mediaPresentationDuration:function(n){return Ir(n)},availabilityStartTime:function(n){return function(n){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(n)&&(n+="Z"),Date.parse(n)}(n)/1e3},minimumUpdatePeriod:function(n){return Ir(n)},suggestedPresentationDelay:function(n){return Ir(n)},type:function(n){return n},timeShiftBufferDepth:function(n){return Ir(n)},start:function(n){return Ir(n)},width:function(n){return parseInt(n,10)},height:function(n){return parseInt(n,10)},bandwidth:function(n){return parseInt(n,10)},startNumber:function(n){return parseInt(n,10)},timescale:function(n){return parseInt(n,10)},presentationTimeOffset:function(n){return parseInt(n,10)},duration:function(n){var t=parseInt(n,10);return isNaN(t)?Ir(n):t},d:function(n){return parseInt(n,10)},t:function(n){return parseInt(n,10)},r:function(n){return parseInt(n,10)},DEFAULT:function(n){return n}},Mt=function(n){return n&&n.attributes?au(n.attributes).reduce(function(t,r){return t[r.name]=(pu[r.name]||pu.DEFAULT)(r.value),t},{}):{}},Mf={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Gn=function(n,t){return t.length?qn(n.map(function(r){return t.map(function(e){return Ji(r,ls(e))})})):n},ds=function(n){var t=Tt(n,"SegmentTemplate")[0],r=Tt(n,"SegmentList")[0],e=r&&Tt(r,"SegmentURL").map(function(g){return Bt({tag:"SegmentURL"},Mt(g))}),i=Tt(n,"SegmentBase")[0],a=r||t,o=a&&Tt(a,"SegmentTimeline")[0],l=r||i||t,d=l&&Tt(l,"Initialization")[0],f=t&&Mt(t);f&&d?f.initialization=d&&Mt(d):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});var v={template:f,segmentTimeline:o&&Tt(o,"S").map(function(g){return Mt(g)}),list:r&&Bt(Mt(r),{segmentUrls:e,initialization:Mt(d)}),base:i&&Bt(Mt(i),{initialization:Mt(d)})};return Object.keys(v).forEach(function(g){v[g]||delete v[g]}),v},Hf=function(n,t){return function(r,e){var i=Gn(t,Tt(r.node,"BaseURL")),a=Bt(n,{periodStart:r.attributes.start});"number"==typeof r.attributes.duration&&(a.periodDuration=r.attributes.duration);var o=Tt(r.node,"AdaptationSet"),l=ds(r.node);return qn(o.map(function(n,t,r){return function(e){var i=Mt(e),a=Gn(t,Tt(e,"BaseURL")),o=Tt(e,"Role")[0],l={role:Mt(o)},d=Bt(n,i,l),f=Tt(e,"Accessibility")[0],v=function(n){return"urn:scte:dash:cc:cea-608:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var i,a;if(a=e,/^CC\d=/.test(e)){var o=e.split("=");i=o[0],a=o[1]}else/^CC\d$/.test(e)&&(i=e);return{channel:i,language:a}}):"urn:scte:dash:cc:cea-708:2015"===n.schemeIdUri?("string"!=typeof n.value?[]:n.value.split(";")).map(function(e){var i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var a=e.split("="),l=a[1],d=void 0===l?"":l;i.channel=a[0],i.language=e,d.split(",").forEach(function(f){var v=f.split(":"),g=v[0],T=v[1];"lang"===g?i.language=T:"er"===g?i.easyReader=Number(T):"war"===g?i.aspectRatio=Number(T):"3D"===g&&(i["3D"]=Number(T))})}else i.language=e;return i.channel&&(i.channel="SERVICE"+i.channel),i}):void 0}(Mt(f));v&&(d=Bt(d,{captionServices:v}));var g=Tt(e,"Label")[0];if(g&&g.childNodes.length){var T=g.childNodes[0].nodeValue.trim();d=Bt(d,{label:T})}var E=function(n){return n.reduce(function(t,r){var e=Mt(r),i=Mf[e.schemeIdUri];if(i){t[i]={attributes:e};var a=Tt(r,"cenc:pssh")[0];if(a){var o=ls(a),l=o&&er(o);t[i].pssh=l}}return t},{})}(Tt(e,"ContentProtection"));Object.keys(E).length&&(d=Bt(d,{contentProtection:E}));var x=ds(e),S=Tt(e,"Representation"),F=Bt(r,x);return qn(S.map(function(n,t,r){return function(e){var i=Tt(e,"BaseURL"),a=Gn(t,i),o=Bt(n,Mt(e)),l=ds(e);return a.map(function(d){return{segmentInfo:Bt(r,l),attributes:Bt(o,{baseUrl:d})}})}}(d,a,F)))}}(a,i,l)))}},mu=function(n){if(""===n)throw new Error("DASH_EMPTY_MANIFEST");var r,e,t=new Vn.DOMParser;try{e=(r=t.parseFromString(n,"application/xml"))&&"MPD"===r.documentElement.tagName?r.documentElement:null}catch(i){}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return e},Zf=j(7459),zf=j.n(Zf),Re=function(n){return n instanceof Uint8Array?n:(!Array.isArray(n)&&!function(n){return function(n){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer}(n)}(n)&&!(n instanceof ArrayBuffer)&&(n="number"!=typeof n||"number"==typeof n&&n!=n?0:[n]),new Uint8Array(n&&n.buffer||n,n&&n.byteOffset||0,n&&n.byteLength||0))},Lt=P().BigInt||Number,cs=[Lt("0x1"),Lt("0x100"),Lt("0x10000"),Lt("0x1000000"),Lt("0x100000000"),Lt("0x10000000000"),Lt("0x1000000000000"),Lt("0x100000000000000"),Lt("0x10000000000000000")],Jf=(s=new Uint16Array([65484]),new Uint8Array(s.buffer,s.byteOffset,s.byteLength),function(n,t){var r=void 0===t?{}:t,e=r.signed,i=void 0!==e&&e,a=r.le,o=void 0!==a&&a;n=Re(n);var l=o?"reduce":"reduceRight",f=(n[l]?n[l]:Array.prototype[l]).call(n,function(g,T,E){var x=o?E:Math.abs(E+1-n.length);return g+Lt(T)*cs[x]},Lt(0));if(i){var v=cs[n.length]/Lt(2)-Lt(1);(f=Lt(f))>v&&(f-=v,f-=v,f-=Lt(2))}return Number(f)}),_u=function(n,t){if("string"!=typeof n&&n&&"function"==typeof n.toString&&(n=n.toString()),"string"!=typeof n)return new Uint8Array;t||(n=unescape(encodeURIComponent(n)));for(var r=new Uint8Array(n.length),e=0;e=t.length&&(t.every?t.every:Array.prototype.every).call(t,function(f,v){return f===(l[v]?l[v]&n[a+v]:n[a+v])})},rh=Re([73,68,51]),un=function s(n,t){return void 0===t&&(t=0),(n=Re(n)).length-t<10||!ht(n,rh,{offset:t})?t:(t+=function(n,t){void 0===t&&(t=0);var e=(n=Re(n))[t+6]<<21|n[t+7]<<14|n[t+8]<<7|n[t+9];return(16&n[t+5])>>4?e+20:e+10}(n,t),s(n,t))},fs=(new Uint8Array([79,112,117,115,72,101,97,100]),function(n){return"string"==typeof n?_u(n):n}),ps=function(n){n=Re(n);for(var t=[],r=0;n.length>r;){var e=n[r],i=0,a=0,o=n[++a];for(a++;128&o;)i=(127&o)<<7,o=n[a],a++;i+=127&o;for(var l=0;l>>0,o=n.subarray(i+4,i+8);if(0===a)break;var l=i+a;if(l>n.length){if(r)break;l=n.length}var d=n.subarray(i+8,l);ht(o,t[0])&&(1===t.length?e.push(d):e.push.apply(e,s(d,t.slice(1),r))),i=l}return e},dt={EBML:Re([26,69,223,163]),DocType:Re([66,130]),Segment:Re([24,83,128,103]),SegmentInfo:Re([21,73,169,102]),Tracks:Re([22,84,174,107]),Track:Re([174]),TrackNumber:Re([215]),DefaultDuration:Re([35,227,131]),TrackEntry:Re([174]),TrackType:Re([131]),FlagDefault:Re([136]),CodecID:Re([134]),CodecPrivate:Re([99,162]),VideoTrack:Re([224]),AudioTrack:Re([225]),Cluster:Re([31,67,182,117]),Timestamp:Re([231]),TimestampScale:Re([42,215,177]),BlockGroup:Re([160]),BlockDuration:Re([155]),Block:Re([161]),SimpleBlock:Re([163])},ms=[128,64,32,16,8,4,2,1],rr=function(n,t,r,e){void 0===r&&(r=!0),void 0===e&&(e=!1);var i=function(n){for(var t=1,r=0;r=t.length)return t.length;var e=rr(t,r,!1);if(ht(n.bytes,e.bytes))return r;var i=rr(t,r+e.length);return s(n,t,r+i.length+i.value+e.length)},pt=function s(n,t){t=function(n){return Array.isArray(n)?n.map(function(t){return yu(t)}):[yu(n)]}(t),n=Re(n);var r=[];if(!t.length)return r;for(var e=0;en.length?n.length:o+a.value);ht(t[0],i.bytes)&&(1===t.length?r.push(d):r=r.concat(s(d,t.slice(1)))),e+=i.length+a.length+d.length}return r},ph=Re([0,0,0,1]),mh=Re([0,0,1]),gh=Re([0,0,3]),vh=function(n){for(var t=[],r=1;r>1&63),-1!==r.indexOf(d)&&(a=i+l),i+=l+("h264"===t?1:2)}else i++}return n.subarray(0,0)},Ht={webm:Re([119,101,98,109]),matroska:Re([109,97,116,114,111,115,107,97]),flac:Re([102,76,97,67]),ogg:Re([79,103,103,83]),ac3:Re([11,119]),riff:Re([82,73,70,70]),avi:Re([65,86,73]),wav:Re([87,65,86,69]),"3gp":Re([102,116,121,112,51,103]),mp4:Re([102,116,121,112]),fmp4:Re([115,116,121,112]),mov:Re([102,116,121,112,113,116]),moov:Re([109,111,111,118]),moof:Re([109,111,111,102])},Pr={aac:function(n){var t=un(n);return ht(n,[255,16],{offset:t,mask:[255,22]})},mp3:function(n){var t=un(n);return ht(n,[255,2],{offset:t,mask:[255,6]})},webm:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,Ht.webm)},mkv:function(n){var t=pt(n,[dt.EBML,dt.DocType])[0];return ht(t,Ht.matroska)},mp4:function(n){return!Pr["3gp"](n)&&!Pr.mov(n)&&(!!(ht(n,Ht.mp4,{offset:4})||ht(n,Ht.fmp4,{offset:4})||ht(n,Ht.moof,{offset:4})||ht(n,Ht.moov,{offset:4}))||void 0)},mov:function(n){return ht(n,Ht.mov,{offset:4})},"3gp":function(n){return ht(n,Ht["3gp"],{offset:4})},ac3:function(n){var t=un(n);return ht(n,Ht.ac3,{offset:t})},ts:function(n){if(n.length<189&&n.length>=1)return 71===n[0];for(var t=0;t+1880?l:0)}if(P().console){var d=P().console[r];!d&&"debug"===r&&(d=P().console.info||P().console.log),d&&a&&o.test(r)&&d[Array.isArray(i)?"apply":"call"](P().console,i)}}}(s,r),r.createLogger=function(e){return Eu(s+": "+e)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return Kt?[].concat(Kt):[]}).filter=function(e){return(Kt||[]).filter(function(i){return new RegExp(".*"+e+".*").test(i[0])})},r.history.clear=function(){Kt&&(Kt.length=0)},r.history.disable=function(){null!==Kt&&(Kt.length=0,Kt=null)},r.history.enable=function(){null===Kt&&(Kt=[])},r.error=function(){for(var e=arguments.length,i=new Array(e),a=0;a1?n-1:0),r=1;r=0)throw new Error("class has illegal whitespace characters")}function Rr(){return K()===P().document}function Mr(s){return Ii(s)&&1===s.nodeType}function Mu(){try{return P().parent!==P().self}catch(s){return!0}}function Nu(s){return function(n,t){if(!Ou(n))return K()[s](null);Ou(t)&&(t=K().querySelector(t));var r=Mr(t)?t:K();return r[s]&&r[s](n)}}function $e(s,n,t,r){void 0===s&&(s="div"),void 0===n&&(n={}),void 0===t&&(t={});var e=K().createElement(s);return Object.getOwnPropertyNames(n).forEach(function(i){var a=n[i];-1!==i.indexOf("aria-")||"role"===i||"type"===i?(ze.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+i+" to "+a+"."),e.setAttribute(i,a)):"textContent"===i?nr(e,a):(e[i]!==a||"tabIndex"===i)&&(e[i]=a)}),Object.getOwnPropertyNames(t).forEach(function(i){e.setAttribute(i,t[i])}),r&&Es(e,r),e}function nr(s,n){return void 0===s.textContent?s.innerText=n:s.textContent=n,s}function xs(s,n){n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s)}function ar(s,n){return Ru(n),s.classList?s.classList.contains(n):function Dh(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}(n).test(s.className)}function Li(s,n){return s.classList?s.classList.add(n):ar(s,n)||(s.className=(s.className+" "+n).trim()),s}function mn(s,n){return s?(s.classList?s.classList.remove(n):(Ru(n),s.className=s.className.split(/\s+/).filter(function(t){return t!==n}).join(" ")),s):(ze.warn("removeClass was called with an element that doesn't exist"),null)}function Fu(s,n,t){var r=ar(s,n);if("function"==typeof t&&(t=t(s,n)),"boolean"!=typeof t&&(t=!r),t!==r)return t?Li(s,n):mn(s,n),s}function Uu(s,n){Object.getOwnPropertyNames(n).forEach(function(t){var r=n[t];null==r||!1===r?s.removeAttribute(t):s.setAttribute(t,!0===r?"":r)})}function Oi(s){var n={};if(s&&s.attributes&&s.attributes.length>0)for(var r=s.attributes,e=r.length-1;e>=0;e--){var i=r[e].name,a=r[e].value;("boolean"==typeof s[i]||-1!==",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+","))&&(a=null!==a),n[i]=a}return n}function Bu(s,n){return s.getAttribute(n)}function Nr(s,n,t){s.setAttribute(n,t)}function Qn(s,n){s.removeAttribute(n)}function Hu(){K().body.focus(),K().onselectstart=function(){return!1}}function ju(){K().onselectstart=function(){return!0}}function Fr(s){if(s&&s.getBoundingClientRect&&s.parentNode){var n=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(r){void 0!==n[r]&&(t[r]=n[r])}),t.height||(t.height=parseFloat(fn(s,"height"))),t.width||(t.width=parseFloat(fn(s,"width"))),t}}function gn(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var n=s.offsetWidth,t=s.offsetHeight,r=0,e=0;s.offsetParent&&s!==K()[zn.fullscreenElement];)r+=s.offsetLeft,e+=s.offsetTop,s=s.offsetParent;return{left:r,top:e,width:n,height:t}}function Jn(s,n){var t={x:0,y:0};if(jt)for(var r=s;r&&"html"!==r.nodeName.toLowerCase();){var e=fn(r,"transform");if(/^matrix/.test(e)){var i=e.slice(7,-1).split(/,\s/).map(Number);t.x+=i[4],t.y+=i[5]}else if(/^matrix3d/.test(e)){var a=e.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}r=r.parentNode}var o={},l=gn(n.target),d=gn(s),f=d.width,g=n.offsetY-(d.top-l.top),T=n.offsetX-(d.left-l.left);return n.changedTouches&&(T=n.changedTouches[0].pageX-d.left,g=n.changedTouches[0].pageY+d.top,jt&&(T-=t.x,g-=t.y)),o.y=1-Math.max(0,Math.min(1,g/d.height)),o.x=Math.max(0,Math.min(1,T/f)),o}function Vu(s){return Ii(s)&&3===s.nodeType}function Ss(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function qu(s){return"function"==typeof s&&(s=s()),(Array.isArray(s)?s:[s]).map(function(n){return"function"==typeof n&&(n=n()),Mr(n)||Vu(n)?n:"string"==typeof n&&/\S/.test(n)?K().createTextNode(n):void 0}).filter(function(n){return n})}function Es(s,n){return qu(n).forEach(function(t){return s.appendChild(t)}),s}function Wu(s,n){return Es(Ss(s),n)}function vn(s){return void 0===s.button&&void 0===s.buttons||0===s.button&&void 0===s.buttons||"mouseup"===s.type&&0===s.button&&0===s.buttons||!(0!==s.button||1!==s.buttons)}var Cs,Gi=Nu("querySelector"),Gu=Nu("querySelectorAll"),Zu=Object.freeze({__proto__:null,isReal:Rr,isEl:Mr,isInFrame:Mu,createEl:$e,textContent:nr,prependTo:xs,hasClass:ar,addClass:Li,removeClass:mn,toggleClass:Fu,setAttributes:Uu,getAttributes:Oi,getAttribute:Bu,setAttribute:Nr,removeAttribute:Qn,blockTextSelection:Hu,unblockTextSelection:ju,getBoundingClientRect:Fr,findPosition:gn,getPointerPosition:Jn,isTextNode:Vu,emptyEl:Ss,normalizeContent:qu,appendContent:Es,insertContent:Wu,isSingleLeftClick:vn,$:Gi,$$:Gu}),zu=!1,Ph=function(){if(!1!==Cs.options.autoSetup){var n=Array.prototype.slice.call(K().getElementsByTagName("video")),t=Array.prototype.slice.call(K().getElementsByTagName("audio")),r=Array.prototype.slice.call(K().getElementsByTagName("video-js")),e=n.concat(t,r);if(e&&e.length>0)for(var i=0,a=e.length;i-1&&(e={passive:!0}),s.addEventListener(n,r.dispatcher,e)}else s.attachEvent&&s.attachEvent("on"+n,r.dispatcher)}function Nt(s,n,t){if(Vt.has(s)){var r=Vt.get(s);if(r.handlers){if(Array.isArray(n))return ws(Nt,s,n,t);var e=function(d,f){r.handlers[f]=[],Xu(d,f)};if(void 0===n){for(var i in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},i)&&e(s,i);return}var a=r.handlers[n];if(a){if(!t)return void e(s,n);if(t.guid)for(var o=0;o=t&&(n.apply(void 0,arguments),r=a)}},It=function(){};It.prototype.allowedEvents_={},It.prototype.addEventListener=It.prototype.on=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Qt(this,s,n),this.addEventListener=t},It.prototype.removeEventListener=It.prototype.off=function(s,n){Nt(this,s,n)},It.prototype.one=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},ia(this,s,n),this.addEventListener=t},It.prototype.any=function(s,n){var t=this.addEventListener;this.addEventListener=function(){},Qu(this,s,n),this.addEventListener=t},It.prototype.dispatchEvent=It.prototype.trigger=function(s){var n=s.type||s;"string"==typeof s&&(s={type:n}),s=ea(s),this.allowedEvents_[n]&&this["on"+n]&&this["on"+n](s),Ur(this,s)},It.prototype.queueTrigger=function(s){var n=this;_n||(_n=new Map);var t=s.type||s,r=_n.get(this);r||_n.set(this,r=new Map);var e=r.get(t);r.delete(t),P().clearTimeout(e);var i=P().setTimeout(function(){0===r.size&&(r=null,_n.delete(n)),n.trigger(s)},0);r.set(t,i)};var ra=function(n){return"function"==typeof n.name?n.name():"string"==typeof n.name?n.name:n.name_?n.name_:n.constructor&&n.constructor.name?n.constructor.name:typeof n},Mi=function(n){return n instanceof It||!!n.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof n[t]})},Is=function(n){return"string"==typeof n&&/\S/.test(n)||Array.isArray(n)&&!!n.length},na=function(n,t,r){if(!n||!n.nodeName&&!Mi(n))throw new Error("Invalid target for "+ra(t)+"#"+r+"; must be a DOM node or evented object.")},Ju=function(n,t,r){if(!Is(n))throw new Error("Invalid event type for "+ra(t)+"#"+r+"; must be a non-empty string or array.")},el=function(n,t,r){if("function"!=typeof n)throw new Error("Invalid listener for "+ra(t)+"#"+r+"; must be a function.")},Ds=function(n,t,r){var i,a,o,e=t.length<3||t[0]===n||t[0]===n.eventBusEl_;return e?(i=n.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(i=t[0],a=t[1],o=t[2]),na(i,n,r),Ju(a,n,r),el(o,n,r),{isTargetingSelf:e,target:i,type:a,listener:o=at(n,o)}},sr=function(n,t,r,e){na(n,n,t),n.nodeName?Nh[t](n,r,e):n[t](r,e)},Bh={on:function(){for(var n=this,t=arguments.length,r=new Array(t),e=0;e=0;r--)this.children_[r].dispose&&this.children_[r].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null}},n.isDisposed=function(){return Boolean(this.isDisposed_)},n.player=function(){return this.player_},n.options=function(r){return r?(this.options_=ct(this.options_,r),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(r,e,i){return $e(r,e,i)},n.localize=function(r,e,i){void 0===i&&(i=r);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],d=a&&a.split("-")[0],f=o&&o[d],v=i;return l&&l[r]?v=l[r]:f&&f[r]&&(v=f[r]),e&&(v=v.replace(/\{(\d+)\}/g,function(g,T){var E=e[T-1],x=E;return void 0===E&&(x=g),x})),v},n.handleLanguagechange=function(){},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(r){return this.childIndex_[r]},n.getChild=function(r){if(r)return this.childNameIndex_[r]},n.getDescendant=function(){for(var r=arguments.length,e=new Array(r),i=0;i=0;i--)if(this.children_[i]===r){e=!0,this.children_.splice(i,1);break}if(e){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[bt(r.name())]=null,this.childNameIndex_[aa(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},n.initChildren=function(){var r=this,e=this.options_.children;if(e){var o,i=this.options_,l=s.getComponent("Tech");(o=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(d){return!o.some(function(f){return"string"==typeof f?d===f:d===f.name})})).map(function(d){var f,v;return"string"==typeof d?v=e[f=d]||r.options_[f]||{}:(f=d.name,v=d),{name:f,opts:v}}).filter(function(d){var f=s.getComponent(d.opts.componentClass||bt(d.name));return f&&!l.isTech(f)}).forEach(function(f){var v=f.name,g=f.opts;if(void 0!==i[v]&&(g=i[v]),!1!==g){!0===g&&(g={}),g.playerOptions=r.options_.playerOptions;var T=r.addChild(v,g);T&&(r[v]=T)}})}},n.buildCSSClass=function(){return""},n.ready=function(r,e){if(void 0===e&&(e=!1),r){if(!this.isReady_)return this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(r);e?r.call(this):this.setTimeout(r,1)}},n.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},n.$=function(r,e){return Gi(r,e||this.contentEl())},n.$$=function(r,e){return Gu(r,e||this.contentEl())},n.hasClass=function(r){return ar(this.el_,r)},n.addClass=function(r){Li(this.el_,r)},n.removeClass=function(r){mn(this.el_,r)},n.toggleClass=function(r,e){Fu(this.el_,r,e)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(r){return Bu(this.el_,r)},n.setAttribute=function(r,e){Nr(this.el_,r,e)},n.removeAttribute=function(r){Qn(this.el_,r)},n.width=function(r,e){return this.dimension("width",r,e)},n.height=function(r,e){return this.dimension("height",r,e)},n.dimensions=function(r,e){this.width(r,!0),this.height(e)},n.dimension=function(r,e,i){if(void 0!==e)return(null===e||e!=e)&&(e=0),this.el_.style[r]=-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?e:"auto"===e?"":e+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[r],o=a.indexOf("px");return parseInt(-1!==o?a.slice(0,o):this.el_["offset"+bt(r)],10)},n.currentDimension=function(r){var e=0;if("width"!==r&&"height"!==r)throw new Error("currentDimension only accepts width or height value");if(e=fn(this.el_,r),0===(e=parseFloat(e))||isNaN(e)){var i="offset"+bt(r);e=this.el_[i]}return e},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(r){this.player_&&(Ie().isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},n.handleKeyPress=function(r){this.handleKeyDown(r)},n.emitTapEvents=function(){var o,r=0,e=null;this.on("touchstart",function(d){1===d.touches.length&&(e={pageX:d.touches[0].pageX,pageY:d.touches[0].pageY},r=P().performance.now(),o=!0)}),this.on("touchmove",function(d){if(d.touches.length>1)o=!1;else if(e){var f=d.touches[0].pageX-e.pageX,v=d.touches[0].pageY-e.pageY;Math.sqrt(f*f+v*v)>10&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(d){e=null,!0===o&&P().performance.now()-r<200&&(d.preventDefault(),this.trigger("tap"))})},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,r=at(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)});var i=function(o){r(),this.clearInterval(e)};this.on("touchmove",r),this.on("touchend",i),this.on("touchcancel",i)}},n.setTimeout=function(r,e){var a,i=this;return r=at(this,r),this.clearTimersOnDispose_(),a=P().setTimeout(function(){i.setTimeoutIds_.has(a)&&i.setTimeoutIds_.delete(a),r()},e),this.setTimeoutIds_.add(a),a},n.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),P().clearTimeout(r)),r},n.setInterval=function(r,e){r=at(this,r),this.clearTimersOnDispose_();var i=P().setInterval(r,e);return this.setIntervalIds_.add(i),i},n.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),P().clearInterval(r)),r},n.requestAnimationFrame=function(r){var i,e=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),r=at(this,r),i=P().requestAnimationFrame(function(){e.rafIds_.has(i)&&e.rafIds_.delete(i),r()}),this.rafIds_.add(i),i):this.setTimeout(r,1e3/60)},n.requestNamedAnimationFrame=function(r,e){var i=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),e=at(this,e);var a=this.requestAnimationFrame(function(){e(),i.namedRafs_.has(r)&&i.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},n.cancelNamedAnimationFrame=function(r){!this.namedRafs_.has(r)||(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},n.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),P().cancelAnimationFrame(r)),r):this.clearTimeout(r)},n.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var a=e[1];r[e[0]].forEach(function(o,l){return r[a](l)})}),r.clearingTimersOnDispose_=!1}))},s.registerComponent=function(r,e){if("string"!=typeof r||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var i=s.getComponent("Tech"),a=i&&i.isTech(e),o=s===e||s.prototype.isPrototypeOf(e.prototype);if(a||!o)throw new Error('Illegal component, "'+r+'"; '+(a?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");r=bt(r),s.components_||(s.components_={});var d=s.getComponent("Player");if("Player"===r&&d&&d.players){var f=d.players,v=Object.keys(f);if(f&&v.length>0&&v.map(function(g){return f[g]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[r]=e,s.components_[aa(r)]=e,e},s.getComponent=function(r){if(r&&s.components_)return s.components_[r]},s}();function il(s,n,t,r){return function Gh(s,n,t){if("number"!=typeof n||n<0||n>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+n+") is non-numeric or out of bounds (0-"+t+").")}(s,r,t.length-1),t[r][n]}function Os(s){var n;return n=void 0===s||0===s.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:s.length,start:il.bind(null,"start",0,s),end:il.bind(null,"end",1,s)},P().Symbol&&P().Symbol.iterator&&(n[P().Symbol.iterator]=function(){return(s||[]).values()}),n}function or(s,n){return Array.isArray(s)?Os(s):void 0===s||void 0===n?Os():Os([[s,n]])}function rl(s,n){var r,e,t=0;if(!n)return 0;(!s||!s.length)&&(s=or(0,0));for(var i=0;in&&(e=n),t+=e-r;return t/n}function qt(s){if(s instanceof qt)return s;"number"==typeof s?this.code=s:"string"==typeof s?this.message=s:Ii(s)&&("number"==typeof s.code&&(this.code=s.code),_t(this,s)),this.message||(this.message=qt.defaultMessages[this.code]||"")}$.prototype.supportsRaf_="function"==typeof P().requestAnimationFrame&&"function"==typeof P().cancelAnimationFrame,$.registerComponent("Component",$),qt.prototype.code=0,qt.prototype.message="",qt.prototype.status=null,qt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],qt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Br=0;Br=0;i--)if(r[i].enabled){Ns(r,r[i]);break}return(e=s.call(this,r)||this).changing_=!1,e}ie(n,s);var t=n.prototype;return t.addTrack=function(e){var i=this;e.enabled&&Ns(this,e),s.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){i.changing_||(i.changing_=!0,Ns(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},n}(jr),Fs=function(n,t){for(var r=0;r=0;i--)if(r[i].selected){Fs(r,r[i]);break}return(e=s.call(this,r)||this).changing_=!1,Object.defineProperty(Fe(e),"selectedIndex",{get:function(){for(var o=0;o0&&(P().console&&P().console.groupCollapsed&&P().console.groupCollapsed("Text Track parsing errors for "+t.src),e.forEach(function(i){return ze.error(i)}),P().console&&P().console.groupEnd&&P().console.groupEnd()),r.flush()},dl=function(n,t){var r={uri:n},e=sa(n);e&&(r.cors=e);var i="use-credentials"===t.tech_.crossOrigin();i&&(r.withCredentials=i),ki()(r,at(this,function(a,o,l){if(a)return ze.error(a,o);t.loaded_=!0,"function"!=typeof P().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(d){if("vttjserror"!==d.type)return ll(l,t);ze.error("vttjs failed to load, stopping trying to process "+t.src)}):ll(l,t)}))},Tn=function(s){function n(r){var e;if(void 0===r&&(r={}),!r.tech)throw new Error("A tech was not provided.");var i=ct(r,{kind:ep[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=ol[i.mode]||"disabled",o=i.default;("metadata"===i.kind||"chapters"===i.kind)&&(a="hidden"),(e=s.call(this,i)||this).tech_=i.tech,e.cues_=[],e.activeCues_=[],e.preload_=!1!==e.tech_.preloadTextTracks;var l=new sl(e.cues_),d=new sl(e.activeCues_),f=!1,v=at(Fe(e),function(){!this.tech_.isReady_||this.tech_.isDisposed()||(this.activeCues=this.activeCues,f&&(this.trigger("cuechange"),f=!1))});return e.tech_.one("dispose",function(){e.tech_.off("timeupdate",v)}),"disabled"!==a&&e.tech_.on("timeupdate",v),Object.defineProperties(Fe(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(E){!ol[E]||a!==E&&(a=E,!this.preload_&&"disabled"!==a&&0===this.cues.length&&dl(this.src,this),this.tech_.off("timeupdate",v),"disabled"!==a&&this.tech_.on("timeupdate",v),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var E=this.tech_.currentTime(),x=[],S=0,F=this.cues.length;S=E||U.startTime===U.endTime&&U.startTime<=E&&U.startTime+.5>=E)&&x.push(U)}if(f=!1,x.length!==this.activeCues_.length)f=!0;else for(var H=0;H0)return void this.trigger("vttjsloaded");var i=K().createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",i.onload=function(){e.trigger("vttjsloaded")},i.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){i.onload=null,i.onerror=null}),P().WebVTT=!0,this.el().parentNode.appendChild(i)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var e=this,i=this.textTracks(),a=this.remoteTextTracks(),o=function(g){return i.addTrack(g.track)},l=function(g){return i.removeTrack(g.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var d=function(){return e.trigger("texttrackchange")},f=function(){d();for(var g=0;g=0;e--){var i=s[e];i[n]&&i[n](r,t)}}(s,t,o,a),o}var dp={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},cp={setCurrentTime:1,setMuted:1,setVolume:1},gl={play:1,pause:1};function Vs(s){return function(n,t){return n===oa?oa:t[s]?t[s](n):n}}function lr(s,n,t,r,e,i){void 0===s&&(s={}),void 0===n&&(n=[]),void 0===e&&(e=[]),void 0===i&&(i=!1);var o=n[0],l=n.slice(1);if("string"==typeof o)lr(s,ur[o],t,r,e,i);else if(o){var d=function pp(s,n){var t=js[s.id()],r=null;if(null==t)return r=n(s),js[s.id()]=[[n,r]],r;for(var e=0;e0;this.player_.tech(!0)&&!((pn||hn)&&i)&&this.player_.tech(!0).focus(),this.player_.paused()?yi(this.player_.play()):this.player_.pause()}},n}(la);$.registerComponent("PosterImage",yp);var ni="#222",Tp={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function qs(s,n){var t;if(4===s.length)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else{if(7!==s.length)throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");t=s.slice(1)}return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+n+")"}function Ws(s,n,t){try{s.style[n]=t}catch(r){return}}var bp=function(s){function n(r,e,i){var a;a=s.call(this,r,e,i)||this;var o=function(d){return a.updateDisplay(d)};return r.on("loadstart",function(l){return a.toggleDisplay(l)}),r.on("texttrackchange",o),r.on("loadedmetadata",function(l){return a.preselectTrack(l)}),r.ready(at(Fe(a),function(){if(r.tech_&&r.tech_.featuresNativeTextTracks)this.hide();else{r.on("fullscreenchange",o),r.on("playerresize",o),P().addEventListener("orientationchange",o),r.on("dispose",function(){return P().removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],d=0;d0;return yi(i),void(this.player_.tech(!0)&&(!pn&&!hn||!a)&&this.player_.tech(!0).focus())}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(l){var d=function(){return l.focus()};yn(i)?i.then(d,function(){}):this.setTimeout(d,1)}else this.player_.tech(!0).focus()},t.handleKeyDown=function(e){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,e)},t.handleMouseDown=function(e){this.mouseused_=!0},n}(hi);yl.prototype.controlText_="Play Video",$.registerComponent("BigPlayButton",yl);var Sp=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).controlText(e&&e.controlText||i.localize("Close")),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(e){Ie().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,e)},n}(hi);$.registerComponent("CloseButton",Sp);var Tl=function(s){function n(r,e){var i;return void 0===e&&(e={}),i=s.call(this,r,e)||this,e.replay=void 0===e.replay||e.replay,i.on(r,"play",function(a){return i.handlePlay(a)}),i.on(r,"pause",function(a){return i.handlePause(a)}),e.replay&&i.on(r,"ended",function(a){return i.handleEnded(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.player_.paused()?yi(this.player_.play()):this.player_.pause()},t.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(e){var i=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return i.handleSeeked(a)})},n}(hi);Tl.prototype.controlText_="Play",$.registerComponent("PlayToggle",Tl);var bl=function(n,t){n=n<0?0:n;var r=Math.floor(n%60),e=Math.floor(n/60%60),i=Math.floor(n/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(n)||n===1/0)&&(i=e=r="-"),(i=i>0||o>0?i+":":"")+(e=((i||a>=10)&&e<10?"0"+e:e)+":")+(r<10?"0"+r:r)},Gs=bl;function Wr(s,n){return void 0===n&&(n=s),Gs(s,n)}var Gr=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,["timeupdate","ended"],function(a){return i.updateContent(a)}),i.updateTextNode_(),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=this.buildCSSClass(),i=s.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=$e("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xa0"},{role:"presentation"});return i.appendChild(a),this.contentEl_=$e("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(e){var i=this;void 0===e&&(e=0),e=Wr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(i.contentEl_){var a=i.textNode_;a&&i.contentEl_.firstChild!==a&&(a=null,ze.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),i.textNode_=K().createTextNode(i.formattedTime_),i.textNode_&&(a?i.contentEl_.replaceChild(i.textNode_,a):i.contentEl_.appendChild(i.textNode_))}}))},t.updateContent=function(e){},n}($);Gr.prototype.labelText_="Time",Gr.prototype.controlText_="Time",$.registerComponent("TimeDisplay",Gr);var Zs=function(s){function n(){return s.apply(this,arguments)||this}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(e){var i;i=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)},n}(Gr);Zs.prototype.labelText_="Current Time",Zs.prototype.controlText_="Current Time",$.registerComponent("CurrentTimeDisplay",Zs);var zs=function(s){function n(r,e){var i,a=function(l){return i.updateContent(l)};return(i=s.call(this,r,e)||this).on(r,"durationchange",a),i.on(r,"loadstart",a),i.on(r,"loadedmetadata",a),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var i=this.player_.duration();this.updateTextNode_(i)},n}(Gr);zs.prototype.labelText_="Duration",zs.prototype.controlText_="Duration",$.registerComponent("DurationDisplay",zs);var kp=function(s){function n(){return s.apply(this,arguments)||this}return ie(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(a),e.appendChild(i),e},n}($);$.registerComponent("TimeDivider",kp);var Ks=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,"durationchange",function(a){return i.updateContent(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=s.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&e.insertBefore($e("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){var i;"number"==typeof this.player_.duration()&&(i=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(i))},n}(Gr);Ks.prototype.labelText_="Remaining Time",Ks.prototype.controlText_="Remaining Time",$.registerComponent("RemainingTimeDisplay",Ks);var Ap=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).updateShowing(),i.on(i.player(),"durationchange",function(a){return i.updateShowing(a)}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=$e("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild($e("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xa0"})),this.contentEl_.appendChild(K().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},n}($);$.registerComponent("LiveDisplay",Ap);var xl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(a){return i.updateLiveEdgeStatus(a)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=$e("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},n}(hi);xl.prototype.controlText_="Seek to live, currently playing live",$.registerComponent("SeekToLive",xl);var da=function(n,t,r){return n=Number(n),Math.min(r,Math.max(t,isNaN(n)?t:n))},$s=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).handleMouseDown_=function(a){return i.handleMouseDown(a)},i.handleMouseUp_=function(a){return i.handleMouseUp(a)},i.handleKeyDown_=function(a){return i.handleKeyDown(a)},i.handleClick_=function(a){return i.handleClick(a)},i.handleMouseMove_=function(a){return i.handleMouseMove(a)},i.update_=function(a){return i.update(a)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}ie(n,s);var t=n.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(e,i,a){return void 0===i&&(i={}),void 0===a&&(a={}),i.className=i.className+" vjs-slider",i=_t({tabIndex:0},i),a=_t({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,e,i,a)},t.handleMouseDown=function(e){var i=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"===e.type&&!Pi&&e.preventDefault(),Hu(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},t.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;ju(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var e=this;if(this.el_&&this.bar){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*i).toFixed(2)+"%"})),i}},t.getProgress=function(){return Number(da(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(e){var i=Jn(this.el_,e);return this.vertical()?i.y:i.x},t.handleKeyDown=function(e){Ie().isEventKey(e,"Left")||Ie().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):Ie().isEventKey(e,"Right")||Ie().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.addClass(this.vertical_?"vjs-slider-vertical":"vjs-slider-horizontal")},n}($);$.registerComponent("Slider",$s);var Ys=function(n,t){return da(n/t*100,0,100).toFixed(2)+"%"},wp=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).partEls_=[],i.on(r,"progress",function(a){return i.update(a)}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=$e("span",{className:"vjs-control-text"}),a=$e("span",{textContent:this.localize("Loaded")}),o=K().createTextNode(": ");return this.percentageEl_=$e("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(a),i.appendChild(o),i.appendChild(this.percentageEl_),e},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(e){var i=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=i.player_.liveTracker,o=i.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():i.player_.duration(),d=i.player_.bufferedEnd(),f=i.partEls_,v=Ys(d,l);i.percent_!==v&&(i.el_.style.width=v,nr(i.percentageEl_,v),i.percent_=v);for(var g=0;go.length;S--)i.el_.removeChild(f[S-1]);f.length=o.length})},n}($);$.registerComponent("LoadProgressBar",wp);var Ip=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(e,i,a){var o=gn(this.el_),l=Fr(this.player_.el()),d=e.width*i;if(l&&o){var f=e.left-l.left+d,v=e.width-d+(l.right-e.right),g=o.width/2;fo.width&&(g=o.width),g=Math.round(g),this.el_.style.right="-"+g+"px",this.write(a)}},t.write=function(e){nr(this.el_,e)},t.updateTime=function(e,i,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var d,f=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var v=l.player_.liveTracker.liveWindow(),g=v-i*v;d=(g<1?"":"-")+Wr(g,v)}else d=Wr(a,f);l.update(e,i,d),o&&o()})},n}($);$.registerComponent("TimeTooltip",Ip);var Xs=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(e,i){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,i,o)}},n}($);Xs.prototype.options_={children:[]},!jt&&!Di&&Xs.prototype.options_.children.push("timeTooltip"),$.registerComponent("PlayProgressBar",Xs);var Sl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,i){var a=this,o=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,o,function(){a.el_.style.left=e.width*i+"px"})},n}($);Sl.prototype.options_={children:["timeTooltip"]},$.registerComponent("MouseTimeDisplay",Sl);var Qs=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).setEventHandlers_(),i}ie(n,s);var t=n.prototype;return t.setEventHandlers_=function(){var e=this;this.update_=at(this,this.update),this.update=Ri(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(i){return e.enableInterval_(i)},this.disableIntervalHandler_=function(i){return e.disableInterval_(i)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in K()&&"visibilityState"in K()&&this.on(K(),"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){"hidden"===K().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(e){var i=this;if("hidden"!==K().visibilityState){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),l=i.player_.liveTracker,d=i.player_.duration();l&&l.isLive()&&(d=i.player_.liveTracker.liveCurrentTime()),i.percent_!==a&&(i.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),i.percent_=a),(i.currentTime_!==o||i.duration_!==d)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Wr(o,d),Wr(d,d)],"{1} of {2}")),i.currentTime_=o,i.duration_=d),i.bar&&i.bar.update(Fr(i.el()),i.getProgress())}),a}},t.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var i,e=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(i=(e-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i},t.handleMouseDown=function(e){!vn(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e,i){if(void 0===i&&(i=!1),vn(e)){!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(e),l=this.player_.liveTracker;if(l&&l.isLive()){if(o>=.99)return void l.seekToLiveEdge();var d=l.seekableStart(),f=l.liveCurrentTime();if((a=d+o*l.liveWindow())>=f&&(a=f),a<=d&&(a=d+.1),a===1/0)return}else(a=o*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.show()},t.disable=function(){s.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.hide()},t.handleMouseUp=function(e){s.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?yi(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){var i=this.player_.liveTracker;if(Ie().isEventKey(e,"Space")||Ie().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(Ie().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(Ie().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Ie()(e))){e.preventDefault(),e.stopPropagation();var a=10*(Ie().codes[Ie()(e)]-Ie().codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else Ie().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):Ie().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):s.prototype.handleKeyDown.call(this,e)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in K()&&"visibilityState"in K()&&this.off(K(),"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},n}($s);Qs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},!jt&&!Di&&Qs.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),$.registerComponent("SeekBar",Qs);var Cl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).handleMouseMove=Ri(at(Fe(i),i.handleMouseMove),30),i.throttledHandleMouseSeek=Ri(at(Fe(i),i.handleMouseSeek),30),i.handleMouseUpHandler_=function(a){return i.handleMouseUp(a)},i.handleMouseDownHandler_=function(a){return i.handleMouseDown(a)},i.enable(),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var i=this.getChild("seekBar");if(i){var a=i.getChild("playProgressBar"),o=i.getChild("mouseTimeDisplay");if(a||o){var l=i.el(),d=gn(l),f=Jn(l,e).x;f=da(f,0,1),o&&o.update(d,f),a&&a.update(d,i.getProgress())}}},t.handleMouseSeek=function(e){var i=this.getChild("seekBar");i&&i.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(i){return i.disable&&i.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&yi(this.player_.play())}},t.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(e){var i=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},n}($);Cl.prototype.options_={children:["seekBar"]},$.registerComponent("ProgressControl",Cl);var kl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,["enterpictureinpicture","leavepictureinpicture"],function(a){return i.handlePictureInPictureChange(a)}),i.on(r,["disablepictureinpicturechanged","loadedmetadata"],function(a){return i.handlePictureInPictureEnabledChange(a)}),i.disable(),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){K().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},t.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},n}(hi);kl.prototype.controlText_="Picture-in-Picture",$.registerComponent("PictureInPictureToggle",kl);var Al=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,"fullscreenchange",function(a){return i.handleFullscreenChange(a)}),!1===K()[r.fsApi_.fullscreenEnabled]&&i.disable(),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},n}(hi);Al.prototype.controlText_="Fullscreen",$.registerComponent("FullscreenToggle",Al);var Pp=function(s){function n(){return s.apply(this,arguments)||this}return ie(n,s),n.prototype.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},n}($);$.registerComponent("VolumeLevel",Pp);var Lp=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(e,i,a,o){if(!a){var l=Fr(this.el_),d=Fr(this.player_.el()),f=e.width*i;if(!d||!l)return;var v=e.left-d.left+f,g=e.width-f+(d.right-e.right),T=l.width/2;vl.width&&(T=l.width),this.el_.style.right="-"+T+"px"}this.write(o+"%")},t.write=function(e){nr(this.el_,e)},t.updateVolume=function(e,i,a,o,l){var d=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){d.update(e,i,a,o.toFixed(0)),l&&l()})},n}($);$.registerComponent("VolumeLevelTooltip",Lp);var wl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).update=Ri(at(Fe(i),i.update),30),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,i,a){var o=this,l=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,a,l,function(){a?o.el_.style.bottom=e.height*i+"px":o.el_.style.left=e.width*i+"px"})},n}($);wl.prototype.options_={children:["volumeLevelTooltip"]},$.registerComponent("MouseVolumeLevelDisplay",wl);var fa=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on("slideractive",function(a){return i.updateLastVolume_(a)}),i.on(r,"volumechange",function(a){return i.updateARIAAttributes(a)}),r.ready(function(){return i.updateARIAAttributes()}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){!vn(e)||s.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){var i=this.getChild("mouseVolumeLevelDisplay");if(i){var a=this.el(),o=Fr(a),l=this.vertical(),d=Jn(a,e);d=da(d=l?d.y:d.x,0,1),i.update(o,d,l)}!vn(e)||(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,i=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(i)})},n}($s);fa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!jt&&!Di&&fa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),fa.prototype.playerEvent="volumechange",$.registerComponent("VolumeBar",fa);var Il=function(s){function n(r,e){var i;return void 0===e&&(e={}),e.vertical=e.vertical||!1,(void 0===e.volumeBar||cn(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),function(n,t){t.tech_&&!t.tech_.featuresVolumeControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})}(Fe(i=s.call(this,r,e)||this),r),i.throttledHandleMouseMove=Ri(at(Fe(i),i.handleMouseMove),30),i.handleMouseUpHandler_=function(a){return i.handleMouseUp(a)},i.on("mousedown",function(a){return i.handleMouseDown(a)}),i.on("touchstart",function(a){return i.handleMouseDown(a)}),i.on("mousemove",function(a){return i.handleMouseMove(a)}),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}ie(n,s);var t=n.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.handleMouseDown=function(e){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(e){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},n}($);Il.prototype.options_={children:["volumeBar"]},$.registerComponent("VolumeControl",Il);var Dl=function(s){function n(r,e){var i;return function(n,t){t.tech_&&!t.tech_.featuresMuteControl&&n.addClass("vjs-hidden"),n.on(t,"loadstart",function(){t.tech_.featuresMuteControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")})}(Fe(i=s.call(this,r,e)||this),r),i.on(r,["loadstart","volumechange"],function(a){return i.update(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var i=this.player_.volume(),a=this.player_.lastVolume_();0===i?(this.player_.volume(a<.1?.1:a),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),i=3;jt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?i=0:e<.33?i=1:e<.67&&(i=2);for(var a=0;a<4;a++)mn(this.el_,"vjs-vol-"+a);Li(this.el_,"vjs-vol-"+i)},t.updateControlText_=function(){var i=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)},n}(hi);Dl.prototype.controlText_="Mute",$.registerComponent("MuteToggle",Dl);var Pl=function(s){function n(r,e){var i;return void 0===e&&(e={}),e.inline=void 0===e.inline||e.inline,(void 0===e.volumeControl||cn(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),(i=s.call(this,r,e)||this).handleKeyPressHandler_=function(a){return i.handleKeyPress(a)},i.on(r,["loadstart"],function(a){return i.volumePanelState_(a)}),i.on(i.muteToggle,"keyup",function(a){return i.handleKeyPress(a)}),i.on(i.volumeControl,"keyup",function(a){return i.handleVolumeControlKeyUp(a)}),i.on("keydown",function(a){return i.handleKeyPress(a)}),i.on("mouseover",function(a){return i.handleMouseOver(a)}),i.on("mouseout",function(a){return i.handleMouseOut(a)}),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}ie(n,s);var t=n.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(e){Ie().isEventKey(e,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(e){this.addClass("vjs-hover"),Qt(K(),"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(e){this.removeClass("vjs-hover"),Nt(K(),"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(e){Ie().isEventKey(e,"Esc")&&this.handleMouseOut()},n}($);Pl.prototype.options_={children:["muteToggle","volumeControl"]},$.registerComponent("VolumePanel",Pl);var Ll=function(s){function n(r,e){var i;return i=s.call(this,r,e)||this,e&&(i.menuButton_=e.menuButton),i.focusedChild_=-1,i.on("keydown",function(a){return i.handleKeyDown(a)}),i.boundHandleBlur_=function(a){return i.handleBlur(a)},i.boundHandleTapClick_=function(a){return i.handleTapClick(a)},i}ie(n,s);var t=n.prototype;return t.addEventListenerForItem=function(e){e instanceof $&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof $&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),s.prototype.removeChild.call(this,e)},t.addItem=function(e){var i=this.addChild(e);i&&this.addEventListenerForItem(i)},t.createEl=function(){this.contentEl_=$e(this.options_.contentElType||"ul",{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Qt(i,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),i},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(e){var i=e.relatedTarget||K().activeElement;if(!this.children().some(function(o){return o.el()===i})){var a=this.menuButton_;a&&a.buttonPressed_&&i!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i))return;var a=i.filter(function(o){return o.el()===e.target})[0];if(!a)return;"CaptionSettingsMenuItem"!==a.name()&&this.menuButton_.focus()}},t.handleKeyDown=function(e){Ie().isEventKey(e,"Left")||Ie().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(Ie().isEventKey(e,"Right")||Ie().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var i=this.children().slice();i.length&&i[0].hasClass("vjs-menu-title")&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())},n}($);$.registerComponent("Menu",Ll);var Js=function(s){function n(r,e){var i;void 0===e&&(e={}),(i=s.call(this,r,e)||this).menuButton_=new hi(r,e),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var a=hi.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+a,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var o=function(d){return i.handleClick(d)};return i.handleMenuKeyUp_=function(l){return i.handleMenuKeyUp(l)},i.on(i.menuButton_,"tap",o),i.on(i.menuButton_,"click",o),i.on(i.menuButton_,"keydown",function(l){return i.handleKeyDown(l)}),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),Qt(K(),"keyup",i.handleMenuKeyUp_)}),i.on("mouseleave",function(l){return i.handleMouseLeave(l)}),i.on("keydown",function(l){return i.handleSubmenuKeyDown(l)}),i}ie(n,s);var t=n.prototype;return t.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.createMenu=function(){var e=new Ll(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var i=$e("li",{className:"vjs-menu-title",textContent:bt(this.options_.title),tabIndex:-1}),a=new $(this.player_,{el:i});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o-1&&"showing"===d.mode){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(e){for(var i=this.player().textTracks(),a=!0,o=0,l=i.length;o-1&&"showing"===d.mode){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},n}(xn);$.registerComponent("OffTextTrackMenuItem",Ol);var Zr=function(s){function n(r,e){return void 0===e&&(e={}),e.tracks=r.textTracks(),s.call(this,r,e)||this}return ie(n,s),n.prototype.createItems=function(e,i){var a;void 0===e&&(e=[]),void 0===i&&(i=xn),this.label_&&(a=this.label_+" off"),e.push(new Ol(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l-1){var f=new i(this.player_,{track:d,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});f.addClass("vjs-"+d.kind+"-menu-item"),e.push(f)}}return e},n}(eo);$.registerComponent("TextTrackButton",Zr);var Rl=function(s){function n(r,e){var i,a=e.track,o=e.cue,l=r.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=l&&l=0;i--){var a=e[i];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(bt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var e=[];if(!this.track_)return e;var i=this.track_.cues;if(!i)return e;for(var a=0,o=i.length;a-1&&(i.label_="captions"),i.menuButton_.controlText(bt(i.label_)),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new no(this.player_,{kind:this.label_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,e,Ml)},n}(Zr);so.prototype.kinds_=["captions","subtitles"],so.prototype.controlText_="Subtitles",$.registerComponent("SubsCapsButton",so);var Nl=function(s){function n(r,e){var i,a=e.track,o=r.audioTracks();e.label=a.label||a.language||"Unknown",e.selected=a.enabled,(i=s.call(this,r,e)||this).track=a,i.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var f=arguments.length,v=new Array(f),g=0;g=0;a--)i.push(new oo(this.player(),{rate:e[a]+"x"}));return i},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(e){var i=this.player().playbackRate(),a=this.playbackRates(),l=(a.indexOf(i)+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(e){this.update()},t.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},n}(Js);Ul.prototype.controlText_="Playback Rate",$.registerComponent("PlaybackRateMenuButton",Ul);var Bl=function(s){function n(){return s.apply(this,arguments)||this}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(e,i,a){return void 0===e&&(e="div"),void 0===i&&(i={}),void 0===a&&(a={}),i.className||(i.className=this.buildCSSClass()),s.prototype.createEl.call(this,e,i,a)},n}($);$.registerComponent("Spacer",Bl);var Mp=function(s){function n(){return s.apply(this,arguments)||this}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xa0"})},n}(Bl);$.registerComponent("CustomControlSpacer",Mp);var ha=function(s){function n(){return s.apply(this,arguments)||this}return ie(n,s),n.prototype.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},n}($);ha.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in K()&&ha.prototype.options_.children.splice(ha.prototype.options_.children.length-1,0,"pictureInPictureToggle"),$.registerComponent("ControlBar",ha);var Hl=function(s){function n(r,e){var i;return(i=s.call(this,r,e)||this).on(r,"error",function(a){return i.open(a)}),i}ie(n,s);var t=n.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var e=this.player().error();return e?this.localize(e.message):""},n}(Hr);Hl.prototype.options_=gt({},Hr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),$.registerComponent("ErrorDisplay",Hl);var uo="vjs-text-track-settings",jl=["#000","Black"],Vl=["#00F","Blue"],ql=["#0FF","Cyan"],Wl=["#0F0","Green"],Gl=["#F0F","Magenta"],Zl=["#F00","Red"],zl=["#FFF","White"],Kl=["#FF0","Yellow"],lo=["1","Opaque"],co=["0.5","Semi-Transparent"],$l=["0","Transparent"],dr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[jl,zl,Zl,Wl,Vl,Kl,Gl,ql]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[lo,co,$l]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[zl,jl,Zl,Wl,Vl,Kl,Gl,ql]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(n){return"1.00"===n?null:Number(n)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[lo,co]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[$l,co,lo]}};function Yl(s,n){if(n&&(s=n(s)),s&&"none"!==s)return s}dr.windowColor.options=dr.backgroundColor.options;var Up=function(s){function n(r,e){var i;return e.temporary=!1,(i=s.call(this,r,e)||this).updateDisplay=i.updateDisplay.bind(Fe(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=$e("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===e.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",function(){i.saveSettings(),i.close()}),i.on(i.$(".vjs-default-button"),"click",function(){i.setDefaults(),i.updateDisplay()}),Lr(dr,function(a){i.on(i.$(a.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}ie(n,s);var t=n.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(e,i,a){var o=this;void 0===i&&(i=""),void 0===a&&(a="label");var l=dr[e],d=l.id.replace("%s",this.id_),f=[i,d].join(" ").trim();return["<"+a+' id="'+d+'" class="'+("label"===a?"vjs-label":"")+'">',this.localize(l.label),"",'").join("")},t.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},t.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},t.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},t.createElColors_=function(){return $e("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return $e("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},t.createElControls_=function(){var e=this.localize("restore all settings to the default values");return $e("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var e=this;return function kh(s,n,t){return void 0===t&&(t=0),ku(s).reduce(function(r,e){return n(r,s[e],e)},t)}(dr,function(i,a,o){var l=function Np(s,n){return Yl(s.options[s.options.selectedIndex].value,n)}(e.$(a.selector),a.parser);return void 0!==l&&(i[o]=l),i},{})},t.setValues=function(e){var i=this;Lr(dr,function(a,o){!function Fp(s,n,t){if(n)for(var r=0;rthis.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(d=!1),d!==this.behindLiveEdge_&&(this.behindLiveEdge_=d,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){!this.isTracking()||(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var e=this.player_.seekable(),i=[],a=e?e.length:0;a--;)i.push(e.end(a));return i.length?i.sort()[i.length-1]:1/0},t.seekableStart=function(){for(var e=this.player_.seekable(),i=[],a=e?e.length:0;a--;)i.push(e.start(a));return i.length?i.sort()[0]:0},t.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return"number"==typeof this.trackingInterval_},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(K(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},n}($);$.registerComponent("LiveTracker",jp);var pa,fo=function(n){var t=n.el();if(t.hasAttribute("src"))return n.triggerSourceset(t.src),!0;var r=n.$$("source"),e=[],i="";if(!r.length)return!1;for(var a=0;a=2&&l.push("loadeddata"),e.readyState>=3&&l.push("canplay"),e.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(d){this.trigger(d)},this)})}},t.setScrubbing=function(e){this.isScrubbing_=e},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Xn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){ze(i,"Video is not ready. (Video.js)")}},t.duration=function(){var e=this;return this.el_.duration===1/0&&Di&&Pi&&0===this.el_.currentTime?(this.on("timeupdate",function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))}),NaN):this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var i=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",i),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",i)})}},t.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=P().navigator&&P().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)yi(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},t.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.reset=function(){n.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(e){this.el_.controls=!!e},t.addTextTrack=function(e,i,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,a):s.prototype.addTextTrack.call(this,e,i,a)},t.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,e);var i=K().createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i},t.addRemoteTextTrack=function(e,i){var a=s.prototype.addRemoteTextTrack.call(this,e,i);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(e){if(s.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var i=this.$$("track"),a=i.length;a--;)(e===i[a]||e===i[a].track)&&this.el().removeChild(i[a])},t.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),P().performance&&"function"==typeof P().performance.now?e.creationTime=P().performance.now():P().performance&&P().performance.timing&&"number"==typeof P().performance.timing.navigationStart&&(e.creationTime=P().Date.now()-P().performance.timing.navigationStart),e},n}(st);ho(be,"TEST_VID",function(){if(Rr()){var s=K().createElement("video"),n=K().createElement("track");return n.kind="captions",n.srclang="en",n.label="English",s.appendChild(n),s}}),be.isSupported=function(){try{be.TEST_VID.volume=.5}catch(s){return!1}return!(!be.TEST_VID||!be.TEST_VID.canPlayType)},be.canPlayType=function(s){return be.TEST_VID.canPlayType(s)},be.canPlaySource=function(s,n){return be.canPlayType(s.type)},be.canControlVolume=function(){try{var s=be.TEST_VID.volume;be.TEST_VID.volume=s/2+.1;var n=s!==be.TEST_VID.volume;return n&&jt?(P().setTimeout(function(){be&&be.prototype&&(be.prototype.featuresVolumeControl=s!==be.TEST_VID.volume)}),!1):n}catch(t){return!1}},be.canMuteVolume=function(){try{var s=be.TEST_VID.muted;return be.TEST_VID.muted=!s,be.TEST_VID.muted?Nr(be.TEST_VID,"muted","muted"):Qn(be.TEST_VID,"muted"),s!==be.TEST_VID.muted}catch(n){return!1}},be.canControlPlaybackRate=function(){if(Di&&Pi&&Pu<58)return!1;try{var s=be.TEST_VID.playbackRate;return be.TEST_VID.playbackRate=s/2+.1,s!==be.TEST_VID.playbackRate}catch(n){return!1}},be.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(K().createElement("video"),"src",{get:s,set:s}),Object.defineProperty(K().createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(K().createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(K().createElement("audio"),"innerHTML",{get:s,set:s})}catch(n){return!1}return!0},be.supportsNativeTextTracks=function(){return Xn||jt&&Pi},be.supportsNativeVideoTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.videoTracks)},be.supportsNativeAudioTracks=function(){return!(!be.TEST_VID||!be.TEST_VID.audioTracks)},be.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var t=s[1];ho(be.prototype,s[0],function(){return be[t]()},!0)}),be.prototype.featuresVolumeControl=be.canControlVolume(),be.prototype.movingMediaElementInDOM=!jt,be.prototype.featuresFullscreenResize=!0,be.prototype.featuresProgressEvents=!0,be.prototype.featuresTimeupdateEvents=!0,be.patchCanPlayType=function(){_s>=4&&!Du&&!Pi&&(pa=be.TEST_VID&&be.TEST_VID.constructor.prototype.canPlayType,be.TEST_VID.constructor.prototype.canPlayType=function(s){return s&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(s)?"maybe":pa.call(this,s)})},be.unpatchCanPlayType=function(){var s=be.TEST_VID.constructor.prototype.canPlayType;return pa&&(be.TEST_VID.constructor.prototype.canPlayType=pa),s},be.patchCanPlayType(),be.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch(n){}}()}},be.resetMediaElement=function(s){if(s){for(var n=s.querySelectorAll("source"),t=n.length;t--;)s.removeChild(n[t]);s.removeAttribute("src"),"function"==typeof s.load&&function(){try{s.load()}catch(r){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n,n?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){be.prototype["set"+bt(s)]=function(n){this.el_[s]=n}}),["pause","load","play"].forEach(function(s){be.prototype[s]=function(){return this.el_[s]()}}),st.withSourceHandlers(be),be.nativeSourceHandler={},be.nativeSourceHandler.canPlayType=function(s){try{return be.TEST_VID.canPlayType(s)}catch(n){return""}},be.nativeSourceHandler.canHandleSource=function(s,n){if(s.type)return be.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=Hs(s.src);return be.nativeSourceHandler.canPlayType("video/"+t)}return""},be.nativeSourceHandler.handleSource=function(s,n,t){n.setSrc(s.src)},be.nativeSourceHandler.dispose=function(){},be.registerSourceHandler(be.nativeSourceHandler),st.registerTech("Html5",be);var Jl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],po={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},mo=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};mo.forEach(function(s){var n="x"===s.charAt(0)?"x-"+s.substring(1):s;ma[s]="vjs-layout-"+n});var zp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Et=function(s){function n(r,e,i){var a;if(r.id=r.id||e.id||"vjs_video_"+Zi(),(e=_t(n.getTagSettings(r),e)).initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if("function"==typeof r.closest){var o=r.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var l=r;l&&1===l.nodeType;){if(Oi(l).hasOwnProperty("lang")){e.language=l.getAttribute("lang");break}l=l.parentNode}if((a=s.call(this,null,e,i)||this).boundDocumentFullscreenChange_=function(g){return a.documentFullscreenChange_(g)},a.boundFullWindowOnEscKey_=function(g){return a.fullWindowOnEscKey(g)},a.boundUpdateStyleEl_=function(g){return a.updateStyleEl_(g)},a.boundApplyInitTime_=function(g){return a.applyInitTime_(g)},a.boundUpdateCurrentBreakpoint_=function(g){return a.updateCurrentBreakpoint_(g)},a.boundHandleTechClick_=function(g){return a.handleTechClick_(g)},a.boundHandleTechDoubleClick_=function(g){return a.handleTechDoubleClick_(g)},a.boundHandleTechTouchStart_=function(g){return a.handleTechTouchStart_(g)},a.boundHandleTechTouchMove_=function(g){return a.handleTechTouchMove_(g)},a.boundHandleTechTouchEnd_=function(g){return a.handleTechTouchEnd_(g)},a.boundHandleTechTap_=function(g){return a.handleTechTap_(g)},a.isFullscreen_=!1,a.log=Cu(a.id_),a.fsApi_=zn,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=r,a.tagAttributes=r&&Oi(r),a.language(a.options_.language),e.languages){var d={};Object.getOwnPropertyNames(e.languages).forEach(function(g){d[g.toLowerCase()]=e.languages[g]}),a.languages_=d}else a.languages_=n.prototype.options_.languages;a.resetCache_(),a.poster_=e.poster||"",a.controls_=!!e.controls,r.controls=!1,r.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],r.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(g){if("function"!=typeof a[g])throw new Error('plugin "'+g+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),Ps(Fe(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Qt(K(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var f=ct(a.options_);e.plugins&&Object.keys(e.plugins).forEach(function(g){a[g](e.plugins[g])}),e.debug&&a.debug(!0),a.options_.playerOptions=f,a.middleware_=[],a.playbackRates(e.playbackRates),a.initChildren(),a.isAudio("audio"===r.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Or&&a.addClass("vjs-touch-enabled"),jt||a.addClass("vjs-workinghover"),n.players[a.id_]=Fe(a);var v="7.18.1".split(".")[0];return a.addClass("vjs-v"+v),a.userActive(!0),a.reportUserActivity(),a.one("play",function(g){return a.listenForUserActivity_(g)}),a.on("stageclick",function(g){return a.handleStageClick_(g)}),a.on("keydown",function(g){return a.handleKeyDown(g)}),a.on("languagechange",function(g){return a.handleLanguagechange(g)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}ie(n,s);var t=n.prototype;return t.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Nt(K(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Nt(K(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),n.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),function hp(s){js[s.id()]=null}(this),Wt.names.forEach(function(i){var o=e[Wt[i].getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this)},t.createEl=function(){var i,e=this.tag,a=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();a?i=this.el_=e.parentNode:o||(i=this.el_=s.prototype.createEl.call(this,"div"));var l=Oi(e);if(o){for(i=this.el_=e,e=this.tag=K().createElement("video");i.children.length;)e.appendChild(i.firstChild);ar(i,"video-js")||Li(i,"video-js"),i.appendChild(e),a=this.playerElIngest_=i,Object.keys(i).forEach(function(E){try{e[E]=i[E]}catch(x){}})}if(e.setAttribute("tabindex","-1"),l.tabindex="-1",(pn||Pi&&Lu)&&(e.setAttribute("role","application"),l.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(E){o&&"class"===E||i.setAttribute(E,l[E]),o&&e.setAttribute(E,l[E])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused"),!0!==P().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ku("vjs-styles-dimensions");var d=Gi(".vjs-styles-defaults"),f=Gi("head");f.insertBefore(this.styleEl_,d?d.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var v=e.getElementsByTagName("a"),g=0;g0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),g=v[1]/v[0];o=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/g:this.videoWidth()||300,l=void 0!==this.height_?this.height_:o*g,f=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(f),$u(this.styleEl_,"\n ."+f+" {\n width: "+o+"px;\n height: "+l+"px;\n }\n\n ."+f+".vjs-fluid {\n padding-top: "+100*g+"%;\n }\n ")}else{var e="number"==typeof this.width_?this.width_:this.options_.width,i="number"==typeof this.height_?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(e>=0&&(a.width=e),i>=0&&(a.height=i))}},t.loadTech_=function(e,i){var a=this;this.tech_&&this.unloadTech_();var o=bt(e),l=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==o&&this.tag&&(st.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var d=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(d=!1);var f={source:i,autoplay:d,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Wt.names.forEach(function(g){var T=Wt[g];f[T.getterName]=a[T.privateName]}),_t(f,this.options_[o]),_t(f,this.options_[l]),_t(f,this.options_[e.toLowerCase()]),this.tag&&(f.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(f.startTime=this.cache_.currentTime);var v=st.getTech(e);if(!v)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new v(f),this.tech_.ready(at(this,this.handleTechReady_),!0),function(n,t){n.forEach(function(r){var e=t.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(i){return e.addCue(i)})}),t.textTracks()}(this.textTracksJson_||[],this.tech_),Jl.forEach(function(g){a.on(a.tech_,g,function(T){return a["handleTech"+bt(g)+"_"](T)})}),Object.keys(po).forEach(function(g){a.on(a.tech_,g,function(T){0===a.tech_.playbackRate()&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+po[g]+"_"].bind(a),event:T}):a["handleTech"+po[g]+"_"](T)})}),this.on(this.tech_,"loadstart",function(g){return a.handleTechLoadStart_(g)}),this.on(this.tech_,"sourceset",function(g){return a.handleTechSourceset_(g)}),this.on(this.tech_,"waiting",function(g){return a.handleTechWaiting_(g)}),this.on(this.tech_,"ended",function(g){return a.handleTechEnded_(g)}),this.on(this.tech_,"seeking",function(g){return a.handleTechSeeking_(g)}),this.on(this.tech_,"play",function(g){return a.handleTechPlay_(g)}),this.on(this.tech_,"firstplay",function(g){return a.handleTechFirstPlay_(g)}),this.on(this.tech_,"pause",function(g){return a.handleTechPause_(g)}),this.on(this.tech_,"durationchange",function(g){return a.handleTechDurationChange_(g)}),this.on(this.tech_,"fullscreenchange",function(g,T){return a.handleTechFullscreenChange_(g,T)}),this.on(this.tech_,"fullscreenerror",function(g,T){return a.handleTechFullscreenError_(g,T)}),this.on(this.tech_,"enterpictureinpicture",function(g){return a.handleTechEnterPictureInPicture_(g)}),this.on(this.tech_,"leavepictureinpicture",function(g){return a.handleTechLeavePictureInPicture_(g)}),this.on(this.tech_,"error",function(g){return a.handleTechError_(g)}),this.on(this.tech_,"posterchange",function(g){return a.handleTechPosterChange_(g)}),this.on(this.tech_,"textdata",function(g){return a.handleTechTextData_(g)}),this.on(this.tech_,"ratechange",function(g){return a.handleTechRateChange_(g)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&("Html5"!==o||!this.tag)&&xs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var e=this;Wt.names.forEach(function(i){var a=Wt[i];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=function(n){var t=n.$$("track"),r=Array.prototype.map.call(t,function(i){return i.track});return Array.prototype.map.call(t,function(i){var a=Rs(i.track);return i.src&&(a.src=i.src),a}).concat(Array.prototype.filter.call(n.textTracks(),function(i){return-1===r.indexOf(i)}).map(Rs))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(e){return void 0===e&&ze.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(e){var i=this;if(this.tech_&&"string"==typeof e){var o,a=function(){var d=i.muted();i.muted(!0);var f=function(){i.muted(d)};i.playTerminatedQueue_.push(f);var v=i.play();if(yn(v))return v.catch(function(g){throw f(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(g||""))})};if("any"!==e||this.muted()?o="muted"!==e||this.muted()?this.play():a():yn(o=this.play())&&(o=o.catch(a)),yn(o))return o.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},t.updateSourceCaches_=function(e){void 0===e&&(e="");var i=e,a="";"string"!=typeof i&&(i=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!a&&(a=function(n,t){if(!t)return"";if(n.cache_.source.src===t&&n.cache_.source.type)return n.cache_.source.type;var r=n.cache_.sources.filter(function(o){return o.src===t});if(r.length)return r[0].type;for(var e=n.$$("source"),i=0;i0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime();this.on("timeupdate",function o(){i!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))})},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(ze.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(e){!this.controls_||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?yi(this.play()):this.pause())},t.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(e.target)})||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.doubleClick||!1!==this.options_.userActions.doubleClick)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(e){var i=e.target.player;if(!i||i===this){var a=this.el(),o=K()[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(e,i){var a=this;i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))},t.handleTechFullscreenError_=function(e,i){this.trigger("fullscreenerror",i)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(e,i){this.ready(function(){if(e in cp)return function lp(s,n,t,r){return n[t](s.reduce(Vs(t),r))}(this.middleware_,this.tech_,e,i);if(e in gl)return ml(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(a){throw ze(a),a}},!0)},t.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in dp)return function up(s,n,t){return s.reduceRight(Vs(t),n[t]())}(this.middleware_,this.tech_,e);if(e in gl)return ml(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw void 0===this.tech_[e]?(ze("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",i),i):"TypeError"===i.name?(ze("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",i),this.tech_.isReady_=!1,i):(ze(i),i)}}},t.play=function(){var e=this,i=this.options_.Promise||P().Promise;return i?new i(function(a){e.play_(a)}):this.play_()},t.play_=function(e){var i=this;void 0===e&&(e=yi),this.playCallbacks_.push(e);var a=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(l){i.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&(Xn||jt)&&this.load());var o=this.techGet_("play");null===o?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},t.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})},t.runPlayCallbacks_=function(e){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(a){a(e)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return!1!==this.techGet_("paused")},t.played=function(){return this.techGet_("played")||or(0,0)},t.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=or(0,0)),e},t.bufferedPercent=function(){return rl(this.buffered(),this.duration())},t.bufferedEnd=function(){var e=this.buffered(),i=this.duration(),a=e.end(e.length-1);return a>i&&(a=i),a},t.volume=function(e){var i;return void 0!==e?(i=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=i,this.techCall_("setVolume",i),void(i>0&&this.lastVolume_(i))):(i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i)},t.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(e){if(void 0!==e){var i=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},t.requestFullscreen=function(e){var i=this.options_.Promise||P().Promise;if(i){var a=this;return new i(function(o,l){function d(){a.off("fullscreenerror",v),a.off("fullscreenchange",f)}function f(){d(),o()}function v(T,E){d(),l(E)}a.one("fullscreenchange",f),a.one("fullscreenerror",v);var g=a.requestFullscreenHelper_(e);g&&(g.then(d,d),g.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(e){var a,i=this;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(a=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),o}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var e=this.options_.Promise||P().Promise;if(e){var i=this;return new e(function(a,o){function l(){i.off("fullscreenerror",f),i.off("fullscreenchange",d)}function d(){l(),a()}function f(g,T){l(),o(T)}i.one("fullscreenchange",d),i.one("fullscreenerror",f);var v=i.exitFullscreenHelper_();v&&(v.then(l,l),v.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var i=K()[this.fsApi_.exitFullscreen]();return i&&yi(i.then(function(){return e.isFullscreen(!1)})),i}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=K().documentElement.style.overflow,Qt(K(),"keydown",this.boundFullWindowOnEscKey_),K().documentElement.style.overflow="hidden",Li(K().body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(e){Ie().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Nt(K(),"keydown",this.boundFullWindowOnEscKey_),K().documentElement.style.overflow=this.docOrigOverflow,mn(K().body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in K()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in K())return K().exitPictureInPicture()},t.handleKeyDown=function(e){var l,d,i=this.options_.userActions;i&&i.hotkeys&&(d=(l=this.el_.ownerDocument.activeElement).tagName.toLowerCase(),l.isContentEditable||("input"===d?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(l.type):-1!==["textarea"].indexOf(d))||("function"==typeof i.hotkeys?i.hotkeys.call(this,e):this.handleHotkeys(e)))},t.handleHotkeys=function(e){var i=this.options_.userActions?this.options_.userActions.hotkeys:{},a=i.fullscreenKey,l=i.muteKey,d=void 0===l?function(x){return Ie().isEventKey(x,"m")}:l,f=i.playPauseKey,v=void 0===f?function(x){return Ie().isEventKey(x,"k")||Ie().isEventKey(x,"Space")}:f;if((void 0===a?function(x){return Ie().isEventKey(x,"f")}:a).call(this,e)){e.preventDefault(),e.stopPropagation();var g=$.getComponent("FullscreenToggle");!1!==K()[this.fsApi_.fullscreenEnabled]&&g.prototype.handleClick.call(this,e)}else d.call(this,e)?(e.preventDefault(),e.stopPropagation(),$.getComponent("MuteToggle").prototype.handleClick.call(this,e)):v.call(this,e)&&(e.preventDefault(),e.stopPropagation(),$.getComponent("PlayToggle").prototype.handleClick.call(this,e))},t.canPlayType=function(e){for(var i,a=0,o=this.options_.techOrder;a1?a.handleSrc_(o.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void a.triggerReady());!function op(s,n){s.forEach(function(t){return t.setTech&&t.setTech(n)})}(v,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},d=function(){a.off("error",l)};this.one("error",l),this.one("playing",d),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",d)}}}else this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},t.src=function(e){return this.handleSrc_(e,!1)},t.src_=function(e){var i=this,a=this.selectSource([e]);return!a||(function(n,t){return bt(n)===bt(t)}(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){i.changingSrc_=!1}),!1))},t.load=function(){this.techCall_("load")},t.reset=function(){var e=this,i=this.options_.Promise||P().Promise;this.paused()||!i?this.doReset_():yi(this.play().then(function(){return e.doReset_()}))},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Mi(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,i=e.durationDisplay,a=e.remainingTimeDisplay;i&&i.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var e=this.currentSource(),i=[];return 0!==Object.keys(e).length&&i.push(e),this.cache_.sources||i},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var i;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),i=!1):this.options_.autoplay=!!e,i=void 0===i?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)},t.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(e){var i=this;if(void 0===e)return this.error_||null;if(Wi("beforeerror").forEach(function(o){var l=o(i,e);Ii(l)&&!Array.isArray(l)||"string"==typeof l||"number"==typeof l||null===l?e=l:i.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){var a=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new qt(e),this.addClass("vjs-error"),ze.error("(CODE:"+this.error_.code+" "+qt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Wi("error").forEach(function(o){return o(i,i.error_)})},t.reportUserActivity=function(e){this.userActivity_=!0},t.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var e,i,a,o=at(this,this.reportUserActivity),f=function(E){o(),this.clearInterval(e)};this.on("mousedown",function(){o(),this.clearInterval(e),e=this.setInterval(o,250)}),this.on("mousemove",function(E){(E.screenX!==i||E.screenY!==a)&&(i=E.screenX,a=E.screenY,o())}),this.on("mouseup",f),this.on("mouseleave",f);var g,v=this.getChild("controlBar");v&&!jt&&!Di&&(v.on("mouseenter",function(T){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),v.on("mouseleave",function(T){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);var T=this.options_.inactivityTimeout;T<=0||(g=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},T))}},250)},t.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.addTextTrack=function(e,i,a){if(this.tech_)return this.tech_.addTextTrack(e,i,a)},t.addRemoteTextTrack=function(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)},t.removeRemoteTextTrack=function(e){void 0===e&&(e={});var a=e.track;if(a||(a=e),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Mi(this)&&this.trigger("languagechange"))},t.languages=function(){return ct(n.prototype.options_.languages,this.languages_)},t.toJSON=function(){var e=ct(this.options_),i=e.tracks;e.tracks=[];for(var a=0;a"):function(){}},zi=1/30,bi=.1,rd=function(n,t){var e,r=[];if(n&&n.length)for(e=0;e=t})},xa=function(n,t){return rd(n,function(r){return r-zi>=t})},nd=function(n){var t=[];if(!n||!n.length)return"";for(var r=0;r "+n.end(r));return t.join(", ")},cr=function(n){for(var t=[],r=0;ra)){if(t>i&&t<=a){r+=a-t;continue}r+=a-i}}return r},sd=N.createTimeRange,_o=function(n,t){if(!t.preload)return t.duration;var r=0;return(t.parts||[]).forEach(function(e){r+=e.duration}),(t.preloadHints||[]).forEach(function(e){"PART"===e.type&&(r+=n.partTargetDuration)}),r},yo=function(n){return(n.segments||[]).reduce(function(t,r,e){return r.parts?r.parts.forEach(function(i,a){t.push({duration:i.duration,segmentIndex:e,partIndex:a,part:i,segment:r})}):t.push({duration:r.duration,segmentIndex:e,partIndex:null,segment:r,part:null}),t},[])},od=function(n){var t=n.segments&&n.segments.length&&n.segments[n.segments.length-1];return t&&t.parts||[]},ud=function(n){var t=n.preloadSegment;if(t){var r=t.parts;return(t.preloadHints||[]).reduce(function(a,o){return a+("PART"===o.type?1:0)},0)+(r&&r.length?r.length:0)}},ld=function(n,t){if(t.endList)return 0;if(n&&n.suggestedPresentationDelay)return n.suggestedPresentationDelay;var r=od(t).length>0;return r&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:r&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},dd=function(n,t,r){if(void 0===t&&(t=n.mediaSequence+n.segments.length),ti){var o=[i,e];e=o[0],i=o[1]}if(e<0){for(var l=e;lDate.now()},To=function(n){return n.excludeUntil&&n.excludeUntil===1/0},Sa=function(n){var t=hd(n);return!n.disabled&&!t},pd=function(n,t){return t.attributes&&t.attributes[n]},bo=function(n,t){if(1===n.playlists.length)return!0;var r=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===n.playlists.filter(function(e){return!!Sa(e)&&(e.attributes.BANDWIDTH||0)0)for(var T=f-1;T>=0;T--){var E=d[T];if(l+=E.duration,o){if(l<0)continue}else if(l+zi<=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a-En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:T})}}return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:r}}if(f<0){for(var x=f;x<0;x++)if((l-=t.targetDuration)<0)return{partIndex:d[0]&&d[0].partIndex||null,segmentIndex:d[0]&&d[0].segmentIndex||0,startTime:r};f=0}for(var S=f;S0)continue}else if(l-zi>=0)continue;return{partIndex:F.partIndex,segmentIndex:F.segmentIndex,startTime:a+En({defaultDuration:t.targetDuration,durationList:d,startIndex:f,endIndex:S})}}return{segmentIndex:d[d.length-1].segmentIndex,partIndex:d[d.length-1].partIndex,startTime:r}},isEnabled:Sa,isDisabled:function(n){return n.disabled},isBlacklisted:hd,isIncompatible:To,playlistEnd:fd,isAes:function(n){for(var t=0;t-1&&o!==a.length-1&&(r._HLS_part=o),(o>-1||a.length)&&i--}r._HLS_msn=i}if(t.serverControl&&t.serverControl.canSkipUntil&&(r._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var l=new(P().URL)(n);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(d){!r.hasOwnProperty(d)||l.searchParams.set(d,r[d])}),n=l.toString()}return n}(a,i)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},t.playlistRequestError=function(e,i,a){var o=i.uri,l=i.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(e){var i=this,a=e.url;return function(n){var t=n.onwarn,r=n.oninfo,e=n.manifestString,i=n.customTagParsers,a=void 0===i?[]:i,o=n.customTagMappers,l=void 0===o?[]:o,d=n.experimentalLLHLS,f=new ef;t&&f.on("warn",t),r&&f.on("info",r),a.forEach(function(x){return f.addParser(x)}),l.forEach(function(x){return f.addTagMapper(x)}),f.push(e),f.end();var v=f.manifest;if(d||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(x){v.hasOwnProperty(x)&&delete v[x]}),v.segments&&v.segments.forEach(function(x){["parts","preloadHints"].forEach(function(S){x.hasOwnProperty(S)&&delete x[S]})})),!v.targetDuration){var g=10;v.segments&&v.segments.length&&(g=v.segments.reduce(function(x,S){return Math.max(x,S.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+g),v.targetDuration=g}var T=od(v);if(T.length&&!v.partTargetDuration){var E=T.reduce(function(x,S){return Math.max(x,S.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+E),gd.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),v.partTargetDuration=E}return v}({onwarn:function(d){return i.logger_("m3u8-parser warn for "+a+": "+d.message)},oninfo:function(d){return i.logger_("m3u8-parser info for "+a+": "+d.message)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(e){var i=e.playlistString,a=e.playlistObject,o=e.url,l=e.id;this.request=null,this.state="HAVE_METADATA";var d=a||this.parseManifest_({url:o,manifestString:i});d.lastRequest=Date.now(),vd({playlist:d,uri:o,id:l});var f=Eo(this.master,d);this.targetDuration=d.partTargetDuration||d.targetDuration,this.pendingMedia_=null,f?(this.master=f,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!f)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),P().clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e,i){var a=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(P().clearTimeout(this.finalRenditionTimeout),i){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=P().setTimeout(this.media.bind(this,e,!1),o)}else{var l=this.state,d=!this.media_||e.id!==this.media_.id,f=this.master.playlists[e.id];if(f&&f.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(d&&(this.trigger("mediachanging"),this.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")));if(this.updateMediaUpdateTimeout_(Co(e,!0)),d){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(v,g){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=ba(a.handleManifestRedirects,e.resolvedUri,g),v)return a.playlistRequestError(a.request,e,l);a.haveMetadata({playlistString:g.responseText,url:e.uri,id:e.id}),a.trigger("HAVE_MASTER"===l?"loadedmetadata":"mediachange")}})}}},t.pause=function(){this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},t.load=function(e){var i=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){i.mediaUpdateTimeout=null,i.load()},o)}else this.started?this.trigger(a&&!a.endList?"mediaupdatetimeout":"loadedplaylist"):this.start()},t.updateMediaUpdateTimeout_=function(e){var i=this;this.mediaUpdateTimeout&&(P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=P().setTimeout(function(){i.mediaUpdateTimeout=null,i.trigger("mediaupdatetimeout"),i.updateMediaUpdateTimeout_(e)},e))},t.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=P().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(i,a){if(e.request){if(e.request=null,i)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=ba(e.handleManifestRedirects,e.src,a);var o=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(o)}})},t.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},t.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,_d(this.master,this.srcUri()),e.playlists.forEach(function(a){a.segments=Td(a),a.segments.forEach(function(o){yd(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var i=this.srcUri()||P().location.href;this.master=function(n,t){var r=So(0,t),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:P().location.href,resolvedUri:P().location.href,playlists:[{uri:t,id:r,resolvedUri:t,attributes:{}}]};return e.playlists[r]=e.playlists[0],e.playlists[t]=e.playlists[0],e}(0,i),this.haveMetadata({playlistObject:e,url:i,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},n}(N.EventTarget),mm=N.xhr,gm=N.mergeOptions,ko=function(n,t,r,e){var i="arraybuffer"===n.responseType?n.response:n.responseText;!t&&i&&(n.responseTime=Date.now(),n.roundTripTime=n.responseTime-n.requestTime,n.bytesReceived=i.byteLength||i.length,n.bandwidth||(n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3))),r.headers&&(n.responseHeaders=r.headers),t&&"ETIMEDOUT"===t.code&&(n.timedout=!0),!t&&!n.aborted&&200!==r.statusCode&&206!==r.statusCode&&0!==r.statusCode&&(t=new Error("XHR Failed with a response of: "+(n&&(i||n.responseText)))),e(t,n)},xd=function(){var n=function t(r,e){r=gm({timeout:45e3},r);var i=t.beforeRequest||N.Vhs.xhr.beforeRequest;if(i&&"function"==typeof i){var a=i(r);a&&(r=a)}var l=(!0===N.Vhs.xhr.original?mm:N.Vhs.xhr)(r,function(f,v){return ko(l,f,v,e)}),d=l.abort;return l.abort=function(){return l.aborted=!0,d.apply(l,arguments)},l.uri=r.uri,l.requestTime=Date.now(),l};return n.original=!0,n},Ao=function(n){var t={};return n.byterange&&(t.Range=function(n){return"bytes="+n.offset+"-"+("bigint"==typeof n.offset||"bigint"==typeof n.length?P().BigInt(n.offset)+P().BigInt(n.length)-P().BigInt(1):n.offset+n.length-1)}(n.byterange)),t},_m=function(n,t){return n.start(t)+"-"+n.end(t)},ym=function(n,t){var r=n.toString(16);return"00".substring(0,2-r.length)+r+(t%2?" ":"")},Tm=function(n){return n>=32&&n<126?String.fromCharCode(n):"."},Sd=function(n){var t={};return Object.keys(n).forEach(function(r){var e=n[r];t[r]=ArrayBuffer.isView(e)?{bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:e}),t},Ca=function(n){var t=n.byterange||{length:1/0,offset:0};return[t.length,t.offset,n.resolvedUri].join(",")},Ed=function(n){return n.resolvedUri},Cd=function(n){for(var t=Array.prototype.slice.call(n),r=16,e="",o=0;onew Date(l.getTime()+1e3*d)?null:(r>l&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:$t.duration(t,t.mediaSequence+t.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})}(t,r);if(!v)return f({message:t+" was not found in the stream"});var g=v.segment,T=function(n,t){var r,e;try{r=new Date(n),e=new Date(t)}catch(o){}var i=r.getTime();return(e.getTime()-i)/1e3}(g.dateTimeObject,t);if("estimate"===v.type)return 0===i?f({message:t+" is not buffered yet. Try again"}):(a(v.estimatedStart+T),void d.one("seeked",function(){s({programTime:t,playlist:r,retryCount:i-1,seekTo:a,pauseAfterSeek:l,tech:d,callback:f})}));var E=g.start+T;d.one("seeked",function(){return f(null,d.currentTime())}),l&&d.pause(),a(E)},wo=function(n,t){if(4===n.readyState)return t()},Ad=N.mergeOptions,wd=function(n,t){if(!bd(n,t)||n.sidx&&t.sidx&&(n.sidx.offset!==t.sidx.offset||n.sidx.length!==t.sidx.length))return!1;if(!n.sidx&&t.sidx||n.sidx&&!t.sidx||n.segments&&!t.segments||!n.segments&&t.segments)return!1;if(!n.segments&&!t.segments)return!0;for(var r=0;r=F+S)return f(v,{response:E.subarray(S,S+F),status:g.status,uri:g.uri});o.request=o.vhs_.xhr({uri:d,responseType:"arraybuffer",headers:Ao({byterange:e.sidx.byterange})},f)})}else this.mediaRequest_=P().setTimeout(function(){return a(!1)},0)},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},P().clearTimeout(this.minimumUpdatePeriodTimeout_),P().clearTimeout(this.mediaRequest_),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},t.media=function(e){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var o=!this.media_||e.id!==this.media_.id;if(o&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(o&&(this.trigger("mediachanging"),this.trigger("mediachange")));!o||(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,a,function(l){i.haveMetadata({startingState:a,playlist:e})}))},t.haveMetadata=function(e){var i=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),this.trigger("HAVE_MASTER"===i?"loadedmetadata":"mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(P().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},t.load=function(e){var i=this;P().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=P().setTimeout(function(){return i.load()},o)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},t.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(i,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=P().setTimeout(function(){return e.haveMaster_()},0)},t.requestMaster_=function(e){var i=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(!i.requestErrored_(a,o)){var l=o.responseText!==i.masterPlaylistLoader_.masterXml_;return i.masterPlaylistLoader_.masterXml_=o.responseText,i.masterLoaded_=o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):Date.now(),i.masterPlaylistLoader_.srcUrl=ba(i.handleManifestRedirects,i.masterPlaylistLoader_.srcUrl,o),l?(i.handleMaster_(),void i.syncClientServerClock_(function(){return e(o,l)})):e(o,l)}"HAVE_NOTHING"===i.state&&(i.started=!1)})},t.syncClientServerClock_=function(e){var i=this,a=function(n){return function(n){var t=Tt(n,"UTCTiming")[0];if(!t)return null;var r=Mt(t);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return r}(mu(n))}(this.masterPlaylistLoader_.masterXml_);return null===a?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===a.method?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:pi(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(i.request){if(o)return i.masterPlaylistLoader_.clientOffset_=i.masterLoaded_-Date.now(),e();var d;d="HEAD"===a.method?l.responseHeaders&&l.responseHeaders.date?Date.parse(l.responseHeaders.date):i.masterLoaded_:Date.parse(l.responseText),i.masterPlaylistLoader_.clientOffset_=d-Date.now(),e()}}))},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,i=function(n){var r=n.srcUrl,o=function(n,t){void 0===t&&(t={});var r=function(n,t){void 0===t&&(t={});var r=t,e=r.manifestUri,i=void 0===e?"":e,a=r.NOW,o=void 0===a?Date.now():a,l=r.clientOffset,d=void 0===l?0:l,f=Tt(n,"Period");if(!f.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var v=Tt(n,"Location"),g=Mt(n),T=Gn([i],Tt(n,"BaseURL"));g.type=g.type||"static",g.sourceDuration=g.mediaPresentationDuration||0,g.NOW=o,g.clientOffset=d,v.length&&(g.locations=v.map(ls));var E=[];return f.forEach(function(x,S){var F=Mt(x),U=E[S-1];F.start=function(n){var t=n.attributes,r=n.priorPeriodAttributes;return"number"==typeof t.start?t.start:r&&"number"==typeof r.start&&"number"==typeof r.duration?r.start+r.duration:r||"static"!==n.mpdType?null:0}({attributes:F,priorPeriodAttributes:U?U.attributes:null,mpdType:g.type}),E.push({node:x,attributes:F})}),{locations:g.locations,representationInfo:qn(E.map(Hf(g,T)))}}(mu(n),t),e=function(n){return n.map(Lf)}(r.representationInfo);return Ef({dashPlaylists:e,locations:r.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}(n.masterXml,{manifestUri:r,clientOffset:n.clientOffset,sidxMapping:n.sidxMapping,previousManifest:n.previousManifest});return _d(o,r),o}({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(i=function(n,t,r){for(var e=!0,i=Ad(n,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a-1)},this.trigger=function(p){var h,m,_,y;if(h=c[p])if(2===arguments.length)for(_=h.length,m=0;m<_;++m)h[m].call(this,arguments[1]);else{for(y=[],m=arguments.length,m=1;m>>1,c.samplingfrequencyindex<<7|c.channelcount<<3,6,1,2]))},d=function(){return a(Pe.ftyp,ot,Ft,ot,Je)},q=function(c){return a(Pe.hdlr,si[c])},f=function(c){return a(Pe.mdat,c)},W=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,c.duration>>>24&255,c.duration>>>16&255,c.duration>>>8&255,255&c.duration,85,196,0,0]);return c.samplerate&&(p[12]=c.samplerate>>>24&255,p[13]=c.samplerate>>>16&255,p[14]=c.samplerate>>>8&255,p[15]=255&c.samplerate),a(Pe.mdhd,p)},H=function(c){return a(Pe.mdia,W(c),q(c.type),g(c))},v=function(c){return a(Pe.mfhd,new Uint8Array([0,0,0,0,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c]))},g=function(c){return a(Pe.minf,"video"===c.type?a(Pe.vmhd,Ei):a(Pe.smhd,Ui),o(),he(c))},T=function(c,p){for(var h=[],m=p.length;m--;)h[m]=ye(p[m]);return a.apply(null,[Pe.moof,v(c)].concat(h))},E=function(c){for(var p=c.length,h=[];p--;)h[p]=F(c[p]);return a.apply(null,[Pe.moov,S(4294967295)].concat(h).concat(x(c)))},x=function(c){for(var p=c.length,h=[];p--;)h[p]=ge(c[p]);return a.apply(null,[Pe.mvex].concat(h))},S=function(c){var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(Pe.mvhd,p)},ne=function(c){var m,_,p=c.samples||[],h=new Uint8Array(4+p.length);for(_=0;_>>8),y.push(255&m[I].byteLength),y=y.concat(Array.prototype.slice.call(m[I]));for(I=0;I<_.length;I++)k.push((65280&_[I].byteLength)>>>8),k.push(255&_[I].byteLength),k=k.concat(Array.prototype.slice.call(_[I]));if(O=[Pe.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&h.width)>>8,255&h.width,(65280&h.height)>>8,255&h.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(Pe.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([m.length],y,[_.length],k))),a(Pe.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var L=h.sarRatio[0],M=h.sarRatio[1];O.push(a(Pe.pasp,new Uint8Array([(4278190080&L)>>24,(16711680&L)>>16,(65280&L)>>8,255&L,(4278190080&M)>>24,(16711680&M)>>16,(65280&M)>>8,255&M])))}return a.apply(null,O)},c=function(h){return a(Pe.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&h.channelcount)>>8,255&h.channelcount,(65280&h.samplesize)>>8,255&h.samplesize,0,0,0,0,(65280&h.samplerate)>>8,255&h.samplerate,0,0]),l(h))},U=function(c){var p=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,0,(4278190080&c.duration)>>24,(16711680&c.duration)>>16,(65280&c.duration)>>8,255&c.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&c.width)>>8,255&c.width,0,0,(65280&c.height)>>8,255&c.height,0,0]);return a(Pe.tkhd,p)},ye=function(c){var p,h,m,_,k,I;return p=a(Pe.tfhd,new Uint8Array([0,0,0,58,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),k=Math.floor(c.baseMediaDecodeTime/i),I=Math.floor(c.baseMediaDecodeTime%i),h=a(Pe.tfdt,new Uint8Array([1,0,0,0,k>>>24&255,k>>>16&255,k>>>8&255,255&k,I>>>24&255,I>>>16&255,I>>>8&255,255&I])),"audio"===c.type?(m=Ye(c,92),a(Pe.traf,p,h,m)):(_=ne(c),m=Ye(c,_.length+92),a(Pe.traf,p,h,m,_))},F=function(c){return c.duration=c.duration||4294967295,a(Pe.trak,U(c),H(c))},ge=function(c){var p=new Uint8Array([0,0,0,0,(4278190080&c.id)>>24,(16711680&c.id)>>16,(65280&c.id)>>8,255&c.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==c.type&&(p[p.length-1]=0),a(Pe.trex,p)},function(){var b,c,p;p=function(m,_){var y=0,k=0,I=0,O=0;return m.length&&(void 0!==m[0].duration&&(y=1),void 0!==m[0].size&&(k=2),void 0!==m[0].flags&&(I=4),void 0!==m[0].compositionTimeOffset&&(O=8)),[0,0,y|k|I|O,1,(4278190080&m.length)>>>24,(16711680&m.length)>>>16,(65280&m.length)>>>8,255&m.length,(4278190080&_)>>>24,(16711680&_)>>>16,(65280&_)>>>8,255&_]},c=function(m,_){var y,k,I,O,L,M;for(I=p(O=m.samples||[],_+=20+16*O.length),(k=new Uint8Array(I.length+16*O.length)).set(I),y=I.length,M=0;M>>24,k[y++]=(16711680&L.duration)>>>16,k[y++]=(65280&L.duration)>>>8,k[y++]=255&L.duration,k[y++]=(4278190080&L.size)>>>24,k[y++]=(16711680&L.size)>>>16,k[y++]=(65280&L.size)>>>8,k[y++]=255&L.size,k[y++]=L.flags.isLeading<<2|L.flags.dependsOn,k[y++]=L.flags.isDependedOn<<6|L.flags.hasRedundancy<<4|L.flags.paddingValue<<1|L.flags.isNonSyncSample,k[y++]=61440&L.flags.degradationPriority,k[y++]=15&L.flags.degradationPriority,k[y++]=(4278190080&L.compositionTimeOffset)>>>24,k[y++]=(16711680&L.compositionTimeOffset)>>>16,k[y++]=(65280&L.compositionTimeOffset)>>>8,k[y++]=255&L.compositionTimeOffset;return a(Pe.trun,k)},b=function(m,_){var y,k,I,O,L,M;for(I=p(O=m.samples||[],_+=20+8*O.length),(y=new Uint8Array(I.length+8*O.length)).set(I),k=I.length,M=0;M>>24,y[k++]=(16711680&L.duration)>>>16,y[k++]=(65280&L.duration)>>>8,y[k++]=255&L.duration,y[k++]=(4278190080&L.size)>>>24,y[k++]=(16711680&L.size)>>>16,y[k++]=(65280&L.size)>>>8,y[k++]=255&L.size;return a(Pe.trun,y)},Ye=function(m,_){return"audio"===m.type?b(m,_):c(m,_)}}();var Vo,Wo,Go,Fa,Zo,vc,_c,yc,Dn_mdat=f,Dn_moof=T,gc=function(c,p){var h={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return h.dataOffset=p,h.compositionTimeOffset=c.pts-c.dts,h.duration=c.duration,h.size=4*c.length,h.size+=c.byteLength,c.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},Ki=[33,16,5,32,164,27],jo=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],et=function(c){for(var p=[];c--;)p.push(0);return p};Wo=function(c){return 9e4*c},Go=function(c,p){return c*p},Fa=function(c){return c/9e4},Zo=function(c,p){return c/p},vc=function(c,p){return Wo(Zo(c,p))},_c=function(c,p){return Go(Fa(c),p)},yc=function(c,p,h){return Fa(h?c:c-p)};var Xe_secondsToVideoTs=Wo,Xe_videoTsToSeconds=Fa,Xe_audioTsToVideoTs=vc,Xe_videoTsToAudioTs=_c,Xe_metadataTsToSeconds=yc,Ua_prefixWithSilence=function(c,p,h,m){var _,L,M,G,y=0,k=0,I=0,O=0;if(p.length&&(_=Xe_audioTsToVideoTs(c.baseMediaDecodeTime,c.samplerate),y=Math.ceil(9e4/(c.samplerate/1024)),h&&m&&(k=_-Math.max(h,m),O=(I=Math.floor(k/y))*y),!(I<1||O>45e3))){for((L=function(){if(!Vo){var c={96e3:[Ki,[227,64],et(154),[56]],88200:[Ki,[231],et(170),[56]],64e3:[Ki,[248,192],et(240),[56]],48e3:[Ki,[255,192],et(268),[55,148,128],et(54),[112]],44100:[Ki,[255,192],et(268),[55,163,128],et(84),[112]],32e3:[Ki,[255,192],et(268),[55,234],et(226),[112]],24e3:[Ki,[255,192],et(268),[55,255,128],et(268),[111,112],et(126),[224]],16e3:[Ki,[255,192],et(268),[55,255,128],et(268),[111,255],et(269),[223,108],et(195),[1,192]],12e3:[jo,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,253,128],et(259),[56]],11025:[jo,et(268),[3,127,248],et(268),[6,255,240],et(268),[13,255,224],et(268),[27,255,192],et(268),[55,175,128],et(108),[112]],8e3:[jo,et(268),[3,121,16],et(47),[7]]};Vo=function(c){return Object.keys(c).reduce(function(p,h){return p[h]=new Uint8Array(c[h].reduce(function(m,_){return m.concat(_)},[])),p},{})}(c)}return Vo}()[c.samplerate])||(L=p[0].data),M=0;M=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(b),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Hi.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Hi.prototype.addText=function(b){this.rows[this.rowIdx]+=b},Hi.prototype.backspace=function(){if(!this.isEmpty()){var b=this.rows[this.rowIdx];this.rows[this.rowIdx]=b.substr(0,b.length-1)}};var Ha=function(c,p,h){this.serviceNum=c,this.text="",this.currentWindow=new Hi(-1),this.windows=[],this.stream=h,"string"==typeof p&&this.createTextDecoder(p)};Ha.prototype.init=function(b,c){this.startPts=b;for(var p=0;p<8;p++)this.windows[p]=new Hi(p),"function"==typeof c&&(this.windows[p].beforeRowOverflow=c)},Ha.prototype.setCurrentWindow=function(b){this.currentWindow=this.windows[b]},Ha.prototype.createTextDecoder=function(b){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(b)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+b+" encoding. "+c})}};var ut=function b(c){c=c||{},b.prototype.init.call(this);var _,p=this,h=c.captionServices||{},m={};Object.keys(h).forEach(function(y){_=h[y],/^SERVICE/.test(y)&&(m[y]=_.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(y){3===y.type?(p.new708Packet(),p.add708Bytes(y)):(null===p.current708Packet&&p.new708Packet(),p.add708Bytes(y))}};ut.prototype=new n,ut.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ut.prototype.add708Bytes=function(b){var c=b.ccData,p=c>>>8,h=255&c;this.current708Packet.ptsVals.push(b.pts),this.current708Packet.data.push(p),this.current708Packet.data.push(h)},ut.prototype.push708Packet=function(){var b=this.current708Packet,c=b.data,p=null,h=null,m=0,_=c[m++];for(b.seq=_>>6,b.sizeCode=63&_;m>5)&&h>0&&(p=_=c[m++]),this.pushServiceBlock(p,m,h),h>0&&(m+=h-1)},ut.prototype.pushServiceBlock=function(b,c,p){var h,m=c,_=this.current708Packet.data,y=this.services[b];for(y||(y=this.initService(b,m));m>5,_.rowLock=(16&h)>>4,_.columnLock=(8&h)>>3,_.priority=7&h,h=p[++b],_.relativePositioning=(128&h)>>7,_.anchorVertical=127&h,h=p[++b],_.anchorHorizontal=h,h=p[++b],_.anchorPoint=(240&h)>>4,_.rowCount=15&h,h=p[++b],_.columnCount=63&h,h=p[++b],_.windowStyle=(56&h)>>3,_.penStyle=7&h,_.virtualRowCount=_.rowCount+1,b},ut.prototype.setWindowAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.winAttr;return h=p[++b],m.fillOpacity=(192&h)>>6,m.fillRed=(48&h)>>4,m.fillGreen=(12&h)>>2,m.fillBlue=3&h,h=p[++b],m.borderType=(192&h)>>6,m.borderRed=(48&h)>>4,m.borderGreen=(12&h)>>2,m.borderBlue=3&h,h=p[++b],m.borderType+=(128&h)>>5,m.wordWrap=(64&h)>>6,m.printDirection=(48&h)>>4,m.scrollDirection=(12&h)>>2,m.justify=3&h,h=p[++b],m.effectSpeed=(240&h)>>4,m.effectDirection=(12&h)>>2,m.displayEffect=3&h,b},ut.prototype.flushDisplayed=function(b,c){for(var p=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&p.push(c.windows[h].getText());c.endPts=b,c.text=p.join("\n\n"),this.pushCaption(c),c.startPts=b},ut.prototype.pushCaption=function(b){""!==b.text&&(this.trigger("data",{startPts:b.startPts,endPts:b.endPts,text:b.text,stream:"cc708_"+b.serviceNum}),b.text="",b.startPts=b.endPts)},ut.prototype.displayWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=1);return b},ut.prototype.hideWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible=0);return b},ut.prototype.toggleWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&(c.windows[_].visible^=1);return b},ut.prototype.clearWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].clearText();return b},ut.prototype.deleteWindows=function(b,c){var h=this.current708Packet.data[++b],m=this.getPts(b);this.flushDisplayed(m,c);for(var _=0;_<8;_++)h&1<<_&&c.windows[_].reset();return b},ut.prototype.setPenAttributes=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penAttr;return h=p[++b],m.textTag=(240&h)>>4,m.offset=(12&h)>>2,m.penSize=3&h,h=p[++b],m.italics=(128&h)>>7,m.underline=(64&h)>>6,m.edgeType=(56&h)>>3,m.fontStyle=7&h,b},ut.prototype.setPenColor=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penColor;return h=p[++b],m.fgOpacity=(192&h)>>6,m.fgRed=(48&h)>>4,m.fgGreen=(12&h)>>2,m.fgBlue=3&h,h=p[++b],m.bgOpacity=(192&h)>>6,m.bgRed=(48&h)>>4,m.bgGreen=(12&h)>>2,m.bgBlue=3&h,h=p[++b],m.edgeRed=(48&h)>>4,m.edgeGreen=(12&h)>>2,m.edgeBlue=3&h,b},ut.prototype.setPenLocation=function(b,c){var p=this.current708Packet.data,h=p[b],m=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=p[++b],m.row=15&h,h=p[++b],m.column=63&h,b},ut.prototype.reset=function(b,c){var p=this.getPts(b);return this.flushDisplayed(p,c),this.initService(c.serviceNum,b)};var F0={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},ja=function(c){return null===c?"":(c=F0[c]||c,String.fromCharCode(c))},U0=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],gr=function(){for(var c=[],p=15;p--;)c.push("");return c},mt=function b(c,p){b.prototype.init.call(this),this.field_=c||0,this.dataChannel_=p||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(h){var m,_,y,k,I;if((m=32639&h.ccData)!==this.lastControlCode_){if(4096==(61440&m)?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),y=m>>>8,k=255&m,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),_=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=_,this.startPts_=h.pts;else if(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(m===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=gr();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=gr();else if(m===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(h.pts),this.displayed_=gr()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(y,k))I=ja((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isExtCharacter(y,k))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),I=ja((y=(3&y)<<8)|k),this[this.mode_](h.pts,I),this.column_++;else if(this.isMidRowCode(y,k))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,14==(14&k)&&this.addFormatting(h.pts,["i"]),1==(1&k)&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(y,k))this.column_+=3&k;else if(this.isPAC(y,k)){var O=U0.indexOf(7968&m);"rollUp"===this.mode_&&(O-this.rollUpRows_+1<0&&(O=this.rollUpRows_-1),this.setRollUp(h.pts,O)),O!==this.row_&&(this.clearFormatting(h.pts),this.row_=O),1&k&&-1===this.formatting_.indexOf("u")&&this.addFormatting(h.pts,["u"]),16==(16&m)&&(this.column_=4*((14&m)>>1)),this.isColorPAC(k)&&14==(14&k)&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(y)&&(0===k&&(k=null),I=ja(y),I+=ja(k),this[this.mode_](h.pts,I),this.column_+=I.length)}else this.lastControlCode_=null}};mt.prototype=new n,mt.prototype.flushDisplayed=function(b){var c=this.displayed_.map(function(p,h){try{return p.trim()}catch(m){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");c.length&&this.trigger("data",{startPts:this.startPts_,endPts:b,text:c,stream:this.name_})},mt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=gr(),this.nonDisplayed_=gr(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},mt.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},mt.prototype.isSpecialCharacter=function(b,c){return b===this.EXT_&&c>=48&&c<=63},mt.prototype.isExtCharacter=function(b,c){return(b===this.EXT_+1||b===this.EXT_+2)&&c>=32&&c<=63},mt.prototype.isMidRowCode=function(b,c){return b===this.EXT_&&c>=32&&c<=47},mt.prototype.isOffsetControlCode=function(b,c){return b===this.OFFSET_&&c>=33&&c<=35},mt.prototype.isPAC=function(b,c){return b>=this.BASE_&&b=64&&c<=127},mt.prototype.isColorPAC=function(b){return b>=64&&b<=79||b>=96&&b<=127},mt.prototype.isNormalChar=function(b){return b>=32&&b<=127},mt.prototype.setRollUp=function(b,c){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(b),this.nonDisplayed_=gr(),this.displayed_=gr()),void 0!==c&&c!==this.row_)for(var p=0;p"},"");this[this.mode_](b,p)},mt.prototype.clearFormatting=function(b){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(p,h){return p+""},"");this.formatting_=[],this[this.mode_](b,c)}},mt.prototype.popOn=function(b,c){var p=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=p+=c},mt.prototype.rollUp=function(b,c){var p=this.displayed_[this.row_];this.displayed_[this.row_]=p+=c},mt.prototype.shiftRowsUp_=function(){var b;for(b=0;bp&&(h=-1);Math.abs(p-c)>4294967296;)c+=8589934592*h;return c},xc=function b(c){var p,h;b.prototype.init.call(this),this.type_=c||"shared",this.push=function(m){"shared"!==this.type_&&m.type!==this.type_||(void 0===h&&(h=m.dts),m.dts=zo(m.dts,h),m.pts=zo(m.pts,h),p=m.dts,this.trigger("data",m))},this.flush=function(){h=p,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,p=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};xc.prototype=new n;var Za,Sc_TimestampRolloverStream=xc,Sc_handleRollover=zo,Ec=function(c,p,h){var m,_="";for(m=p;m>>2;ae*=4,M.timeStamp=ae+=3&Se[7],void 0===I.pts&&void 0===I.dts&&(I.pts=M.timeStamp,I.dts=M.timeStamp),this.trigger("timestamp",M)}I.frames.push(M),O+=10,O+=L}while(O>>4>1&&(k+=_[k]+1),0===y.pid)y.type="pat",c(_.subarray(k),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",c(_.subarray(k),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([_,k,y]):this.processPes_(_,k,y)},this.processPes_=function(_,y,k){k.streamType=k.pid===this.programMapTable.video?Rt.H264_STREAM_TYPE:k.pid===this.programMapTable.audio?Rt.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][k.pid],k.type="pes",k.data=_.subarray(y),this.trigger("data",k)}},On.prototype=new n,On.STREAM_TYPES={h264:27,adts:15},Ka=function(){var y,c=this,p=!1,h={data:[],size:0},m={data:[],size:0},_={data:[],size:0},I=function(L,M,G){var Zt,fe=new Uint8Array(L.size),Se={type:M},ae=0,Be=0,kt=!1;if(L.data.length&&!(L.size<9)){for(Se.trackId=L.data[0].pid,ae=0;ae>>3,M.pts*=4,M.pts+=(6&L[13])>>>1,M.dts=M.pts,64&G&&(M.dts=(14&L[14])<<27|(255&L[15])<<20|(254&L[16])<<12|(255&L[17])<<5|(254&L[18])>>>3,M.dts*=4,M.dts+=(6&L[18])>>>1)),M.data=L.subarray(9+L[8]))})(fe,Se),kt="video"===M||Se.packetLength<=L.size,(G||kt)&&(L.size=0,L.data.length=0),kt&&c.trigger("data",Se)}};Ka.prototype.init.call(this),this.push=function(O){({pat:function(){},pes:function(){var M,G;switch(O.streamType){case Rt.H264_STREAM_TYPE:M=h,G="video";break;case Rt.ADTS_STREAM_TYPE:M=m,G="audio";break;case Rt.METADATA_STREAM_TYPE:M=_,G="timed-metadata";break;default:return}O.payloadUnitStartIndicator&&I(M,G,!0),M.data.push(O),M.size+=O.data.byteLength},pmt:function(){var M={type:"metadata",tracks:[]};null!==(y=O.programMapTable).video&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&M.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),p=!0,c.trigger("data",M)}})[O.type]()},this.reset=function(){h.size=0,h.data.length=0,m.size=0,m.data.length=0,this.trigger("reset")},this.flushStreams_=function(){I(h,"video"),I(m,"audio"),I(_,"timed-metadata")},this.flush=function(){if(!p&&y){var O={type:"metadata",tracks:[]};null!==y.video&&O.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),null!==y.audio&&O.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),c.trigger("data",O)}p=!1,this.flushStreams_(),this.trigger("done")}},Ka.prototype=new n;var kc={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:za,TransportParseStream:On,ElementaryStream:Ka,TimestampRolloverStream:q0,CaptionStream:qa.CaptionStream,Cea608Stream:qa.Cea608Stream,Cea708Stream:qa.Cea708Stream,MetadataStream:V0};for(var $o in Rt)Rt.hasOwnProperty($o)&&(kc[$o]=Rt[$o]);var $a,ji=kc,Ac=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];$a=function(c){var p,h=0;$a.prototype.init.call(this),this.skipWarn_=function(m,_){this.trigger("log",{level:"warn",message:"adts skiping bytes "+m+" to "+_+" in frame "+h+" outside syncword"})},this.push=function(m){var y,k,I,O,L,_=0;if(c||(h=0),"audio"===m.type){p&&p.length?(I=p,(p=new Uint8Array(I.byteLength+m.data.byteLength)).set(I),p.set(m.data,I.byteLength)):p=m.data;for(var M;_+7>>2],p.byteLength-_<(y=(3&p[_+3])<<11|p[_+4]<<3|(224&p[_+5])>>5))break;this.trigger("data",{pts:m.pts+h*L,dts:m.dts+h*L,sampleCount:O,audioobjecttype:1+(p[_+2]>>>6&3),channelcount:(1&p[_+2])<<2|(192&p[_+3])>>>6,samplerate:Ac[(60&p[_+2])>>>2],samplingfrequencyindex:(60&p[_+2])>>>2,samplesize:16,data:p.subarray(_+7+k,_+y)}),h++,_+=y}else"number"!=typeof M&&(M=_),_++;"number"==typeof M&&(this.skipWarn_(M,_),M=null),p=p.subarray(_)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){p=void 0,this.trigger("reset")},this.endTimeline=function(){p=void 0,this.trigger("endedtimeline")}},$a.prototype=new n;var Ic,wc=$a;Ic=function(c){var p=c.byteLength,h=0,m=0;this.length=function(){return 8*p},this.bitsAvailable=function(){return 8*p+m},this.loadWord=function(){var _=c.byteLength-p,y=new Uint8Array(4),k=Math.min(4,p);if(0===k)throw new Error("no bytes available");y.set(c.subarray(_,_+k)),h=new DataView(y.buffer).getUint32(0),m=8*k,p-=k},this.skipBits=function(_){var y;m>_?(h<<=_,m-=_):(_-=m,_-=8*(y=Math.floor(_/8)),p-=y,this.loadWord(),h<<=_,m-=_)},this.readBits=function(_){var y=Math.min(m,_),k=h>>>32-y;return(m-=y)>0?h<<=y:p>0&&this.loadWord(),(y=_-y)>0?k<>>_))return h<<=_,m-=_,_;return this.loadWord(),_+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var _=this.skipLeadingZeros();return this.readBits(_+1)-1},this.readExpGolomb=function(){var _=this.readUnsignedExpGolomb();return 1&_?1+_>>>1:-1*(_>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ya,Rn,Dc,G0=Ic;Rn=function(){var p,h,c=0;Rn.prototype.init.call(this),this.push=function(m){var _;h?((_=new Uint8Array(h.byteLength+m.data.byteLength)).set(h),_.set(m.data,h.byteLength),h=_):h=m.data;for(var y=h.byteLength;c3&&this.trigger("data",h.subarray(c+3)),h=null,c=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Rn.prototype=new n,Dc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ya=function(){var p,h,m,_,y,k,I,c=new Rn;Ya.prototype.init.call(this),p=this,this.push=function(O){"video"===O.type&&(h=O.trackId,m=O.pts,_=O.dts,c.push(O))},c.on("data",function(O){var L={trackId:h,pts:m,dts:_,data:O,nalUnitTypeCode:31&O[0]};switch(L.nalUnitTypeCode){case 5:L.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:L.nalUnitType="sei_rbsp",L.escapedRBSP=y(O.subarray(1));break;case 7:L.nalUnitType="seq_parameter_set_rbsp",L.escapedRBSP=y(O.subarray(1)),L.config=k(L.escapedRBSP);break;case 8:L.nalUnitType="pic_parameter_set_rbsp";break;case 9:L.nalUnitType="access_unit_delimiter_rbsp"}p.trigger("data",L)}),c.on("done",function(){p.trigger("done")}),c.on("partialdone",function(){p.trigger("partialdone")}),c.on("reset",function(){p.trigger("reset")}),c.on("endedtimeline",function(){p.trigger("endedtimeline")}),this.flush=function(){c.flush()},this.partialFlush=function(){c.partialFlush()},this.reset=function(){c.reset()},this.endTimeline=function(){c.endTimeline()},I=function(L,M){var Se,G=8,fe=8;for(Se=0;Se=0?h:0,(16&c[p+5])>>4?h+20:h+10},K0=function b(c,p){return c.length-p<10||c[p]!=="I".charCodeAt(0)||c[p+1]!=="D".charCodeAt(0)||c[p+2]!=="3".charCodeAt(0)?p:b(c,p+=Pc(c,p))},Lc=function(c){return c[0]<<21|c[1]<<14|c[2]<<7|c[3]},X0=function(c,p,h){return unescape(function(c,p,h){var m,_="";for(m=p;m=p+2&&255==(255&c[p])&&240==(240&c[p+1])&&16==(22&c[p+1])},parseId3TagSize:Pc,parseAdtsSize:function(c,p){return 6144&c[p+3]|c[p+4]<<3|(224&c[p+5])>>5},parseType:function(c,p){return c[p]==="I".charCodeAt(0)&&c[p+1]==="D".charCodeAt(0)&&c[p+2]==="3".charCodeAt(0)?"timed-metadata":!0&c[p]&&240==(240&c[p+1])?"audio":null},parseSampleRate:function(c){for(var p=0;p+5>>2];p++}return null},parseAacTimestamp:function(c){var p,h,m;p=10,64&c[5]&&(p+=4,p+=Lc(c.subarray(10,14)));do{if((h=Lc(c.subarray(p+4,p+8)))<1)return null;if("PRIV"===String.fromCharCode(c[p],c[p+1],c[p+2],c[p+3])){m=c.subarray(p+10,p+h+10);for(var y=0;y>>2;return(O*=4)+(3&I[7])}break}}p+=10,p+=h}while(p=3;)if(c[_]!=="I".charCodeAt(0)||c[_+1]!=="D".charCodeAt(0)||c[_+2]!=="3".charCodeAt(0))if(255!=(255&c[_])||240!=(240&c[_+1]))_++;else{if(c.length-_<7||_+(m=Xa.parseAdtsSize(c,_))>c.length)break;I={type:"audio",data:c.subarray(_,_+m),pts:p,dts:p},this.trigger("data",I),_+=m}else{if(c.length-_<10||_+(m=Xa.parseId3TagSize(c,_))>c.length)break;k={type:"timed-metadata",data:c.subarray(_,_+m)},this.trigger("data",k),_+=m}c=c.length-_>0?c.subarray(_):new Uint8Array},this.reset=function(){c=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){c=new Uint8Array,this.trigger("endedtimeline")}},Qa.prototype=new n;var Mn,en,Ja,vr,iy=Qa,Yo=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Xo=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ay=Z0.H264Stream,sy=Xa.isLikelyAacData,uy=function(c,p){p.stream=c,this.trigger("log",p)},Oc=function(c,p){for(var h=Object.keys(p),m=0;m=h?c:(p.minSegmentDts=1/0,c.filter(function(m){return m.dts>=h&&(p.minSegmentDts=Math.min(p.minSegmentDts,m.dts),p.minSegmentPts=p.minSegmentDts,!0)}))}(h,c,_),c.baseMediaDecodeTime=gi_calculateTrackBaseMediaDecodeTime(c,p.keepOriginalTimestamps),Se=Ua_prefixWithSilence(c,I,y,k),c.samples=function(c){var p,m=[];for(p=0;p1&&(p=c.shift(),c.byteLength-=p.byteLength,c.nalCount-=p.nalCount,c[0][0].dts=p.dts,c[0][0].pts=p.pts,c[0][0].duration+=p.duration),c}(L)),_.length){var kt;if(!(kt=p.alignGopsAtEnd?this.alignGopsAtEnd_(L):this.alignGopsAtStart_(L)))return this.gopCache_.unshift({gop:L.pop(),pps:c.pps,sps:c.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),m=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");gi_clearDtsInfo(c),L=kt}gi_collectDtsInfo(c,L),c.samples=function(c,p){var h,m,_,y,I=p||0,O=[];for(h=0;h=-1e4&&G<=45e3&&(!fe||M>G)&&(fe=ae,M=G));return fe?fe.gop:null},this.alignGopsAtStart_=function(I){var O,L,M,G,fe,Se,ae,Be;for(fe=I.byteLength,Se=I.nalCount,ae=I.duration,O=L=0;O<_.length&&LM.pts?O++:(L++,fe-=G.byteLength,Se-=G.nalCount,ae-=G.duration);return 0===L?I:L===I.length?null:((Be=I.slice(L)).byteLength=fe,Be.duration=ae,Be.nalCount=Se,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be)},this.alignGopsAtEnd_=function(I){var O,L,M,G,fe,Se,ae;for(O=_.length-1,L=I.length-1,fe=null,Se=!1;O>=0&&L>=0;){if((M=_[O]).pts===(G=I[L]).pts){Se=!0;break}M.pts>G.pts?O--:(O===_.length-1&&(fe=L),L--)}if(!Se&&null===fe)return null;if(0===(ae=Se?L:fe))return I;var Be=I.slice(ae),kt=Be.reduce(function(Zt,Tr){return Zt.byteLength+=Tr.byteLength,Zt.duration+=Tr.duration,Zt.nalCount+=Tr.nalCount,Zt},{byteLength:0,duration:0,nalCount:0});return Be.byteLength=kt.byteLength,Be.duration=kt.duration,Be.nalCount=kt.nalCount,Be.pts=Be[0].pts,Be.dts=Be[0].dts,Be},this.alignGopsWith=function(I){_=I}},Mn.prototype=new n,vr=function(c,p){this.numberOfTracks=0,this.metadataStream=p,this.remuxTracks=void 0===(c=c||{}).remux||!!c.remux,this.keepOriginalTimestamps="boolean"==typeof c.keepOriginalTimestamps&&c.keepOriginalTimestamps,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vr.prototype.init.call(this),this.push=function(h){return h.text?this.pendingCaptions.push(h):h.frames?this.pendingMetadata.push(h):(this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,"video"===h.track.type&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),void("audio"===h.track.type&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))))}},vr.prototype=new n,vr.prototype.flush=function(b){var h,m,_,k,c=0,p={captions:[],captionStreams:{},metadata:[],info:{}},y=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,Xo.forEach(function(I){p.info[I]=this.videoTrack[I]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,Yo.forEach(function(I){p.info[I]=this.audioTrack[I]},this)),this.videoTrack||this.audioTrack){for(p.type=1===this.pendingTracks.length?this.pendingTracks[0].type:"combined",this.emittedTracks+=this.pendingTracks.length,_=function(c){var m,p=d(),h=E(c);return(m=new Uint8Array(p.byteLength+h.byteLength)).set(p),m.set(h,p.byteLength),m}(this.pendingTracks),p.initSegment=new Uint8Array(_.byteLength),p.initSegment.set(_),p.data=new Uint8Array(this.pendingBytes),k=0;k=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vr.prototype.setRemux=function(b){this.remuxTracks=b},Ja=function(c){var m,_,p=this,h=!0;Ja.prototype.init.call(this),this.baseMediaDecodeTime=(c=c||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new ji.MetadataStream,y.aacStream=new iy,y.audioTimestampRolloverStream=new ji.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new ji.TimestampRolloverStream("timed-metadata"),y.adtsStream=new wc,y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(k){y.aacStream.setTimestamp(k.timeStamp)}),y.aacStream.on("data",function(k){"timed-metadata"!==k.type&&"audio"!==k.type||y.audioSegmentStream||(_=_||{timelineStartInfo:{baseMediaDecodeTime:p.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Oc(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new ji.MetadataStream,y.packetStream=new ji.TransportPacketStream,y.parseStream=new ji.TransportParseStream,y.elementaryStream=new ji.ElementaryStream,y.timestampRolloverStream=new ji.TimestampRolloverStream,y.adtsStream=new wc,y.h264Stream=new ay,y.captionStream=new ji.CaptionStream(c),y.coalesceStream=new vr(c,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(k){var I;if("metadata"===k.type){for(I=k.tracks.length;I--;)m||"video"!==k.tracks[I].type?!_&&"audio"===k.tracks[I].type&&((_=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime):(m=k.tracks[I]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime;m&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new Mn(m,c),y.videoSegmentStream.on("log",p.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(O){_&&!c.keepOriginalTimestamps&&(_.timelineStartInfo=O,y.audioSegmentStream.setEarliestDts(O.dts-p.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",p.trigger.bind(p,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(O){_&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(O)}),y.videoSegmentStream.on("timingInfo",p.trigger.bind(p,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),_&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new en(_,c),y.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),p.trigger("trackinfo",{hasAudio:!!_,hasVideo:!!m})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(k){k.dispatchType=y.metadataStream.dispatchType,p.trigger("id3Frame",k)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),Oc(this,y)},this.setBaseMediaDecodeTime=function(y){var k=this.transmuxPipeline_;c.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),_&&(_.timelineStartInfo.dts=void 0,_.timelineStartInfo.pts=void 0,gi_clearDtsInfo(_),k.audioTimestampRolloverStream&&k.audioTimestampRolloverStream.discontinuity()),m&&(k.videoSegmentStream&&(k.videoSegmentStream.gopCache_=[]),m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,gi_clearDtsInfo(m),k.captionStream.reset()),k.timestampRolloverStream&&k.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){_&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var k=this.transmuxPipeline_;c.remux=y,k&&k.coalesceStream&&k.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){m&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var k=this;return function(I){I.stream=y,k.trigger("log",I)}},this.push=function(y){if(h){var k=sy(y);k&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():!k&&"ts"!==this.transmuxPipeline_.type&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ja.prototype=new n;var jc,Wc,Jo,ly={Transmuxer:Ja,VideoSegmentStream:Mn,AudioSegmentStream:en,AUDIO_PROPERTIES:Yo,VIDEO_PROPERTIES:Xo,generateSegmentTimingInfo:Qo},es_toUnsigned=function(c){return c>>>0},_r=function(c){var p="";return p+=String.fromCharCode(c[0]),p+=String.fromCharCode(c[1]),(p+=String.fromCharCode(c[2]))+String.fromCharCode(c[3])},hy=es_toUnsigned,ft=function b(c,p){var m,_,y,k,I,h=[];if(!p.length)return null;for(m=0;m1?m+_:c.byteLength,y===p[0]&&(1===p.length?h.push(c.subarray(m+8,k)):(I=b(c.subarray(m+8,k),p.slice(1))).length&&(h=h.concat(I))),m=k;return h},my=es_toUnsigned,gy=e.getUint64,Nc=function(c){return{isLeading:(12&c[0])>>>2,dependsOn:3&c[0],isDependedOn:(192&c[1])>>>6,hasRedundancy:(48&c[1])>>>4,paddingValue:(14&c[1])>>>1,isNonSyncSample:1&c[1],degradationPriority:c[2]<<8|c[3]}},Bc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Fn="undefined"!=typeof window?window:void 0!==Bc?Bc:"undefined"!=typeof self?self:{},by=function(c){for(var _,y,p=c.byteLength,h=[],m=1;m0?function(c){var p={version:c[0],flags:new Uint8Array(c.subarray(1,4))};return p.baseMediaDecodeTime=1===p.version?gy(c.subarray(4)):my(c[4]<<24|c[5]<<16|c[6]<<8|c[7]),p}(fe[0]).baseMediaDecodeTime:0,ae=ft(O,["trun"]);p===G&&ae.length>0&&(Be=function(c,p,h){var m=p,_=h.defaultSampleDuration||0,y=h.defaultSampleSize||0,k=h.trackId,I=[];return c.forEach(function(O){var M=function(c){var G,p={version:c[0],flags:new Uint8Array(c.subarray(1,4)),samples:[]},h=new DataView(c.buffer,c.byteOffset,c.byteLength),m=1&p.flags[2],_=4&p.flags[2],y=1&p.flags[1],k=2&p.flags[1],I=4&p.flags[1],O=8&p.flags[1],L=h.getUint32(4),M=8;for(m&&(p.dataOffset=h.getInt32(M),M+=4),_&&L&&(G={flags:Nc(c.subarray(M,M+4))},M+=4,y&&(G.duration=h.getUint32(M),M+=4),k&&(G.size=h.getUint32(M),M+=4),O&&(G.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(G),L--);L--;)G={},y&&(G.duration=h.getUint32(M),M+=4),k&&(G.size=h.getUint32(M),M+=4),I&&(G.flags=Nc(c.subarray(M,M+4)),M+=4),O&&(G.compositionTimeOffset=1===p.version?h.getInt32(M):h.getUint32(M),M+=4),p.samples.push(G);return p}(O).samples;M.forEach(function(G){void 0===G.duration&&(G.duration=_),void 0===G.size&&(G.size=y),G.trackId=k,G.dts=m,void 0===G.compositionTimeOffset&&(G.compositionTimeOffset=0),"bigint"==typeof m?(G.pts=m+Fn.BigInt(G.compositionTimeOffset),m+=Fn.BigInt(G.duration)):(G.pts=m+G.compositionTimeOffset,m+=G.duration)}),I=I.concat(M)}),I}(ae,Se,M),kt=function(c,p,h){var y,k,I,O,m=new DataView(c.buffer,c.byteOffset,c.byteLength),_={logs:[],seiNals:[]};for(k=0;k+40;){var G=h.shift();this.parse(G,O,L)}return M=function(c,p,h){if(null===p)return null;var _=ky(c,p)[p]||{};return{seiNals:_.seiNals,logs:_.logs,timescale:h}}(I,m,_),M&&M.logs&&(y.logs=y.logs.concat(M.logs)),null!==M&&M.seiNals?(this.pushNals(M.seiNals),this.flushStream(),y):y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(I){if(!this.isInitialized()||!I||0===I.length)return null;I.forEach(function(O){p.push(O)})},this.flushStream=function(){if(!this.isInitialized())return null;k?p.partialFlush():p.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;p.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],m=null,_=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},ts=es_toUnsigned,Un=function(c){return("00"+c.toString(16)).slice(-2)},Dy=e.getUint64;jc=function(c,p){var m=ft(p,["moof","traf"]).reduce(function(_,y){var G,fe,k=ft(y,["tfhd"])[0],I=ts(k[4]<<24|k[5]<<16|k[6]<<8|k[7]),O=c[I]||9e4,L=ft(y,["tfdt"])[0],M=new DataView(L.buffer,L.byteOffset,L.byteLength);return"bigint"==typeof(G=1===L[0]?Dy(L.subarray(4,12)):M.getUint32(4))?fe=G/Fn.BigInt(O):"number"==typeof G&&!isNaN(G)&&(fe=G/O),fe11?(_.codec+=".",_.codec+=Un(Se[9]),_.codec+=Un(Se[10]),_.codec+=Un(Se[11])):_.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(_.codec)?(Se=fe.subarray(28),"esds"===_r(Se.subarray(4,8))&&Se.length>20&&0!==Se[19]?(_.codec+="."+Un(Se[19]),_.codec+="."+Un(Se[20]>>>2&63).replace(/^0/,"")):_.codec="mp4a.40.2"):_.codec=_.codec.toLowerCase())}var Be=ft(m,["mdia","mdhd"])[0];Be&&(_.timescale=Jo(Be)),h.push(_)}),h};var Gc_startTime=jc,Gc_tracks=Wc,Zc=function(c){var p=31&c[1];return(p<<=8)|c[2]},is=function(c){return!!(64&c[1])},rs=function(c){var p=0;return(48&c[3])>>>4>1&&(p+=c[4]+1),p},eu=function(c){switch(c){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Fy={parseType:function(c,p){var h=Zc(c);return 0===h?"pat":h===p?"pmt":p?"pes":null},parsePat:function(c){var p=is(c),h=4+rs(c);return p&&(h+=c[h]+1),(31&c[h+10])<<8|c[h+11]},parsePmt:function(c){var p={},h=is(c),m=4+rs(c);if(h&&(m+=c[m]+1),1&c[m+5]){var y;y=3+((15&c[m+1])<<8|c[m+2])-4;for(var I=12+((15&c[m+10])<<8|c[m+11]);I=c.byteLength)return null;var _,m=null;return 192&(_=c[h+7])&&((m={}).pts=(14&c[h+9])<<27|(255&c[h+10])<<20|(254&c[h+11])<<12|(255&c[h+12])<<5|(254&c[h+13])>>>3,m.pts*=4,m.pts+=(6&c[h+13])>>>1,m.dts=m.pts,64&_&&(m.dts=(14&c[h+14])<<27|(255&c[h+15])<<20|(254&c[h+16])<<12|(255&c[h+17])<<5|(254&c[h+18])>>>3,m.dts*=4,m.dts+=(6&c[h+18])>>>1)),m},videoPacketContainsKeyFrame:function(c){for(var p=4+rs(c),h=c.subarray(p),m=0,_=0,y=!1;_3&&"slice_layer_without_partitioning_rbsp_idr"===eu(31&h[_+3])&&(y=!0),y}},tn=Sc_handleRollover,tt={};tt.ts=Fy,tt.aac=Xa;var yr=9e4,Gt=188,zc=function(c,p,h){for(var y,I,O,L,m=0,_=Gt,M=!1;_<=c.byteLength;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m++,_++;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),O=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&O&&(L=tt.ts.parsePesTime(y))&&(L.type="audio",h.audio.push(L),M=!0)),M)break;m+=Gt,_+=Gt}for(m=(_=c.byteLength)-Gt,M=!1;m>=0;)if(71!==c[m]||71!==c[_]&&_!==c.byteLength)m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),O=tt.ts.parsePayloadUnitStartIndicator(y),"audio"===I&&O&&(L=tt.ts.parsePesTime(y))&&(L.type="audio",h.audio.push(L),M=!0)),M)break;m-=Gt,_-=Gt}},By=function(c,p,h){for(var y,I,O,L,M,G,fe,m=0,_=Gt,Se=!1,ae={data:[],size:0};_=0;)if(71!==c[m]||71!==c[_])m--,_--;else{if("pes"===(y=c.subarray(m,_),tt.ts.parseType(y,p.pid))&&(I=tt.ts.parsePesType(y,p.table),O=tt.ts.parsePayloadUnitStartIndicator(y),"video"===I&&O&&(L=tt.ts.parsePesTime(y))&&(L.type="video",h.video.push(L),Se=!0)),Se)break;m-=Gt,_-=Gt}},Wy_inspect=function(c,p){var m;return m=tt.aac.isLikelyAacData(c)?function(c){for(var I,p=!1,h=0,m=null,_=null,y=0,k=0;c.length-k>=3;){switch(tt.aac.parseType(c,k)){case"timed-metadata":if(c.length-k<10){p=!0;break}if((y=tt.aac.parseId3TagSize(c,k))>c.length){p=!0;break}null===_&&(I=c.subarray(k,k+y),_=tt.aac.parseAacTimestamp(I)),k+=y;break;case"audio":if(c.length-k<7){p=!0;break}if((y=tt.aac.parseAdtsSize(c,k))>c.length){p=!0;break}null===m&&(I=c.subarray(k,k+y),m=tt.aac.parseSampleRate(I)),h++,k+=y;break;default:k++}if(p)return null}if(null===m||null===_)return null;var L=yr/m;return{audio:[{type:"audio",dts:_,pts:_},{type:"audio",dts:_+1024*h*L,pts:_+1024*h*L}]}}(c):function(c){var p={pid:null,table:null},h={};for(var m in function(c,p){for(var _,h=0,m=Gt;m0}(x)){t.isFmp4=!0;var S=t.map.tracks,F={isFmp4:!0,hasVideo:!!S.video,hasAudio:!!S.audio};S.audio&&S.audio.codec&&"enca"!==S.audio.codec&&(F.audioCodec=S.audio.codec),S.video&&S.video.codec&&"encv"!==S.video.codec&&(F.videoCodec=S.video.codec),S.video&&S.audio&&(F.isMuxed=!0),e(t,F);var U=function(W){g(t,{data:x,type:F.hasAudio&&!F.isMuxed?"audio":"video"}),W&&W.length&&d(t,W),T(null,t,{})};ka({action:"probeMp4StartTime",timescales:t.map.timescales,data:x,transmuxer:t.transmuxer,callback:function(W){var q=W.data,ne=W.startTime;r=q.buffer,t.bytes=x=q,F.hasAudio&&!F.isMuxed&&i(t,"audio","start",ne),F.hasVideo&&i(t,"video","start",ne),S.video&&q.byteLength&&t.transmuxer?ka({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:x,timescales:t.map.timescales,trackIds:[S.video.id],callback:function(z){r=z.data.buffer,t.bytes=x=z.data,z.logs.forEach(function(ye){E(N.mergeOptions(ye,{stream:"mp4CaptionParser"}))}),U(z.captions)}}):U()}})}else{if(t.transmuxer)return void 0===t.container&&(t.container=vs(x)),"ts"!==t.container&&"aac"!==t.container?(e(t,{hasAudio:!1,hasVideo:!1}),void T(null,t,{})):void Qm({segment:t,bytes:r,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});T(null,t,{})}},Vd=function(n,t){var l,r=n.id,e=n.key,i=n.encryptedBytes,a=n.decryptionWorker;a.addEventListener("message",function d(f){if(f.data.source===r){a.removeEventListener("message",d);var v=f.data.decrypted;t(new Uint8Array(v.bytes,v.byteOffset,v.byteLength))}}),l=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),a.postMessage(Sd({source:r,encrypted:i,key:l,iv:e.iv}),[i.buffer,l.buffer])},rg=function(n){var t=n.xhr,r=n.xhrOptions,i=n.segment,a=n.abortFn,o=n.progressFn,l=n.trackInfoFn,d=n.timingInfoFn,f=n.videoSegmentTimingInfoFn,v=n.audioSegmentTimingInfoFn,g=n.id3Fn,T=n.captionsFn,E=n.isEndOfTimeline,x=n.endedTimelineFn,S=n.dataFn,H=[],W=function(n){var t=n.activeXhrs,r=n.decryptionWorker,e=n.trackInfoFn,i=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog,x=0,S=!1;return function(F,U){if(!S){if(F)return S=!0,Po(t),T(F,U);if((x+=1)===t.length){var H=function(){if(U.encryptedBytes)return function(n){var r=n.segment,e=n.trackInfoFn,i=n.timingInfoFn,a=n.videoSegmentTimingInfoFn,o=n.audioSegmentTimingInfoFn,l=n.id3Fn,d=n.captionsFn,f=n.isEndOfTimeline,v=n.endedTimelineFn,g=n.dataFn,T=n.doneFn,E=n.onTransmuxerLog;Vd({id:r.requestId,key:r.key,encryptedBytes:r.encryptedBytes,decryptionWorker:n.decryptionWorker},function(x){r.bytes=x,jd({segment:r,bytes:r.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})})}({decryptionWorker:r,segment:U,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E});jd({segment:U,bytes:U.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:v,dataFn:g,doneFn:T,onTransmuxerLog:E})};if(U.endOfAllRequests=Date.now(),U.map&&U.map.encryptedBytes&&!U.map.bytes)return Vd({decryptionWorker:r,id:U.requestId+"-init",encryptedBytes:U.map.encryptedBytes,key:U.map.key},function(W){U.map.bytes=W,Hd(U,function(q){if(q)return Po(t),T(q,U);H()})});H()}}}}({activeXhrs:H,decryptionWorker:n.decryptionWorker,trackInfoFn:l,timingInfoFn:d,videoSegmentTimingInfoFn:f,audioSegmentTimingInfoFn:v,id3Fn:g,captionsFn:T,isEndOfTimeline:E,endedTimelineFn:x,dataFn:S,doneFn:n.doneFn,onTransmuxerLog:n.onTransmuxerLog});if(i.key&&!i.key.bytes){var q=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&q.push(i.map.key);var z=t(N.mergeOptions(r,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),Bd(i,q,W));H.push(z)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){var Pe=t(N.mergeOptions(r,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),Bd(i,[i.map.key],W));H.push(Pe)}var ot=N.mergeOptions(r,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Ao(i.map)}),Ft=function(n){var t=n.segment,r=n.finishProcessingFn;return function(e,i){var a=Lo(e,i);if(a)return r(a,t);var o=new Uint8Array(i.response);if(t.map.key)return t.map.encryptedBytes=o,r(null,t);t.map.bytes=o,Hd(t,function(l){if(l)return l.xhr=i,l.status=i.status,r(l,t);r(null,t)})}}({segment:i,finishProcessingFn:W}),Je=t(ot,Ft);H.push(Je)}var fr=N.mergeOptions(r,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Ao(i)}),si=t(fr,function(n){var t=n.segment,r=n.finishProcessingFn,e=n.responseType;return function(i,a){var o=Lo(i,a);if(o)return r(o,t);var l="arraybuffer"!==e&&a.responseText?function(n){for(var t=new Uint8Array(new ArrayBuffer(n.length)),r=0;r1)return ng("multiple "+r+" codecs found as attributes: "+t[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[r]=null);t[r]=t[r][0]}),t},Wd=function(n){var t=0;return n.audio&&t++,n.video&&t++,t},An=function(n,t){var r=t.attributes||{},e=Aa(function(n){var t=n.attributes||{};if(t.CODECS)return Qe(t.CODECS)}(t)||[]);if(qd(n,t)&&!e.audio&&!function(n,t){if(!qd(n,t))return!0;var e=n.mediaGroups.AUDIO[(t.attributes||{}).AUDIO];for(var i in e)if(!e[i].uri&&!e[i].playlists)return!0;return!1}(n,t)){var i=Aa(function(n,t){if(!n.mediaGroups.AUDIO||!t)return null;var r=n.mediaGroups.AUDIO[t];if(!r)return null;for(var e in r){var i=r[e];if(i.default&&i.playlists)return Qe(i.playlists[0].attributes.CODECS)}return null}(n,r.AUDIO)||[]);i.audio&&(e.audio=i.audio)}return e},wa=mi("PlaylistSelector"),Gd=function(n){if(n&&n.playlist){var t=n.playlist;return JSON.stringify({id:t.id,bandwidth:n.bandwidth,width:n.width,height:n.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Ia=function(n,t){if(!n)return"";var r=P().getComputedStyle(n);return r?r[t]:""},Xr=function(n,t){var r=n.slice();n.sort(function(e,i){var a=t(e,i);return 0===a?r.indexOf(e)-r.indexOf(i):a})},Oo=function(n,t){var r,e;return n.attributes.BANDWIDTH&&(r=n.attributes.BANDWIDTH),r=r||P().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(e=t.attributes.BANDWIDTH),r-(e||P().Number.MAX_VALUE)},Zd=function(n,t,r,e,i,a){if(n){var o={bandwidth:t,width:r,height:e,limitRenditionByPlayerDimensions:i},l=n.playlists;$t.isAudioOnly(n)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var d=l.map(function(ge){var Pe=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.width,ot=ge.attributes&&ge.attributes.RESOLUTION&&ge.attributes.RESOLUTION.height;return{bandwidth:ge.attributes&&ge.attributes.BANDWIDTH||P().Number.MAX_VALUE,width:Pe,height:ot,playlist:ge}});Xr(d,function(ge,Ye){return ge.bandwidth-Ye.bandwidth});var f=(d=d.filter(function(ge){return!$t.isIncompatible(ge.playlist)})).filter(function(ge){return $t.isEnabled(ge.playlist)});f.length||(f=d.filter(function(ge){return!$t.isDisabled(ge.playlist)}));var v=f.filter(function(ge){return ge.bandwidth*Dt.BANDWIDTH_VARIANCEr||ge.height>e})).filter(function(ge){return ge.width===H[0].width&&ge.height===H[0].height}),g=W[W.length-1],q=W.filter(function(ge){return ge.bandwidth===g.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var he=S.map(function(ge){return ge.pixelDiff=Math.abs(ge.width-r)+Math.abs(ge.height-e),ge});Xr(he,function(ge,Ye){return ge.pixelDiff===Ye.pixelDiff?Ye.bandwidth-ge.bandwidth:ge.pixelDiff-Ye.pixelDiff}),ne=he[0]}var z=ne||q||U||T||f[0]||d[0];if(z&&z.playlist){var ye="sortedPlaylistReps";return ne?ye="leastPixelDiffRep":q?ye="resolutionPlusOneRep":U?ye="resolutionBestRep":T?ye="bandwidthBestRep":f[0]&&(ye="enabledPlaylistReps"),wa("choosing "+Gd(z)+" using "+ye+" with options",o),z.playlist}return wa("could not choose a playlist with options",o),null}},zd=function(){var n=this.useDevicePixelRatio&&P().devicePixelRatio||1;return Zd(this.playlists.master,this.systemBandwidth,parseInt(Ia(this.tech_.el(),"width"),10)*n,parseInt(Ia(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},wn=function(n,t,r){var e,i;if(r&&r.cues)for(e=r.cues.length;e--;)(i=r.cues[e]).startTime>=n&&i.endTime<=t&&r.removeCue(i)},$d=function(n){return"number"==typeof n&&isFinite(n)},Da=1/60,Qr=function(n){var t=n.startOfSegment,r=n.duration,e=n.segment,i=n.part,a=n.playlist,o=a.mediaSequence,l=a.id,d=a.segments,v=n.mediaIndex,g=n.partIndex,T=n.timeline,E=(void 0===d?[]:d).length-1,x="mediaIndex/partIndex increment";n.getMediaInfoForTime?x="getMediaInfoForTime ("+n.getMediaInfoForTime+")":n.isSyncRequest&&(x="getSyncSegmentCandidate (isSyncRequest)"),n.independent&&(x+=" with independent "+n.independent);var S="number"==typeof g,F=n.segment.uri?"segment":"pre-segment",U=S?ud({preloadSegment:e})-1:0;return F+" ["+(o+v)+"/"+(o+E)+"]"+(S?" part ["+g+"/"+U+"]":"")+" segment start/end ["+e.start+" => "+e.end+"]"+(S?" part start/end ["+i.start+" => "+i.end+"]":"")+" startOfSegment ["+t+"] duration ["+r+"] timeline ["+T+"] selected by ["+x+"] playlist ["+l+"]"},Yd=function(n){return n+"TimingInfo"},Xd=function(n){var t=n.timelineChangeController,e=n.segmentTimeline,i=n.loaderType,a=n.audioDisabled;if(n.currentTimeline===e)return!1;if("audio"===i){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==e}if("main"===i&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===e)}return!1},Qd=function(n){var t=n.segmentDuration,r=n.maxDuration;return!!t&&Math.round(t)>r+zi},Ro=function(s){function n(r,e){var i;if(i=s.call(this)||this,!r)throw new TypeError("Initialization settings are required");if("function"!=typeof r.currentTime)throw new TypeError("No currentTime getter specified");if(!r.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=r.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=r.hasPlayed,i.currentTime_=r.currentTime,i.seekable_=r.seekable,i.seeking_=r.seeking,i.duration_=r.duration,i.mediaSource_=r.mediaSource,i.vhs_=r.vhs,i.loaderType_=r.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=r.segmentMetadataTrack,i.goalBufferLength_=r.goalBufferLength,i.sourceType_=r.sourceType,i.sourceUpdater_=r.sourceUpdater,i.inbandTextTracks_=r.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=r.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=r.parse708captions,i.captionServices_=r.captionServices,i.experimentalExactManifestTimings=r.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=N.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=r.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=r.decrypter,i.syncController_=r.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=mi("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(Fe(i),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"main"===i.loaderType_&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),"audio"===i.loaderType_&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}ie(n,s);var t=n.prototype;return t.createTransmuxer_=function(){return function(n){var t=new jm;t.currentTransmux=null,t.transmuxQueue=[];var r=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,r.call(t)},t.postMessage({action:"init",options:n}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},t.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,P().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},t.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Do_reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return N.createTimeRanges();if("main"===this.loaderType_){var a=e.hasVideo;if(a&&e.hasAudio&&!this.audioDisabled_&&!e.isMuxed)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(e,i){if(void 0===i&&(i=!1),!e)return null;var a=Ca(e),o=this.initSegments_[a];return i&&!o&&e.bytes&&(this.initSegments_[a]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},t.segmentKey=function(e,i){if(void 0===i&&(i=!1),!e)return null;var a=Ed(e),o=this.keyCache_[a];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[a]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var l={resolvedUri:(o||e).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(e,i){if(void 0===i&&(i={}),e){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var d=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+d+"]"),null!==this.mediaIndex)if(this.mediaIndex-=d,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var f=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!f.parts||!f.parts.length||!f.parts[this.partIndex])){var v=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=v}}o&&(o.mediaIndex-=d,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}},t.pause=function(){this.checkBufferTimeout_&&(P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return null===this.checkBufferTimeout_},t.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&Do_reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(e,i,a,o){if(void 0===a&&(a=function(){}),void 0===o&&(o=!1),i===1/0&&(i=this.duration_()),i<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var l=1,d=function(){0==--l&&a()};for(var f in(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(e,i,d)),(o||"main"===this.loaderType_)&&(this.gopBuffer_=function(n,t,r,e){for(var i=Math.ceil((t-e)*Zn.ONE_SECOND_IN_TS),a=Math.ceil((r-e)*Zn.ONE_SECOND_IN_TS),o=n.slice(),l=n.length;l--&&!(n[l].pts<=a););if(-1===l)return o;for(var d=l+1;d--&&!(n[d].pts<=i););return d=Math.max(d,0),o.splice(d,l-d+1),o}(this.gopBuffer_,e,i,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(e,i,d)),this.inbandTextTracks_)wn(e,i,this.inbandTextTracks_[f]);wn(e,i,this.segmentMetadataTrack_),d()}else this.logger_("skipping remove because no source updater or starting media info")},t.monitorBuffer_=function(){this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&P().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=P().setTimeout(this.monitorBufferTick_.bind(this),500)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();!e||("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},t.isEndOfStream_=function(e,i,a){if(void 0===e&&(e=this.mediaIndex),void 0===i&&(i=this.playlist_),void 0===a&&(a=this.partIndex),!i||!this.mediaSource_)return!1;var o="number"==typeof e&&i.segments[e];return i.endList&&"open"===this.mediaSource_.readyState&&e+1===i.segments.length&&(!o||!o.parts||a+1===o.parts.length)},t.chooseNextRequest_=function(){var e=this.buffered_(),i=ad(e)||0,a=vo(e,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),d=this.playlist_.segments;if(!d.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var f={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(f.isSyncRequest)f.mediaIndex=function(n,t,r){t=t||[];for(var e=[],i=0,a=0;ar))return a}return 0===e.length?0:e[e.length-1]}(this.currentTimeline_,d,i);else if(null!==this.mediaIndex){var v=d[this.mediaIndex],g="number"==typeof this.partIndex?this.partIndex:-1;f.startOfSegment=v.end?v.end:i,v.parts&&v.parts[g+1]?(f.mediaIndex=this.mediaIndex,f.partIndex=g+1):f.mediaIndex=this.mediaIndex+1}else{var T=$t.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?i:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),E=T.segmentIndex,x=T.startTime,S=T.partIndex;f.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+i:"currentTime "+this.currentTime_(),f.mediaIndex=E,f.startOfSegment=x,f.partIndex=S}var F=d[f.mediaIndex],U=F&&"number"==typeof f.partIndex&&F.parts&&F.parts[f.partIndex];if(!F||"number"==typeof f.partIndex&&!U)return null;if("number"!=typeof f.partIndex&&F.parts&&(f.partIndex=0,U=F.parts[0]),!a&&U&&!U.independent)if(0===f.partIndex){var H=d[f.mediaIndex-1],W=H.parts&&H.parts.length&&H.parts[H.parts.length-1];W&&W.independent&&(f.mediaIndex-=1,f.partIndex=H.parts.length-1,f.independent="previous segment")}else F.parts[f.partIndex-1].independent&&(f.partIndex-=1,f.independent="previous part");return f.mediaIndex>=d.length-1&&this.mediaSource_&&"ended"===this.mediaSource_.readyState&&!this.seeking_()?null:this.generateSegmentInfo_(f)},t.generateSegmentInfo_=function(e){var i=e.independent,a=e.playlist,o=e.mediaIndex,l=e.startOfSegment,d=e.isSyncRequest,f=e.partIndex,v=e.forceTimestampOffset,g=e.getMediaInfoForTime,T=a.segments[o],E="number"==typeof f&&T.parts[f],x={requestId:"segment-loader-"+Math.random(),uri:E&&E.resolvedUri||T.resolvedUri,mediaIndex:o,partIndex:E?f:null,isSyncRequest:d,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:T.timeline,duration:E&&E.duration||T.duration,segment:T,part:E,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:g,independent:i},S=void 0!==v?v:this.isPendingTimestampOffset_;x.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:T.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:S});var F=ad(this.sourceUpdater_.audioBuffered());return"number"==typeof F&&(x.audioAppendStart=F-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(x.gopsToAlignWith=function(n,t,r){if(null==t||!n.length)return[];var i,e=Math.ceil((t-r+3)*Zn.ONE_SECOND_IN_TS);for(i=0;ie);i++);return n.slice(i)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),x},t.timestampOffsetForSegment_=function(e){return function(n){var t=n.segmentTimeline,r=n.currentTimeline,e=n.startOfSegment,i=n.buffered;return n.overrideCheck||t!==r?t "+T+" for "+f),function(n,t,r){if(!n[r]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var e=r;/^cc708_/.test(r)&&(e="SERVICE"+r.split("_")[1]);var i=t.textTracks().getTrackById(e);if(i)n[r]=i;else{var o=r,l=r,d=!1,f=(t.options_.vhs&&t.options_.vhs.captionServices||{})[e];f&&(o=f.label,l=f.language,d=f.default),n[r]=t.addRemoteTextTrack({kind:"captions",id:e,default:d,label:o,language:l},!1).track}}}(x,a.vhs_.tech_,f),wn(g,T,x[f]),function(n){var t=n.inbandTextTracks,r=n.captionArray,e=n.timestampOffset;if(r){var i=P().WebKitDataCue||P().VTTCue;r.forEach(function(a){t[a.stream].addCue(new i(a.startTime+e,a.endTime+e,a.text))})}}({captionArray:E,inbandTextTracks:x,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(e,i,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,a));var l=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();(function(n,t,r){n.metadataTrack_||(n.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,n.metadataTrack_.inBandMetadataTrackDispatchType=t)})(this.inbandTextTracks_,a,this.vhs_.tech_),function(n){var t=n.inbandTextTracks,r=n.metadataArray,e=n.timestampOffset,i=n.videoDuration;if(r){var a=P().WebKitDataCue||P().VTTCue,o=t.metadataTrack_;if(o&&(r.forEach(function(T){var E=T.cueTime+e;"number"!=typeof E||P().isNaN(E)||E<0||!(E<1/0)||T.frames.forEach(function(x){var S=new a(E,E,x.value||x.url||x.data||"");S.frame=x,S.value=x,function(n){Object.defineProperties(n.frame,{id:{get:function(){return N.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),n.value.key}},value:{get:function(){return N.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),n.value.data}},privateData:{get:function(){return N.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),n.value.data}}})}(S),o.addCue(S)})}),o.cues&&o.cues.length)){for(var l=o.cues,d=[],f=0;f1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+cr(f).join(", ")),v.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+cr(v).join(", "));var g=f.length?f.start(0):0,T=f.length?f.end(f.length-1):0,E=v.length?v.start(0):0,x=v.length?v.end(v.length-1):0;if(T-g<=1&&x-E<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+d.byteLength+", audio buffer: "+cr(f).join(", ")+", video buffer: "+cr(v).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:d}));var F=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+F),this.remove(0,F,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=P().setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3)},!0)},t.handleAppendError_=function(e,i){var a=e.segmentInfo,o=e.type,l=e.bytes;if(i){if(22===i.code)return void this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(o+" append of "+l.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(e){var i=e.segmentInfo,a=e.type,o=e.initSegment,l=e.data,d=e.bytes;if(!d){var f=[l],v=l.byteLength;o&&(f.unshift(o),v+=o.byteLength),d=function(n){var r,t=0;return n.bytes&&(r=new Uint8Array(n.bytes),n.segments.forEach(function(e){r.set(e,t),t+=e.byteLength})),r}({bytes:v,segments:f})}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:a,bytes:d},this.handleAppendError_.bind(this,{segmentInfo:i,type:a,bytes:d}))},t.handleSegmentTimingInfo_=function(e,i,a){if(this.pendingSegment_&&i===this.pendingSegment_.requestId){var o=this.pendingSegment_.segment,l=e+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(e,i){var a=i.type,o=i.data;if(o&&o.byteLength&&("audio"!==a||!this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:l,data:o})}},t.loadSegment_=function(e){var i=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var a=gt({},e,{forceTimestampOffset:!0});gt(e,i.generateSegmentInfo_(a)),i.isPendingTimestampOffset_=!1,i.updateTransmuxerAndRequestSegment_(e)})},t.updateTransmuxerAndRequestSegment_=function(e){var i=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var a=this.createSimplifiedSegmentObj_(e),f=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)||null!==this.mediaIndex&&e.timeline!==this.currentTimeline_&&e.timeline>0;this.logger_("Requesting "+Qr(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=rg({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:f,endedTimelineFn:function(){i.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(g){var T=g.message,E=g.level,x=g.stream;i.logger_(Qr(e)+" logged from transmuxer stream "+x+" as a "+E+": "+T)}})},t.trimBackBuffer_=function(e){var i=function(n,t,r){var e=t-Dt.BACK_BUFFER_LENGTH;return n.length&&(e=Math.max(e,n.start(0))),Math.min(t-r,e)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)},t.createSimplifiedSegmentObj_=function(e){var i=e.segment,a=e.part,o={resolvedUri:a?a.resolvedUri:i.resolvedUri,byterange:a?a.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===i.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),i.key){var d=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(i.key),o.key.iv=d}return i.map&&(o.map=this.initSegmentForMap(i.map)),o},t.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},t.saveBandwidthRelatedStats_=function(e,i){this.pendingSegment_.byteLength=i.bytesReceived,e=e);i++);return n.slice(0,i).concat(t)}(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(e){var i=this.syncController_.mappingForTimeline(e);null!==i&&(this.timeMapping_=i)},t.updateMediaSecondsLoaded_=function(e){this.mediaSecondsLoaded+="number"==typeof e.start&&"number"==typeof e.end?e.end-e.start:e.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},t.trueSegmentStart_=function(e){var i=e.currentStart,o=e.mediaIndex,l=e.firstVideoFrameTimeForData;if(void 0!==i)return i;if(!e.useVideoTimingInfo)return e.audioTimingInfo.start;var T=e.playlist.segments[o-1];return 0!==o&&T&&void 0!==T.start&&T.end===l+e.currentVideoTimestampOffset?e.videoTimingInfo.start:l},t.waitForAppendsToComplete_=function(e){var i=this.getCurrentMediaInfo_(e);if(!i)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var d="main"===this.loaderType_&&i.hasVideo,f=!this.audioDisabled_&&i.hasAudio&&!i.isMuxed;if(e.waitingOnAppends=0,!e.hasAppendedData_)return!e.timingInfo&&"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);d&&e.waitingOnAppends++,f&&e.waitingOnAppends++,d&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),f&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},t.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(e){var i=function(n,t,r){return"main"===n&&t&&r?r.hasAudio||r.hasVideo?t.hasVideo&&!r.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&r.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!i&&(this.error({message:i,blacklistDuration:1/0}),this.trigger("error"),!0)},t.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var i=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}},t.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var i=this.getMediaInfo_(),o="main"===this.loaderType_&&i&&i.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;!o||(e.timingInfo.end="number"==typeof o.end?o.end:o.start+e.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var i=function(n,t){if("hls"!==t)return null;var r=function(n){var t=0;return["video","audio"].forEach(function(r){var e=n[r+"TimingInfo"];if(e){var o,i=e.start,a=e.end;"bigint"==typeof i||"bigint"==typeof a?o=P().BigInt(a)-P().BigInt(i):"number"==typeof i&&"number"==typeof a&&(o=a-i),void 0!==o&&o>t&&(t=o)}}),"bigint"==typeof t&&t3*e.playlist.targetDuration,d=o&&o.end&&this.currentTime_()-o.end>3*e.playlist.partTargetDuration;if(l||d)return this.logger_("bad "+(l?"segment":"part")+" "+Qr(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Qr(e))},t.recordThroughput_=function(e){if(e.duration=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},t.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(e,i,a){var o=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(i.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return-101===e.code&&this.handleTimeout_(),-102===e.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,i.stats),this.state="APPENDING",this.trigger("appending");var d=l.segment;if(d.map&&(d.map.bytes=i.map.bytes),l.bytes=i.bytes,"function"!=typeof P().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var f,v=function(){o.subtitlesTrack_.tech_.off("vttjsloaded",f),o.stopForError({message:"Error loading vtt.js"})};return f=function(){o.subtitlesTrack_.tech_.off("vttjserror",v),o.segmentRequestFinished_(e,i,a)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",f),void this.subtitlesTrack_.tech_.one("vttjserror",v)}d.requested=!0;try{this.parseVTTCues_(l)}catch(g){return void this.stopForError({message:g.message})}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.timingInfo=l.cues.length?{start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:{start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=d.duration,l.cues.forEach(function(g){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new(P().VTTCue)(g.startTime,g.endTime,g.text):g)}),function(n){var t=n.cues;if(t)for(var r=0;r1&&e.push(t[a]);e.length&&e.forEach(function(o){return n.removeCue(o)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(e){var i,a=!1;"function"==typeof P().TextDecoder?i=new(P().TextDecoder)("utf8"):(i=P().WebVTT.StringDecoder(),a=!0);var o=new(P().WebVTT.Parser)(P(),P().vttjs,i);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(f){e.timestampmap=f},o.onparsingerror=function(f){N.log.warn("Error encountered when parsing cues: "+f.message)},e.segment.map){var l=e.segment.map.bytes;a&&(l=rc(l)),o.parse(l)}var d=e.bytes;a&&(d=rc(d)),o.parse(d),o.flush()},t.updateTimeMapping_=function(e,i,a){var o=e.segment;if(i){if(!e.cues.length)return void(o.empty=!0);var l=e.timestampmap,d=l.MPEGTS/Zn.ONE_SECOND_IN_TS-l.LOCAL+i.mapping;e.cues.forEach(function(g){g.startTime+=d,g.endTime+=d}),a.syncInfo||(a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(e.cues[0].startTime,e.cues[e.cues.length-1].startTime-o.duration)})}},n}(Ro),Lg=function(n,t){for(var r=n.cues,e=0;e=i.adStartTime&&t<=i.adEndTime)return i}return null},ac=[{name:"VOD",run:function(n,t,r,e,i){return r!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(n,t,r,e,i){if(!Object.keys(n.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=yo(t);i=i||0;for(var d=0;d=E)&&(o=E,a={time:T,segmentIndex:v.segmentIndex,partIndex:v.partIndex})}}return a}},{name:"Discontinuity",run:function(n,t,r,e,i){var a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l=g)&&(o=g,a={time:v.time,segmentIndex:d,partIndex:null})}}return a}},{name:"Playlist",run:function(n,t,r,e,i){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Mg=function(s){function n(r){var e;return(e=s.call(this)||this).timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=mi("SyncController"),e}ie(n,s);var t=n.prototype;return t.getSyncPoint=function(e,i,a,o){var l=this.runStrategies_(e,i,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(e,i){if(!e||!e.segments)return null;var a=this.runStrategies_(e,i,e.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+En({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(e,i,a,o){for(var l=[],d=0;d86400)N.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var o=a-1;o>=0;o--){var l=e.segments[o];if(l&&void 0!==l.start){i.syncInfo={mediaSequence:e.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+", mediaSequence: "+i.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var i=e.segments[0],a=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-a}},t.saveSegmentTimingInfo=function(e){var i=e.segmentInfo,a=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(i,i.timingInfo,a),l=i.segment;o&&(this.saveDiscontinuitySyncInfo_(i),i.playlist.syncInfo||(i.playlist.syncInfo={mediaSequence:i.playlist.mediaSequence+i.mediaIndex,time:l.start}));var d=l.dateTimeObject;l.discontinuity&&a&&d&&(this.timelineToDatetimeMappings[l.timeline]=-d.getTime()/1e3)},t.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},t.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},t.calculateSegmentTimeMapping_=function(e,i,a){var f,v,o=e.segment,l=e.part,d=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)d={time:e.startOfSegment,mapping:e.startOfSegment-i.start},a&&(this.timelines[e.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),f=e.startOfSegment,v=i.end+d.mapping;else{if(!d)return!1;f=i.start+d.mapping,v=i.end+d.mapping}return l&&(l.start=f,l.end=v),(!o.start||fv){var g;g=f<0?a.start-En({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:l}):a.end+En({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:l}),this.discontinuities[d]={time:g,accuracy:v}}}},t.dispose=function(){this.trigger("dispose"),this.off()},n}(N.EventTarget),Ng=function(s){function n(){var r;return(r=s.call(this)||this).pendingTimelineChanges_={},r.lastTimelineChanges_={},r}ie(n,s);var t=n.prototype;return t.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(e){var i=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.pendingTimelineChanges_[i]={type:i,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[i]},t.lastTimelineChange=function(e){var i=e.type,a=e.from,o=e.to;return"number"==typeof a&&"number"==typeof o&&(this.lastTimelineChanges_[i]={type:i,from:a,to:o},delete this.pendingTimelineChanges_[i],this.trigger("timelinechange")),this.lastTimelineChanges_[i]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},n}(N.EventTarget),Fg=Ld(Od(function(){function s(x,S,F){return x(F={path:S,exports:{},require:function(H,W){return function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},F.exports),F.exports}var t=s(function(x){function S(U,H){for(var W=0;W-1},S.trigger=function(U){var H=this.listeners[U];if(H)if(2===arguments.length)for(var W=H.length,q=0;q>7))^q]=q;for(ne=he=0;!H[ne];ne^=ge||1,he=ye[he]||1)for(H[ne]=ot=(ot=he^he<<1^he<<2^he<<3^he<<4)>>8^255&ot^99,W[ot]=ne,Je=16843009*z[Ye=z[ge=z[ne]]]^65537*Ye^257*ge^16843008*ne,Ft=257*z[ot]^16843008*ot,q=0;q<4;q++)F[q][ne]=Ft=Ft<<24^Ft>>>8,U[q][ot]=Je=Je<<24^Je>>>8;for(q=0;q<5;q++)F[q]=F[q].slice(0),U[q]=U[q].slice(0);return S}()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var U,H,W,q=this._tables[0][4],ne=this._tables[1],he=F.length,z=1;if(4!==he&&6!==he&&8!==he)throw new Error("Invalid aes key size");var ye=F.slice(0),ge=[];for(this._key=[ye,ge],U=he;U<4*he+28;U++)W=ye[U-1],(U%he==0||8===he&&U%he==4)&&(W=q[W>>>24]<<24^q[W>>16&255]<<16^q[W>>8&255]<<8^q[255&W],U%he==0&&(W=W<<8^W>>>24^z<<24,z=z<<1^283*(z>>7))),ye[U]=ye[U-he]^W;for(H=0;U;H++,U--)W=ye[3&H?U:U-4],ge[H]=U<=4||H<4?W:ne[0][q[W>>>24]]^ne[1][q[W>>16&255]]^ne[2][q[W>>8&255]]^ne[3][q[255&W]]}return x.prototype.decrypt=function(U,H,W,q,ne,he){var ot,Ft,Je,ai,z=this._key[1],ye=U^z[0],ge=q^z[1],Ye=W^z[2],Pe=H^z[3],fr=z.length/4-2,si=4,Ei=this._tables[1],Ui=Ei[0],hr=Ei[1],Bi=Ei[2],pr=Ei[3],mr=Ei[4];for(ai=0;ai>>24]^hr[ge>>16&255]^Bi[Ye>>8&255]^pr[255&Pe]^z[si],Ft=Ui[ge>>>24]^hr[Ye>>16&255]^Bi[Pe>>8&255]^pr[255&ye]^z[si+1],Je=Ui[Ye>>>24]^hr[Pe>>16&255]^Bi[ye>>8&255]^pr[255&ge]^z[si+2],Pe=Ui[Pe>>>24]^hr[ye>>16&255]^Bi[ge>>8&255]^pr[255&Ye]^z[si+3],si+=4,ye=ot,ge=Ft,Ye=Je;for(ai=0;ai<4;ai++)ne[(3&-ai)+he]=mr[ye>>>24]<<24^mr[ge>>16&255]<<16^mr[Ye>>8&255]<<8^mr[255&Pe]^z[si++],ot=ye,ye=ge,ge=Ye,Ye=Pe,Pe=ot},x}(),f=function(x){function S(){var U;return(U=x.call(this,i)||this).jobs=[],U.delay=1,U.timeout_=null,U}e(S,x);var F=S.prototype;return F.processJob_=function(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null},F.push=function(H){this.jobs.push(H),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},S}(i),v=function(S){return S<<24|(65280&S)<<8|(16711680&S)>>8|S>>>24},T=function(){function x(F,U,H,W){var q=x.STEP,ne=new Int32Array(F.buffer),he=new Uint8Array(F.byteLength),z=0;for(this.asyncStream_=new f,this.asyncStream_.push(this.decryptChunk_(ne.subarray(z,z+q),U,H,he)),z=q;z>2),W=new d(Array.prototype.slice.call(F)),q=new Uint8Array(S.byteLength),ne=new Int32Array(q.buffer);for(he=U[0],z=U[1],ye=U[2],ge=U[3],Je=0;Je=0&&(t="main-desc"),t},Pa=function(n,t){n.abort(),n.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Fo=function(n,t){t.activePlaylistLoader=n,n.load()},La={AUDIO:function(n,t){return function(){var e=t.mediaTypes[n],i=t.blacklistCurrentPlaylist;Pa(t.segmentLoaders[n],e);var a=e.activeTrack(),o=e.activeGroup(),l=(o.filter(function(v){return v.default})[0]||o[0]).id,d=e.tracks[l];if(a!==d){for(var f in N.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[f].enabled=e.tracks[f]===d;e.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(n,t){return function(){var r=t.segmentLoaders[n],e=t.mediaTypes[n];N.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Pa(r,e);var i=e.activeTrack();i&&(i.mode="disabled"),e.onTrackChanged()}}},sc={AUDIO:function(n,t,r){if(t){var e=r.tech,i=r.requestOptions,a=r.segmentLoaders[n];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,i),(!e.paused()||o.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),i),e.paused()||a.load()}),t.on("error",La[n](n,r))}},SUBTITLES:function(n,t,r){var e=r.tech,i=r.requestOptions,a=r.segmentLoaders[n],o=r.mediaTypes[n];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,i),a.track(o.activeTrack()),(!e.paused()||l.endList&&"none"!==e.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),i),e.paused()||a.load()}),t.on("error",La[n](n,r))}},qg={AUDIO:function(n,t){var r=t.vhs,e=t.sourceType,i=t.segmentLoaders[n],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[n],d=l.groups,f=l.tracks,v=l.logger_,g=t.masterPlaylistLoader,T=Cn(g.master);for(var E in(!o[n]||0===Object.keys(o[n]).length)&&(o[n]={main:{default:{default:!0}}},T&&(o[n].main.default.playlists=g.master.playlists)),o[n])for(var x in d[E]||(d[E]=[]),o[n][E]){var S=o[n][E][x],F=void 0;if(T?(v("AUDIO group '"+E+"' label '"+x+"' is a master playlist"),S.isMasterPlaylist=!0,F=null):F="vhs-json"===e&&S.playlists?new Yr(S.playlists[0],r,a):S.resolvedUri?new Yr(S.resolvedUri,r,a):S.playlists&&"dash"===e?new Io(S.playlists[0],r,a,g):null,S=N.mergeOptions({id:x,playlistLoader:F},S),sc[n](n,S.playlistLoader,t),d[E].push(S),void 0===f[x]){var U=new N.AudioTrack({id:x,kind:Bg(S),enabled:!1,language:S.language,default:S.default,label:x});f[x]=U}}i.on("error",La[n](n,t))},SUBTITLES:function(n,t){var r=t.tech,e=t.vhs,i=t.sourceType,a=t.segmentLoaders[n],o=t.requestOptions,l=t.master.mediaGroups,d=t.mediaTypes[n],f=d.groups,v=d.tracks,g=t.masterPlaylistLoader;for(var T in l[n])for(var E in f[T]||(f[T]=[]),l[n][T])if(!l[n][T][E].forced){var x=l[n][T][E],S=void 0;if("hls"===i)S=new Yr(x.resolvedUri,e,o);else if("dash"===i){if(!x.playlists.filter(function(H){return H.excludeUntil!==1/0}).length)return;S=new Io(x.playlists[0],e,o,g)}else"vhs-json"===i&&(S=new Yr(x.playlists?x.playlists[0]:x.resolvedUri,e,o));if(x=N.mergeOptions({id:E,playlistLoader:S},x),sc[n](n,x.playlistLoader,t),f[T].push(x),void 0===v[E]){var U=r.addRemoteTextTrack({id:E,kind:"subtitles",default:x.default&&x.autoselect,language:x.language,label:E},!1).track;v[E]=U}}a.on("error",La[n](n,t))},"CLOSED-CAPTIONS":function(n,t){var r=t.tech,e=t.master.mediaGroups,i=t.mediaTypes[n],a=i.groups,o=i.tracks;for(var l in e[n])for(var d in a[l]||(a[l]=[]),e[n][l]){var f=e[n][l][d];if(/^(?:CC|SERVICE)/.test(f.instreamId)){var v=r.options_.vhs&&r.options_.vhs.captionServices||{},g={label:d,language:f.language,instreamId:f.instreamId,default:f.default&&f.autoselect};if(v[g.instreamId]&&(g=N.mergeOptions(g,v[g.instreamId])),void 0===g.default&&delete g.default,a[l].push(N.mergeOptions({id:d},f)),void 0===o[d]){var T=r.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;o[d]=T}}}}},Wg=function s(n,t){for(var r=0;r "+d+" from "+i),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+i})),this.masterPlaylistLoader_.media(e,a)},t.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=P().setInterval(function(){return e.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(P().clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var e=this.master(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;var l,a=e.mediaGroups.AUDIO,o=Object.keys(a);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var d=a.main||o.length&&a[o[0]];for(var f in d)if(d[f].default){l={label:f};break}}if(!l)return i;var v=[];for(var g in a)if(a[g][l.label]){var T=a[g][l.label];if(T.playlists&&T.playlists.length)v.push.apply(v,T.playlists);else if(T.uri)v.push(T);else if(e.playlists.length)for(var E=0;E1&&Cn(t.master))for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(e){var i=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine();return function(n){var t=n.currentPlaylist,r=n.buffered,e=n.currentTime,i=n.nextPlaylist,a=n.bufferLowWaterLine,o=n.bufferHighWaterLine,l=n.duration,d=n.experimentalBufferBasedABR,f=n.log;if(!i)return N.log.warn("We received no playlist to switch to. Please check your stream."),!1;var v="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return f(v+" as current playlist is not set"),!0;if(i.id===t.id)return!1;var g=Boolean($r(r,e).length);if(!t.endList)return g||"number"!=typeof t.partTargetDuration?(f(v+" as current playlist is live"),!0):(f("not "+v+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var T=vo(r,e),E=d?Dt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Dt.MAX_BUFFER_LOW_WATER_LINE;if(lS)&&T>=a){var U=v+" as forwardBuffer >= bufferLowWaterLine ("+T+" >= "+a+")";return d&&(U+=" and next bandwidth > current bandwidth ("+x+" > "+S+")"),f(U),!0}return f("not "+v+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:a,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var a=e.selectPlaylist();e.shouldSwitchToMedia_(a)&&e.switchMedia_(a,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var i=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();!o||e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",i),this.audioSegmentLoader_.on("trackinfo",i),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},t.fastQualityChange_=function(e){var i=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){i.tech_.setCurrentTime(N.browser.IE_VERSION||N.browser.IS_EDGE?i.tech_.currentTime()+.04:i.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*i,a.excludeUntil=v,e.reason&&(a.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var g=this.selectPlaylist();if(!g)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");(e.internal?this.logger_:N.log.warn)((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(e.message?" "+e.message:"")+" Switching to playlist "+g.id+"."),g.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),g.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var x=g.targetDuration/2*1e3||5e3,S="number"==typeof g.lastRequest&&Date.now()-g.lastRequest<=x;return this.switchMedia_(g,"exclude",d||S)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(e,i){var a=this,o=[],l="all"===e;(l||"main"===e)&&o.push(this.masterPlaylistLoader_);var d=[];(l||"audio"===e)&&d.push("AUDIO"),(l||"subtitle"===e)&&(d.push("CLOSED-CAPTIONS"),d.push("SUBTITLES")),d.forEach(function(f){var v=a.mediaTypes_[f]&&a.mediaTypes_[f].activePlaylistLoader;v&&o.push(v)}),["main","audio","subtitle"].forEach(function(f){var v=a[f+"SegmentLoader_"];v&&(e===f||"all"===e)&&o.push(v)}),o.forEach(function(f){return i.forEach(function(v){"function"==typeof f[v]&&f[v]()})})},t.setCurrentTime=function(e){var i=$r(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?i&&i.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Fi.Playlist.duration(e):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var a=this.syncController_.getExpiredTime(i,this.duration());if(null!==a){var d,f,o=this.masterPlaylistLoader_.master,l=Fi.Playlist.seekable(i,a,Fi.Playlist.liveEdgeDelay(o,i));0===l.length||this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(a=this.syncController_.getExpiredTime(i,this.duration()))||0===(e=Fi.Playlist.seekable(i,a,Fi.Playlist.liveEdgeDelay(o,i))).length)||(this.seekable_&&this.seekable_.length&&(d=this.seekable_.end(0),f=this.seekable_.start(0)),this.seekable_=e?e.start(0)>l.end(0)||l.start(0)>e.end(0)?l:N.createTimeRanges([[e.start(0)>l.start(0)?e.start(0):l.start(0),e.end(0)0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)}},t.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(i){var a=e.mediaTypes_[i].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!i||!a)},t.getCodecsOrExclude_=function(){var e=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};i.video=i.main;var a=An(this.master(),this.media()),o={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(o.video=a.video||i.main.videoCodec||"avc1.4d400d"),i.main.isMuxed&&(o.video+=","+(a.audio||i.main.audioCodec||Xt)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||l)&&(o.audio=a.audio||i.main.audioCodec||i.audio.audioCodec||Xt,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),o.audio||o.video){var v,f={};if(["video","audio"].forEach(function(x){if(o.hasOwnProperty(x)&&!function(S,F){return S?ii(F):ci(F)}(i[x].isFmp4,o[x])){var S=i[x].isFmp4?"browser":"muxer";f[S]=f[S]||[],f[S].push(o[x]),"audio"===x&&(v=S)}}),l&&v&&this.media().attributes.AUDIO){var g=this.media().attributes.AUDIO;this.master().playlists.forEach(function(x){(x.attributes&&x.attributes.AUDIO)===g&&x!==e.media()&&(x.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+v+' does not support codec(s): "'+o.audio+'"')}if(!Object.keys(f).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var E=[];if(["video","audio"].forEach(function(x){var S=(Qe(e.sourceUpdater_.codecs[x]||"")[0]||{}).type,F=(Qe(o[x]||"")[0]||{}).type;S&&F&&S.toLowerCase()!==F.toLowerCase()&&E.push('"'+e.sourceUpdater_.codecs[x]+'" -> "'+o[x]+'"')}),E.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+E.join(", ")+".",blacklistDuration:1/0,internal:!0})}return o}var T=Object.keys(f).reduce(function(x,S){return x&&(x+=", "),x+(S+' does not support codec(s): "')+f[S].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:T,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},t.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}}},t.excludeUnsupportedVariants_=function(){var e=this,i=this.master().playlists,a=[];Object.keys(i).forEach(function(o){var l=i[o];if(-1===a.indexOf(l.id)){a.push(l.id);var d=An(e.master,l),f=[];d.audio&&!ci(d.audio)&&!ii(d.audio)&&f.push("audio codec "+d.audio),d.video&&!ci(d.video)&&!ii(d.video)&&f.push("video codec "+d.video),d.text&&"stpp.ttml.im1t"===d.text&&f.push("text codec "+d.text),f.length&&(l.excludeUntil=1/0,e.logger_("excluding "+l.id+" for unsupported: "+f.join(", ")))}})},t.excludeIncompatibleVariants_=function(e){var i=this,a=[],o=this.master().playlists,l=Aa(Qe(e)),d=Wd(l),f=l.video&&Qe(l.video)[0]||null,v=l.audio&&Qe(l.audio)[0]||null;Object.keys(o).forEach(function(g){var T=o[g];if(-1===a.indexOf(T.id)&&T.excludeUntil!==1/0){a.push(T.id);var E=[],x=An(i.masterPlaylistLoader_.master,T),S=Wd(x);if(x.audio||x.video){if(S!==d&&E.push('codec count "'+S+'" !== "'+d+'"'),!i.sourceUpdater_.canChangeType()){var F=x.video&&Qe(x.video)[0]||null,U=x.audio&&Qe(x.audio)[0]||null;F&&f&&F.type.toLowerCase()!==f.type.toLowerCase()&&E.push('video codec "'+F.type+'" !== "'+f.type+'"'),U&&v&&U.type.toLowerCase()!==v.type.toLowerCase()&&E.push('audio codec "'+U.type+'" !== "'+v.type+'"')}E.length&&(T.excludeUntil=1/0,i.logger_("blacklisting "+T.id+": "+E.join(" && ")))}}})},t.updateAdCues_=function(e){var i=0,a=this.seekable();a.length&&(i=a.start(0)),function(n,t,r){if(void 0===r&&(r=0),n.segments)for(var i,e=r,a=0;a0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=e.buffered_()},n.checkSegmentDownloads_=function(r){var e=this.masterPlaylistController_,i=e[r+"SegmentLoader_"],a=i.buffered_(),o=function(n,t){if(n===t)return!1;if(!n&&t||!t&&n||n.length!==t.length)return!0;for(var r=0;r=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},n.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},n.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var o,e=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(o=e.end(e.length-1)),this.beforeSeekableWindow_(e,i)){var d=e.start(0);o=d+(d===e.end(0)?0:bi)}if(void 0!==o)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+nd(e)+". Seeking to "+o+"."),this.tech_.setCurrentTime(o),!0;for(var f=this.masterPlaylistController_.sourceUpdater_,v=this.tech_.buffered(),g=f.audioBuffer?f.audioBuffered():null,T=f.videoBuffer?f.videoBuffered():null,E=this.media(),x=E.partTargetDuration?E.partTargetDuration:2*(E.targetDuration-zi),S=[g,T],F=0;F "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}},n.techWaiting_=function(){var r=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(r,e)){var i=r.end(r.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var d=xa(o,e);if(d.length>0){var f=d.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+f+", seeking to "+d.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*f,e),!0}return!1},n.afterSeekableWindow_=function(r,e,i,a){if(void 0===a&&(a=!1),!r.length)return!1;var o=r.end(r.length-1)+bi;return!i.endList&&a&&(o=r.end(r.length-1)+3*i.targetDuration),e>o},n.beforeSeekableWindow_=function(r,e){return!!(r.length&&r.start(0)>0&&e2)return{start:o,end:l}}return null},s}(),av={errorInterval:30,getSource:function(n){return n(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},sv=function s(n,t){var r=0,e=0,i=N.mergeOptions(av,t);n.ready(function(){n.trigger({type:"usage",name:"vhs-error-reload-initialized"}),n.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){e&&n.currentTime(e)},o=function(g){null!=g&&(e=n.duration()!==1/0&&n.currentTime()||0,n.one("loadedmetadata",a),n.src(g),n.trigger({type:"usage",name:"vhs-error-reload"}),n.trigger({type:"usage",name:"hls-error-reload"}),n.play())},l=function(){return Date.now()-r<1e3*i.errorInterval?(n.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void n.trigger({type:"usage",name:"hls-error-reload-canceled"})):i.getSource&&"function"==typeof i.getSource?(r=Date.now(),i.getSource.call(n,o)):void N.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},d=function v(){n.off("loadedmetadata",a),n.off("error",l),n.off("dispose",v)};n.on("error",l),n.on("dispose",d),n.reloadSourceOnError=function(g){d(),s(n,g)}},Ot={PlaylistLoader:Yr,Playlist:$t,utils:Sm,STANDARD_PLAYLIST_SELECTOR:zd,INITIAL_PLAYLIST_SELECTOR:function(){var n=this,t=this.playlists.master.playlists.filter($t.isEnabled);return Xr(t,function(e,i){return Oo(e,i)}),t.filter(function(e){return!!An(n.playlists.master,e).video})[0]||null},lastBandwidthSelector:zd,movingAverageBandwidthSelector:function(n){var t=-1,r=-1;if(n<0||n>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&P().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(t=n*this.systemBandwidth+(1-n)*t,r=this.systemBandwidth),Zd(this.playlists.master,t,parseInt(Ia(this.tech_.el(),"width"),10)*e,parseInt(Ia(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Oo,comparePlaylistResolution:function(n,t){var r,e;return n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(r=n.attributes.RESOLUTION.width),r=r||P().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(e=t.attributes.RESOLUTION.width),r===(e=e||P().Number.MAX_VALUE)&&n.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?n.attributes.BANDWIDTH-t.attributes.BANDWIDTH:r-e},xhr:xd()};Object.keys(Dt).forEach(function(s){Object.defineProperty(Ot,s,{get:function(){return N.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Dt[s]},set:function(t){N.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?N.log.warn("value of Vhs."+s+" must be greater than or equal to 0"):Dt[s]=t}})});var lc="videojs-vhs",dc=function(n,t){for(var r=t.media(),e=-1,i=0;i=g&&f>=g?Math.max(f,T):T}return f},set:function(f){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=f,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){return Math.floor(1/(1/(this.bandwidth||1)+(this.throughput>0?1/this.throughput:0)))},set:function(){N.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return cr(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return cr(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&function(n){if(!P().localStorage)return!1;var t=cc();t=t?N.mergeOptions(t,n):n;try{P().localStorage.setItem(lc,JSON.stringify(t))}catch(r){return!1}}({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n){n.representations=function(){var t=n.masterPlaylistController_.master(),r=Cn(t)?n.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return r?r.filter(function(e){return!To(e)}).map(function(e,i){return new iv(n,e,e.id)}):[]}}(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=P().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(n){var t=n.player,r=n.sourceKeySystems,e=n.audioMedia,i=n.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var o=function(n,t){return n.reduce(function(r,e){if(!e.contentProtection)return r;var i=t.reduce(function(a,o){var l=e.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(i).length&&r.push(i),r},[])}(e?i.concat([e]):i,Object.keys(r)),l=[],d=[];return o.forEach(function(f){d.push(new Promise(function(v,g){t.tech_.one("keysessioncreated",v)})),l.push(new Promise(function(v,g){t.eme.initializeMediaKeys({keySystems:f},function(T){T?g(T):v()})}))}),Promise.race([Promise.all(l),Promise.race(d)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=function(n){var t=n.player,a=function(n,t,r){if(!n)return n;var e={};t&&t.attributes&&t.attributes.CODECS&&(e=Aa(Qe(t.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(e.audio=r.attributes.CODECS);var i=Yt(e.video),a=Yt(e.audio),o={};for(var l in n)o[l]={},a&&(o[l].audioContentType=a),i&&(o[l].videoContentType=i),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),"string"==typeof n[l]&&(o[l].url=n[l]);return N.mergeOptions(n,o)}(n.sourceKeySystems,n.media,n.audioMedia);return!(!a||(t.currentSource().keySystems=a,a&&!t.eme&&(N.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))}({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()});this.player_.tech_.on("keystatuschange",function(o){"output-restricted"===o.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+o.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==N.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},t.setupQualityLevels_=function(){var e=this,i=N.players[this.tech_.options_.playerId];!i||!i.qualityLevels||this.qualityLevels_||(this.qualityLevels_=i.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){!function(n,t){t.representations().forEach(function(r){n.addQualityLevel(r)}),dc(n,t.playlists)}(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){dc(e.qualityLevels_,e.playlists)}))},n.version=function(){return{"@videojs/http-streaming":"2.13.1","mux.js":"6.0.1","mpd-parser":"0.21.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return ic.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&P().URL.revokeObjectURL&&(P().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(e,i){return function(n){var t=n.playlist,r=n.time,e=void 0===r?void 0:r,i=n.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===e)return i({message:"getProgramTime: playlist and time must be provided"});var a=function(n,t){if(!t||!t.segments||0===t.segments.length)return null;for(var e,r=0,i=0;ir){if(n>r+.25*a.duration)return null;e=a}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:r-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}}(e,t);if(!a)return i({message:"valid programTime was not found"});if("estimate"===a.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:e},l=function(n,t){if(!t.dateTimeObject)return null;var a=n-(t.videoTimingInfo.transmuxedPresentationStart+t.videoTimingInfo.transmuxerPrependedSeconds);return new Date(t.dateTimeObject.getTime()+1e3*a)}(e,a.segment);return l&&(o.programDateTime=l.toISOString()),i(null,o)}({playlist:this.masterPlaylistController_.media(),time:e,callback:i})},t.seekToProgramTime=function(e,i,a,o){return void 0===a&&(a=!0),void 0===o&&(o=2),Pm({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})},n}(N.getComponent("Component")),Oa={name:"videojs-http-streaming",VERSION:"2.13.1",canHandleSource:function(n,t){void 0===t&&(t={});var r=N.mergeOptions(N.options,t);return Oa.canPlayType(n.type,r)},handleSource:function(n,t,r){void 0===r&&(r={});var e=N.mergeOptions(N.options,r);return t.vhs=new Uo(n,t,e),N.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return N.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=xd(),t.vhs.src(n.src,n.type),t.vhs},canPlayType:function(n,t){void 0===t&&(t={});var r=N.mergeOptions(N.options,t),e=r.vhs,i=(e=void 0===e?{}:e).overrideNative,a=void 0===i?!N.browser.IS_ANY_SAFARI:i,o=r.hls,l=(o=void 0===o?{}:o).overrideNative,d=void 0!==l&&l,f=sn(n);return f&&(!Ot.supportsTypeNatively(f)||d||a)?"maybe":""}};ii("avc1.4d400d,mp4a.40.2")&&N.getTech("Html5").registerSourceHandler(Oa,0),N.VhsHandler=Uo,Object.defineProperty(N,"HlsHandler",{get:function(){return N.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Uo},configurable:!0}),N.VhsSourceHandler=Oa,Object.defineProperty(N,"HlsSourceHandler",{get:function(){return N.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Oa},configurable:!0}),N.Vhs=Ot,Object.defineProperty(N,"Hls",{get:function(){return N.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Ot},configurable:!0}),N.use||(N.registerComponent("Hls",Ot),N.registerComponent("Vhs",Ot)),N.options.vhs=N.options.vhs||{},N.options.hls=N.options.hls||{},N.getPlugin&&N.getPlugin("reloadSourceOnError")||(N.registerPlugin||N.plugin)("reloadSourceOnError",function(n){sv(this,n)});const xv=N,Sv=["target"];let Ev=(()=>{class s{constructor(t){this.gs=t,this.subtitlesOctopus=null,this.videoUrl=null,this.videoThumb=null,this.subtitleUrl=null,this.subtitleFonts=[]}ngOnInit(){this.gs.isBrowser&&this.target&&this.videoUrl&&(this.gs.log("[VIDEO-JS_INIT_URL]",this.videoUrl),this.player=xv(this.target.nativeElement,{autoplay:!1,controls:!0,fluid:!0,muted:!1,sources:[{src:this.videoUrl,type:"video/mp4"}],poster:this.videoThumb},()=>{this.gs.log("[VIDEO-JS_READY]",this.player),this.initSubtitle()}))}ngOnDestroy(){var t,r;null===(t=this.subtitlesOctopus)||void 0===t||t.dispose(),null===(r=this.player)||void 0===r||r.dispose()}ngOnChanges(){this.subtitlesOctopus?this.subtitleUrl&&this.subtitlesOctopus.setTrackByUrl(this.subtitleUrl):this.initSubtitle()}initSubtitle(){this.subtitleUrl&&(this.subtitlesOctopus=new SubtitlesOctopus({video:this.target.nativeElement,subUrl:this.subtitleUrl,fonts:this.subtitleFonts,workerUrl:"/assets/lib/subtitles-octopus-worker.js",legacyWorkerUrl:"/assets/lib/subtitles-octopus-worker-legacy.js"}),this.gs.log("[SUBTITLE_INIT]",this.subtitlesOctopus))}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(ke.U))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-vjs-player"]],viewQuery:function(t,r){if(1&t&&u.Gf(Sv,7),2&t){let e;u.iGM(e=u.CRH())&&(r.target=e.first)}},inputs:{videoUrl:"videoUrl",videoThumb:"videoThumb",subtitleUrl:"subtitleUrl",subtitleFonts:"subtitleFonts"},features:[u.TTD],decls:2,vars:0,consts:[["controls","","muted","","playsinline","","preload","none",1,"video-js","w-100"],["target",""]],template:function(t,r){1&t&&u._UZ(0,"video",0,1)},styles:[""]}),s})();var Cv=j(325),kv=j(9461),fc=j(3626);function Av(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",22),u._UZ(1,"img",23),u.TgZ(2,"h4"),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.hYB("routerLink","/anime/",t.berkasData.anime_.id,"-",t.animeName,""),u.xp6(1),u.s9C("src",t.berkasData.anime_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.anime_.name)}}function wv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",22),u._UZ(1,"img",23),u.TgZ(2,"h4"),u._uU(3),u.qZA()()),2&s){const t=u.oxw(2);u.MGl("routerLink","/dorama/",t.berkasData.dorama_.slug,""),u.xp6(1),u.s9C("src",t.berkasData.dorama_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.dorama_.name)}}function Iv(s,n){if(1&s&&(u.TgZ(0,"mat-list-option",22),u._UZ(1,"img",23),u.TgZ(2,"h4"),u._uU(3),u.qZA()()),2&s){const t=n.$implicit;u.MGl("routerLink","/fansub/",t.slug,""),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.Oqu(t.name)}}function Dv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return e.ddl(e.berkasData.attachment_.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"movie"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.ALo(5,"bytes"),u.qZA()}if(2&s){const t=u.oxw(4);u.cQ8("matTooltip","",t.lampiran.name,".",t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan"),u.xp6(3),u.lnq(" ",u.Dn7(4,6,t.lampiran.name,0,5),".....",t.lampiran.ext," (",u.lcZ(5,10,t.lampiran.size),") ")}}function Pv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return e.cancel_dl(e.berkasData.attachment_.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"close"),u.qZA(),u._uU(3," Batal Unduh "),u.qZA()}if(2&s){const t=u.oxw(4);u.cQ8("matTooltip","",t.lampiran.name,".",t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan")}}function Lv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(4);return e.saveFileAs(e.berkasData.attachment_.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"save"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.qZA()}if(2&s){const t=u.oxw(4);u.cQ8("matTooltip","",t.lampiran.name,".",t.lampiran.ext," :: ",t.lampiran.download_count,"x Unduhan"),u.xp6(3),u.AsE(" ",u.Dn7(4,5,t.lampiran.name,0,5),".....",t.lampiran.ext," ")}}function Ov(s,n){if(1&s&&(u.TgZ(0,"div",31),u._uU(1),u._UZ(2,"br"),u._uU(3),u._UZ(4,"br")(5,"mat-progress-bar",38),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.AsE(" ",t.lampiran.percentage>=100?"Selesai Mengunduh ... ":"Sedang Mengunduh ... "," ",t.lampiran.totals," Bytes "),u.xp6(2),u.AsE(" ",t.lampiran.percentage,"% @ ",t.lampiran.speed," KB/s "),u.xp6(2),u.Q6J("mode",t.lampiran.mode)("value",t.lampiran.percentage)}}function Rv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",40),u.NdJ("click",function(){u.CHM(t);const e=u.oxw(5);return e.standardDdlVideo(e.berkasData.attachment_.id)}),u._uU(1," Unduhan Macet? "),u.TgZ(2,"i")(3,"u"),u._uU(4,"Coba Gunakan Unduhan Biasa~"),u.qZA()()()}}function Mv(s,n){if(1&s&&(u.TgZ(0,"div",13),u.YNc(1,Rv,5,0,"div",39),u.qZA()),2&s){const t=u.oxw(4);u.xp6(1),u.Q6J("ngIf",t.lampiran.isDownloading)}}function Nv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).standardDdlSubsFont(i.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"notes"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.ALo(5,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.cQ8("matTooltip","",t.name,".",t.name," :: ",t.download_count,"x Unduhan"),u.xp6(3),u.lnq(" ",u.Dn7(4,6,t.name,0,5),".....",t.ext," (",u.lcZ(5,10,t.size),") ")}}function Fv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",36),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).standardDdlSubsFont(i.id)}),u.TgZ(1,"mat-icon",37),u._uU(2,"font_download"),u.qZA(),u._uU(3),u.ALo(4,"slice"),u.ALo(5,"bytes"),u.qZA()}if(2&s){const t=n.$implicit;u.cQ8("matTooltip","",t.name,".",t.name," :: ",t.download_count,"x Unduhan"),u.xp6(3),u.lnq(" ",u.Dn7(4,6,t.name,0,5),".....",t.ext," (",u.lcZ(5,10,t.size),") ")}}function Uv(s,n){if(1&s&&(u.TgZ(0,"div",30)(1,"div",31),u.YNc(2,Dv,6,12,"button",32),u.YNc(3,Pv,4,3,"button",32),u.YNc(4,Lv,5,9,"button",32),u.TgZ(5,"div",13),u.YNc(6,Ov,6,6,"div",33),u.qZA(),u.YNc(7,Mv,2,1,"div",34),u.YNc(8,Nv,6,12,"button",35),u.YNc(9,Fv,6,12,"button",35),u.qZA()()),2&s){const t=u.oxw(3);u.xp6(2),u.Q6J("ngIf",!t.lampiran.data&&!t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",!t.lampiran.data&&t.lampiran.isDownloading),u.xp6(1),u.Q6J("ngIf",t.lampiran.data),u.xp6(2),u.Q6J("ngIf",t.lampiran.isDownloading&&!t.lampiran.isCompleted),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.isDiscord),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.subtitles_),u.xp6(1),u.Q6J("ngForOf",t.berkasData.attachment_.fonts_)}}function Bv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",30)(1,"div",31)(2,"button",41),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).verify()}),u.TgZ(3,"mat-icon",37),u._uU(4,"enhanced_encryption"),u.qZA(),u._uU(5),u.qZA()()()}if(2&s){const t=u.oxw(3);u.xp6(5),u.hij(" ",t.berkasData.attachment_," ")}}function Hv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17)(4,"i"),u._uU(5,"Direct Download"),u.qZA()()()(),u.YNc(6,Uv,10,7,"div",29),u.YNc(7,Bv,6,1,"div",29),u.qZA()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("ngIf",t.isHaveDDL),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function jv(s,n){if(1&s&&(u.TgZ(0,"a",43)(1,"mat-icon",37),u._uU(2,"cloud_download"),u.qZA(),u._uU(3),u.qZA()),2&s){const t=n.$implicit;u.s9C("href",t.url,u.LSH),u.xp6(3),u.hij(" ",t.name," ")}}function Vv(s,n){if(1&s&&(u.TgZ(0,"div",30),u.YNc(1,jv,4,2,"a",42),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.berkasData.download_url)}}function qv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",30)(1,"button",44),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).login()}),u.TgZ(2,"mat-icon",37),u._uU(3,"vpn_key"),u.qZA(),u._uU(4," Klik Untuk Login "),u.qZA()()}}function Wv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4),u.qZA()()(),u.YNc(5,Vv,2,1,"div",29),u.YNc(6,qv,5,0,"div",29),u.qZA()),2&s){const t=u.oxw(2);u.xp6(4),u.hij("Tautan Unduhan ",null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value?"External":"",""),u.xp6(1),u.Q6J("ngIf",null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value))}}function Gv(s,n){if(1&s&&(u.TgZ(0,"mat-option",56),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.url),u.xp6(1),u.Oqu(t.name)}}function Zv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",53)(1,"mat-label"),u._uU(2,"Pilih Subtitle / Takarir (.ASS Saja)"),u.qZA(),u.TgZ(3,"mat-select",54),u.NdJ("valueChange",function(e){return u.CHM(t),u.oxw(3).selectedSubsUrl=e}),u.YNc(4,Gv,2,2,"mat-option",55),u.qZA()()}if(2&s){const t=u.oxw(3);u.Q6J("color","accent"),u.xp6(3),u.Q6J("value",t.selectedSubsUrl),u.xp6(1),u.Q6J("ngForOf",t.subtitles)}}function zv(s,n){1&s&&u._UZ(0,"mat-progress-bar",57)}function Kv(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1,"Mulai Streaming Video"),u.qZA())}function $v(s,n){1&s&&(u.TgZ(0,"span"),u._uU(1," Loading ... "),u.qZA())}function Yv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",58),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).watchDdl()}),u.TgZ(1,"mat-icon",37),u._uU(2,"play_arrow"),u.qZA(),u.YNc(3,Kv,2,0,"span",59),u.YNc(4,$v,2,0,"span",59),u.qZA()}if(2&s){const t=u.oxw(3);u.Q6J("disabled",t.vjsInit),u.xp6(3),u.Q6J("ngIf",!t.vjsInit),u.xp6(1),u.Q6J("ngIf",t.vjsInit)}}function Xv(s,n){if(1&s&&u._UZ(0,"app-vjs-player",60),2&s){const t=u.oxw(3);u.Q6J("videoUrl",t.ddlVideo)("videoThumb",t.videoThumb)("subtitleUrl",t.selectedSubsUrl)("subtitleFonts",t.ddlFonts)}}function Qv(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",61),u.NdJ("click",function(){return u.CHM(t),u.oxw(3).verify()}),u.TgZ(1,"mat-icon",37),u._uU(2,"enhanced_encryption"),u.qZA(),u._uU(3),u.qZA()}if(2&s){const t=u.oxw(3);u.xp6(3),u.hij(" ",t.berkasData.attachment_," ")}}function Jv(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Video Stream (Browser Tertentu T.T)"),u.qZA()()(),u.TgZ(5,"div",18)(6,"div",45),u._uU(7," Dapat digunakan sebagai referensi untuk pratinjau namun kemungkinan jenis huruf tulisan gagal dimuat sehingga nantinya akan muncul huruf dengan gambar \u{1f533} misalnya kanji. Lalu juga memungkinkan terjadinya gerakan patah - patah jika browser tidak kuat untuk render .ASS subtitle dengan efek yang terlalu banyak. "),u.TgZ(8,"span",46)(9,"i"),u._uU(10,"Player"),u.qZA(),u._uU(11," ini mungkin tidak dapat memutar video HEVC-x265 (belum support semua "),u.TgZ(12,"i"),u._uU(13,"web browser"),u.qZA(),u._uU(14,") dan audio AC3 (atau ekstensi lain yang masih memiliki lisensi paten belum "),u.TgZ(15,"i"),u._uU(16,"open source"),u.qZA(),u._uU(17,"). Takarir / "),u.TgZ(18,"i"),u._uU(19,"subtitle"),u.qZA(),u._uU(20," yang dapat ditampilkan jenis .ASS saja, itupun jika tersedia di dalam video internalnya. "),u.qZA(),u.TgZ(21,"a",47),u._uU(22," * Browser Firefox sudah pasti tidak bisa memutar video "),u.qZA()(),u.TgZ(23,"div",31),u.YNc(24,Zv,5,3,"mat-form-field",48),u.YNc(25,zv,1,0,"mat-progress-bar",49),u.YNc(26,Yv,5,3,"button",50),u.YNc(27,Xv,1,4,"app-vjs-player",51),u.YNc(28,Qv,4,1,"button",52),u.qZA()()()),2&s){const t=u.oxw(2);u.xp6(24),u.Q6J("ngIf",t.subtitles.length>0),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&!t.vjsReady),u.xp6(1),u.Q6J("ngIf",t.isHaveDDL&&t.vjsInit&&t.vjsReady),u.xp6(1),u.Q6J("ngIf",!t.isHaveDDL)}}function e_(s,n){if(1&s&&(u.TgZ(0,"div",14)(1,"div",15)(2,"h2",16)(3,"b",17),u._uU(4,"Deskripsi & Informasi"),u.qZA()()(),u.TgZ(5,"div",18),u._UZ(6,"div",62),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(6),u.Q6J("innerHTML",t.berkasData.description,u.oJD)}}function t_(s,n){1&s&&(u.TgZ(0,"div",14)(1,"div",18),u._UZ(2,"app-report"),u.qZA()())}function i_(s,n){if(1&s&&(u.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"ul",4),u._UZ(4,"li")(5,"li")(6,"li")(7,"li")(8,"li")(9,"li")(10,"li")(11,"li")(12,"li")(13,"li"),u.TgZ(14,"div",5)(15,"h2",6),u._uU(16),u.qZA(),u.TgZ(17,"p",7),u._uU(18),u.qZA(),u.TgZ(19,"p",8),u._uU(20),u.ALo(21,"date"),u.qZA()()()()(),u._UZ(22,"app-notifications"),u.TgZ(23,"div",9)(24,"div",10)(25,"div",11)(26,"div",12)(27,"div",13)(28,"div",14)(29,"div",15)(30,"h2",16)(31,"b",17),u._uU(32,"Rujukan"),u.qZA()()(),u.TgZ(33,"div",18)(34,"mat-selection-list",19),u.YNc(35,Av,4,4,"mat-list-option",20),u.YNc(36,wv,4,3,"mat-list-option",20),u.YNc(37,Iv,4,3,"mat-list-option",21),u.TgZ(38,"mat-list-option",22),u._UZ(39,"img",23),u.TgZ(40,"h4"),u._uU(41),u.qZA()()()()(),u.YNc(42,Hv,8,2,"div",24),u.YNc(43,Wv,7,3,"div",24),u.qZA()()(),u.TgZ(44,"div",25)(45,"div",12)(46,"div",13),u.YNc(47,Jv,29,5,"div",24),u.YNc(48,e_,7,1,"div",24),u.YNc(49,t_,3,0,"div",24),u.TgZ(50,"div",14)(51,"div",26)(52,"h2",27)(53,"b",17),u._uU(54,"Komentar"),u.qZA()()(),u.TgZ(55,"div",18)(56,"div",28),u._UZ(57,"app-discussion"),u.qZA()()()()()()()()()),2&s){const t=u.oxw();u.xp6(2),u.Udp("background","url(/assets/img/banner/berkas-detail.png), linear-gradient(to bottom, "+(t.GS.isDarkMode?"#673ab7":"#3f51b5")+" 0%, #ee0dfd 100%)"),u.xp6(14),u.hij(" ",t.berkasData.name," "),u.xp6(2),u.AsE(" ",t.berkasData.view_count,"x Dilihat :: ",t.berkasData.like_count," Orang Suka "),u.xp6(2),u.hij(" ",u.xi3(21,18,t.berkasData.created_at,"d MMMM y, hh:mm:ss a z")," "),u.xp6(14),u.Q6J("multiple",!1),u.xp6(1),u.Q6J("ngIf",t.berkasData.anime_),u.xp6(1),u.Q6J("ngIf",t.berkasData.dorama_),u.xp6(1),u.Q6J("ngForOf",t.berkasData.fansub_),u.xp6(1),u.MGl("routerLink","/user/",t.berkasData.user_.username,""),u.xp6(1),u.s9C("src",t.berkasData.user_.image_url,u.LSH),u.xp6(2),u.Oqu(t.berkasData.user_.username),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&t.berkasData.attachment_),u.xp6(1),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&t.AS.currentUserSubject.value)||(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.berkasData.download_url?null:t.berkasData.download_url.length)>0),u.xp6(4),u.Q6J("ngIf",t.berkasData.attachment_&&t.isStreamable),u.xp6(1),u.Q6J("ngIf",t.berkasData.description),u.xp6(1),u.Q6J("ngIf",null==t.SS.mySocket?null:t.SS.mySocket.id)}}let r_=(()=>{class s{constructor(t,r,e,i,a,o,l,d,f,v,g,T){this.router=t,this.activatedRoute=r,this.gs=e,this.bs=i,this.pi=a,this.berkas=o,this.fs=l,this.as=d,this.dm=f,this.wb=v,this.ss=g,this.dls=T,this.berkasId="",this.berkasData=null,this.subsBerkas=null,this.subsParam=null,this.subsDialog=null,this.subsSubtitlesFonts=null,this.subtitles=[],this.fonts=[],this.selectedSubsUrl=null,this.vjsInit=!1,this.vjsReady=!1,this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get GS(){return this.gs}get AS(){return this.as}get SS(){return this.ss}ngOnDestroy(){var t,r,e,i;null===(t=this.subsBerkas)||void 0===t||t.unsubscribe(),null===(r=this.subsParam)||void 0===r||r.unsubscribe(),null===(e=this.subsDialog)||void 0===e||e.unsubscribe(),null===(i=this.subsSubtitlesFonts)||void 0===i||i.unsubscribe()}ngOnInit(){this.subsParam=this.activatedRoute.params.subscribe({next:t=>{this.berkasId=t.berkasId,this.bs.busy(),this.subsBerkas=this.berkas.getBerkas(this.berkasId).subscribe({next:r=>{this.gs.log("[BERKAS_DETAIL_SUCCESS]",r),this.berkasData=r.result,this.pi.updatePageMetaData(`${this.berkasData.name}`,`${this.berkasData.description}`,`${this.berkasData.name}`,this.berkasData.image_url,this.berkasData.user_.username),this.pi.updatePageHeader(this.berkasData.project_type_.name),this.bs.idle(),this.gs.isBrowser&&this.fs.initializeFab("edit",null,"Ubah Data Berkas",`/berkas/${this.berkasId}/edit`,!1)},error:r=>{this.gs.log("[BERKAS_DETAIL_ERROR]",r,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:"/berkas"}})}})}})}watchDdl(){this.vjsInit=!0,this.setupVjs()}login(){this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}verify(){this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}get animeName(){return this.berkasData.anime_.name.replace(/[^a-zA-Z0-9]/g,"-")}get lampiran(){return this.dm.getAttachmentDownloadFile(this.berkasData.attachment_)}get ddlVideo(){return this.ddlUrlLinkVideo(this.berkasData.attachment_.id)}get videoThumb(){return this.berkasData.image_url}get ddlFonts(){return this.fonts.length>0?this.fonts:[]}get isHaveDDL(){return!(!("attachment_"in this.berkasData)||!this.berkasData.attachment_)&&"string"!=typeof this.berkasData.attachment_}get isDiscord(){var t;return this.isHaveDDL&&(null===(t=this.berkasData.attachment_)||void 0===t?void 0:t.discord)}get isStreamable(){var t;return this.isHaveDDL&&this.gs.includesOneOf(null===(t=this.berkasData.attachment_)||void 0===t?void 0:t.ext,te.t.fileTypeAttachmentStreamable)}ddl(t){var r=this;return(0,ue.Z)(function*(){r.isDiscord?r.dm.startDownload(t,!1):r.dm.startDownload(t)})()}cancel_dl(t){this.dm.cancelDownload(t)}saveFileAs(t){this.dm.saveFileAs(t)}standardDdlVideo(t){this.wb.winboxOpenUri(this.ddlUrlLinkVideo(t))}ddlUrlLinkVideo(t){return this.isDiscord?`${Ge.N.apiUrl}/ddl-seek/${t}?ngsw-bypass=true`:`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}standardDdlSubsFont(t){this.wb.winboxOpenUri(this.ddlUrlLinkSubsFont(t))}ddlUrlLinkSubsFont(t){return`${Ge.N.apiUrl}/attachment/${t}?ngsw-bypass=true`}setupVjs(){if(this.isHaveDDL){const t=[],r=[],e=[];if("subtitles_"in this.berkasData.attachment_&&this.berkasData.attachment_.subtitles_)for(const i of this.berkasData.attachment_.subtitles_){const a=this.dls.downloadLampiran(i.id).pipe((0,me.b)(o=>{o.type===Oe.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),r.push({name:i.name,url:URL.createObjectURL(new Blob([o.body]))}))}));t.push(a)}if("fonts_"in this.berkasData.attachment_&&this.berkasData.attachment_.fonts_)for(const i of this.berkasData.attachment_.fonts_){const a=this.dls.downloadLampiran(i.id).pipe((0,me.b)(o=>{o.type===Oe.dt.Response&&(this.gs.log("[DOWNLOAD_COMPLETED]",o),e.push(URL.createObjectURL(new Blob([o.body]))))}));t.push(a)}this.subsSubtitlesFonts=(0,Le.z)(...t).subscribe({next:i=>{i.type===Oe.dt.DownloadProgress&&this.gs.log("[DOWNLOAD_PROGRESS]",i),i.type===Oe.dt.Response&&this.gs.log("[DOWNLOAD_COMPLETED]",i)},error:i=>{this.gs.log("[DOWNLOAD_ERROR]",i,"error")},complete:()=>{this.subtitles=r,this.fonts=e,this.vjsReady=!0}})}}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(ke.U),u.Y36(Ne.z),u.Y36(He.Z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e),u.Y36(de),u.Y36(le.N),u.Y36(xe.R),u.Y36(Y.v))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-detail"]],decls:1,vars:1,consts:[["class","p-0 m-0",4,"ngIf"],[1,"p-0","m-0"],[1,"container-fluid","p-0"],[1,"wrapper"],[1,"bg-bubbles","align-items-center","p-0"],[1,"container","align-items-center","h-100","p-3","text-light",2,"overflow-y","auto"],["_ngcontent-serverapp-c311","",1,"mb-0",2,"line-height","normal"],[1,"mt-3","mb-0"],[1,"mb-0"],[1,"container"],[1,"row"],[1,"col-md-5","col-xl-4","p-3"],[1,"row","sticky-top"],[1,"col"],[1,"row","py-3"],[1,"col-12","pt-3","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12"],[3,"multiple"],[3,"routerLink",4,"ngIf"],[3,"routerLink",4,"ngFor","ngForOf"],[3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],["class","row py-3",4,"ngIf"],[1,"col-md-7","col-xl-8","p-3","sticky-top"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"p-3"],["class","col-12 text-center",4,"ngIf"],[1,"col-12","text-center"],[1,"px-3"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngIf"],["class","px-3",4,"ngIf"],["class","col",4,"ngIf"],["type","button","class","m-1 w-100","mat-stroked-button","","color","accent",3,"matTooltip","click",4,"ngFor","ngForOf"],["type","button","mat-stroked-button","","color","accent",1,"m-1","w-100",3,"matTooltip","click"],[1,"me-1"],["color","accent",3,"mode","value"],["class","px-3 text-danger","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"px-3","text-danger",2,"cursor","pointer",3,"click"],["type","button","mat-stroked-button","","color","accent","matTooltip","Direct Download Link Berkas",1,"m-1",3,"click"],["class","m-1","target","_blank","mat-stroked-button","","color","accent",3,"href",4,"ngFor","ngForOf"],["target","_blank","mat-stroked-button","","color","accent",1,"m-1",3,"href"],["type","button","mat-stroked-button","","color","accent",1,"m-1",3,"click"],[1,"py-2","px-3"],[1,"text-success"],["href","https://bugzilla.mozilla.org/show_bug.cgi?id=1422891",1,"text-warning","text-decoration-none"],["appearance","outline","class","pt-3 col-12",3,"color",4,"ngIf"],["color","warn","mode","buffer","class","mb-3",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","warn",3,"disabled","click",4,"ngIf"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts",4,"ngIf"],["type","button","class","w-100","mat-stroked-button","","color","accent",3,"click",4,"ngIf"],["appearance","outline",1,"pt-3","col-12",3,"color"],["placeholder","Pilih Salah Satu",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["color","warn","mode","buffer",1,"mb-3"],["type","button","mat-stroked-button","","color","warn",1,"w-100",3,"disabled","click"],[4,"ngIf"],[3,"videoUrl","videoThumb","subtitleUrl","subtitleFonts"],["type","button","mat-stroked-button","","color","accent",1,"w-100",3,"click"],[1,"py-2","px-3",2,"white-space","pre-line !important",3,"innerHTML"]],template:function(t,r){1&t&&u.YNc(0,i_,58,21,"div",0),2&t&&u.Q6J("ngIf",r.berkasData)},directives:[Q.O5,J.t,re.Ub,re.vS,_e.rH,re.eA,Q.sg,X.lW,oe.gM,De.Hw,Ze.pW,X.zs,qe.KE,qe.hX,We.gD,Me.ey,Ev,Cv.Y,kv.S],pipes:[Q.uU,Q.OU,fc.$],styles:[".wrapper[_ngcontent-%COMP%]{position:sticky;left:0;width:100%;height:128px;overflow:hidden;background-size:168px,auto!important;background-repeat:no-repeat,repeat!important;background-position-x:100%,0%!important}.bg-bubbles[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:#ffffff26;bottom:-160px;animation:square 25s infinite;transition-timing-function:linear}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(1){left:10%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:#ffffff40}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(5){left:70%}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:#fff3}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:#ffffff4d}.bg-bubbles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes square{0%{transform:translateY(0)}to{transform:translateY(-512px) rotate(512deg)}}"]}),s})();var Ra=j(8372),Ma=j(9094),Bo=j(3900),Ho=j(8746),Na=j(5625),n_=j(519),a_=j(8439),s_=j(5679),o_=j(6781),u_=j(7902),hc=j(2368),l_=j(7531),pc=j(1079),d_=j(4834);function c_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.ALo(2,"bytes"),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.hij("Ukuran Upload Melebihi Batas ",u.lcZ(2,1,t.imageLimitExceeded)," !")}}function f_(s,n){if(1&s&&(u.TgZ(0,"div"),u._uU(1),u.qZA()),2&s){const t=u.oxw(2);u.xp6(1),u.Oqu(t.imageErrorText)}}function h_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",28)(1,"button",30),u.NdJ("click",function(){return u.CHM(t),u.oxw(2).submitImage()}),u.TgZ(2,"mat-icon",31),u._uU(3,"add_photo_alternate"),u.qZA(),u._uU(4," Unggah "),u.qZA()()}if(2&s){const t=u.oxw(2);u.xp6(1),u.Q6J("disabled",t.submitted)}}function p_(s,n){1&s&&(u.TgZ(0,"div",20)(1,"mat-slide-toggle",46)(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Akses Hanya Dengan URL "),u.qZA()())}function m_(s,n){if(1&s&&(u.TgZ(0,"mat-option",47),u._uU(1),u.qZA()),2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.Oqu(t.name)}}function g_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Tidak Boleh Kosong"),u.qZA())}function v_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Jenis Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function __(s,n){1&s&&(u.TgZ(0,"mat-option",53),u._UZ(1,"mat-progress-bar",54),u.qZA())}function y_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",56),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).filterAnimeSelected(i)}),u._UZ(1,"img",57),u.TgZ(2,"span",45),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.lnq("",t.id," :: ",null==t.media_type?null:t.media_type.toUpperCase()," :: ",t.title,"")}}function T_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,y_,4,5,"mat-option",55),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredAnime)}}function b_(s,n){if(1&s&&(u.TgZ(0,"small",58),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.fg.get("anime_name").value)}}function x_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Tidak Boleh Kosong"),u.qZA())}function S_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Anime Hanya Boleh Angka"),u.qZA())}function E_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",48)(1,"mat-label"),u._uU(2,"Anime Terkait"),u.qZA(),u.TgZ(3,"input",49),u.NdJ("keyup",function(){return u.CHM(t),u.oxw(2).resetSelectedAnime()}),u.qZA(),u.TgZ(4,"mat-icon",15),u._uU(5,"short_text"),u.qZA(),u.TgZ(6,"mat-autocomplete",null,50),u.YNc(8,__,2,0,"mat-option",51),u.YNc(9,T_,2,1,"ng-container",17),u.qZA(),u.YNc(10,b_,2,1,"small",52),u.TgZ(11,"mat-error"),u.YNc(12,x_,2,0,"div",17),u.YNc(13,S_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(7),r=u.oxw(2);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(5),u.Q6J("ngIf",r.isLoading),u.xp6(1),u.Q6J("ngIf",!r.isLoading),u.xp6(1),u.Q6J("ngIf",r.fg.get("anime_name").value),u.xp6(2),u.Q6J("ngIf",r.fg.get("anime_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",r.fg.get("anime_id").hasError("pattern"))}}function C_(s,n){1&s&&(u.TgZ(0,"mat-option",53),u._UZ(1,"mat-progress-bar",54),u.qZA())}function k_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",56),u.NdJ("click",function(){const i=u.CHM(t).$implicit;return u.oxw(4).filterDoramaSelected(i)}),u._UZ(1,"img",57),u.TgZ(2,"span",45),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.mdl_id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.mdl_id," :: ",t.title,"")}}function A_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,k_,4,4,"mat-option",55),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredDorama)}}function w_(s,n){if(1&s&&(u.TgZ(0,"small",58),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.fg.get("dorama_name").value)}}function I_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Tidak Boleh Kosong"),u.qZA())}function D_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Dorama Hanya Boleh Angka"),u.qZA())}function P_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-form-field",48)(1,"mat-label"),u._uU(2,"Dorama Terkait"),u.qZA(),u.TgZ(3,"input",59),u.NdJ("keyup",function(){return u.CHM(t),u.oxw(2).resetSelectedDorama()}),u.qZA(),u.TgZ(4,"mat-icon",15),u._uU(5,"short_text"),u.qZA(),u.TgZ(6,"mat-autocomplete",null,60),u.YNc(8,C_,2,0,"mat-option",51),u.YNc(9,A_,2,1,"ng-container",17),u.qZA(),u.YNc(10,w_,2,1,"small",52),u.TgZ(11,"mat-error"),u.YNc(12,I_,2,0,"div",17),u.YNc(13,D_,2,0,"div",17),u.qZA()()}if(2&s){const t=u.MAs(7),r=u.oxw(2);u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",t),u.xp6(5),u.Q6J("ngIf",r.isLoading),u.xp6(1),u.Q6J("ngIf",!r.isLoading),u.xp6(1),u.Q6J("ngIf",r.fg.get("dorama_name").value),u.xp6(2),u.Q6J("ngIf",r.fg.get("dorama_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",r.fg.get("dorama_id").hasError("pattern"))}}function L_(s,n){1&s&&(u.TgZ(0,"mat-icon",15),u._uU(1,"short_text"),u.qZA())}function O_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",67),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index;return u.oxw(2).removeFansub(e)}),u.TgZ(1,"mat-icon"),u._uU(2,"close"),u.qZA()()}}function R_(s,n){1&s&&(u.TgZ(0,"mat-option",53),u._UZ(1,"mat-progress-bar",54),u.qZA())}function M_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"mat-option",56),u.NdJ("click",function(){const i=u.CHM(t).$implicit,a=u.oxw(2).index;return u.oxw(2).filterFansubSelected(i,a)}),u._UZ(1,"img",68),u.TgZ(2,"span",45),u._uU(3),u.qZA()()}if(2&s){const t=n.$implicit;u.Q6J("value",t.id),u.xp6(1),u.s9C("src",t.image_url,u.LSH),u.xp6(2),u.AsE("",t.slug," :: ",t.name,"")}}function N_(s,n){if(1&s&&(u.ynx(0),u.YNc(1,M_,4,4,"mat-option",55),u.BQk()),2&s){const t=u.oxw(3);u.xp6(1),u.Q6J("ngForOf",t.filteredFansub)}}function F_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Tidak Boleh Kosong"),u.qZA())}function U_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"ID Fansub Hanya Boleh Angka"),u.qZA())}function B_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div")(1,"div",61)(2,"mat-form-field",62)(3,"mat-label"),u._uU(4,"Fansub Terkait"),u.qZA(),u.TgZ(5,"input",63),u.NdJ("keyup",function(){const i=u.CHM(t).index;return u.oxw(2).resetSelectedFansub(i)}),u.qZA(),u.YNc(6,L_,2,0,"mat-icon",64),u.YNc(7,O_,3,0,"button",65),u.TgZ(8,"mat-autocomplete",null,66),u.YNc(10,R_,2,0,"mat-option",51),u.YNc(11,N_,2,1,"ng-container",17),u.qZA(),u.TgZ(12,"small",58),u._uU(13),u.qZA(),u.TgZ(14,"mat-error"),u.YNc(15,F_,2,0,"div",17),u.YNc(16,U_,2,0,"div",17),u.qZA()()()()}if(2&s){const t=n.$implicit,r=n.index,e=u.MAs(9),i=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",r),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("matAutocomplete",e),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").value||0===r),u.xp6(1),u.Q6J("ngIf",!t.get("fansub_id").value&&r>0),u.xp6(3),u.Q6J("ngIf",i.isLoading),u.xp6(1),u.Q6J("ngIf",!i.isLoading),u.xp6(2),u.Oqu(t.get("fansub_name").value),u.xp6(2),u.Q6J("ngIf",t.get("fansub_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("fansub_id").hasError("pattern"))}}function H_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Tidak Boleh Kosong"),u.qZA())}function j_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Nama Berkas Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function V_(s,n){1&s&&(u.TgZ(0,"div",9)(1,"div",20),u._UZ(2,"mat-divider"),u.qZA()())}function q_(s,n){if(1&s&&(u.TgZ(0,"p",73),u._uU(1),u.qZA()),2&s){const t=u.oxw(3);u.xp6(1),u.Oqu(t.attachmentFontSubtitle.join(", ").toLowerCase())}}function W_(s,n){if(1&s&&(u.TgZ(0,"div",9)(1,"mat-list")(2,"div",69),u._uU(3,"Berkas yang terlampir tidak boleh diubah."),u.qZA(),u.TgZ(4,"mat-list-item")(5,"mat-icon",70),u._uU(6,"attach_file"),u.qZA(),u.TgZ(7,"div",71),u._uU(8),u.qZA(),u.TgZ(9,"div",71),u._uU(10),u.ALo(11,"bytes"),u.qZA()(),u.YNc(12,q_,2,1,"p",72),u.qZA()()),2&s){const t=u.oxw(2);u.xp6(8),u.AsE("",t.attachmentFile.name,".",t.attachmentFile.ext,""),u.xp6(2),u.Oqu(u.lcZ(11,4,t.attachmentFile.size)),u.xp6(2),u.Q6J("ngIf",t.attachmentFontSubtitle.length>0)}}function G_(s,n){1&s&&(u.TgZ(0,"div",80)(1,"small",81),u._uU(2,"* "),u.TgZ(3,"i"),u._uU(4,"Gunakan tombol (X) untuk menghapus URL Eksternal jika ingin hanya menggunakan lampiran "),u.TgZ(5,"i"),u._uU(6,"upload"),u.qZA(),u._uU(7," DDL saja"),u.qZA()()())}function Z_(s,n){1&s&&(u.TgZ(0,"mat-icon",15),u._uU(1,"web"),u.qZA())}function z_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",67),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index;return u.oxw(2).removeDownloadLink(e)}),u.TgZ(1,"mat-icon"),u._uU(2,"close"),u.qZA()()}}function K_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Tidak Boleh Kosong"),u.qZA())}function $_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Web Hanya Boleh Huruf Standar Papan Ketik"),u.qZA())}function Y_(s,n){1&s&&(u.TgZ(0,"mat-icon",15),u._uU(1,"link"),u.qZA())}function X_(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"button",67),u.NdJ("click",function(){u.CHM(t);const e=u.oxw().index;return u.oxw(2).removeDownloadLink(e)}),u.TgZ(1,"mat-icon"),u._uU(2,"close"),u.qZA()()}}function Q_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Tidak Boleh Kosong"),u.qZA())}function J_(s,n){1&s&&(u.TgZ(0,"div"),u._uU(1,"Tautan Link Tidak Valid"),u.qZA())}function e0(s,n){if(1&s&&(u.ynx(0),u.TgZ(1,"div",74),u.YNc(2,G_,8,0,"div",75),u.TgZ(3,"mat-form-field",76)(4,"mat-label"),u._uU(5,"Nama Website"),u.qZA(),u._UZ(6,"input",77),u.YNc(7,Z_,2,0,"mat-icon",64),u.YNc(8,z_,3,0,"button",65),u.TgZ(9,"mat-error"),u.YNc(10,K_,2,0,"div",17),u.YNc(11,$_,2,0,"div",17),u.qZA()(),u.TgZ(12,"mat-form-field",78)(13,"mat-label"),u._uU(14,"Tautan Link"),u.qZA(),u._UZ(15,"input",79),u.YNc(16,Y_,2,0,"mat-icon",64),u.YNc(17,X_,3,0,"button",65),u.TgZ(18,"mat-error"),u.YNc(19,Q_,2,0,"div",17),u.YNc(20,J_,2,0,"div",17),u.qZA()()(),u.BQk()),2&s){const t=n.$implicit,r=n.index,e=u.oxw(2);u.xp6(1),u.Q6J("formGroupName",r),u.xp6(1),u.Q6J("ngIf",(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified)&&0===r),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("name").value||0===r&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("name").value&&(r>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("name").hasError("pattern")),u.xp6(1),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngIf",t.get("url").value||0===r&&!(null!=e.AS.currentUserSubject&&null!=e.AS.currentUserSubject.value&&e.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",!t.get("url").value&&(r>0||(null==e.AS.currentUserSubject||null==e.AS.currentUserSubject.value?null:e.AS.currentUserSubject.value.verified))),u.xp6(2),u.Q6J("ngIf",t.get("url").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.get("url").hasError("pattern"))}}function t0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"form",4),u.NdJ("submit",function(){return u.CHM(t),u.oxw().onSubmit()}),u.TgZ(1,"div",5)(2,"div",6)(3,"h2",7)(4,"b",8),u._uU(5,"Ubah Berkas"),u.qZA()()(),u.TgZ(6,"div",2)(7,"div",9)(8,"div",10)(9,"div",9)(10,"div",2),u._UZ(11,"img",11),u.TgZ(12,"mat-form-field",12)(13,"mat-label"),u._uU(14,"Gambar Untuk Embed SEO"),u.qZA(),u.TgZ(15,"ngx-mat-file-input",13,14),u.NdJ("change",function(e){u.CHM(t);const i=u.MAs(16);return u.oxw().uploadImage(e,i)}),u.qZA(),u.TgZ(17,"mat-icon",15),u._uU(18,"image"),u.qZA()(),u.TgZ(19,"mat-error",16)(20,"small"),u.YNc(21,c_,3,3,"div",17),u.YNc(22,f_,2,1,"div",17),u.qZA()()(),u.YNc(23,h_,5,1,"div",18),u.YNc(24,p_,5,0,"div",19),u.TgZ(25,"div",20)(26,"mat-slide-toggle",21),u._uU(27," R-18+ Konten Eksplisit "),u.qZA()(),u.TgZ(28,"mat-form-field",22)(29,"mat-label"),u._uU(30,"Jenis Proyek"),u.qZA(),u.TgZ(31,"mat-select",23),u.YNc(32,m_,2,2,"mat-option",24),u.qZA(),u.TgZ(33,"mat-error"),u.YNc(34,g_,2,0,"div",17),u.YNc(35,v_,2,0,"div",17),u.qZA()(),u.YNc(36,E_,14,7,"mat-form-field",25),u.YNc(37,P_,14,7,"mat-form-field",25),u.TgZ(38,"div",20),u._UZ(39,"mat-divider"),u.qZA(),u.TgZ(40,"div",26),u.YNc(41,B_,17,10,"div",27),u.qZA(),u.TgZ(42,"div",28)(43,"div",9),u._UZ(44,"div",29),u.TgZ(45,"div",29)(46,"button",30),u.NdJ("click",function(){return u.CHM(t),u.oxw().addFansub()}),u.TgZ(47,"mat-icon",31),u._uU(48,"add"),u.qZA(),u._uU(49," Tambah Fansub "),u.qZA()()()()()(),u.TgZ(50,"div",32)(51,"div",9)(52,"mat-form-field",33)(53,"mat-label"),u._uU(54,"Nama Berkas"),u.qZA(),u._UZ(55,"input",34),u.TgZ(56,"mat-icon",15),u._uU(57,"wysiwyg"),u.qZA(),u.TgZ(58,"mat-error"),u.YNc(59,H_,2,0,"div",17),u.YNc(60,j_,2,0,"div",17),u.qZA()(),u._UZ(61,"angular-editor",35),u.qZA(),u.YNc(62,V_,3,0,"div",36),u.YNc(63,W_,13,6,"div",36),u.TgZ(64,"div",9)(65,"div",20),u._UZ(66,"mat-divider"),u.qZA()(),u.ynx(67,37),u.YNc(68,e0,21,12,"ng-container",27),u.BQk(),u.TgZ(69,"div",38),u._UZ(70,"div",29)(71,"div",29)(72,"div",29),u.TgZ(73,"div",29)(74,"button",30),u.NdJ("click",function(){return u.CHM(t),u.oxw().addDownloadLink()}),u.TgZ(75,"mat-icon",31),u._uU(76,"add"),u.qZA(),u._uU(77," Tambah URL "),u.qZA()()()()(),u.TgZ(78,"div",9)(79,"div",39)(80,"div",40),u._UZ(81,"div",41),u.TgZ(82,"div",42)(83,"a",43)(84,"mat-icon",31),u._uU(85,"undo"),u.qZA(),u._uU(86," Batal "),u.qZA()(),u.TgZ(87,"div",42)(88,"button",44),u._uU(89," Simpan "),u.TgZ(90,"mat-icon",45),u._uU(91,"save"),u.qZA()()()()()()()()()}if(2&s){const t=u.oxw();u.Q6J("formGroup",t.fg),u.xp6(11),u.Q6J("src",t.image_url,u.LSH),u.xp6(1),u.Q6J("color","accent"),u.xp6(3),u.Q6J("disabled",t.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),u.xp6(6),u.Q6J("ngIf",t.imageLimitExceeded),u.xp6(1),u.Q6J("ngIf",t.imageErrorText),u.xp6(1),u.Q6J("ngIf",t.image&&!t.fg.value.image),u.xp6(1),u.Q6J("ngIf",null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified),u.xp6(4),u.Q6J("color","accent"),u.xp6(4),u.Q6J("ngForOf",t.projectList),u.xp6(2),u.Q6J("ngIf",t.fg.get("projectType_id").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.fg.get("projectType_id").hasError("pattern")),u.xp6(1),u.Q6J("ngIf",t.berkasType.toLowerCase().includes("anime")),u.xp6(1),u.Q6J("ngIf",t.berkasType.toLowerCase().includes("dorama")),u.xp6(4),u.Q6J("ngForOf",t.getFansubControl.controls),u.xp6(5),u.Q6J("disabled",t.submitted),u.xp6(6),u.Q6J("color","accent"),u.xp6(7),u.Q6J("ngIf",t.fg.get("name").hasError("required")),u.xp6(1),u.Q6J("ngIf",t.fg.get("name").hasError("pattern")),u.xp6(1),u.Q6J("config",t.GS.angularEditorConfig),u.xp6(1),u.Q6J("ngIf",t.attachmentFile),u.xp6(1),u.Q6J("ngIf",t.attachmentFile),u.xp6(5),u.Q6J("ngForOf",t.getDownloadUrlControl.controls),u.xp6(6),u.Q6J("disabled",t.submitted),u.xp6(9),u.Q6J("disabled",t.submitted),u.xp6(5),u.Q6J("disabled",t.submitted||t.fg.invalid||!t.fg.dirty)}}let i0=(()=>{class s{constructor(t,r,e,i,a,o,l,d,f,v,g,T,E,x){this.router=t,this.activatedRoute=r,this.fb=e,this.bs=i,this.pi=a,this.anime=o,this.dorama=l,this.project=d,this.fansub=f,this.berkas=v,this.toast=g,this.imgbb=T,this.gs=E,this.as=x,this.berkasId="",this.submitted=!1,this.projectList=[],this.uploadToast=null,this.gambar=null,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.filteredAnime=[],this.filteredDorama=[],this.filteredFansub=[],this.isLoading=!1,this.animeCheckOrAddResponse=null,this.doramaCheckOrAddResponse=null,this.attachmentFile=null,this.attachmentFontSubtitle=[],this.subsProject=null,this.subsFansub=null,this.subsAnimeDetail=null,this.subsDoramaDetail=null,this.subsProjectDetail=null,this.subsFansubDetail=[],this.subsAnimeNew=null,this.subsDoramaNew=null,this.subsImgbb=null,this.subsBerkasDetail=null,this.subsBerkasUpdate=null,this.berkasType="",this.gs.bannerImg=null,this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get GS(){return this.gs}ngOnInit(){this.pi.updatePageMetaData("Berkas - Ubah Berkas","Halaman Pembaharuan Data Berkas","Ubah Berkas"),this.gs.isBrowser&&(this.berkasId=this.activatedRoute.snapshot.paramMap.get("berkasId"),this.bs.busy(),this.subsBerkasDetail=this.berkas.getBerkas(this.berkasId).subscribe({next:t=>{var r,e,i,a;this.gs.log("[BERKAS_DETAIL_SUCCESS]",t),this.bs.idle(),(null===(e=null===(r=this.as.currentUserSubject)||void 0===r?void 0:r.value)||void 0===e?void 0:e.id)!==t.result.user_.id&&(this.toast.warning("Berkas Ini Bukan Milikmu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)),!(null===(a=null===(i=this.as.currentUserSubject)||void 0===i?void 0:i.value)||void 0===a?void 0:a.verified)&&t.result.attachment_?(this.toast.warning("string"==typeof t.result.attachment_?t.result.attachment_:"Harap Verifikasi Akun Terlebih Dahulu","Whoops!",null,!0),this.router.navigateByUrl(`/berkas/${t.result.id}`)):(this.loadProjectList(),this.initForm(t.result))},error:t=>{this.gs.log("[BERKAS_DETAIL_ERROR]",t,"error"),this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:`/berkas/${this.berkasId}`}})}}))}ngOnDestroy(){var t,r,e,i,a,o,l,d,f,v;this.uploadToast&&this.toast.remove(this.uploadToast.toastId),null===(t=this.subsProject)||void 0===t||t.unsubscribe(),null===(r=this.subsFansub)||void 0===r||r.unsubscribe(),null===(e=this.subsAnimeDetail)||void 0===e||e.unsubscribe(),null===(i=this.subsDoramaDetail)||void 0===i||i.unsubscribe(),null===(a=this.subsProjectDetail)||void 0===a||a.unsubscribe();for(const g of this.subsFansubDetail)null==g||g.unsubscribe();null===(o=this.subsAnimeNew)||void 0===o||o.unsubscribe(),null===(l=this.subsDoramaNew)||void 0===l||l.unsubscribe(),null===(d=this.subsImgbb)||void 0===d||d.unsubscribe(),null===(f=this.subsBerkasDetail)||void 0===f||f.unsubscribe(),null===(v=this.subsBerkasUpdate)||void 0===v||v.unsubscribe()}loadProjectList(){this.bs.busy(),this.subsProject=this.project.getProject().subscribe({next:t=>{this.gs.log("[PROJECT_LOAD_SUCCESS]",t),this.projectList=t.results,this.bs.idle()},error:t=>{this.gs.log("[PROJECT_LOAD_ERROR]",t,"error"),this.bs.idle()}})}hasRequiredField(t,r){return t.get(r).hasValidator(B.kI.required)}initForm(t){var r,e,i,a;"attachment_"in t&&t.attachment_&&(this.attachmentFile=t.attachment_,t.attachment_.fonts_&&t.attachment_.fonts_.forEach(o=>{this.attachmentFontSubtitle.push(`${o.name}.${o.ext}`)}),t.attachment_.subtitles_&&t.attachment_.subtitles_.forEach(o=>{this.attachmentFontSubtitle.push(`${o.name}.${o.ext}`)})),this.fg=this.fb.group({name:[t.name,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],description:[t.description,B.kI.compose([B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],projectType_id:[t.project_type_.id,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],anime_id:[(null===(r=t.anime_)||void 0===r?void 0:r.id)||null,B.kI.compose([])],anime_name:[(null===(e=t.anime_)||void 0===e?void 0:e.name)||null,B.kI.compose([])],dorama_id:[(null===(i=t.dorama_)||void 0===i?void 0:i.id)||null,B.kI.compose([])],dorama_name:[(null===(a=t.dorama_)||void 0===a?void 0:a.name)||null,B.kI.compose([])],fansub_list:this.fb.array([]),image:[null,B.kI.compose([B.kI.pattern(te.t.regexUrl)])],download_url:this.fb.array([]),private:[t.private,B.kI.compose([B.kI.required])],r18:[t.r18,B.kI.compose([B.kI.required])]}),this.image_url=t.image_url,this.image_url_original=this.image_url,this.berkasType=t.project_type_.name,t.anime_&&(this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required])),t.dorama_&&(this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required]));for(const o of t.download_url)this.addDownloadLink(o);for(const o of t.fansub_)this.addFansub(o);this.subsAnimeDetail=this.fg.get("anime_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(o=>this.anime.searchAnime(o).pipe((0,Ho.x)(()=>this.isLoading=!1))),(0,Na.X)(-1)).subscribe({next:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_SUCCESS]",o),this.filteredAnime=o.results},error:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_ANIME_RESULT_ERROR]",o,"error")}}),this.subsDoramaDetail=this.fg.get("dorama_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(o=>this.dorama.searchDorama(o).pipe((0,Ho.x)(()=>this.isLoading=!1))),(0,Na.X)(-1)).subscribe({next:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_SUCCESS]",o);for(const l of o.results)l.mdl_id=l.mdl_id.split("-")[1],l.image_url=l.thumb;this.filteredDorama=o.results},error:o=>{this.gs.log("[BERKAS_EDIT_SEARCH_DORAMA_RESULT_ERROR]",o,"error")}}),this.subsProjectDetail=this.fg.get("projectType_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,Na.X)(-1)).subscribe({next:o=>{this.gs.log("[BERKAS_EDIT_PROJECT_CHANGED]",o);const l=this.projectList.find(d=>d.id===o);this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null),this.fg.controls.anime_id.setErrors(null),this.fg.controls.anime_name.setErrors(null),this.fg.controls.dorama_id.setErrors(null),this.fg.controls.dorama_name.setErrors(null),this.fg.controls.anime_id.clearValidators(),this.fg.controls.anime_name.clearValidators(),this.fg.controls.dorama_id.clearValidators(),this.fg.controls.dorama_name.clearValidators(),this.fg.controls.anime_id.markAsPristine(),this.fg.controls.anime_name.markAsPristine(),this.fg.controls.dorama_id.markAsPristine(),this.fg.controls.dorama_name.markAsPristine(),this.fg.controls.anime_id.markAsUntouched(),this.fg.controls.anime_name.markAsUntouched(),this.fg.controls.dorama_id.markAsUntouched(),this.fg.controls.dorama_name.markAsUntouched(),l.name.toLowerCase().includes("anime")?(this.berkasType=l.name,this.fg.controls.anime_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.anime_name.setValidators([B.kI.required])):l.name.toLowerCase().includes("dorama")?(this.berkasType=l.name,this.fg.controls.dorama_id.setValidators([B.kI.required,B.kI.pattern(/^\d+$/)]),this.fg.controls.dorama_name.setValidators([B.kI.required])):this.berkasType="",this.fg.controls.anime_id.updateValueAndValidity(),this.fg.controls.anime_name.updateValueAndValidity(),this.fg.controls.dorama_id.updateValueAndValidity(),this.fg.controls.dorama_name.updateValueAndValidity()}})}get getDownloadUrlControl(){return this.fg.get("download_url")}createDownloadLink(t=null,r=null){return this.fb.group({name:[t,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexEnglishKeyboardKeys)])],url:[r,B.kI.compose([B.kI.required,B.kI.pattern(te.t.regexUrl)])]})}addDownloadLink(t=null){this.getDownloadUrlControl.push(t?this.createDownloadLink(t.name,t.url):this.createDownloadLink())}removeDownloadLink(t){this.getDownloadUrlControl.removeAt(t)}get getFansubControl(){return this.fg.get("fansub_list")}createFansub(t=null){const r=this.fb.group({fansub_id:[(null==t?void 0:t.id)||null,B.kI.compose([B.kI.required,B.kI.pattern(/^\d+$/)])],fansub_name:[(null==t?void 0:t.name)||null,B.kI.compose([B.kI.required])]});return this.subsFansubDetail.push(r.get("fansub_id").valueChanges.pipe((0,Ra.b)(500),(0,Ma.x)(),(0,me.b)(()=>this.isLoading=!0),(0,Bo.w)(e=>this.fansub.searchFansub(e).pipe((0,Ho.x)(()=>this.isLoading=!1))),(0,Na.X)(-1)).subscribe({next:e=>{this.gs.log("[BERKAS_EDIT_SEARCH_FANSUB_RESULT]",e),this.filteredFansub=e.results}})),r}removeFansub(t){var r;this.getFansubControl.removeAt(t),null===(r=this.subsFansubDetail[t])||void 0===r||r.unsubscribe(),this.subsFansubDetail.splice(t,1)}addFansub(t=null){this.getFansubControl.push(t?this.createFansub(t):this.createFansub())}resetSelectedAnime(){this.fg.controls.anime_name.patchValue(null)}resetSelectedDorama(){this.fg.controls.dorama_name.patchValue(null)}resetSelectedFansub(t){this.getFansubControl.controls[t].get("fansub_name").patchValue(null)}filterAnimeSelected(t){var r;this.gs.log("[ANIME_FILTER_CLICK]",t),this.submitted=!0,this.subsAnimeNew=this.anime.addNewAnime({id:t.id,name:t.title,image_url:t.image_url,type:null===(r=t.media_type)||void 0===r?void 0:r.toUpperCase()}).subscribe({next:e=>{this.gs.log("[ANIME_CHECK_ADD_SUCCESS]",e),this.animeCheckOrAddResponse=e.result,this.submitted=!1,this.fg.controls.anime_id.patchValue(e.result.id),this.fg.controls.anime_name.patchValue(e.result.name)},error:e=>{this.gs.log("[ANIME_CHECK_ADD_ERROR]",e,"error"),this.submitted=!1,this.resetSelectedAnime(),this.fg.controls.anime_id.patchValue(null),this.fg.controls.anime_name.patchValue(null)}})}filterDoramaSelected(t){this.gs.log("[DORAMA_FILTER_CLICK]",t),this.submitted=!0,this.subsDoramaNew=this.dorama.addNewDorama({id:parseInt(t.mdl_id,10),slug:t.slug,name:t.title,image_url:t.image_url,type:t.type}).subscribe({next:r=>{this.gs.log("[DORAMA_CHECK_ADD_SUCCESS]",r),this.doramaCheckOrAddResponse=r.result,this.submitted=!1,this.fg.controls.dorama_id.patchValue(r.result.id),this.fg.controls.dorama_name.patchValue(r.result.name)},error:r=>{this.gs.log("[DORAMA_CHECK_ADD_ERROR]",r,"error"),this.submitted=!1,this.resetSelectedDorama(),this.fg.controls.dorama_id.patchValue(null),this.fg.controls.dorama_name.patchValue(null)}})}filterFansubSelected(t,r){this.gs.log("[FANSUB_FILTER_CLICK]",t),this.getFansubControl.controls[r].get("fansub_id").patchValue(t.id),this.getFansubControl.controls[r].get("fansub_name").patchValue(t.name)}uploadImage(t,r){this.gambar=r,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const e=t.target.files[0];try{const i=new FileReader;i.readAsDataURL(e),i.onload=a=>{if(this.gs.log("[IMAGE_SELECTED]",a),e.size<=te.t.fileSizeImageLimit){const o=this.gs.document.createElement("img");o.onload=()=>{this.image=e,this.image_url=i.result.toString()},o.src=i.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=te.t.fileSizeImageLimit,this.gambar.clear(t)}}catch(i){this.image=null,this.image_url=this.image_url_original,this.gambar.clear(t)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:t=>{this.gs.log("[IMAGE_SUCCESS]",t),this.fg.controls.image.patchValue(t.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:t=>{var r;this.gs.log("[IMAGE_ERROR]",t,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=(null===(r=t.result)||void 0===r?void 0:r.message)||t.info}})}onSubmit(){this.bs.busy();const t=this.gs.getDirtyValues(this.fg);if("fansub_list"in t){const r=[];for(const e of this.fg.value.fansub_list)r.push(e.fansub_id);t.fansub_id=r,delete t.fansub_list}return null===this.attachmentFile&&0===this.fg.value.download_url.lenth?(this.submitted=!1,this.uploadToast=this.toast.warning("Lampiran DDL / URL Eksternal!","Harap Mengisi Setidaknya Salah Satu ..."),void this.bs.idle()):(this.gs.log("[BERKAS_EDIT_DIRTY]",t),this.submitted=!0,this.fg.invalid?(this.submitted=!1,void this.bs.idle()):void(this.subsBerkasUpdate=this.berkas.updateBerkas(this.berkasId,{...t}).subscribe({next:r=>{this.gs.log("[BERKAS_EDIT_SUCCESS]",r),this.submitted=!1,this.bs.idle(),this.router.navigateByUrl(`/berkas/${this.berkasId}`)},error:r=>{this.gs.log("[BERKAS_EDIT_ERROR]",r,"error"),this.submitted=!1,this.bs.idle()}})))}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(_e.F0),u.Y36(_e.gz),u.Y36(B.qu),u.Y36(Ne.z),u.Y36(He.Z),u.Y36(n_.o),u.Y36(a_.X),u.Y36(s_.Y),u.Y36(o_.T),u.Y36(rt.A),u.Y36(ee.k),u.Y36(u_.X),u.Y36(ke.U),u.Y36(D.e))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-edit"]],decls:5,vars:1,consts:[[1,"container"],[1,"row","px-3"],[1,"col-12"],[3,"formGroup","submit",4,"ngIf"],[3,"formGroup","submit"],[1,"row","mt-3","mb-3"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["matSuffix",""],[1,"px-3","w-100"],[4,"ngIf"],["class","col-12 mb-4",4,"ngIf"],["class","col-12 p-3",4,"ngIf"],[1,"col-12","p-3"],["formControlName","r18","matTooltip","Konten Eksplisit"],["appearance","outline",1,"px-3","pt-3","col-12",3,"color"],["formControlName","projectType_id","placeholder","Anime / Drama"],[3,"value",4,"ngFor","ngForOf"],["appearance","outline","class","p-3 w-100",3,"color",4,"ngIf"],["formArrayName","fansub_list","matTooltip","Silahkan Buat Terlebih Dahulu Jika Tidak Ada"],[4,"ngFor","ngForOf"],[1,"col-12","mb-4"],[1,"col"],["type","button","mat-raised-button","","color","primary",1,"w-100",3,"disabled","click"],[1,"me-1"],[1,"col-12","col-md-7","col-xl-8","pt-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","name","placeholder","[Fansub] Judul Anime - 00 [BD 4K x265 FLAC][CRC32].mkv"],["formControlName","description",1,"p-3","w-100",3,"config"],["class","row",4,"ngIf"],["formArrayName","download_url"],[1,"row","mb-4"],[1,"col-12","py-3"],[1,"row","gy-3"],[1,"col","g-0"],[1,"col-12","col-md-3"],["mat-stroked-button","","routerLink","../",1,"w-100",3,"disabled"],["type","submit","mat-flat-button","","color","accent",1,"w-100",3,"disabled"],[1,"ms-1"],["formControlName","private","matTooltip","Hanya Dapat Di Akses Melalui URL"],[3,"value"],["appearance","outline",1,"p-3","w-100",3,"color"],["matInput","","formControlName","anime_id","placeholder","Full Metal Alchemist",3,"matAutocomplete","keyup"],["autoCompleteAnime","matAutocomplete"],["class","is-loading",4,"ngIf"],["class","text-warning",4,"ngIf"],[1,"is-loading"],["mode","indeterminate"],["class","px-1",3,"value","click",4,"ngFor","ngForOf"],[1,"px-1",3,"value","click"],[1,"me-1",2,"height","40px","width","30px","object-fit","cover",3,"src"],[1,"text-warning"],["matInput","","formControlName","dorama_id","placeholder","Flying Colors",3,"matAutocomplete","keyup"],["autoCompleteDorama","matAutocomplete"],[1,"row",3,"formGroupName"],["appearance","outline",1,"px-3","pt-3","w-100",3,"color"],["matInput","","formControlName","fansub_id","placeholder","NamaFansub",3,"matAutocomplete","keyup"],["matSuffix","",4,"ngIf"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click",4,"ngIf"],["autoCompleteFansub","matAutocomplete"],["type","button","mat-button","","matSuffix","","mat-icon-button","",3,"click"],[1,"me-1",2,"height","40px","width","40px","object-fit","cover",3,"src"],["mat-subheader","",1,"text-warning"],["mat-list-icon",""],["mat-line",""],["class","p-3 m-0",4,"ngIf"],[1,"p-3","m-0"],["matTooltip","Silahkan Isi Alamat Website Kamu Jika Ingin Mendapatkan Traffic Pengunjung",1,"row",3,"formGroupName"],["class","col-12 px-3",4,"ngIf"],["appearance","outline",1,"px-3","pt-3","col-12","col-md-5",3,"color"],["matInput","","formControlName","name","placeholder","Web Shit","required",""],["appearance","outline",1,"px-3","pt-3","col-12","col-md-7",3,"color"],["matInput","","formControlName","url","placeholder","https://drive.google.com/drive/u/2/folders/1KYTJZsmH9dyyHBXnQD4N0SjSBXcs8qD-","required",""],[1,"col-12","px-3"],[1,"text-success"]],template:function(t,r){1&t&&(u._UZ(0,"app-notifications"),u.TgZ(1,"div",0)(2,"div",1)(3,"div",2),u.YNc(4,t0,92,27,"form",3),u.qZA()()()),2&t&&(u.xp6(4),u.Q6J("ngIf",r.fg))},directives:[J.t,Q.O5,B._Y,B.JL,B.sg,qe.KE,qe.hX,ve.Yh,De.Hw,qe.R9,qe.TO,X.lW,hc.Rr,B.JJ,B.u,oe.gM,We.gD,Q.sg,Me.ey,l_.Nt,B.Fj,pc.ZL,pc.XC,Ze.pW,d_.d,B.CE,B.x0,Ae.s6,re.i$,re.gs,re.Tg,re.Nh,Me.X2,B.Q7,X.zs,_e.yS],pipes:[fc.$],styles:[""]}),s})();var r0=j(8757);function n0(s,n){1&s&&(u.TgZ(0,"div",10),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Seluruh Pengguna Tidak Di Tampilkan "),u.qZA())}function a0(s,n){1&s&&(u.TgZ(0,"div",10),u._uU(1," * Berkas "),u.TgZ(2,"i"),u._uU(3,"Private"),u.qZA(),u._uU(4," Dari Pengguna "),u.TgZ(5,"i"),u._uU(6,"Private"),u.qZA(),u._uU(7," Tidak Di Tampilkan "),u.qZA())}function s0(s,n){if(1&s){const t=u.EpF();u.TgZ(0,"div",1)(1,"div",2)(2,"div",3),u.YNc(3,n0,5,0,"div",4),u.YNc(4,a0,8,0,"div",4),u.TgZ(5,"div",5),u._uU(6," * Berkas Dari Anggota Fansub => Warna - Warni "),u.qZA()()(),u.TgZ(7,"div",2)(8,"div",6)(9,"mat-slide-toggle",7),u.NdJ("ngModelChange",function(e){return u.CHM(t),u.oxw().r18=e})("change",function(){return u.CHM(t),u.oxw().getBerkas()}),u._uU(10," Tampilkan R-18+ "),u.qZA()()(),u.TgZ(11,"div",8)(12,"app-material-tab",9),u.NdJ("tableRowClicked",function(e){return u.CHM(t),u.oxw().openBerkas(e)})("paginatorClicked",function(e){return u.CHM(t),u.oxw().onPaginatorClicked(e)})("serverSideFilter",function(e){return u.CHM(t),u.oxw().onServerSideFilter(e)})("serverSideOrder",function(e){return u.CHM(t),u.oxw().onServerSideOrder(e)}),u.qZA()()()}if(2&s){const t=u.oxw();u.xp6(3),u.Q6J("ngIf",!(null!=t.AS.currentUserSubject&&null!=t.AS.currentUserSubject.value&&t.AS.currentUserSubject.value.verified)),u.xp6(1),u.Q6J("ngIf",(null==t.AS.currentUserSubject?null:t.AS.currentUserSubject.value)&&(null==t.AS.currentUserSubject||null==t.AS.currentUserSubject.value?null:t.AS.currentUserSubject.value.verified)&&!t.showTruelyPrivate),u.xp6(5),u.Q6J("ngModel",t.r18),u.xp6(3),u.Q6J("tablePageSizeOptions",t.tablePageSizeOptions)("tabData",t.tabData)("count",t.count)("serverSide",!0)}}let o0=(()=>{class s{constructor(t,r,e,i,a,o){this.router=t,this.gs=r,this.bs=e,this.berkas=i,this.fs=a,this.as=o,this.allBerkasId=[],this.berkasData=[],this.tabData=[{name:"Berkas Terkini",icon:"file_copy",type:"table",data:{column:["Proyek","Nama Berkas","Tanggal","Kunjungan","Pemilik"],row:[]}}],this.count=0,this.page=1,this.row=50,this.tablePageSizeOptions=[50,75,100,125,150],this.q="",this.sort="",this.order="",this.subsBerkas=null,this.subsTrusted=null,this.r18=!1,this.gs.bannerImg="/assets/img/banner/berkas.jpg",this.gs.sizeContain=!1,this.gs.bgRepeat=!1}get AS(){return this.as}get showTruelyPrivate(){var t,r,e,i,a,o;return(null===(r=null===(t=this.as.currentUserSubject)||void 0===t?void 0:t.value)||void 0===r?void 0:r.role)===Ce.yS.ADMIN||(null===(i=null===(e=this.as.currentUserSubject)||void 0===e?void 0:e.value)||void 0===i?void 0:i.role)===Ce.yS.MODERATOR||(null===(o=null===(a=this.as.currentUserSubject)||void 0===a?void 0:a.value)||void 0===o?void 0:o.role)===Ce.yS.FANSUBBER}ngOnDestroy(){var t,r;null===(t=this.subsBerkas)||void 0===t||t.unsubscribe(),null===(r=this.subsTrusted)||void 0===r||r.unsubscribe()}ngOnInit(){this.gs.isBrowser&&(this.gs.isDesktop||(this.tablePageSizeOptions=[10,25,50,75,100]),this.row=this.tablePageSizeOptions[0],this.getBerkas())}getBerkas(){this.bs.busy(),this.subsBerkas&&(this.subsBerkas.unsubscribe(),this.bs.idle()),this.subsBerkas=this.berkas.getAllBerkas(this.q,this.page,this.row,this.sort,this.order,this.r18).subscribe({next:t=>{this.gs.log("[BERKAS_LIST_SUCCESS]",t),this.count=t.count,this.berkasData=[];for(const r of t.results)this.allBerkasId.push(r.id),this.berkasData.push({id:r.id,private:r.private,foto:r.user_.image_url,Proyek:r.project_type_.name,Tanggal:r.created_at,Kunjungan:r.view_count,Pemilik:r.user_.username,"Nama Berkas":r.name});this.tabData[0].data.row=this.berkasData,this.allBerkasId.length>0&&this.checkTrusted(),this.fs.initializeFab("add",null,"Tambah Berkas Baru","/create/berkas",!1),this.bs.idle()},error:t=>{this.gs.log("[BERKAS_LIST_ERROR]",t,"error"),this.bs.idle()}})}checkTrusted(){this.bs.busy(),this.subsTrusted=this.berkas.checkTrusted(this.allBerkasId).subscribe({next:t=>{this.gs.log("[BERKAS_TRUSTED_SUCCESS]",t);for(const r of this.berkasData)r.trusted=t.results[r.id];this.bs.idle()},error:t=>{this.gs.log("[BERKAS_TRUSTED_ERROR]",t,"error"),this.bs.idle()}})}openBerkas(t){this.gs.log("[BERKAS_LIST_CLICK_BERKAS]",t),this.router.navigateByUrl(`/berkas/${t.id}`)}onPaginatorClicked(t){this.gs.log("[BERKAS_LIST_CLICK_PAGINATOR]",t),this.page=t.pageIndex+1,this.row=t.pageSize,this.getBerkas()}onServerSideFilter(t){this.gs.log("[BERKAS_LIST_ENTER_FILTER]",t),this.q=t,this.getBerkas()}onServerSideOrder(t){this.gs.log("[BERKAS_LIST_CLICK_ORDER]",t),this.q=t.q,this.sort=t.active,this.order=t.direction,this.getBerkas()}}return s.\u0275fac=function(t){return new(t||s)(u.Y36(_e.F0),u.Y36(ke.U),u.Y36(Ne.z),u.Y36(rt.A),u.Y36(w.r),u.Y36(D.e))},s.\u0275cmp=u.Xpm({type:s,selectors:[["app-berkas-list"]],decls:2,vars:1,consts:[["class","container",4,"ngIf"],[1,"container"],[1,"row","my-4"],[1,"col-12"],["class","text-danger text-end",4,"ngIf"],[1,"text-success","text-end"],[1,"col-12","text-end","text-warning"],["labelPosition","before",3,"ngModel","ngModelChange","change"],[1,"row"],[3,"tablePageSizeOptions","tabData","count","serverSide","tableRowClicked","paginatorClicked","serverSideFilter","serverSideOrder"],[1,"text-danger","text-end"]],template:function(t,r){1&t&&(u._UZ(0,"app-notifications"),u.YNc(1,s0,13,7,"div",0)),2&t&&(u.xp6(1),u.Q6J("ngIf",r.berkasData))},directives:[J.t,Q.O5,hc.Rr,B.JJ,B.On,r0.H],styles:[""]}),s})();var u0=j(2438);const l0=[{path:"",pathMatch:"full",component:o0},{path:":berkasId",children:[{path:"",pathMatch:"full",component:r_},{path:"edit",component:i0,canActivate:[yt.t],data:{title:"Berkas - Ubah Data",description:"Halaman Pembaharuan Data Fansub",keywords:"Ubah Berkas",[te.t.decoratorRoles]:[Ce.yS.ADMIN,Ce.yS.MODERATOR,Ce.yS.FANSUBBER,Ce.yS.USER]}}]}];let d0=(()=>{class s{}return s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=u.oAB({type:s}),s.\u0275inj=u.cJS({imports:[[Q.ez,_e.Bz.forChild(l0),Ee.m,Te.L,B.u5,B.UX,ve.Ad,pe.F,Ae.UM,se,Ue.R,Ve.b,it.T,u0.d]]}),s})()},3992:(je,we,j)=>{"use strict";var Q=j(9226);je.exports=function(ve,te){return void 0===te&&(te=!1),function(Ce,Ee,Te){if(Ce)ve(Ce);else if(Ee.statusCode>=400&&Ee.statusCode<=599){var pe=Te;if(te)if(Q.TextDecoder){var u=function B(Ae){return void 0===Ae&&(Ae=""),Ae.toLowerCase().split(";").reduce(function(ve,te){var Ce=te.split("="),Te=Ce[1];return"charset"===Ce[0].trim()?Te.trim():ve},"utf-8")}(Ee.headers&&Ee.headers["content-type"]);try{pe=new TextDecoder(u).decode(Te)}catch(se){}}else pe=String.fromCharCode.apply(null,new Uint8Array(Te));ve({cause:pe})}else ve(null,Te)}}},745:(je,we,j)=>{"use strict";var Q=j(9226),_e=j(7154),B=j(2703);function Ce(se,Ue,Ve){var it=se;return B(Ue)?(Ve=Ue,"string"==typeof se&&(it={uri:se})):it=_e({},Ue,{uri:se}),it.callback=Ve,it}function Ee(se,Ue,Ve){return Te(Ue=Ce(se,Ue,Ve))}function Te(se){if(void 0===se.callback)throw new Error("callback argument missing");var Ue=!1,Ve=function(de,le,xe){Ue||(Ue=!0,se.callback(de,le,xe))};function yt(){var Y=void 0;if(Y=me.response?me.response:me.responseText||function pe(se){try{if("document"===se.responseType)return se.responseXML;if(""===se.responseType&&(!se.responseXML||"parsererror"!==se.responseXML.documentElement.nodeName))return se.responseXML}catch(Ve){}return null}(me),D)try{Y=JSON.parse(Y)}catch(de){}return Y}function ue(Y){return clearTimeout(V),Y instanceof Error||(Y=new Error(""+(Y||"Unknown XMLHttpRequest Error"))),Y.statusCode=0,Ve(Y,ee)}function Oe(){if(!Ge){var Y;clearTimeout(V);var de=ee,le=null;return 0!==(Y=se.useXDR&&void 0===me.status?200:1223===me.status?204:me.status)?(de={body:yt(),statusCode:Y,method:Ne,headers:{},url:ke,rawRequest:me},me.getAllResponseHeaders&&(de.headers=function(Ue){var Ve={};return Ue&&Ue.trim().split("\n").forEach(function(it){var yt=it.indexOf(":"),ue=it.slice(0,yt).trim().toLowerCase(),Oe=it.slice(yt+1).trim();void 0===Ve[ue]?Ve[ue]=Oe:Array.isArray(Ve[ue])?Ve[ue].push(Oe):Ve[ue]=[Ve[ue],Oe]}),Ve}(me.getAllResponseHeaders()))):le=new Error("Internal XMLHttpRequest Error"),Ve(le,de,de.body)}}var me=se.xhr||null;me||(me=se.cors||se.useXDR?new Ee.XDomainRequest:new Ee.XMLHttpRequest);var Le,Ge,V,ke=me.url=se.uri||se.url,Ne=me.method=se.method||"GET",He=se.body||se.data,rt=me.headers=se.headers||{},w=!!se.sync,D=!1,ee={body:void 0,headers:{},statusCode:0,method:Ne,url:ke,rawRequest:me};if("json"in se&&!1!==se.json&&(D=!0,rt.accept||rt.Accept||(rt.Accept="application/json"),"GET"!==Ne&&"HEAD"!==Ne&&(rt["content-type"]||rt["Content-Type"]||(rt["Content-Type"]="application/json"),He=JSON.stringify(!0===se.json?He:se.json))),me.onreadystatechange=function it(){4===me.readyState&&setTimeout(Oe,0)},me.onload=Oe,me.onerror=ue,me.onprogress=function(){},me.onabort=function(){Ge=!0},me.ontimeout=ue,me.open(Ne,ke,!w,se.username,se.password),w||(me.withCredentials=!!se.withCredentials),!w&&se.timeout>0&&(V=setTimeout(function(){if(!Ge){Ge=!0,me.abort("timeout");var Y=new Error("XMLHttpRequest timeout");Y.code="ETIMEDOUT",ue(Y)}},se.timeout)),me.setRequestHeader)for(Le in rt)rt.hasOwnProperty(Le)&&me.setRequestHeader(Le,rt[Le]);else if(se.headers&&!function te(se){for(var Ue in se)if(se.hasOwnProperty(Ue))return!1;return!0}(se.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in se&&(me.responseType=se.responseType),"beforeSend"in se&&"function"==typeof se.beforeSend&&se.beforeSend(me),me.send(He||null),me}Ee.httpHandler=j(3992),je.exports=Ee,je.exports.default=Ee,Ee.XMLHttpRequest=Q.XMLHttpRequest||function u(){},Ee.XDomainRequest="withCredentials"in new Ee.XMLHttpRequest?Ee.XMLHttpRequest:Q.XDomainRequest,function ve(se,Ue){for(var Ve=0;Ve{"use strict";function j(B,Ae){return void 0===Ae&&(Ae=Object),Ae&&"function"==typeof Ae.freeze?Ae.freeze(B):B}var Q=j({HTML:"text/html",isHTML:function(B){return B===Q.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_e=j({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(B){return B===_e.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});we.freeze=j,we.MIME_TYPE=Q,we.NAMESPACE=_e},1991:(je,we,j)=>{var _e=j(9401),B=j(6853),Ae=j(4436),ve=j(8702),te=B.DOMImplementation,Ce=_e.NAMESPACE,Ee=ve.ParseError,Te=ve.XMLReader;function pe(ue){this.options=ue||{locator:{}}}function se(){this.cdata=!1}function Ue(ue,Oe){Oe.lineNumber=ue.lineNumber,Oe.columnNumber=ue.columnNumber}function Ve(ue){if(ue)return"\n@"+(ue.systemId||"")+"#[line:"+ue.lineNumber+",col:"+ue.columnNumber+"]"}function it(ue,Oe,me){return"string"==typeof ue?ue.substr(Oe,me):ue.length>=Oe+me||Oe?new java.lang.String(ue,Oe,me)+"":ue}function yt(ue,Oe){ue.currentElement?ue.currentElement.appendChild(Oe):ue.doc.appendChild(Oe)}pe.prototype.parseFromString=function(ue,Oe){var me=this.options,Le=new Te,Ge=me.domBuilder||new se,ke=me.errorHandler,Ne=me.locator,He=me.xmlns||{},rt=/\/x?html?$/.test(Oe),w=rt?Ae.HTML_ENTITIES:Ae.XML_ENTITIES;return Ne&&Ge.setDocumentLocator(Ne),Le.errorHandler=function u(ue,Oe,me){if(!ue){if(Oe instanceof se)return Oe;ue=Oe}var Le={},Ge=ue instanceof Function;function ke(Ne){var He=ue[Ne];!He&&Ge&&(He=2==ue.length?function(rt){ue(Ne,rt)}:ue),Le[Ne]=He&&function(rt){He("[xmldom "+Ne+"]\t"+rt+Ve(me))}||function(){}}return me=me||{},ke("warning"),ke("error"),ke("fatalError"),Le}(ke,Ge,Ne),Le.domBuilder=me.domBuilder||Ge,rt&&(He[""]=Ce.HTML),He.xml=He.xml||Ce.XML,ue&&"string"==typeof ue?Le.parse(ue,He,w):Le.errorHandler.error("invalid doc source"),Ge.doc},se.prototype={startDocument:function(){this.doc=(new te).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(ue,Oe,me,Le){var Ge=this.doc,ke=Ge.createElementNS(ue,me||Oe),Ne=Le.length;yt(this,ke),this.currentElement=ke,this.locator&&Ue(this.locator,ke);for(var He=0;He{var _e=j(9401).NAMESPACE;function B(C){return""!==C}function ve(C,A){return C.hasOwnProperty(A)||(C[A]=!0),C}function te(C){if(!C)return[];var A=function Ae(C){return C?C.split(/[\t\n\f\r ]+/).filter(B):[]}(C);return Object.keys(A.reduce(ve,{}))}function Ee(C,A){for(var R in C)A[R]=C[R]}function Te(C,A){var R=C.prototype;if(!(R instanceof A)){let ce=function(){};ce.prototype=A.prototype,ce=new ce,Ee(R,ce),C.prototype=R=ce}R.constructor!=C&&("function"!=typeof C&&console.error("unknown Class:"+C),R.constructor=C)}var pe={},u=pe.ELEMENT_NODE=1,se=pe.ATTRIBUTE_NODE=2,Ue=pe.TEXT_NODE=3,Ve=pe.CDATA_SECTION_NODE=4,it=pe.ENTITY_REFERENCE_NODE=5,yt=pe.ENTITY_NODE=6,ue=pe.PROCESSING_INSTRUCTION_NODE=7,Oe=pe.COMMENT_NODE=8,me=pe.DOCUMENT_NODE=9,Le=pe.DOCUMENT_TYPE_NODE=10,Ge=pe.DOCUMENT_FRAGMENT_NODE=11,ke=pe.NOTATION_NODE=12,Ne={},He={},D=(Ne.INDEX_SIZE_ERR=(He[1]="Index size error",1),Ne.DOMSTRING_SIZE_ERR=(He[2]="DOMString size error",2),Ne.HIERARCHY_REQUEST_ERR=(He[3]="Hierarchy request error",3)),le=(Ne.WRONG_DOCUMENT_ERR=(He[4]="Wrong document",4),Ne.INVALID_CHARACTER_ERR=(He[5]="Invalid character",5),Ne.NO_DATA_ALLOWED_ERR=(He[6]="No data allowed",6),Ne.NO_MODIFICATION_ALLOWED_ERR=(He[7]="No modification allowed",7),Ne.NOT_FOUND_ERR=(He[8]="Not found",8)),J=(Ne.NOT_SUPPORTED_ERR=(He[9]="Not supported",9),Ne.INUSE_ATTRIBUTE_ERR=(He[10]="Attribute in use",10));function qe(C,A){if(A instanceof Error)var R=A;else R=this,Error.call(this,He[C]),this.message=He[C],Error.captureStackTrace&&Error.captureStackTrace(this,qe);return R.code=C,A&&(this.message=this.message+": "+A),R}function We(){}function Me(C,A){this._node=C,this._refresh=A,Pt(this)}function Pt(C){var A=C._node._inc||C._node.ownerDocument._inc;if(C._inc!=A){var R=C._refresh(C._node);Ar(C,"length",R.length),Ee(R,C),C._inc=A}}function P(){}function St(C,A){for(var R=C.length;R--;)if(C[R]===A)return R}function K(C,A,R,Z){if(Z?A[St(A,Z)]=R:A[A.length++]=R,C){R.ownerElement=C;var ce=C.ownerDocument;ce&&(Z&&$i(ce,C,Z),function Ct(C,A,R){C&&C._inc++,R.namespaceURI===_e.XMLNS&&(A._nsMap[R.prefix?R.localName:""]=R.value)}(ce,C,R))}}function gt(C,A,R){var Z=St(A,R);if(!(Z>=0))throw qe(le,new Error(C.tagName+"@"+R));for(var ce=A.length-1;Z"==C&&">")||"&"==C&&"&"||'"'==C&&"""||"&#"+C.charCodeAt()+";"}function lt(C,A){if(A(C))return!0;if(C=C.firstChild)do{if(lt(C,A))return!0}while(C=C.nextSibling)}function ie(){}function $i(C,A,R,Z){C&&C._inc++,R.namespaceURI===_e.XMLNS&&delete A._nsMap[R.prefix?R.localName:""]}function Yi(C,A,R){if(C&&C._inc){C._inc++;var Z=A.childNodes;if(R)Z[Z.length++]=R;else{for(var ce=A.firstChild,Ke=0;ce;)Z[Ke++]=ce,ce=ce.nextSibling;Z.length=Ke}}}function ki(C,A){var R=A.previousSibling,Z=A.nextSibling;return R?R.nextSibling=Z:C.firstChild=Z,Z?Z.previousSibling=R:C.lastChild=R,Yi(C.ownerDocument,C),A}function Xi(C,A,R){var Z=A.parentNode;if(Z&&Z.removeChild(A),A.nodeType===Ge){var ce=A.firstChild;if(null==ce)return A;var Ke=A.lastChild}else ce=Ke=A;var Qe=R?R.previousSibling:C.lastChild;ce.previousSibling=Qe,Ke.nextSibling=R,Qe?Qe.nextSibling=ce:C.firstChild=ce,null==R?C.lastChild=Ke:R.previousSibling=Ke;do{ce.parentNode=C}while(ce!==Ke&&(ce=ce.nextSibling));return Yi(C.ownerDocument||C,C),A.nodeType==Ge&&(A.firstChild=A.lastChild=null),A}function vt(){this._nsMap={}}function oi(){}function Qi(){}function rn(){}function xr(){}function Sr(){}function Er(){}function Ji(){}function Cr(){}function nn(){}function er(){}function an(){}function Bn(){}function kr(C,A){var R=[],Z=9==this.nodeType&&this.documentElement||this,ce=Z.prefix,Ke=Z.namespaceURI;if(Ke&&null==ce&&null==(ce=Z.lookupPrefix(Ke)))var Qe=[{namespace:Ke,prefix:null}];return Vi(this,R,C,A,Qe),R.join("")}function Hn(C,A,R){var Z=C.prefix||"",ce=C.namespaceURI;if(!ce||"xml"===Z&&ce===_e.XML||ce===_e.XMLNS)return!1;for(var Ke=R.length;Ke--;){var Qe=R[Ke];if(Qe.prefix===Z)return Qe.namespace!==ce}return!0}function Ut(C,A,R){C.push(" ",A,'="',R.replace(/[<&"]/g,Fe),'"')}function Vi(C,A,R,Z,ce){if(ce||(ce=[]),Z){if(!(C=Z(C)))return;if("string"==typeof C)return void A.push(C)}switch(C.nodeType){case u:var Ke=C.attributes,Qe=Ke.length,At=C.firstChild,ui=C.tagName,tr=ui;if(!(R=_e.isHTML(C.namespaceURI)||R)&&!C.prefix&&C.namespaceURI){for(var li,di=0;di=0;Yt--)if(""===(ii=ce[Yt]).prefix&&ii.namespace===C.namespaceURI){li=ii.namespace;break}if(li!==C.namespaceURI)for(Yt=ce.length-1;Yt>=0;Yt--){var ii;if((ii=ce[Yt]).namespace===C.namespaceURI){ii.prefix&&(tr=ii.prefix+":"+ui);break}}}A.push("<",tr);for(var ci=0;ci"),R&&/^script$/i.test(ui))for(;At;)At.data?A.push(At.data):Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;else for(;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;A.push("")}else A.push("/>");return;case me:case Ge:for(At=C.firstChild;At;)Vi(At,A,R,Z,ce.slice()),At=At.nextSibling;return;case se:return Ut(A,C.name,C.value);case Ue:return A.push(C.data.replace(/[<&]/g,Fe).replace(/]]>/g,"]]>"));case Ve:return A.push("");case Oe:return A.push("\x3c!--",C.data,"--\x3e");case Le:var sn=C.publicId,qi=C.systemId;if(A.push("");else if(qi&&"."!=qi)A.push(" SYSTEM ",qi,">");else{var Vn=C.internalSubset;Vn&&A.push(" [",Vn,"]"),A.push(">")}return;case ue:return A.push("");case it:return A.push("&",C.nodeName,";");default:A.push("??",C.nodeName)}}function jn(C,A,R){var Z;switch(A.nodeType){case u:(Z=A.cloneNode(!1)).ownerDocument=C;case Ge:break;case se:R=!0}if(Z||(Z=A.cloneNode(!1)),Z.ownerDocument=C,Z.parentNode=null,R)for(var ce=A.firstChild;ce;)Z.appendChild(jn(C,ce,R)),ce=ce.nextSibling;return Z}function _i(C,A,R){var Z=new A.constructor;for(var ce in A){var Ke=A[ce];"object"!=typeof Ke&&Ke!=Z[ce]&&(Z[ce]=Ke)}switch(A.childNodes&&(Z.childNodes=new We),Z.ownerDocument=C,Z.nodeType){case u:var Qe=A.attributes,ui=Z.attributes=new P,tr=Qe.length;ui._ownerElement=Z;for(var li=0;li0},lookupPrefix:function(C){for(var A=this;A;){var R=A._nsMap;if(R)for(var Z in R)if(R[Z]==C)return Z;A=A.nodeType==se?A.ownerDocument:A.parentNode}return null},lookupNamespaceURI:function(C){for(var A=this;A;){var R=A._nsMap;if(R&&C in R)return R[C];A=A.nodeType==se?A.ownerDocument:A.parentNode}return null},isDefaultNamespace:function(C){return null==this.lookupPrefix(C)}},Ee(pe,Ie),Ee(pe,Ie.prototype),ie.prototype={nodeName:"#document",nodeType:me,doctype:null,documentElement:null,_inc:1,insertBefore:function(C,A){if(C.nodeType==Ge){for(var R=C.firstChild;R;){var Z=R.nextSibling;this.insertBefore(R,A),R=Z}return C}return null==this.documentElement&&C.nodeType==u&&(this.documentElement=C),Xi(this,C,A),C.ownerDocument=this,C},removeChild:function(C){return this.documentElement==C&&(this.documentElement=null),ki(this,C)},importNode:function(C,A){return jn(this,C,A)},getElementById:function(C){var A=null;return lt(this.documentElement,function(R){if(R.nodeType==u&&R.getAttribute("id")==C)return A=R,!0}),A},getElementsByClassName:function(C){var A=te(C);return new Me(this,function(R){var Z=[];return A.length>0&<(R.documentElement,function(ce){if(ce!==R&&ce.nodeType===u){var Ke=ce.getAttribute("class");if(Ke){var Qe=C===Ke;if(!Qe){var ui=te(Ke);Qe=A.every(function Ce(C){return function(A){return C&&-1!==C.indexOf(A)}}(ui))}Qe&&Z.push(ce)}}}),Z})},createElement:function(C){var A=new vt;return A.ownerDocument=this,A.nodeName=C,A.tagName=C,A.localName=C,A.childNodes=new We,(A.attributes=new P)._ownerElement=A,A},createDocumentFragment:function(){var C=new er;return C.ownerDocument=this,C.childNodes=new We,C},createTextNode:function(C){var A=new rn;return A.ownerDocument=this,A.appendData(C),A},createComment:function(C){var A=new xr;return A.ownerDocument=this,A.appendData(C),A},createCDATASection:function(C){var A=new Sr;return A.ownerDocument=this,A.appendData(C),A},createProcessingInstruction:function(C,A){var R=new an;return R.ownerDocument=this,R.tagName=R.target=C,R.nodeValue=R.data=A,R},createAttribute:function(C){var A=new oi;return A.ownerDocument=this,A.name=C,A.nodeName=C,A.localName=C,A.specified=!0,A},createEntityReference:function(C){var A=new nn;return A.ownerDocument=this,A.nodeName=C,A},createElementNS:function(C,A){var R=new vt,Z=A.split(":"),ce=R.attributes=new P;return R.childNodes=new We,R.ownerDocument=this,R.nodeName=A,R.tagName=A,R.namespaceURI=C,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,ce._ownerElement=R,R},createAttributeNS:function(C,A){var R=new oi,Z=A.split(":");return R.ownerDocument=this,R.nodeName=A,R.name=A,R.namespaceURI=C,R.specified=!0,2==Z.length?(R.prefix=Z[0],R.localName=Z[1]):R.localName=A,R}},Te(ie,Ie),ie.prototype.getElementsByTagName=(vt.prototype={nodeType:u,hasAttribute:function(C){return null!=this.getAttributeNode(C)},getAttribute:function(C){var A=this.getAttributeNode(C);return A&&A.value||""},getAttributeNode:function(C){return this.attributes.getNamedItem(C)},setAttribute:function(C,A){var R=this.ownerDocument.createAttribute(C);R.value=R.nodeValue=""+A,this.setAttributeNode(R)},removeAttribute:function(C){var A=this.getAttributeNode(C);A&&this.removeAttributeNode(A)},appendChild:function(C){return C.nodeType===Ge?this.insertBefore(C,null):function nt(C,A){var R=A.parentNode;if(R){var Z=C.lastChild;R.removeChild(A),Z=C.lastChild}return Z=C.lastChild,A.parentNode=C,A.previousSibling=Z,A.nextSibling=null,Z?Z.nextSibling=A:C.firstChild=A,C.lastChild=A,Yi(C.ownerDocument,C,A),A}(this,C)},setAttributeNode:function(C){return this.attributes.setNamedItem(C)},setAttributeNodeNS:function(C){return this.attributes.setNamedItemNS(C)},removeAttributeNode:function(C){return this.attributes.removeNamedItem(C.nodeName)},removeAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);R&&this.removeAttributeNode(R)},hasAttributeNS:function(C,A){return null!=this.getAttributeNodeNS(C,A)},getAttributeNS:function(C,A){var R=this.getAttributeNodeNS(C,A);return R&&R.value||""},setAttributeNS:function(C,A,R){var Z=this.ownerDocument.createAttributeNS(C,A);Z.value=Z.nodeValue=""+R,this.setAttributeNode(Z)},getAttributeNodeNS:function(C,A){return this.attributes.getNamedItemNS(C,A)},getElementsByTagName:function(C){return new Me(this,function(A){var R=[];return lt(A,function(Z){Z!==A&&Z.nodeType==u&&("*"===C||Z.tagName==C)&&R.push(Z)}),R})},getElementsByTagNameNS:function(C,A){return new Me(this,function(R){var Z=[];return lt(R,function(ce){ce!==R&&ce.nodeType===u&&("*"===C||ce.namespaceURI===C)&&("*"===A||ce.localName==A)&&Z.push(ce)}),Z})}}).getElementsByTagName,ie.prototype.getElementsByTagNameNS=vt.prototype.getElementsByTagNameNS,Te(vt,Ie),oi.prototype.nodeType=se,Te(oi,Ie),Qi.prototype={data:"",substringData:function(C,A){return this.data.substring(C,C+A)},appendData:function(C){this.nodeValue=this.data=C=this.data+C,this.length=C.length},insertData:function(C,A){this.replaceData(C,0,A)},appendChild:function(C){throw new Error(He[D])},deleteData:function(C,A){this.replaceData(C,A,"")},replaceData:function(C,A,R){var Z=this.data.substring(0,C),ce=this.data.substring(C+A);this.nodeValue=this.data=R=Z+R+ce,this.length=R.length}},Te(Qi,Ie),rn.prototype={nodeName:"#text",nodeType:Ue,splitText:function(C){var A=this.data,R=A.substring(C);A=A.substring(0,C),this.data=this.nodeValue=A,this.length=A.length;var Z=this.ownerDocument.createTextNode(R);return this.parentNode&&this.parentNode.insertBefore(Z,this.nextSibling),Z}},Te(rn,Qi),xr.prototype={nodeName:"#comment",nodeType:Oe},Te(xr,Qi),Sr.prototype={nodeName:"#cdata-section",nodeType:Ve},Te(Sr,Qi),Er.prototype.nodeType=Le,Te(Er,Ie),Ji.prototype.nodeType=ke,Te(Ji,Ie),Cr.prototype.nodeType=yt,Te(Cr,Ie),nn.prototype.nodeType=it,Te(nn,Ie),er.prototype.nodeName="#document-fragment",er.prototype.nodeType=Ge,Te(er,Ie),an.prototype.nodeType=ue,Te(an,Ie),Bn.prototype.serializeToString=function(C,A,R){return kr.call(C,A,R)},Ie.prototype.toString=kr;try{if(Object.defineProperty){let C=function(A){switch(A.nodeType){case u:case Ge:var R=[];for(A=A.firstChild;A;)7!==A.nodeType&&8!==A.nodeType&&R.push(C(A)),A=A.nextSibling;return R.join("");default:return A.nodeValue}};Object.defineProperty(Me.prototype,"length",{get:function(){return Pt(this),this.$$length}}),Object.defineProperty(Ie.prototype,"textContent",{get:function(){return C(this)},set:function(A){switch(this.nodeType){case u:case Ge:for(;this.firstChild;)this.removeChild(this.firstChild);(A||String(A))&&this.appendChild(this.ownerDocument.createTextNode(A));break;default:this.data=A,this.value=A,this.nodeValue=A}}}),Ar=function(A,R,Z){A["$$"+R]=Z}}}catch(C){}we.DocumentType=Er,we.DOMException=qe,we.DOMImplementation=vi,we.Element=vt,we.Node=Ie,we.NodeList=We,we.XMLSerializer=Bn},4436:(je,we,j)=>{var Q=j(9401).freeze;we.XML_ENTITIES=Q({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),we.HTML_ENTITIES=Q({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xc0",Aacute:"\xc1",Acirc:"\xc2",Atilde:"\xc3",Auml:"\xc4",Aring:"\xc5",AElig:"\xc6",Ccedil:"\xc7",Egrave:"\xc8",Eacute:"\xc9",Ecirc:"\xca",Euml:"\xcb",Igrave:"\xcc",Iacute:"\xcd",Icirc:"\xce",Iuml:"\xcf",ETH:"\xd0",Ntilde:"\xd1",Ograve:"\xd2",Oacute:"\xd3",Ocirc:"\xd4",Otilde:"\xd5",Ouml:"\xd6",Oslash:"\xd8",Ugrave:"\xd9",Uacute:"\xda",Ucirc:"\xdb",Uuml:"\xdc",Yacute:"\xdd",THORN:"\xde",szlig:"\xdf",agrave:"\xe0",aacute:"\xe1",acirc:"\xe2",atilde:"\xe3",auml:"\xe4",aring:"\xe5",aelig:"\xe6",ccedil:"\xe7",egrave:"\xe8",eacute:"\xe9",ecirc:"\xea",euml:"\xeb",igrave:"\xec",iacute:"\xed",icirc:"\xee",iuml:"\xef",eth:"\xf0",ntilde:"\xf1",ograve:"\xf2",oacute:"\xf3",ocirc:"\xf4",otilde:"\xf5",ouml:"\xf6",oslash:"\xf8",ugrave:"\xf9",uacute:"\xfa",ucirc:"\xfb",uuml:"\xfc",yacute:"\xfd",thorn:"\xfe",yuml:"\xff",nbsp:"\xa0",iexcl:"\xa1",cent:"\xa2",pound:"\xa3",curren:"\xa4",yen:"\xa5",brvbar:"\xa6",sect:"\xa7",uml:"\xa8",copy:"\xa9",ordf:"\xaa",laquo:"\xab",not:"\xac",shy:"\xad\xad",reg:"\xae",macr:"\xaf",deg:"\xb0",plusmn:"\xb1",sup2:"\xb2",sup3:"\xb3",acute:"\xb4",micro:"\xb5",para:"\xb6",middot:"\xb7",cedil:"\xb8",sup1:"\xb9",ordm:"\xba",raquo:"\xbb",frac14:"\xbc",frac12:"\xbd",frac34:"\xbe",iquest:"\xbf",times:"\xd7",divide:"\xf7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220b",prod:"\u220f",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221a",prop:"\u221d",infin:"\u221e",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222a",int:"\u222b",there4:"\u2234",sim:"\u223c",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22a5",sdot:"\u22c5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9",alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigmaf:"\u03c2",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",thetasym:"\u03d1",upsih:"\u03d2",piv:"\u03d6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02c6",tilde:"\u02dc",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200c",zwj:"\u200d",lrm:"\u200e",rlm:"\u200f",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201a",ldquo:"\u201c",rdquo:"\u201d",bdquo:"\u201e",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203a",oline:"\u203e",euro:"\u20ac",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21b5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230a",rfloor:"\u230b",loz:"\u25ca",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),we.entityMap=we.HTML_ENTITIES},978:(je,we,j)=>{j(6853);we.DOMParser=j(1991).DOMParser},8702:(je,we,j)=>{var Q=j(9401).NAMESPACE,_e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,B=new RegExp("[\\-\\.0-9"+_e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Ae=new RegExp("^"+_e.source+B.source+"*(?::"+_e.source+B.source+"*)?$");function Ue(w,D){this.message=w,this.locator=D,Error.captureStackTrace&&Error.captureStackTrace(this,Ue)}function Ve(){}function yt(w,D){return D.lineNumber=w.lineNumber,D.columnNumber=w.columnNumber,D}function ue(w,D,V,ee,Y,de){function le(Ze,qe,We){V.attributeNames.hasOwnProperty(Ze)&&de.fatalError("Attribute "+Ze+" redefined"),V.addValue(Ze,qe,We)}for(var xe,re=++D,X=0;;){var oe=w.charAt(re);switch(oe){case"=":if(1===X)xe=w.slice(D,re),X=3;else{if(2!==X)throw new Error("attribute equal must after attrName");X=3}break;case"'":case'"':if(3===X||1===X){if(1===X&&(de.warning('attribute value must after "="'),xe=w.slice(D,re)),!((re=w.indexOf(oe,D=re+1))>0))throw new Error("attribute value no end '"+oe+"' match");le(xe,J=w.slice(D,re).replace(/&#?\w+;/g,Y),D-1),X=5}else{if(4!=X)throw new Error('attribute value must after "="');le(xe,J=w.slice(D,re).replace(/&#?\w+;/g,Y),D),de.warning('attribute "'+xe+'" missed start quot('+oe+")!!"),D=re+1,X=5}break;case"/":switch(X){case 0:V.setTagName(w.slice(D,re));case 5:case 6:case 7:X=7,V.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return de.error("unexpected end of input"),0==X&&V.setTagName(w.slice(D,re)),re;case">":switch(X){case 0:V.setTagName(w.slice(D,re));case 5:case 6:case 7:break;case 4:case 1:"/"===(J=w.slice(D,re)).slice(-1)&&(V.closed=!0,J=J.slice(0,-1));case 2:2===X&&(J=xe),4==X?(de.warning('attribute "'+J+'" missed quot(")!'),le(xe,J.replace(/&#?\w+;/g,Y),D)):((!Q.isHTML(ee[""])||!J.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+J+'" missed value!! "'+J+'" instead!!'),le(J,J,D));break;case 3:throw new Error("attribute value missed!!")}return re;case"\x80":oe=" ";default:if(oe<=" ")switch(X){case 0:V.setTagName(w.slice(D,re)),X=6;break;case 1:xe=w.slice(D,re),X=2;break;case 4:var J=w.slice(D,re).replace(/&#?\w+;/g,Y);de.warning('attribute "'+J+'" missed quot(")!!'),le(xe,J,D);case 5:X=6}else switch(X){case 2:(!Q.isHTML(ee[""])||!xe.match(/^(?:disabled|checked|selected)$/i))&&de.warning('attribute "'+xe+'" missed value!! "'+xe+'" instead2!!'),le(xe,xe,D),D=re,X=1;break;case 5:de.warning('attribute space is required"'+xe+'"!!');case 6:X=1,D=re;break;case 3:X=4,D=re;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}re++}}function Oe(w,D,V){for(var ee=w.tagName,Y=null,oe=w.length;oe--;){var de=w[oe],le=de.qName,xe=de.value;if((De=le.indexOf(":"))>0)var J=de.prefix=le.slice(0,De),re=le.slice(De+1),X="xmlns"===J&&re;else re=le,J=null,X="xmlns"===le&&"";de.localName=re,!1!==X&&(null==Y&&(Y={},Ge(V,V={})),V[X]=Y[X]=xe,de.uri=Q.XMLNS,D.startPrefixMapping(X,xe))}for(oe=w.length;oe--;)(J=(de=w[oe]).prefix)&&("xml"===J&&(de.uri=Q.XML),"xmlns"!==J&&(de.uri=V[J||""]));var De;(De=ee.indexOf(":"))>0?(J=w.prefix=ee.slice(0,De),re=w.localName=ee.slice(De+1)):(J=null,re=w.localName=ee);var Ze=w.uri=V[J||""];if(D.startElement(Ze,re,ee,w),!w.closed)return w.currentNSMap=V,w.localNSMap=Y,!0;if(D.endElement(Ze,re,ee),Y)for(J in Y)D.endPrefixMapping(J)}function me(w,D,V,ee,Y){if(/^(?:script|textarea)$/i.test(V)){var de=w.indexOf("",D),le=w.substring(D+1,de);if(/[&<]/.test(le))return/^script$/i.test(V)?(Y.characters(le,0,le.length),de):(le=le.replace(/&#?\w+;/g,ee),Y.characters(le,0,le.length),de)}return D+1}function Le(w,D,V,ee){var Y=ee[V];return null==Y&&((Y=w.lastIndexOf(""))D?(V.comment(w,D+4,de-D-4),de+3):(ee.error("Unclosed comment"),-1):-1;if("CDATA["==w.substr(D+3,6)){var de=w.indexOf("]]>",D+9);return V.startCDATA(),V.characters(w,D+9,de-D-9),V.endCDATA(),de+3}var le=function rt(w,D){var V,ee=[],Y=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Y.lastIndex=D,Y.exec(w);V=Y.exec(w);)if(ee.push(V),V[1])return ee}(w,D),xe=le.length;if(xe>1&&/!doctype/i.test(le[0][0])){var J=le[1][0],re=!1,X=!1;xe>3&&(/^public$/i.test(le[2][0])?(re=le[3][0],X=xe>4&&le[4][0]):/^system$/i.test(le[2][0])&&(X=le[3][0]));var oe=le[xe-1];return V.startDTD(J,re,X),V.endDTD(),oe.index+oe[0].length}return-1}function Ne(w,D,V){var ee=w.indexOf("?>",D);if(ee){var Y=w.substring(D,ee).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Y?(V.processingInstruction(Y[1],Y[2]),ee+2):-1}return-1}function He(){this.attributeNames={}}(Ue.prototype=new Error).name=Ue.name,Ve.prototype={parse:function(w,D,V){var ee=this.domBuilder;ee.startDocument(),Ge(D,D={}),function it(w,D,V,ee,Y){function le(nt){var vt=nt.slice(1,-1);return vt in V?V[vt]:"#"===vt.charAt(0)?function de(nt){return nt>65535?(nt-=65536,String.fromCharCode(55296+(nt>>10),56320+(1023&nt))):String.fromCharCode(nt)}(parseInt(vt.substr(1).replace("x","0x"))):(Y.error("entity not found:"+nt),nt)}function xe(nt){if(nt>We){var vt=w.substring(We,nt).replace(/&#?\w+;/g,le);De&&J(We),ee.characters(vt,0,nt-We),We=nt}}function J(nt,vt){for(;nt>=X&&(vt=oe.exec(w));)X=(re=vt.index)+vt[0].length,De.lineNumber++;De.columnNumber=nt-re+1}for(var re=0,X=0,oe=/.*(?:\r\n?|\n)|.*$/g,De=ee.locator,Ze=[{currentNSMap:D}],qe={},We=0;;){try{var Me=w.indexOf("<",We);if(Me<0){if(!w.substr(We).match(/^\s*$/)){var Pt=ee.doc,P=Pt.createTextNode(w.substr(We));Pt.appendChild(P),ee.currentElement=P}return}switch(Me>We&&xe(Me),w.charAt(Me+1)){case"/":var Ct=w.indexOf(">",Me+3),St=w.substring(Me+2,Ct).replace(/[ \t\n\r]+$/g,""),K=Ze.pop();Ct<0?(St=w.substring(Me+2).replace(/[\s<].*/,""),Y.error("end tag name: "+St+" is not complete:"+K.tagName),Ct=Me+1+St.length):St.match(/\sWe?We=Ct:xe(Math.max(Me,We)+1)}}(w,D,V,ee,this.errorHandler),ee.endDocument()}},He.prototype={setTagName:function(w){if(!Ae.test(w))throw new Error("invalid tagName:"+w);this.tagName=w},addValue:function(w,D,V){if(!Ae.test(w))throw new Error("invalid attribute:"+w);this.attributeNames[w]=this.length,this[this.length++]={qName:w,value:D,offset:V}},length:0,getLocalName:function(w){return this[w].localName},getLocator:function(w){return this[w].locator},getQName:function(w){return this[w].qName},getURI:function(w){return this[w].uri},getValue:function(w){return this[w].value}},we.XMLReader=Ve,we.ParseError=Ue},1421:(je,we,j)=>{var B,Q="undefined"!=typeof global?global:"undefined"!=typeof window?window:{},_e=j(5893);"undefined"!=typeof document?B=document:(B=Q["__GLOBAL_DOCUMENT_CACHE@4"])||(B=Q["__GLOBAL_DOCUMENT_CACHE@4"]=_e),je.exports=B},9226:je=>{var we;we="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},je.exports=we},2703:je=>{je.exports=function j(Q){if(!Q)return!1;var _e=we.call(Q);return"[object Function]"===_e||"function"==typeof Q&&"[object RegExp]"!==_e||"undefined"!=typeof window&&(Q===window.setTimeout||Q===window.alert||Q===window.confirm||Q===window.prompt)};var we=Object.prototype.toString},1234:(je,we)=>{function j(te){if(te&&"object"==typeof te){var Ce=te.which||te.keyCode||te.charCode;Ce&&(te=Ce)}if("number"==typeof te)return Ae[te];var Te,Ee=String(te);return(Te=Q[Ee.toLowerCase()])?Te:(Te=_e[Ee.toLowerCase()])||(1===Ee.length?Ee.charCodeAt(0):void 0)}j.isEventKey=function(Ce,Ee){if(Ce&&"object"==typeof Ce){var Te=Ce.which||Ce.keyCode||Ce.charCode;if(null==Te)return!1;if("string"==typeof Ee){var pe;if(pe=Q[Ee.toLowerCase()])return pe===Te;if(pe=_e[Ee.toLowerCase()])return pe===Te}else if("number"==typeof Ee)return Ee===Te;return!1}};var Q=(we=je.exports=j).code=we.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},_e=we.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(B=97;B<123;B++)Q[String.fromCharCode(B)]=B-32;for(var B=48;B<58;B++)Q[B-48]=B;for(B=1;B<13;B++)Q["f"+B]=B+111;for(B=0;B<10;B++)Q["numpad "+B]=B+96;var Ae=we.names=we.title={};for(B in Q)Ae[Q[B]]=B;for(var ve in _e)Q[ve]=_e[ve]},7459:(je,we,j)=>{var Q=j(3357).getUint64;je.exports=function(B){var Ae=new DataView(B.buffer,B.byteOffset,B.byteLength),ve={version:B[0],flags:new Uint8Array(B.subarray(1,4)),references:[],referenceId:Ae.getUint32(4),timescale:Ae.getUint32(8)},te=12;0===ve.version?(ve.earliestPresentationTime=Ae.getUint32(te),ve.firstOffset=Ae.getUint32(te+4),te+=8):(ve.earliestPresentationTime=Q(B.subarray(te)),ve.firstOffset=Q(B.subarray(te+8)),te+=16);var Ce=Ae.getUint16(te+=2);for(te+=2;Ce>0;te+=12,Ce--)ve.references.push({referenceType:(128&B[te])>>>7,referencedSize:2147483647&Ae.getUint32(te),subsegmentDuration:Ae.getUint32(te+4),startsWithSap:!!(128&B[te+8]),sapType:(112&B[te+8])>>>4,sapDeltaTime:268435455&Ae.getUint32(te+8)});return ve}},6277:je=>{var j,Q,_e,B,Ae,ve,te;Ae=function(Ce,Ee){return j(B(Ce,Ee))},ve=function(Ce,Ee){return Q(_e(Ce),Ee)},te=function(Ce,Ee,Te){return _e(Te?Ce:Ce-Ee)},je.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:j=function(Ce){return 9e4*Ce},secondsToAudioTs:Q=function(Ce,Ee){return Ce*Ee},videoTsToSeconds:_e=function(Ce){return Ce/9e4},audioTsToSeconds:B=function(Ce,Ee){return Ce/Ee},audioTsToVideoTs:Ae,videoTsToAudioTs:ve,metadataTsToSeconds:te}},3357:je=>{var we=Math.pow(2,32);je.exports={getUint64:function(Q){var B,_e=new DataView(Q.buffer,Q.byteOffset,Q.byteLength);return _e.getBigUint64?(B=_e.getBigUint64(0)){je.exports=function we(j,Q){var _e,B=null;try{_e=JSON.parse(j,Q)}catch(Ae){B=Ae}return[B,_e]}},3871:function(je){var j,Q,_e,B,Ae;j=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Q=/^(?=([^\/?#]*))\1([^]*)$/,_e=/(?:\/|^)\.(?=\/)/g,B=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,je.exports=Ae={buildAbsoluteURL:function(ve,te,Ce){if(Ce=Ce||{},ve=ve.trim(),!(te=te.trim())){if(!Ce.alwaysNormalize)return ve;var Ee=Ae.parseURL(ve);if(!Ee)throw new Error("Error trying to parse base URL.");return Ee.path=Ae.normalizePath(Ee.path),Ae.buildURLFromParts(Ee)}var Te=Ae.parseURL(te);if(!Te)throw new Error("Error trying to parse relative URL.");if(Te.scheme)return Ce.alwaysNormalize?(Te.path=Ae.normalizePath(Te.path),Ae.buildURLFromParts(Te)):te;var pe=Ae.parseURL(ve);if(!pe)throw new Error("Error trying to parse base URL.");if(!pe.netLoc&&pe.path&&"/"!==pe.path[0]){var u=Q.exec(pe.path);pe.netLoc=u[1],pe.path=u[2]}pe.netLoc&&!pe.path&&(pe.path="/");var se={scheme:pe.scheme,netLoc:Te.netLoc,path:null,params:Te.params,query:Te.query,fragment:Te.fragment};if(!Te.netLoc&&(se.netLoc=pe.netLoc,"/"!==Te.path[0]))if(Te.path){var Ue=pe.path,Ve=Ue.substring(0,Ue.lastIndexOf("/")+1)+Te.path;se.path=Ae.normalizePath(Ve)}else se.path=pe.path,Te.params||(se.params=pe.params,Te.query||(se.query=pe.query));return null===se.path&&(se.path=Ce.alwaysNormalize?Ae.normalizePath(Te.path):Te.path),Ae.buildURLFromParts(se)},parseURL:function(ve){var te=j.exec(ve);return te?{scheme:te[1]||"",netLoc:te[2]||"",path:te[3]||"",params:te[4]||"",query:te[5]||"",fragment:te[6]||""}:null},normalizePath:function(ve){for(ve=ve.split("").reverse().join("").replace(_e,"");ve.length!==(ve=ve.replace(B,"")).length;);return ve.split("").reverse().join("")},buildURLFromParts:function(ve){return ve.scheme+ve.netLoc+ve.path+ve.params+ve.query+ve.fragment}}},3629:(je,we,j)=>{var Q=j(9226),_e=je.exports={WebVTT:j(8318),VTTCue:j(5713),VTTRegion:j(3872)};Q.vttjs=_e,Q.WebVTT=_e.WebVTT;var B=_e.VTTCue,Ae=_e.VTTRegion,ve=Q.VTTCue,te=Q.VTTRegion;_e.shim=function(){Q.VTTCue=B,Q.VTTRegion=Ae},_e.restore=function(){Q.VTTCue=ve,Q.VTTRegion=te},Q.VTTCue||_e.shim()},8318:(je,we,j)=>{var Q=j(1421),_e=Object.create||function(){function w(){}return function(D){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return w.prototype=D,new w}}();function B(w,D){this.name="ParsingError",this.code=w.code,this.message=D||w.message}function Ae(w){function D(ee,Y,de,le){return 3600*(0|ee)+60*(0|Y)+(0|de)+(0|le)/1e3}var V=w.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return V?V[3]?D(V[1],V[2],V[3].replace(":",""),V[4]):V[1]>59?D(V[1],V[2],0,V[4]):D(0,V[1],V[2],V[4]):null}function ve(){this.values=_e(null)}function te(w,D,V,ee){var Y=ee?w.split(ee):[w];for(var de in Y)if("string"==typeof Y[de]){var le=Y[de].split(V);2===le.length&&D(le[0],le[1])}}function Ce(w,D,V){var ee=w;function Y(){var xe=Ae(w);if(null===xe)throw new B(B.Errors.BadTimeStamp,"Malformed timestamp: "+ee);return w=w.replace(/^[^\sa-zA-Z-]+/,""),xe}function le(){w=w.replace(/^\s+/,"")}if(le(),D.startTime=Y(),le(),"--\x3e"!==w.substr(0,3))throw new B(B.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+ee);w=w.substr(3),le(),D.endTime=Y(),le(),function de(xe,J){var re=new ve;te(xe,function(X,oe){switch(X){case"region":for(var De=V.length-1;De>=0;De--)if(V[De].id===oe){re.set(X,V[De].region);break}break;case"vertical":re.alt(X,oe,["rl","lr"]);break;case"line":var Ze=oe.split(","),qe=Ze[0];re.integer(X,qe),re.percent(X,qe)&&re.set("snapToLines",!1),re.alt(X,qe,["auto"]),2===Ze.length&&re.alt("lineAlign",Ze[1],["start","center","end"]);break;case"position":Ze=oe.split(","),re.percent(X,Ze[0]),2===Ze.length&&re.alt("positionAlign",Ze[1],["start","center","end"]);break;case"size":re.percent(X,oe);break;case"align":re.alt(X,oe,["start","center","end","left","right"])}},/:/,/\s/),J.region=re.get("region",null),J.vertical=re.get("vertical","");try{J.line=re.get("line","auto")}catch(X){}J.lineAlign=re.get("lineAlign","start"),J.snapToLines=re.get("snapToLines",!0),J.size=re.get("size",100);try{J.align=re.get("align","center")}catch(X){J.align=re.get("align","middle")}try{J.position=re.get("position","auto")}catch(X){J.position=re.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},J.align)}J.positionAlign=re.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},J.align)}(w,D)}(B.prototype=_e(Error.prototype)).constructor=B,B.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ve.prototype={set:function(w,D){!this.get(w)&&""!==D&&(this.values[w]=D)},get:function(w,D,V){return V?this.has(w)?this.values[w]:D[V]:this.has(w)?this.values[w]:D},has:function(w){return w in this.values},alt:function(w,D,V){for(var ee=0;ee=0&&D<=100))&&(this.set(w,D),!0)}};var Ee=Q.createElement&&Q.createElement("textarea"),Te={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},pe={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},u={v:"title",lang:"lang"},se={rt:"ruby"};function Ue(w,D){function V(){if(!D)return null;var We=D.match(/^([^<]*)(<[^>]*>?)?/);return function qe(Me){return D=D.substr(Me.length),Me}(We[1]?We[1]:We[2])}function ee(qe){return Ee.innerHTML=qe,qe=Ee.textContent,Ee.textContent="",qe}function de(qe,We){var Me=Te[qe];if(!Me)return null;var Pt=w.document.createElement(Me),P=u[qe];return P&&We&&(Pt[P]=We.trim()),Pt}for(var J,le=w.document.createElement("div"),xe=le,re=[];null!==(J=V());)if("<"!==J[0])xe.appendChild(w.document.createTextNode(ee(J)));else{if("/"===J[1]){re.length&&re[re.length-1]===J.substr(2).replace(">","")&&(re.pop(),xe=xe.parentNode);continue}var oe,X=Ae(J.substr(1,J.length-2));if(X){oe=w.document.createProcessingInstruction("timestamp",X),xe.appendChild(oe);continue}var De=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!De||!(oe=de(De[1],De[3]))||se[(We=oe).localName]&&se[We.localName]!==xe.localName)continue;if(De[2]){var Ze=De[2].split(".");Ze.forEach(function(qe){var We=/^bg_/.test(qe),Me=We?qe.slice(3):qe;pe.hasOwnProperty(Me)&&(oe.style[We?"background-color":"color"]=pe[Me])}),oe.className=Ze.join(" ")}re.push(De[1]),xe.appendChild(oe),xe=oe}var We;return le}var Ve=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function it(w){for(var D=0;D=V[0]&&w<=V[1])return!0}return!1}function yt(w){var D=[],V="";if(!w||!w.childNodes)return"ltr";function Y(xe,J){for(var re=J.childNodes.length-1;re>=0;re--)xe.push(J.childNodes[re])}function de(xe){if(!xe||!xe.length)return null;var J=xe.pop(),re=J.textContent||J.innerText;if(re){var X=re.match(/^.*(\n|\r)/);return X?(xe.length=0,X[0]):re}return"ruby"===J.tagName?de(xe):J.childNodes?(Y(xe,J),de(xe)):void 0}for(Y(D,w);V=de(D);)for(var le=0;le=0&&w.line<=100))return w.line;if(!w.track||!w.track.textTrackList||!w.track.textTrackList.mediaElement)return-1;for(var D=w.track,V=D.textTrackList,ee=0,Y=0;YDe&&(oe=oe<0?-1:1,oe*=Math.ceil(De/X)*X),xe<0&&(oe+=""===le.vertical?V.height:V.width,J=J.reverse()),de.move(Ze,oe)}else{var qe=de.lineHeight/V.height*100;switch(le.lineAlign){case"center":xe-=qe/2;break;case"end":xe-=qe}switch(le.vertical){case"":D.applyStyles({top:D.formatStyle(xe,"%")});break;case"rl":D.applyStyles({left:D.formatStyle(xe,"%")});break;case"lr":D.applyStyles({right:D.formatStyle(xe,"%")})}J=["+y","-x","+x","-y"],de=new Le(D)}var We=function Y(Me,Pt){for(var P,St=new Le(Me),K=1,gt=0;gtvi&&(P=new Le(Me),K=vi),Me=new Le(St)}return P||St}(de,J);D.move(We.toCSSCompatValues(V))}function ke(){}Oe.prototype.applyStyles=function(w,D){for(var V in D=D||this.div,w)w.hasOwnProperty(V)&&(D.style[V]=w[V])},Oe.prototype.formatStyle=function(w,D){return 0===w?0:w+D},(me.prototype=_e(Oe.prototype)).constructor=me,Le.prototype.move=function(w,D){switch(D=void 0!==D?D:this.lineHeight,w){case"+x":this.left+=D,this.right+=D;break;case"-x":this.left-=D,this.right-=D;break;case"+y":this.top+=D,this.bottom+=D;break;case"-y":this.top-=D,this.bottom-=D}},Le.prototype.overlaps=function(w){return this.leftw.left&&this.topw.top},Le.prototype.overlapsAny=function(w){for(var D=0;D=w.top&&this.bottom<=w.bottom&&this.left>=w.left&&this.right<=w.right},Le.prototype.overlapsOppositeAxis=function(w,D){switch(D){case"+x":return this.leftw.right;case"+y":return this.topw.bottom}},Le.prototype.intersectPercentage=function(w){return Math.max(0,Math.min(this.right,w.right)-Math.max(this.left,w.left))*Math.max(0,Math.min(this.bottom,w.bottom)-Math.max(this.top,w.top))/(this.height*this.width)},Le.prototype.toCSSCompatValues=function(w){return{top:this.top-w.top,bottom:w.bottom-this.bottom,left:this.left-w.left,right:w.right-this.right,height:this.height,width:this.width}},Le.getSimpleBoxPosition=function(w){var D=w.div?w.div.offsetHeight:w.tagName?w.offsetHeight:0,V=w.div?w.div.offsetWidth:w.tagName?w.offsetWidth:0,ee=w.div?w.div.offsetTop:w.tagName?w.offsetTop:0;return{left:(w=w.div?w.div.getBoundingClientRect():w.tagName?w.getBoundingClientRect():w).left,right:w.right,top:w.top||ee,height:w.height||D,bottom:w.bottom||ee+(w.height||D),width:w.width||V}},ke.StringDecoder=function(){return{decode:function(w){if(!w)return"";if("string"!=typeof w)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(w))}}},ke.convertCueToDOMTree=function(w,D){return w&&D?Ue(w,D):null},ke.processCues=function(w,D,V){if(!w||!D||!V)return null;for(;V.firstChild;)V.removeChild(V.firstChild);var ee=w.document.createElement("div");if(ee.style.position="absolute",ee.style.left="0",ee.style.right="0",ee.style.top="0",ee.style.bottom="0",ee.style.margin="1.5%",V.appendChild(ee),function Y(X){for(var oe=0;oe{var j={"":1,lr:1,rl:1},Q={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function B(ve){return"string"==typeof ve&&!!Q[ve.toLowerCase()]&&ve.toLowerCase()}function Ae(ve,te,Ce){this.hasBeenReset=!1;var Ee="",Te=!1,pe=ve,u=te,se=Ce,Ue=null,Ve="",it=!0,yt="auto",ue="start",Oe="auto",me="auto",Le=100,Ge="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return Ee},set:function(ke){Ee=""+ke}},pauseOnExit:{enumerable:!0,get:function(){return Te},set:function(ke){Te=!!ke}},startTime:{enumerable:!0,get:function(){return pe},set:function(ke){if("number"!=typeof ke)throw new TypeError("Start time must be set to a number.");pe=ke,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(ke){if("number"!=typeof ke)throw new TypeError("End time must be set to a number.");u=ke,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return se},set:function(ke){se=""+ke,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return Ue},set:function(ke){Ue=ke,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return Ve},set:function(ke){var Ne=function _e(ve){return"string"==typeof ve&&!!j[ve.toLowerCase()]&&ve.toLowerCase()}(ke);if(!1===Ne)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");Ve=Ne,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return it},set:function(ke){it=!!ke,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return yt},set:function(ke){if("number"!=typeof ke&&"auto"!==ke)throw new SyntaxError("Line: an invalid number or illegal string was specified.");yt=ke,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return ue},set:function(ke){var Ne=B(ke);Ne?(ue=Ne,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return Oe},set:function(ke){if(ke<0||ke>100)throw new Error("Position must be between 0 and 100.");Oe=ke,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return me},set:function(ke){var Ne=B(ke);Ne?(me=Ne,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return Le},set:function(ke){if(ke<0||ke>100)throw new Error("Size must be between 0 and 100.");Le=ke,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return Ge},set:function(ke){var Ne=B(ke);if(!Ne)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");Ge=Ne,this.hasBeenReset=!0}}}),this.displayState=void 0}Ae.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},je.exports=Ae},3872:je=>{var we={"":!0,up:!0};function Q(B){return"number"==typeof B&&B>=0&&B<=100}je.exports=function _e(){var B=100,Ae=3,ve=0,te=100,Ce=0,Ee=100,Te="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return B},set:function(pe){if(!Q(pe))throw new Error("Width must be between 0 and 100.");B=pe}},lines:{enumerable:!0,get:function(){return Ae},set:function(pe){if("number"!=typeof pe)throw new TypeError("Lines must be set to a number.");Ae=pe}},regionAnchorY:{enumerable:!0,get:function(){return te},set:function(pe){if(!Q(pe))throw new Error("RegionAnchorX must be between 0 and 100.");te=pe}},regionAnchorX:{enumerable:!0,get:function(){return ve},set:function(pe){if(!Q(pe))throw new Error("RegionAnchorY must be between 0 and 100.");ve=pe}},viewportAnchorY:{enumerable:!0,get:function(){return Ee},set:function(pe){if(!Q(pe))throw new Error("ViewportAnchorY must be between 0 and 100.");Ee=pe}},viewportAnchorX:{enumerable:!0,get:function(){return Ce},set:function(pe){if(!Q(pe))throw new Error("ViewportAnchorX must be between 0 and 100.");Ce=pe}},scroll:{enumerable:!0,get:function(){return Te},set:function(pe){var u=function j(B){return"string"==typeof B&&!!we[B.toLowerCase()]&&B.toLowerCase()}(pe);!1===u?console.warn("Scroll: an invalid or illegal string was specified."):Te=u}}})}},7154:je=>{function we(){return je.exports=we=Object.assign||function(j){for(var Q=1;Q{}}]); \ No newline at end of file diff --git a/dist/fansubid/browser/index.html b/dist/fansubid/browser/index.html index 871dd2b94..72503b8c5 100644 --- a/dist/fansubid/browser/index.html +++ b/dist/fansubid/browser/index.html @@ -63,7 +63,7 @@ - + \ No newline at end of file diff --git a/dist/fansubid/browser/main.b2d4aa46a02fa196.js b/dist/fansubid/browser/main.752601e9332f73ef.js similarity index 50% rename from dist/fansubid/browser/main.b2d4aa46a02fa196.js rename to dist/fansubid/browser/main.752601e9332f73ef.js index a5078ee9f..ee21233c6 100644 --- a/dist/fansubid/browser/main.b2d4aa46a02fa196.js +++ b/dist/fansubid/browser/main.752601e9332f73ef.js @@ -1 +1 @@ -var HC=Object.defineProperty,VC=(rt,B,a)=>B in rt?HC(rt,B,{enumerable:!0,configurable:!0,writable:!0,value:a}):rt[B]=a,du=(rt,B,a)=>(VC(rt,"symbol"!=typeof B?B+"":B,a),a);(self.webpackChunkfansubid=self.webpackChunkfansubid||[]).push([[179],{192:(rt,B,a)=>{"use strict";a.d(B,{d:()=>o});var n=a(5e3),r=a(8696),l=a(9808);function u(S,E){1&S&&n._UZ(0,"br")}let o=(()=>{class S{constructor(d){this.gs=d}ngOnInit(){}get GS(){return this.gs}}return S.\u0275fac=function(d){return new(d||S)(n.Y36(r.U))},S.\u0275cmp=n.Xpm({type:S,selectors:[["app-no-data"]],decls:7,vars:1,consts:[[2,"background-image","url('/assets/img/404/no-data.png')","background-size","contain","background-position","center","background-repeat","no-repeat","height","256px","overflow","hidden"],[1,"row","align-items-center","h-100"],[1,"col-8","mx-auto","text-light","text-center","rounded","py-3",2,"background-color","rgba(128, 128, 128, 0.875)"],[1,"m-0"],[4,"ngIf"]],template:function(d,v){1&d&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),n._uU(4," Tidak Ada Data "),n.YNc(5,u,1,0,"br",4),n._uU(6," \xaf\\_(\u30c4)_/\xaf "),n.qZA()()()()),2&d&&(n.xp6(5),n.Q6J("ngIf",!v.GS.isDesktop))},directives:[l.O5],styles:[""]}),S})()},2438:(rt,B,a)=>{"use strict";a.d(B,{d:()=>l});var n=a(9808),r=a(5e3);let l=(()=>{class u{}return u.\u0275fac=function(S){return new(S||u)},u.\u0275mod=r.oAB({type:u}),u.\u0275inj=r.cJS({imports:[[n.ez]]}),u})()},1617:(rt,B,a)=>{"use strict";a.d(B,{u:()=>ne});var n=a(6271),r=a(4249),l=a(5e3),u=a(4137),o=a(8696),S=a(8381),E=a(3379),d=a(8406),v=a(9808),y=a(7322),_=a(4107),g=a(508),C=a(7238),w=a(7531),V=a(3075),te=a(5245),U=a(7423);const K=["liveChatScroll"];function ce(Z,he){if(1&Z&&(l.TgZ(0,"mat-option",17),l._uU(1,"Global Fansubber"),l.qZA()),2&Z){const Ie=l.oxw(2);l.Q6J("value",Ie.CONSTANTS.socketRoomNameGlobalFansub)}}function le(Z,he){if(1&Z&&(l.TgZ(0,"div",26)(1,"div",27),l._UZ(2,"img",28),l.qZA(),l.TgZ(3,"div",29)(4,"h4",30)(5,"span"),l._uU(6),l.qZA()()()()),2&Z){const Ie=l.oxw().$implicit;l.MGl("routerLink","/user/",Ie.value.username,""),l.s9C("matTooltip",Ie.value.username),l.xp6(2),l.s9C("src",Ie.value.image_url,l.LSH),l.xp6(4),l.Oqu(Ie.value.username)}}function G(Z,he){if(1&Z&&(l.TgZ(0,"div",24),l.YNc(1,le,7,4,"div",25),l.qZA()),2&Z){const Ie=he.$implicit;l.xp6(1),l.Q6J("ngIf",Ie.value)}}function W(Z,he){if(1&Z&&(l.TgZ(0,"div",22),l.YNc(1,G,2,1,"div",23),l.ALo(2,"keyvalue"),l.qZA()),2&Z){const Ie=l.oxw(2);l.xp6(1),l.Q6J("ngForOf",l.lcZ(2,1,Ie.roomCurrentOrGlobal.member_list))}}function H(Z,he){if(1&Z){const Ie=l.EpF();l.TgZ(0,"div",13)(1,"div",3)(2,"h3",14)(3,"mat-form-field",15)(4,"mat-label"),l._uU(5,"Ruang Obrolan"),l.qZA(),l.TgZ(6,"mat-select",16),l.NdJ("valueChange",function(Tt){return l.CHM(Ie),l.oxw().liveChatResult.roomId=Tt})("valueChange",function(Tt){return l.CHM(Ie),l.oxw().changeRoom(Tt)}),l.TgZ(7,"mat-option",17),l._uU(8,"Halaman Ini"),l.qZA(),l.TgZ(9,"mat-option",17),l._uU(10,"Global Publik"),l.qZA(),l.YNc(11,ce,2,1,"mat-option",18),l.qZA()()()(),l.TgZ(12,"div",19)(13,"div",20),l.YNc(14,W,3,3,"div",21),l.qZA()()()}if(2&Z){const Ie=l.oxw();l.xp6(3),l.Q6J("color","accent"),l.xp6(3),l.Q6J("value",Ie.liveChatResult.roomId),l.xp6(1),l.Q6J("value",Ie.ROUTER.url.split("?")[0]),l.xp6(2),l.Q6J("value",Ie.CONSTANTS.socketRoomNameGlobalPublic),l.xp6(2),l.Q6J("ngIf",Ie.isAdminModFansubber),l.xp6(3),l.Q6J("ngIf",Ie.roomCurrentOrGlobal)}}function Me(Z,he){if(1&Z&&(l.TgZ(0,"div",27),l._UZ(1,"img",36),l.qZA()),2&Z){const Ie=l.oxw().$implicit;l.xp6(1),l.s9C("src",Ie.sender.image_url,l.LSH)}}function q(Z,he){if(1&Z){const Ie=l.EpF();l.TgZ(0,"div"),l.YNc(1,Me,2,1,"div",31),l.TgZ(2,"div",32)(3,"h5",33)(4,"span",34),l.NdJ("click",function(){const Ft=l.CHM(Ie).$implicit;return l.oxw().openUserProfile(Ft.sender.username)}),l._uU(5),l.qZA(),l._UZ(6,"span",35),l.qZA()()()}if(2&Z){const Ie=he.$implicit,Xe=he.index,Tt=l.oxw();l.Gre("d-flex py-1 ",Xe===Tt.chatCurrentOrGlobal.length-Tt.SS.messageChatUnreadCount?"border-top":"",""),l.xp6(1),l.Q6J("ngIf",Ie.sender.image_url),l.xp6(4),l.hij(" ",Ie.sender.username," "),l.xp6(1),l.Q6J("innerHtml",Tt.innerHtml(Ie.message),l.oJD)}}function de(Z,he){if(1&Z){const Ie=l.EpF();l.TgZ(0,"mat-form-field",37)(1,"mat-label"),l._uU(2,"Kirim Pesan Obrolan Disini ..."),l.qZA(),l.TgZ(3,"input",38),l.NdJ("keyup.enter",function(Tt){return l.CHM(Ie),l.oxw().applyFilter(Tt)})("ngModelChange",function(Tt){return l.CHM(Ie),l.oxw().liveChatResult.messageToSend=Tt}),l.qZA(),l.TgZ(4,"mat-icon",39),l._uU(5,"send"),l.qZA()()}if(2&Z){const Ie=l.oxw();l.Q6J("color","accent"),l.xp6(3),l.Q6J("ngModel",Ie.liveChatResult.messageToSend)("disabled",!Ie.canChat)}}function Te(Z,he){if(1&Z){const Ie=l.EpF();l.TgZ(0,"button",40),l.NdJ("click",function(){return l.CHM(Ie),l.oxw().login()}),l.TgZ(1,"mat-icon",41),l._uU(2,"vpn_key"),l.qZA(),l._uU(3," Login Untuk Bisa Mengobrol "),l.qZA()}}const j=function(Z){return{height:Z}};let ne=(()=>{class Z{constructor(Ie,Xe,Tt,Ft,vt){this.as=Ie,this.gs=Xe,this.ss=Tt,this.ls=Ft,this.router=vt,this.chatOnly=!1,this.liveChatResult={messageToSend:"",roomId:""},this.globalRoom=null,this.fansubRoom=null,this.currentRoom=null,this.messageHistory=[],this.subsCurrentRoom=null,this.subsGlobalRoom=null,this.subsFansubRoom=null,this.firstTimeOpen=!0,this.timedOut=null}get AS(){return this.as}get ROUTER(){return this.router}get SS(){return this.ss}ngOnInit(){this.gs.isBrowser&&(this.liveChatResult=this.ls.getItem(this.gs.localStorageKeys.LiveChatResults,!0)||this.liveChatResult,this.liveChatResult.roomId=this.router.url.split("?")[0],this.subsCurrentRoom=this.ss.currentRoom.subscribe({next:Ie=>{this.currentRoom=Ie}}),this.subsGlobalRoom=this.ss.globalRoom.subscribe({next:Ie=>{this.globalRoom=Ie}}),this.subsFansubRoom=this.ss.fansubRoom.subscribe({next:Ie=>{this.fansubRoom=Ie}}))}get CONSTANTS(){return n.t}get isAdminModFansubber(){var Ie,Xe,Tt,Ft,vt,ht,Le;return!(!(null===(Ie=this.as.currentUserSubject)||void 0===Ie?void 0:Ie.value)||(null===(Tt=null===(Xe=this.as.currentUserSubject)||void 0===Xe?void 0:Xe.value)||void 0===Tt?void 0:Tt.role)!==r.yS.ADMIN&&(null===(vt=null===(Ft=this.as.currentUserSubject)||void 0===Ft?void 0:Ft.value)||void 0===vt?void 0:vt.role)!==r.yS.MODERATOR&&(null===(Le=null===(ht=this.as.currentUserSubject)||void 0===ht?void 0:ht.value)||void 0===Le?void 0:Le.role)!==r.yS.FANSUBBER)}get roomCurrentOrGlobal(){return this.liveChatResult.roomId===n.t.socketRoomNameGlobalPublic?this.globalRoom:this.liveChatResult.roomId===n.t.socketRoomNameGlobalFansub?this.fansubRoom:this.currentRoom}get chatCurrentOrGlobal(){return this.messageHistory=this.liveChatResult.roomId===n.t.socketRoomNameGlobalPublic?this.ss.globalChatRoom:this.liveChatResult.roomId===n.t.socketRoomNameGlobalFansub?this.ss.fansubChatRoom:this.ss.currentChatRoom,this.ss.messageChatUnreadCount>0&&this.scrollMessage(),this.messageHistory}get canChat(){var Ie;return!!(null===(Ie=this.as.currentUserSubject)||void 0===Ie?void 0:Ie.value)&&(this.liveChatResult.roomId!==n.t.socketRoomNameGlobalFansub||this.isAdminModFansubber)}ngAfterViewInit(){this.gs.isBrowser&&this.scrollMessage()}ngOnDestroy(){var Ie,Xe;this.ls.setItem(this.gs.localStorageKeys.LiveChatResults,this.liveChatResult),null===(Ie=this.subsCurrentRoom)||void 0===Ie||Ie.unsubscribe(),null===(Xe=this.subsGlobalRoom)||void 0===Xe||Xe.unsubscribe(),this.timedOut&&(clearTimeout(this.timedOut),this.timedOut=null)}innerHtml(Ie){return this.gs.linkify(this.gs.htmlToText(Ie))}scrollToBottom(){this.timedOut=setTimeout(()=>{this.ss.messageChatUnreadCount=0,this.liveChatScroll.nativeElement.scrollTop=this.liveChatScroll.nativeElement.scrollHeight},0)}scrollMessage(){this.liveChatScroll&&(this.firstTimeOpen?(this.firstTimeOpen=!1,this.scrollToBottom()):this.liveChatScroll.nativeElement.scrollTop+this.liveChatScroll.nativeElement.clientHeight===this.liveChatScroll.nativeElement.scrollHeight&&this.scrollToBottom())}sendMessage(){this.ss.socketEmit("send-chat",{roomId:this.roomCurrentOrGlobal.room_id,message:this.gs.htmlToText(this.liveChatResult.messageToSend)}),this.liveChatResult.messageToSend=null}applyFilter(Ie){this.gs.log("[MESSAGE_VALUE_CHANGED]",Ie),this.liveChatResult.messageToSend=Ie.target.value.trim().toLowerCase(),this.liveChatResult.messageToSend&&this.sendMessage()}changeRoom(Ie){this.gs.log("[MESSAGE_ROOM_CHANGED]",Ie),this.liveChatResult.roomId=Ie,this.scrollMessage()}login(){this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]}})}openUserProfile(Ie){this.router.navigateByUrl(`/user/${Ie}`)}}return Z.\u0275fac=function(Ie){return new(Ie||Z)(l.Y36(u.e),l.Y36(o.U),l.Y36(S.R),l.Y36(E.n),l.Y36(d.F0))},Z.\u0275cmp=l.Xpm({type:Z,selectors:[["app-live-chat"]],viewQuery:function(Ie,Xe){if(1&Ie&&l.Gf(K,5),2&Ie){let Tt;l.iGM(Tt=l.CRH())&&(Xe.liveChatScroll=Tt.first)}},inputs:{chatOnly:"chatOnly"},decls:15,vars:13,consts:[[1,"row",3,"ngStyle"],[1,"col-12","h-100"],["class","row","style","height: 40%!important;",4,"ngIf"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12"],[2,"overflow-y","auto",3,"ngStyle"],["liveChatScroll",""],[3,"class",4,"ngFor","ngForOf"],[1,"col-12","mt-auto"],["class","mt-3 col-12",3,"color",4,"ngIf"],["type","button","class","mt-4 col-12 text-light","mat-flat-button","","color","accent",3,"click",4,"ngIf"],[1,"row",2,"height","40%!important"],[1,"border-bottom-dotted","row"],[1,"pt-3","col-12",3,"color"],[3,"value","valueChange"],[3,"value"],[3,"value",4,"ngIf"],[1,"col-12",2,"height","calc(100% - 105px)"],[1,"h-100",2,"overflow-y","auto"],["class","row m-0",4,"ngIf"],[1,"row","m-0"],["class","col-6 p-0",4,"ngFor","ngForOf"],[1,"col-6","p-0"],["class","card d-flex py-1 align-items-center p-1 text-success",3,"routerLink","matTooltip",4,"ngIf"],[1,"card","d-flex","py-1","align-items-center","p-1","text-success",3,"routerLink","matTooltip"],[1,"flex-shrink-0"],["height","24","width","24",1,"ms-1","mt-1",2,"object-fit","cover",3,"src"],[1,"flex-grow-1","mx-1","text-truncate"],["matLine","",1,"m-0","text-truncate"],["class","flex-shrink-0",4,"ngIf"],[1,"flex-grow-1","mx-1","my-auto"],["matLine","",1,"m-0"],[1,"me-1","text-success",2,"cursor","pointer",3,"click"],[1,"text-warning",2,"word-break","break-word",3,"innerHtml"],["height","24","width","24",1,"ms-1","mt-1",3,"src"],[1,"mt-3","col-12",3,"color"],["matInput","","maxlength","200","placeholder","Ex. Hello \u4e16\u754c\uff01",3,"ngModel","disabled","keyup.enter","ngModelChange"],["matSuffix",""],["type","button","mat-flat-button","","color","accent",1,"mt-4","col-12","text-light",3,"click"],[1,"me-1"]],template:function(Ie,Xe){1&Ie&&(l.TgZ(0,"div",0)(1,"div",1),l.YNc(2,H,15,6,"div",2),l.TgZ(3,"div",0)(4,"div",3)(5,"h2",4)(6,"b",5),l._uU(7,"Obrolan"),l.qZA()()(),l.TgZ(8,"div",6)(9,"div",7,8),l.YNc(11,q,7,6,"div",9),l.qZA()(),l.TgZ(12,"div",10),l.YNc(13,de,6,3,"mat-form-field",11),l.YNc(14,Te,4,0,"button",12),l.qZA()()()()),2&Ie&&(l.Q6J("ngStyle",l.VKq(7,j,Xe.chatOnly?"":"calc(100vh - 120px)")),l.xp6(2),l.Q6J("ngIf",!Xe.chatOnly),l.xp6(1),l.Q6J("ngStyle",l.VKq(9,j,Xe.chatOnly?"100%!important":"60%!important")),l.xp6(6),l.Q6J("ngStyle",l.VKq(11,j,Xe.chatOnly?"320px":"calc(50vh - 139px)")),l.xp6(2),l.Q6J("ngForOf",Xe.chatCurrentOrGlobal),l.xp6(2),l.Q6J("ngIf",null==Xe.AS.currentUserSubject?null:Xe.AS.currentUserSubject.value),l.xp6(1),l.Q6J("ngIf",!(null!=Xe.AS.currentUserSubject&&Xe.AS.currentUserSubject.value)))},directives:[v.PC,v.O5,y.KE,y.hX,_.gD,g.ey,v.sg,d.rH,C.gM,g.X2,w.Nt,V.Fj,V.nD,V.JJ,V.On,te.Hw,y.R9,U.lW],pipes:[v.Nd],styles:[".card[_ngcontent-%COMP%]{position:inherit;display:flex;flex-direction:row;min-width:0;overflow-wrap:anywhere;background-color:#0000!important;background-clip:border-box;border:none;border-radius:.25rem;cursor:pointer}.card[_ngcontent-%COMP%]:hover{color:#ffc107!important}"]}),Z})()},5116:(rt,B,a)=>{"use strict";a.d(B,{d:()=>S});var n=a(9808),r=a(8406),l=a(3075),u=a(210),o=a(5e3);let S=(()=>{class E{}return E.\u0275fac=function(v){return new(v||E)},E.\u0275mod=o.oAB({type:E}),E.\u0275inj=o.cJS({imports:[[n.ez,r.Bz,l.u5,u.m]]}),E})()},2777:(rt,B,a)=>{"use strict";a.d(B,{t:()=>d});var n=a(6271),r=a(5e3),l=a(8406),u=a(4137),o=a(6925),S=a(8696),E=a(3e3);let d=(()=>{class v{constructor(_,g,C,w,V){this.router=_,this.as=g,this.toast=C,this.gs=w,this.bs=V}canActivate(_,g){var C;const w=_.data[n.t.decoratorRoles];if(!w)return!0;if(this.gs.isBrowser){const V=null===(C=this.as.currentUserSubject)||void 0===C?void 0:C.value;if(V)return!!w.includes(V.role)||(this.bs.clear(),this.toast.error(`Membutuhkan Role :: ${w.join(" / ")}`,"Whoops, Akses Ditolak!",null,!0),this.router.navigateByUrl(this.gs.previousUrl||"/"),!1);this.bs.clear(),this.toast.error("Harap Login Terlebih Dahulu~","Whoops, Akses Ditolak!",null,!0)}return this.router.navigate(["/login"],{queryParams:{returnUrl:g.url}}),!1}}return v.\u0275fac=function(_){return new(_||v)(r.LFG(l.F0),r.LFG(u.e),r.LFG(o.k),r.LFG(S.U),r.LFG(E.z))},v.\u0275prov=r.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})()},5094:(rt,B,a)=>{"use strict";a.d(B,{H:()=>d});var n=a(6271),r=a(5e3),l=a(8406),u=a(4137),o=a(6925),S=a(8696),E=a(3e3);let d=(()=>{class v{constructor(_,g,C,w,V){this.router=_,this.as=g,this.toast=C,this.gs=w,this.bs=V}canActivate(_,g){var C;if(!_.data[n.t.decoratorVerifiedOnly])return!0;if(this.gs.isBrowser){const V=null===(C=this.as.currentUserSubject)||void 0===C?void 0:C.value;if(V)return!!V.verified||(this.bs.clear(),this.toast.error("Khusus Pengguna Terverifikasi","Whoops, Akses Ditolak!",null,!0),this.router.navigateByUrl("/verify"),!1);this.bs.clear(),this.toast.error("Harap Login Terlebih Dahulu~","Whoops, Akses Ditolak!",null,!0)}return this.router.navigate(["/login"],{queryParams:{returnUrl:g.url}}),!1}}return v.\u0275fac=function(_){return new(_||v)(r.LFG(l.F0),r.LFG(u.e),r.LFG(o.k),r.LFG(S.U),r.LFG(E.z))},v.\u0275prov=r.Yz7({token:v,factory:v.\u0275fac,providedIn:"root"}),v})()},210:(rt,B,a)=>{"use strict";a.d(B,{m:()=>Z});var n=a(1555),r=a(1079),l=a(7544),u=a(7423),o=a(9224),S=a(6688),E=a(6856),d=a(8966),v=a(4834),y=a(1125),_=a(3954),g=a(5245),C=a(7531),w=a(4623),V=a(2181),te=a(508),U=a(6087),K=a(5899),ce=a(4107),le=a(2638),G=a(2368),W=a(5615),H=a(4999),Me=a(3251),q=a(4594),de=a(7238),Te=a(7261),j=a(4847),ne=a(5e3);let Z=(()=>{class he{}return he.\u0275fac=function(Xe){return new(Xe||he)},he.\u0275mod=ne.oAB({type:he}),he.\u0275inj=ne.cJS({imports:[n.U5,r.Bb,l.g,u.ot,o.QW,S.Hi,E.FA,d.Is,v.t,y.To,_.N6,g.Ps,C.c,w.ie,V.Tx,te.XK,U.TU,K.Cv,te.si,ce.LD,le.SJ,G.rP,W.T5,H.p0,Me.Nh,q.g0,de.AV,Te.ZX,j.JX]}),he})()},3626:(rt,B,a)=>{"use strict";a.d(B,{$:()=>r});var n=a(5e3);class r{static formatResult(u,o){return`${u} ${o}`}static calculateResult(u,o){const S=u.prev?r.formats[u.prev]:void 0;return S?o/S.max:o}isNumber(u){return"number"==typeof u}isNumberFinite(u){return this.isNumber(u)&&isFinite(u)}isPositive(u){return u>=0}isInteger(u){return u%1==0}toDecimal(u,o){return Math.round(u*Math.pow(10,o))/Math.pow(10,o)}transform(u,o=2,S="B",E){if(!(this.isNumberFinite(u)&&this.isNumberFinite(o)&&this.isInteger(o)&&this.isPositive(o)))return u;let d=u,v=S;for(;"B"!==v;)d*=1024,v=r.formats[v].prev;if(E){const _=this.toDecimal(r.calculateResult(r.formats[E],d),o);return r.formatResult(_,E)}for(const y in r.formats)if(r.formats.hasOwnProperty(y)){const _=r.formats[y];if(d<_.max){const g=this.toDecimal(r.calculateResult(_,d),o);return r.formatResult(g,y)}}}}r.formats={B:{max:1024},kB:{max:Math.pow(1024,2),prev:"B"},KB:{max:Math.pow(1024,2),prev:"B"},MB:{max:Math.pow(1024,3),prev:"kB"},GB:{max:Math.pow(1024,4),prev:"MB"},TB:{max:Number.MAX_SAFE_INTEGER,prev:"GB"}},r.\u0275fac=function(u){return new(u||r)},r.\u0275pipe=n.Yjl({name:"bytes",type:r,pure:!0})},7355:(rt,B,a)=>{"use strict";a.d(B,{T:()=>l});var n=a(9808),r=a(5e3);let l=(()=>{class u{}return u.\u0275fac=function(S){return new(S||u)},u.\u0275mod=r.oAB({type:u}),u.\u0275inj=r.cJS({imports:[[n.ez]]}),u})()},1861:(rt,B,a)=>{"use strict";a.d(B,{H:()=>l});var n=a(5e3),r=a(2313);let l=(()=>{class u{constructor(S){this.domSanitizer=S}transform(S){return this.domSanitizer.bypassSecurityTrustHtml(S)}}return u.\u0275fac=function(S){return new(S||u)(n.Y36(r.H7,16))},u.\u0275pipe=n.Yjl({name:"safeInnerHtml",type:u,pure:!0}),u})()},466:(rt,B,a)=>{"use strict";a.d(B,{l:()=>o});var n=a(5934),r=a(5e3),l=a(9731),u=a(8696);let o=(()=>{class S{constructor(d,v){this.api=d,this.gs=v,this.menuList=[{url:"banned-list",name:"Banned List",image_url:null,icon:"lock_open",deskripsi:"Kelola Banned User"},{url:"ddl-list",name:"DDL Lampiran",image_url:null,icon:"insert_drive_file",deskripsi:"Kelola DDL Lampiran"},{url:"dns",name:"CNAME / A Record",image_url:null,icon:"badge",deskripsi:`sub-domain.${n.N.domain}`},{url:"cors-list",name:"CORS & API Key",image_url:null,icon:"privacy_tip",deskripsi:"Cross-Origin API"},{url:"email",name:"Email",image_url:null,icon:"alternate_email",deskripsi:`email.address@${n.N.domain}`},{url:"fansub-member",name:"Fansub Members",image_url:null,icon:"stars",deskripsi:"Keanggotaan Fansub"},{url:"information",name:"Informasi Dialog",image_url:null,icon:"live_help",deskripsi:"Popup Info Dialog"},{url:"project-type",name:"Project Type",image_url:null,icon:"loyalty",deskripsi:"Kategori Garapan"},{url:"push-notification",name:"Push Notification",image_url:null,icon:"notifications_active",deskripsi:"Pengumuman Dadakan"},{url:"user-list",name:"User List",image_url:null,icon:"supervisor_account",deskripsi:"Seluruh Member"}]}getAllNotif(d="",v=1,y=10,_="",g=""){return this.api.getData(`/notification?q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`)}createNotif(d){return this.api.postData("/notification",d)}deleteNotif(d){return this.api.deleteData(`/notification/${d}`)}getAllBanned(d="",v=1,y=10,_="",g=""){return this.api.getData(`/banned?q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`)}getBanned(d){return this.api.patchData("/banned",d)}unBan(d){return this.api.deleteData(`/banned/${d}`)}ban(d){return this.api.postData("/banned",d)}proDemote(d){return this.api.postData("/promote",d)}getAllCors(d="",v=1,y=10,_="",g=""){return this.api.getData(`/api-key?q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`)}revokeCors(d){return this.api.deleteData(`/api-key/${d}`)}}return S.\u0275fac=function(d){return new(d||S)(r.LFG(l.s),r.LFG(u.U))},S.\u0275prov=r.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"}),S})()},519:(rt,B,a)=>{"use strict";a.d(B,{o:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}searchAnime(E){return this.api.getData(`/anime?q=${E}`)}getAnime(E){return this.api.getData(`/anime/${E}`)}addNewAnime(E){return this.api.patchData("/anime",E)}getSeasonalAnime(E,d){return this.api.getData(`/anime-seasonal?year=${E}&season=${d}`)}getBerkasAnime(E=[],d="",v=1,y=10,_="",g=""){return this.api.patchData(`/anime-berkas?q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`,{id:E})}getFansubAnime(E=[],d=1,v=10){return this.api.patchData(`/anime-fansub?page=${d}&row=${v}`,{id:E})}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},9731:(rt,B,a)=>{"use strict";a.d(B,{s:()=>te});var n=a(520),r=a(4986),l=a(1165),u=a(4482),o=a(8421),S=a(3888),E=a(5403),d=a(9672);const v=(0,S.d)(U=>function(ce=null){U(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=ce});function y(U,K){const{first:ce,each:le,with:G=_,scheduler:W=(null!=K?K:r.z),meta:H=null}=(0,l.q)(U)?{first:U}:"number"==typeof U?{each:U}:U;if(null==ce&&null==le)throw new TypeError("No timeout provided.");return(0,u.e)((Me,q)=>{let de,Te,j=null,ne=0;const Z=he=>{Te=(0,d.f)(q,W,()=>{try{de.unsubscribe(),(0,o.Xf)(G({meta:H,lastValue:j,seen:ne})).subscribe(q)}catch(Ie){q.error(Ie)}},he)};de=Me.subscribe((0,E.x)(q,he=>{null==Te||Te.unsubscribe(),ne++,q.next(j=he),le>0&&Z(le)},void 0,void 0,()=>{(null==Te?void 0:Te.closed)||null==Te||Te.unsubscribe(),j=null})),!ne&&Z(null!=ce?"number"==typeof ce?ce:+ce-W.now():le)})}function _(U){throw new v(U)}var g=a(5625),C=a(5934),w=a(5e3),V=a(8696);let te=(()=>{class U{constructor(ce,le){this.http=ce,this.gs=le}HTTP_REQ_URL(ce){if(ce.startsWith("/")){let le=C.N.baseUrl;ce.startsWith("/api/")||(le+=C.N.apiUrl),ce=le+ce}return ce}getData(ce,le={},G=2e4,W=3){return this.gs.log("[API_GET]",ce),this.prepareOptions(le),this.http.get(this.HTTP_REQ_URL(ce),le).pipe(y(G),(0,g.X)(W))}postData(ce,le={},G=!1,W={},H=3e4){this.gs.log("[API_POST]",ce);let Me=le;return G&&(Me=this.prepareFormData(le)),this.prepareOptions(W),this.http.post(this.HTTP_REQ_URL(ce),Me,W).pipe(y(H))}putData(ce,le={},G=!1,W={},H=3e4){this.gs.log("[API_PUT]",ce);let Me=le;return G&&(Me=this.prepareFormData(le)),this.prepareOptions(W),this.http.put(this.HTTP_REQ_URL(ce),Me,W).pipe(y(H))}patchData(ce,le={},G=!1,W={},H=3e4){this.gs.log("[API_PATCH]",ce);let Me=le;return G&&(Me=this.prepareFormData(le)),this.prepareOptions(W),this.http.patch(this.HTTP_REQ_URL(ce),Me,W).pipe(y(H))}deleteData(ce,le={},G=2e4,W=3){return this.gs.log("[API_DELETE]",ce),this.prepareOptions(le),this.http.delete(this.HTTP_REQ_URL(ce),le).pipe(y(G),(0,g.X)(W))}prepareOptions(ce){ce.headers instanceof n.WM||(ce.headers=new n.WM(ce.headers))}prepareFormData(ce){const le=new FormData;for(const G in ce)ce.hasOwnProperty(G)&&le.append(G,ce[G]);return le}}return U.\u0275fac=function(ce){return new(ce||U)(w.LFG(n.eN),w.LFG(V.U))},U.\u0275prov=w.Yz7({token:U,factory:U.\u0275fac,providedIn:"root"}),U})()},4137:(rt,B,a)=>{"use strict";a.d(B,{e:()=>_});var n=a(1135),r=a(8505),l=a(5e3),u=a(8406),o=a(8696),S=a(3e3),E=a(3379),d=a(9731),v=a(8379),y=a(6925);let _=(()=>{class g{constructor(w,V,te,U,K,ce,le){var G;this.router=w,this.gs=V,this.bs=te,this.ls=U,this.api=K,this.cs=ce,this.toast=le,this.currentUserSubject=new n.X(null),this.currentUser=null===(G=this.currentUserSubject)||void 0===G?void 0:G.asObservable(),this.token=null,this.timeoutNotif=null,this.timeoutToast=null,this.logoutTimerText="",this.intervalLogout=null,this.gs.isBrowser&&(this.token=this.ls.getItem(this.gs.localStorageKeys.token),this.ls.removeItem(this.gs.localStorageKeys.token))}verify(w){return this.gs.log("[AUTH_VERIFY]",w),this.api.patchData("/verify",{token:w}).pipe((0,r.b)(V=>{var te;if(null===(te=this.currentUserSubject)||void 0===te||te.next(V.result),this.token=V.token,this.token){const U=new Date(1e3*this.cs.jwtView(this.token).exp),K=3e5,ce=U.getTime()-K;this.cleanUpTimeoutInterval(),this.timeoutNotif=setTimeout(()=>{this.timeoutToast=this.toast.warning("Sesi Akun Akan Habis!","Silahkan Logout & Login Ulang ...",{closeButton:!1,timeOut:K,disableTimeOut:"extendedTimeOut",tapToDismiss:!1,progressAnimation:"decreasing"},!0)},ce-Date.now()),this.intervalLogout=setInterval(()=>{const le=U.getTime()-(new Date).getTime(),G=Math.floor(le/864e5),W=Math.floor(le%864e5/36e5),H=Math.floor(le%36e5/6e4),Me=Math.floor(le%6e4/1e3);this.logoutTimerText=`(${G}:${String(W).padStart(2,"0")}:${String(H).padStart(2,"0")}:${String(Me).padStart(2,"0")})`,le<0&&(clearInterval(this.intervalLogout),this.intervalLogout=null,this.logoutTimerText="")},1e3)}}))}resendActivation(w){return this.gs.log("[AUTH_ACTIVATION]",w),this.api.postData("/aktivasi",{id:w})}login(w){return this.gs.log("[AUTH_LOGIN]",w),this.api.postData("/login",w).pipe((0,r.b)(V=>{this.token=V.result.token}))}register(w){return this.gs.log("[AUTH_REGISTER]",w),this.api.postData("/register",w)}removeUser(){var w;null===(w=this.currentUserSubject)||void 0===w||w.next(null),this.token=null,this.cleanUpTimeoutInterval()}logout(w="/",V=null){this.gs.log("[AUTH_LOGOUT]",this.token),this.bs.busy(),this.api.deleteData("/logout").subscribe({next:te=>{this.gs.log("[LOGOUT_SUCCESS]",te),this.bs.idle(),this.removeUser(),this.ls.clear(),this.router.navigate([w],V)},error:te=>{this.gs.log("[LOGOUT_ERROR]",te,"error"),this.cleanUpTimeoutInterval(),this.bs.idle()}})}cleanUpTimeoutInterval(){this.timeoutNotif&&(clearTimeout(this.timeoutNotif),this.timeoutNotif=null),this.timeoutToast&&(this.toast.remove(this.timeoutToast.toastId),this.timeoutToast=null),this.intervalLogout&&(clearInterval(this.intervalLogout),this.intervalLogout=null,this.logoutTimerText="")}}return g.\u0275fac=function(w){return new(w||g)(l.LFG(u.F0),l.LFG(o.U),l.LFG(S.z),l.LFG(E.n),l.LFG(d.s),l.LFG(v.$),l.LFG(y.k))},g.\u0275prov=l.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),g})()},8987:(rt,B,a)=>{"use strict";a.d(B,{A:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}getAllBerkas(E="",d=1,v=10,y="",_="",g){return this.api.getData(`/berkas?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}${g?"&r18=true":""}`)}getBerkas(E){return this.api.getData(`/berkas/${E}`)}createBerkas(E){return this.api.postData("/berkas",E)}updateBerkas(E,d){return this.api.putData(`/berkas/${E}`,d)}checkTrusted(E=[]){return this.api.patchData("/berkas-trusted",{id:E})}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},3e3:(rt,B,a)=>{"use strict";a.d(B,{z:()=>o});var n=a(7579),r=a(5e3),l=a(72),u=a(8696);let o=(()=>{class S{constructor(d,v){this.spinnerService=d,this.gs=v,this.cancelPendingRequests$=new n.x,this.busyRequestCount=0,this.timedOut=null}get onCancelPendingRequests(){return this.cancelPendingRequests$.asObservable()}busy(){this.gs.isBrowser&&(this.busyRequestCount<=0&&this.spinnerService.show(),this.busyRequestCount++,this.gs.log("[BUSY_STATE_COUNTER_BUSY]",this.busyRequestCount),this.timedOut&&clearTimeout(this.timedOut),this.timedOut=setTimeout(()=>{this.clear(),this.timedOut=null},6e4))}idle(){this.gs.isBrowser&&(this.busyRequestCount--,this.busyRequestCount<=0&&(this.busyRequestCount=0,this.spinnerService.hide()),this.gs.log("[BUSY_STATE_COUNTER_IDLE]",this.busyRequestCount))}clear(){if(this.gs.isBrowser)for(;this.busyRequestCount>0;)this.idle(),this.cancelPendingRequests$.next()}}return S.\u0275fac=function(d){return new(d||S)(r.LFG(l.t2),r.LFG(u.U))},S.\u0275prov=r.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"}),S})()},8379:(rt,B,a)=>{"use strict";a.d(B,{$:()=>E});var n=a(3172),r=a(7206),u=a(5934),o=a(5e3),S=a(8696);let E=(()=>{class d{constructor(y){this.gs=y,this.keySize=256,this.ivSize=128,this.iterations=100}universalBtoa(y){return this.convertToBase64(y)}universalAtob(y){return this.convertFromBase64(y)}convertToBase64(y){return this.convertEncoding(y).toString("base64")}convertFromBase64(y){return this.convertEncoding(y,"base64").toString()}convertEncoding(y,_=null){return _?n.lW.from(y,_):n.lW.from(y)}msgEncrypt(y,_=u.N.apiKey){const g=r.lib.WordArray.random(16),C=(0,r.PBKDF2)(_,g,{keySize:this.keySize/32,iterations:this.iterations}),w=r.lib.WordArray.random(16),V=r.AES.encrypt(y,C,{iv:w,padding:r.pad.Pkcs7,mode:r.mode.CBC});return g.toString()+w.toString()+V.toString()}msgDecrypt(y,_=u.N.apiKey){const g=r.enc.Hex.parse(y.substr(0,32)),C=r.enc.Hex.parse(y.substr(32,32)),w=y.substring(64),V=(0,r.PBKDF2)(_,g,{keySize:this.keySize/32,iterations:this.iterations});return r.AES.decrypt(w,V,{iv:C,padding:r.pad.Pkcs7,mode:r.mode.CBC}).toString(r.enc.Utf8)}hashPassword(y){return(0,r.SHA512)(y).toString()}jwtView(y){const g=y.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),C=decodeURIComponent(this.universalAtob(g).split("").map(w=>"%"+("00"+w.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(C)}}return d.\u0275fac=function(y){return new(y||d)(o.LFG(S.U))},d.\u0275prov=o.Yz7({token:d,factory:d.\u0275fac,providedIn:"root"}),d})()},7845:(rt,B,a)=>{"use strict";a.d(B,{x:()=>Cs});var n=a(5861),r=a(6805);function l(T,m){const h="object"==typeof m;return new Promise((A,se)=>{let dt,je=!1;T.subscribe({next:mt=>{dt=mt,je=!0},error:se,complete:()=>{je?A(dt):h?A(m.defaultValue):se(new r.K)}})})}var u=a(8966),o=a(5e3),S=a(8696),E=a(9808),d=a(7423),v=a(1861);function y(T,m){if(1&T&&(o.TgZ(0,"small",6)(1,"i"),o._uU(2),o.qZA()()),2&T){const h=o.oxw();o.xp6(2),o.hij("* ",h.DATA.infoText,"")}}function _(T,m){if(1&T&&(o.TgZ(0,"button",7),o._uU(1),o.qZA()),2&T){const h=o.oxw();o.Q6J("mat-dialog-close",!1),o.xp6(1),o.hij(" ",h.DATA.cancelText," ")}}let g=(()=>{class T{constructor(h,A){this.data=h,this.gs=A}get DATA(){return this.data}ngOnInit(){this.gs.log("[DIALOG_DATA_IN]",this.data)}}return T.\u0275fac=function(h){return new(h||T)(o.Y36(u.WI),o.Y36(S.U))},T.\u0275cmp=o.Xpm({type:T,selectors:[["app-material-dialog-info"]],decls:9,vars:8,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"text-break","text-warning",3,"innerHTML"],["mat-dialog-actions",""],["class","text-start m-2",4,"ngIf"],["type","button","mat-button","",1,"ms-auto","text-success","shiny",3,"mat-dialog-close"],["type","button","mat-button","",3,"mat-dialog-close",4,"ngIf"],[1,"text-start","m-2"],["type","button","mat-button","",3,"mat-dialog-close"]],template:function(h,A){1&h&&(o.TgZ(0,"h1",0),o._uU(1),o.qZA(),o._UZ(2,"div",1),o.ALo(3,"safeInnerHtml"),o.TgZ(4,"div",2),o.YNc(5,y,3,1,"small",3),o.TgZ(6,"button",4),o._uU(7),o.qZA(),o.YNc(8,_,2,2,"button",5),o.qZA()),2&h&&(o.xp6(1),o.Oqu(A.DATA.title),o.xp6(1),o.Q6J("innerHTML",o.lcZ(3,6,A.DATA.htmlMessage),o.oJD),o.xp6(3),o.Q6J("ngIf",A.DATA.infoText),o.xp6(1),o.Q6J("mat-dialog-close",!0),o.xp6(1),o.hij(" ",A.DATA.confirmText," "),o.xp6(1),o.Q6J("ngIf",A.DATA.cancelText))},directives:[u.uh,u.xY,u.H8,E.O5,d.lW,u.ZT],pipes:[v.H],styles:[""]}),T})();var C=a(7238),w=a(5245);const V=["dmakElement"];let te=(()=>{class T{constructor(h,A){this.data=h,this.gs=A,this.dmak=null,this.dmakUrl="/assets/kanji/",this.charToDraw="NO DATA"}get DATA(){return this.data}ngOnInit(){this.gs.log("[DIALOG_DATA_IN]",this.data),"hiragana_katakana_kanji"in this.data&&this.data.hiragana_katakana_kanji&&(this.charToDraw=this.data.hiragana_katakana_kanji)}ngAfterViewInit(){this.dmak=new Dmak(this.charToDraw,{element:"dmakElement",uri:this.dmakUrl,stroke:{order:{visible:!0},attr:{active:"#f44336",stroke:"#28a745"}}})}play(){this.dmak.render()}pause(){this.dmak.pause()}next(){this.pause(),this.dmak.renderNextStrokes(1)}back(){this.pause(),this.dmak.eraseLastStrokes(1)}reset(){this.pause(),this.dmak.erase()}}return T.\u0275fac=function(h){return new(h||T)(o.Y36(u.WI),o.Y36(S.U))},T.\u0275cmp=o.Xpm({type:T,selectors:[["app-material-dialog-dmak"]],viewQuery:function(h,A){if(1&h&&o.Gf(V,5),2&h){let se;o.iGM(se=o.CRH())&&(A.dmakElement=se.first)}},decls:12,vars:1,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"text-break"],["id","dmakElement",1,"text-center"],["dmakElement",""],["mat-dialog-actions",""],["type","button","mat-button","","matTooltip","Back",1,"ms-auto",3,"click"],["type","button","mat-button","","matTooltip","Next",3,"click"]],template:function(h,A){1&h&&(o.TgZ(0,"h1",0),o._uU(1),o.qZA(),o.TgZ(2,"div",1),o._UZ(3,"div",2,3),o.qZA(),o.TgZ(5,"div",4)(6,"button",5),o.NdJ("click",function(){return A.back()}),o.TgZ(7,"mat-icon"),o._uU(8,"chevron_left"),o.qZA()(),o.TgZ(9,"button",6),o.NdJ("click",function(){return A.next()}),o.TgZ(10,"mat-icon"),o._uU(11,"chevron_right"),o.qZA()()()),2&h&&(o.xp6(1),o.hij("Cara Penulisan '",A.DATA.romaji,"'"))},directives:[u.uh,u.xY,u.H8,d.lW,C.gM,w.Hw],styles:[""]}),T})();function U(T){return null===T?"null":T!==Object(T)?typeof T:{}.toString.call(T).slice(8,-1).toLowerCase()}function K(T){return"string"!==U(T)||!T.length}const H={useObsoleteKana:!1,passRomaji:!1,upcaseKatakana:!1,IMEMode:!1,convertLongVowelMark:!0,romanization:"hepburn"};var be=Number.isNaN||function(m){return"number"==typeof m&&m!=m};function R(T,m){return!!(T===m||be(T)&&be(m))}function $(T,m){if(T.length!==m.length)return!1;for(var h=0;h{const se="string"===U(A);return m[h]=se?{"":A}:zt(A),m},{})}function Ae(T,m){return m.split("").reduce((h,A)=>(void 0===h[A]&&(h[A]={}),h[A]),T)}function ct(T={}){const m={};return"object"===U(T)&&Object.entries(T).forEach(([h,A])=>{let se=m;h.split("").forEach(je=>{void 0===se[je]&&(se[je]={}),se=se[je]}),se[""]=A}),function(A){return function je(dt,mt){return void 0===dt||"string"===U(dt)?mt:Object.entries(mt).reduce((Lt,[Kt,fn])=>(Lt[Kt]=je(dt[Kt],fn),Lt),dt)}(JSON.parse(JSON.stringify(A)),m)}}function pe(T,m){return m?"function"===U(m)?m(T):ct(m)(T):T}const oe={a:"\u3042",i:"\u3044",u:"\u3046",e:"\u3048",o:"\u304a",k:{a:"\u304b",i:"\u304d",u:"\u304f",e:"\u3051",o:"\u3053"},s:{a:"\u3055",i:"\u3057",u:"\u3059",e:"\u305b",o:"\u305d"},t:{a:"\u305f",i:"\u3061",u:"\u3064",e:"\u3066",o:"\u3068"},n:{a:"\u306a",i:"\u306b",u:"\u306c",e:"\u306d",o:"\u306e"},h:{a:"\u306f",i:"\u3072",u:"\u3075",e:"\u3078",o:"\u307b"},m:{a:"\u307e",i:"\u307f",u:"\u3080",e:"\u3081",o:"\u3082"},y:{a:"\u3084",u:"\u3086",o:"\u3088"},r:{a:"\u3089",i:"\u308a",u:"\u308b",e:"\u308c",o:"\u308d"},w:{a:"\u308f",i:"\u3090",e:"\u3091",o:"\u3092"},g:{a:"\u304c",i:"\u304e",u:"\u3050",e:"\u3052",o:"\u3054"},z:{a:"\u3056",i:"\u3058",u:"\u305a",e:"\u305c",o:"\u305e"},d:{a:"\u3060",i:"\u3062",u:"\u3065",e:"\u3067",o:"\u3069"},b:{a:"\u3070",i:"\u3073",u:"\u3076",e:"\u3079",o:"\u307c"},p:{a:"\u3071",i:"\u3074",u:"\u3077",e:"\u307a",o:"\u307d"},v:{a:"\u3094\u3041",i:"\u3094\u3043",u:"\u3094",e:"\u3094\u3047",o:"\u3094\u3049"}},Q={".":"\u3002",",":"\u3001",":":"\uff1a","/":"\u30fb","!":"\uff01","?":"\uff1f","~":"\u301c","-":"\u30fc","\u2018":"\u300c","\u2019":"\u300d","\u201c":"\u300e","\u201d":"\u300f","[":"\uff3b","]":"\uff3d","(":"\uff08",")":"\uff09","{":"\uff5b","}":"\uff5d"},fe={k:"\u304d",s:"\u3057",t:"\u3061",n:"\u306b",h:"\u3072",m:"\u307f",r:"\u308a",g:"\u304e",z:"\u3058",d:"\u3062",b:"\u3073",p:"\u3074",v:"\u3094",q:"\u304f",f:"\u3075"},Re={ya:"\u3083",yi:"\u3043",yu:"\u3085",ye:"\u3047",yo:"\u3087"},Ce={a:"\u3041",i:"\u3043",u:"\u3045",e:"\u3047",o:"\u3049"},Ve={sh:"sy",ch:"ty",cy:"ty",chy:"ty",shy:"sy",j:"zy",jy:"zy",shi:"si",chi:"ti",tsu:"tu",ji:"zi",fu:"hu"},Ge=Object.assign({tu:"\u3063",wa:"\u308e",ka:"\u30f5",ke:"\u30f6"},Ce,Re),xt={yi:"\u3044",wu:"\u3046",ye:"\u3044\u3047",wi:"\u3046\u3043",we:"\u3046\u3047",kwa:"\u304f\u3041",whu:"\u3046",tha:"\u3066\u3083",thu:"\u3066\u3085",tho:"\u3066\u3087",dha:"\u3067\u3083",dhu:"\u3067\u3085",dho:"\u3067\u3087"},Mt={wh:"\u3046",qw:"\u304f",q:"\u304f",gw:"\u3050",sw:"\u3059",ts:"\u3064",th:"\u3066",tw:"\u3068",dh:"\u3067",dw:"\u3069",fw:"\u3075",f:"\u3075"},hn={kwi:"\u304f\u3043",kuxi:"\u304f\u3043",kuli:"\u304f\u3043",kwe:"\u304f\u3047",kuxe:"\u304f\u3047",kule:"\u304f\u3047",kwo:"\u304f\u3049",kuxo:"\u304f\u3049",kulo:"\u304f\u3049"};function ft(){const T=zt(oe),m=se=>Ae(T,se);function A(se){return Object.entries(se).reduce((je,[dt,mt])=>(je[dt]=dt?A(mt):`\u3063${mt}`,je),{})}return Object.entries(fe).forEach(([se,je])=>{Object.entries(Re).forEach(([dt,mt])=>{m(se+dt)[""]=je+mt})}),Object.entries(Q).forEach(([se,je])=>{m(se)[""]=je}),Object.entries(hn).forEach(([se,je])=>{m(se)[""]=je}),Object.entries(Mt).forEach(([se,je])=>{Object.entries(Ce).forEach(([dt,mt])=>{m(se+dt)[""]=je+mt})}),["n","n'","xn"].forEach(se=>{m(se)[""]="\u3093"}),T.c=JSON.parse(JSON.stringify(T.k)),Object.entries(Ve).forEach(([se,je])=>{const dt=se.slice(0,se.length-1),mt=se.charAt(se.length-1);m(dt)[mt]=JSON.parse(JSON.stringify(m(je)))}),Object.entries(Ge).forEach(([se,je])=>{const dt=yn=>yn.charAt(yn.length-1),mt=yn=>yn.slice(0,yn.length-1),Kt=m(`x${se}`);Kt[""]=je,m(`l${mt(se)}`)[dt(se)]=Kt,function h(se){return[...Object.entries(Ve),["c","k"]].reduce((je,[dt,mt])=>se.startsWith(mt)?je.concat(se.replace(mt,dt)):je,[])}(se).forEach(yn=>{["l","x"].forEach(In=>{m(In+mt(yn))[dt(yn)]=m(In+se)})})}),Object.entries(xt).forEach(([se,je])=>{m(se)[""]=je}),[...Object.keys(fe),"c","y","w","j"].forEach(se=>{const je=T[se];je[se]=A(je)}),delete T.n.n,Object.freeze(JSON.parse(JSON.stringify(T)))}let gt=null;const Dt=ct({wi:"\u3090",we:"\u3091"});function bn(T=""){return!K(T)&&12540===T.charCodeAt(0)}function ii(T=""){return function ce(T="",m,h){if(K(T))return!1;const A=T.charCodeAt(0);return m<=A&&A<=h}(T,12449,12540)}Ke((T,m,h)=>{let A=function nt(){return null==gt&&(gt=ft()),gt}();return A=T?function Gt(T){const m=JSON.parse(JSON.stringify(T));return m.n.n={"":"\u3093"},m.n[" "]={"":"\u3093"},m}(A):A,A=m?Dt(A):A,h&&(A=pe(A,h)),A},Nt);const Wt={a:"\u3042",i:"\u3044",u:"\u3046",e:"\u3048",o:"\u3046"};function nn(T="",m,{isDestinationRomaji:h,convertLongVowelMark:A}={}){let se="";return T.split("").reduce((je,dt,mt)=>{if(function Sn(T=""){return!K(T)&&12539===T.charCodeAt(0)}(dt)||((T,m)=>bn(T)&&m<1)(dt,mt)||(T=>["\u30f6","\u30f5"].includes(T))(dt))return je.concat(dt);if(A&&se&&((T,m)=>bn(T)&&m>0)(dt,mt)){const Lt=m(se).slice(-1);return ii(T[mt-1])&&"o"===Lt&&h?je.concat("\u304a"):je.concat(Wt[Lt])}if(!bn(dt)&&ii(dt)){const Lt=dt.charCodeAt(0)+-96,Kt=String.fromCharCode(Lt);return se=Kt,je.concat(Kt)}return se="",je.concat(dt)},[]).join("")}let _n=null;const Nn={\u3042:"a",\u3044:"i",\u3046:"u",\u3048:"e",\u304a:"o",\u304b:"ka",\u304d:"ki",\u304f:"ku",\u3051:"ke",\u3053:"ko",\u3055:"sa",\u3057:"shi",\u3059:"su",\u305b:"se",\u305d:"so",\u305f:"ta",\u3061:"chi",\u3064:"tsu",\u3066:"te",\u3068:"to",\u306a:"na",\u306b:"ni",\u306c:"nu",\u306d:"ne",\u306e:"no",\u306f:"ha",\u3072:"hi",\u3075:"fu",\u3078:"he",\u307b:"ho",\u307e:"ma",\u307f:"mi",\u3080:"mu",\u3081:"me",\u3082:"mo",\u3089:"ra",\u308a:"ri",\u308b:"ru",\u308c:"re",\u308d:"ro",\u3084:"ya",\u3086:"yu",\u3088:"yo",\u308f:"wa",\u3090:"wi",\u3091:"we",\u3092:"wo",\u3093:"n",\u304c:"ga",\u304e:"gi",\u3050:"gu",\u3052:"ge",\u3054:"go",\u3056:"za",\u3058:"ji",\u305a:"zu",\u305c:"ze",\u305e:"zo",\u3060:"da",\u3062:"ji",\u3065:"zu",\u3067:"de",\u3069:"do",\u3070:"ba",\u3073:"bi",\u3076:"bu",\u3079:"be",\u307c:"bo",\u3071:"pa",\u3074:"pi",\u3077:"pu",\u307a:"pe",\u307d:"po",\u3094\u3041:"va",\u3094\u3043:"vi",\u3094:"vu",\u3094\u3047:"ve",\u3094\u3049:"vo"},li={"\u3002":".","\u3001":",","\uff1a":":","\u30fb":"/","\uff01":"!","\uff1f":"?","\u301c":"~",\u30fc:"-","\u300c":"\u2018","\u300d":"\u2019","\u300e":"\u201c","\u300f":"\u201d","\uff3b":"[","\uff3d":"]","\uff08":"(","\uff09":")","\uff5b":"{","\uff5d":"}","\u3000":" "},Di=["\u3042","\u3044","\u3046","\u3048","\u304a","\u3084","\u3086","\u3088"],Zn={\u3083:"ya",\u3085:"yu",\u3087:"yo"},Li={\u3043:"yi",\u3047:"ye"},qi={\u3041:"a",\u3043:"i",\u3045:"u",\u3047:"e",\u3049:"o"},vr=["\u304d","\u306b","\u3072","\u307f","\u308a","\u304e","\u3073","\u3074","\u3094","\u304f","\u3075"],er={\u3057:"sh",\u3061:"ch",\u3058:"j",\u3062:"j"},lr={\u3063:"",\u3083:"ya",\u3085:"yu",\u3087:"yo",\u3041:"a",\u3043:"i",\u3045:"u",\u3047:"e",\u3049:"o"},tr={b:"b",c:"t",d:"d",f:"f",g:"g",h:"h",j:"j",k:"k",m:"m",p:"p",q:"q",r:"r",s:"s",t:"t",v:"v",w:"w",x:"x",z:"z"};function Vi(){return null==_n&&(_n=function cr(){const T=zt(Nn),m=A=>Ae(T,A),h=(A,se)=>{m(A)[""]=se};return Object.entries(li).forEach(([A,se])=>{m(A)[""]=se}),[...Object.entries(Zn),...Object.entries(qi)].forEach(([A,se])=>{h(A,se)}),vr.forEach(A=>{const se=m(A)[""][0];Object.entries(Zn).forEach(([je,dt])=>{h(A+je,se+dt)}),Object.entries(Li).forEach(([je,dt])=>{h(A+je,se+dt)})}),Object.entries(er).forEach(([A,se])=>{Object.entries(Zn).forEach(([je,dt])=>{h(A+je,se+dt[1])}),h(`${A}\u3043`,`${se}yi`),h(`${A}\u3047`,`${se}e`)}),T.\u3063=Je(T),Object.entries(lr).forEach(([A,se])=>{h(A,se)}),Di.forEach(A=>{h(`\u3093${A}`,`n'${m(A)[""]}`)}),Object.freeze(JSON.parse(JSON.stringify(T)))}()),_n}function Je(T){return Object.entries(T).reduce((m,[h,A])=>{if(h)m[h]=Je(A);else{const se=A.charAt(0);m[h]=Object.keys(tr).includes(se)?tr[se]+A:A}return m},{})}const Yt=Ke((T,m)=>{let h=function ji(T){return"hepburn"===T?Vi():{}}(T);return m&&(h=pe(h,m)),h},Nt);function Se(T="",m={},h){const A=((T={})=>Object.assign({},H,T))(m);return h||(h=Yt(A.romanization,A.customRomajiMapping)),function qe(T,m,h){h||(h=Yt(m.romanization,m.customRomajiMapping));return bt(nn(T,Se,Object.assign({},{isDestinationRomaji:!0},m)),h,!m.IMEMode)}(T,A,h).map(se=>{const[je,dt,mt]=se;return A.upcaseKatakana&&function vi(T=""){return!K(T)&&[...T].every(ii)}(T.slice(je,dt))?mt.toUpperCase():mt}).join("")}var Bi=a(2663),ir=a(4623),Lr=a(508),yi=a(192);const Ee=["dmakElement"];function Ze(T,m){if(1&T&&(o.TgZ(0,"li"),o._uU(1),o.qZA()),2&T){const h=m.$implicit,A=o.oxw();o.xp6(1),o.AsE(" ",h," (",A.getRomaji(h),") ")}}function me(T,m){if(1&T&&(o.TgZ(0,"li"),o._uU(1),o.qZA()),2&T){const h=m.$implicit,A=o.oxw();o.xp6(1),o.AsE(" ",h," (",A.getRomaji(h),") ")}}function it(T,m){if(1&T){const h=o.EpF();o.TgZ(0,"mat-list-option",25),o.NdJ("click",function(){const je=o.CHM(h).$implicit;return o.oxw(2).openVocab(je)}),o.TgZ(1,"h4",26),o._uU(2),o.qZA(),o.TgZ(3,"h5",27),o._uU(4),o.qZA(),o.TgZ(5,"p",28),o._uU(6),o.qZA()()}if(2&T){const h=m.$implicit,A=o.oxw(2);o.xp6(2),o.Oqu(h.kanji),o.xp6(2),o.AsE("",h.reading," (",A.getRomaji(h.reading),")"),o.xp6(2),o.Oqu(h.meaning)}}function Pt(T,m){if(1&T&&(o.TgZ(0,"div")(1,"mat-selection-list",23),o.YNc(2,it,7,4,"mat-list-option",24),o.qZA()()),2&T){const h=o.oxw();o.xp6(1),o.Q6J("multiple",!1),o.xp6(1),o.Q6J("ngForOf",h.edict)}}function Zt(T,m){1&T&&o._UZ(0,"app-no-data")}function Xt(T,m){if(1&T){const h=o.EpF();o.TgZ(0,"div",29)(1,"button",30),o.NdJ("click",function(){return o.CHM(h),o.oxw().loadNextPage()}),o._uU(2,"Load More ..."),o.qZA()()}}let En=(()=>{class T{constructor(h,A,se){this.data=h,this.nihon=A,this.gs=se,this.dmak=null,this.dmakUrl="/assets/kanji/",this.charToDraw="NO DATA",this.edict=[],this.page=1,this.pageFinished=!1,this.subsEdict=null}get DATA(){return this.data}getRomaji(h){return Se(h)}ngOnInit(){this.gs.log("[DIALOG_DATA_IN]",this.data),"character"in this.data&&this.data.character&&(this.charToDraw=this.data.character),this.loadEdict()}ngOnDestroy(){var h;null===(h=this.subsEdict)||void 0===h||h.unsubscribe()}ngAfterViewInit(){this.dmak=new Dmak(this.charToDraw,{element:"dmakElement",uri:this.dmakUrl,stroke:{order:{visible:!0},attr:{active:"#f44336",stroke:"#28a745"}}})}loadEdict(){this.subsEdict=this.nihon.getAllEdict(this.charToDraw,this.page).subscribe({next:h=>{this.gs.log("[EDICT_LIST_SUCCESS]",h),this.edict=[...this.edict,...h.results],h.results.length<=0&&(this.pageFinished=!0)},error:h=>{this.gs.log("[EDICT_LIST_ERROR]",h,"error")}})}loadNextPage(){this.pageFinished||(this.page++,this.loadEdict())}openVocab(h){this.gs.log("[EDICT_LIST_CLICK_VOCAB]",h)}}return T.\u0275fac=function(h){return new(h||T)(o.Y36(u.WI),o.Y36(Bi.a),o.Y36(S.U))},T.\u0275cmp=o.Xpm({type:T,selectors:[["app-material-dialog-edict"]],viewQuery:function(h,A){if(1&h&&o.Gf(Ee,5),2&h){let se;o.iGM(se=o.CRH())&&(A.dmakElement=se.first)}},decls:42,vars:10,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"text-break"],[1,"row"],[1,"col-md-4","col-xl-3"],[1,"row","sticky-top","p-3"],[1,"col-12"],["id","dmakElement",1,"text-center"],["dmakElement",""],[1,"col-12","mt-3"],[1,"text-warning"],[1,"text-truncate"],[1,"text-success"],[1,"text-truncate","mt-3"],[1,"text-success","m-0"],[4,"ngFor","ngForOf"],[1,"col-md-8","col-xl-9"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"border-bottom-dotted"],[1,"text-bifeldy"],[4,"ngIf"],["class","col-12 text-center p-3",4,"ngIf"],["mat-dialog-actions",""],["type","button","mat-button","",1,"ms-auto",3,"mat-dialog-close"],[3,"multiple"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["matLine","",1,"px-3"],["matLine","",1,"px-3","text-success"],["matLine","",1,"px-3","text-warning"],[1,"col-12","text-center","p-3"],["type","button","mat-button","",3,"click"]],template:function(h,A){1&h&&(o.TgZ(0,"h1",0),o._uU(1),o.qZA(),o.TgZ(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"div",5),o._UZ(7,"div",6,7),o.qZA(),o.TgZ(9,"div",8)(10,"p",9),o._uU(11),o.qZA()(),o.TgZ(12,"div",5)(13,"div",10),o._uU(14," JLPT Level :: "),o.TgZ(15,"span",11),o._uU(16),o.qZA()(),o.TgZ(17,"div",10),o._uU(18," School Level :: "),o.TgZ(19,"span",11),o._uU(20),o.qZA()(),o.TgZ(21,"div",12),o._uU(22," Kunyomi :: "),o.TgZ(23,"ul",13),o.YNc(24,Ze,2,2,"li",14),o.qZA()(),o.TgZ(25,"div",10),o._uU(26," Onyomi :: "),o.TgZ(27,"ul",13),o.YNc(28,me,2,2,"li",14),o.qZA()()()()(),o.TgZ(29,"div",15)(30,"div",2)(31,"div",16)(32,"h2",17)(33,"b",18),o._uU(34,"Kosa Kata"),o.qZA()()(),o.TgZ(35,"div",5),o.YNc(36,Pt,3,2,"div",19),o.YNc(37,Zt,1,0,"app-no-data",19),o.qZA(),o.YNc(38,Xt,3,0,"div",20),o.qZA()()()(),o.TgZ(39,"div",21)(40,"button",22),o._uU(41,"Tutup"),o.qZA()()),2&h&&(o.xp6(1),o.hij("Kamus Dictionary '",A.DATA.character,"'"),o.xp6(10),o.Oqu(A.DATA.translate),o.xp6(5),o.hij("N",A.DATA.jlpt,""),o.xp6(4),o.Oqu(A.DATA.school),o.xp6(4),o.Q6J("ngForOf",A.DATA.v_kunyomi.split(",")),o.xp6(4),o.Q6J("ngForOf",A.DATA.v_onyomi.split(",")),o.xp6(8),o.Q6J("ngIf",A.edict.length>0),o.xp6(1),o.Q6J("ngIf",A.edict.length<=0),o.xp6(1),o.Q6J("ngIf",!A.pageFinished),o.xp6(2),o.Q6J("mat-dialog-close",!0))},directives:[u.uh,u.xY,E.sg,E.O5,ir.Ub,ir.vS,Lr.X2,yi.d,d.lW,u.H8,u.ZT],styles:[""]}),T})();var wn=a(3075),zn=a(6271),Wn=a(3e3),qn=a(7902),di=a(7322),hi=a(1385),_i=a(7531),we=a(8406),ae=a(3626);function Y(T,m){if(1&T&&(o.TgZ(0,"div"),o._uU(1),o.ALo(2,"bytes"),o.qZA()),2&T){const h=o.oxw(2);o.xp6(1),o.hij("Ukuran Upload Melebihi Batas ",o.lcZ(2,1,h.imageLimitExceeded)," !")}}function Qe(T,m){if(1&T&&(o.TgZ(0,"div"),o._uU(1),o.qZA()),2&T){const h=o.oxw(2);o.xp6(1),o.Oqu(h.imageErrorText)}}function Jt(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Gambar Wajib Ada!"),o.qZA())}function xn(T,m){if(1&T){const h=o.EpF();o.TgZ(0,"div",7)(1,"button",22),o.NdJ("click",function(){return o.CHM(h),o.oxw(2).submitImage()}),o.TgZ(2,"mat-icon",23),o._uU(3,"add_photo_alternate"),o.qZA(),o._uU(4," Unggah "),o.qZA()()}if(2&T){const h=o.oxw(2);o.xp6(1),o.Q6J("disabled",h.submitted)}}function xi(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Kana Tidak Boleh Kosong"),o.qZA())}function Ui(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Kana Hanya Boleh Huruf Jepang"),o.qZA())}function Sr(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Romaji Tidak Boleh Kosong"),o.qZA())}function Or(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Romaji Hanya Boleh Huruf Standar Papan Ketik"),o.qZA())}function rn(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Arti Tidak Boleh Kosong"),o.qZA())}function si(T,m){1&T&&(o.TgZ(0,"div"),o._uU(1,"Arti Hanya Boleh Huruf Standar Papan Ketik"),o.qZA())}function ps(T,m){if(1&T&&(o.TgZ(0,"div",5)(1,"div",24),o._uU(2," Last Edit By :: "),o.TgZ(3,"a",25),o._uU(4),o.qZA()()()),2&T){const h=o.oxw(2);o.xp6(3),o.MGl("routerLink","/user/",null==h.DATA.dataset||null==h.DATA.dataset.user_?null:h.DATA.dataset.user_.username,""),o.xp6(1),o.hij(" ",null==h.DATA.dataset||null==h.DATA.dataset.user_?null:h.DATA.dataset.user_.username," ")}}function Fi(T,m){if(1&T){const h=o.EpF();o.TgZ(0,"form",4)(1,"div",5)(2,"div",6)(3,"div",5)(4,"div",7),o._UZ(5,"img",8),o.TgZ(6,"mat-form-field",9)(7,"mat-label"),o._uU(8,"Gambar"),o.qZA(),o.TgZ(9,"ngx-mat-file-input",10,11),o.NdJ("change",function(se){o.CHM(h);const je=o.MAs(10);return o.oxw().uploadImage(se,je)}),o.qZA(),o.TgZ(11,"mat-icon",12),o._uU(12,"image"),o.qZA()(),o.TgZ(13,"mat-error",13)(14,"small"),o.YNc(15,Y,3,3,"div",14),o.YNc(16,Qe,2,1,"div",14),o.YNc(17,Jt,2,0,"div",14),o.qZA()()(),o.YNc(18,xn,5,1,"div",15),o.qZA()(),o.TgZ(19,"div",16)(20,"div",5)(21,"mat-form-field",17)(22,"mat-label"),o._uU(23,"Kana"),o.qZA(),o._UZ(24,"input",18),o.TgZ(25,"mat-icon",12),o._uU(26,"translate"),o.qZA(),o.TgZ(27,"mat-error"),o.YNc(28,xi,2,0,"div",14),o.YNc(29,Ui,2,0,"div",14),o.qZA()(),o.TgZ(30,"mat-form-field",17)(31,"mat-label"),o._uU(32,"Romaji"),o.qZA(),o._UZ(33,"input",19),o.TgZ(34,"mat-icon",12),o._uU(35,"text_fields"),o.qZA(),o.TgZ(36,"mat-error"),o.YNc(37,Sr,2,0,"div",14),o.YNc(38,Or,2,0,"div",14),o.qZA()(),o.TgZ(39,"mat-form-field",17)(40,"mat-label"),o._uU(41,"Arti Terjemahan"),o.qZA(),o._UZ(42,"input",20),o.TgZ(43,"mat-icon",12),o._uU(44,"g_translate"),o.qZA(),o.TgZ(45,"mat-error"),o.YNc(46,rn,2,0,"div",14),o.YNc(47,si,2,0,"div",14),o.qZA()()(),o.YNc(48,ps,5,2,"div",21),o.qZA()()()}if(2&T){const h=o.oxw();o.Q6J("formGroup",h.fg),o.xp6(5),o.Q6J("src",h.image_url,o.LSH),o.xp6(1),o.Q6J("color","accent"),o.xp6(3),o.Q6J("disabled",h.fg.value.image)("accept","image/gif, image/jpeg, image/jpg, image/png"),o.xp6(6),o.Q6J("ngIf",h.imageLimitExceeded),o.xp6(1),o.Q6J("ngIf",h.imageErrorText),o.xp6(1),o.Q6J("ngIf",h.fg.get("image").hasError("required")),o.xp6(1),o.Q6J("ngIf",h.image&&!h.fg.value.image),o.xp6(3),o.Q6J("color","accent"),o.xp6(7),o.Q6J("ngIf",h.fg.get("kana").hasError("required")),o.xp6(1),o.Q6J("ngIf",h.fg.get("kana").hasError("pattern")),o.xp6(1),o.Q6J("color","accent"),o.xp6(7),o.Q6J("ngIf",h.fg.get("romaji").hasError("required")),o.xp6(1),o.Q6J("ngIf",h.fg.get("romaji").hasError("pattern")),o.xp6(1),o.Q6J("color","accent"),o.xp6(7),o.Q6J("ngIf",h.fg.get("meaning").hasError("required")),o.xp6(1),o.Q6J("ngIf",h.fg.get("meaning").hasError("pattern")),o.xp6(1),o.Q6J("ngIf",null==h.DATA.dataset?null:h.DATA.dataset.user_)}}function ms(T,m){if(1&T&&(o.TgZ(0,"button",29),o._uU(1),o.qZA()),2&T){const h=o.oxw(2);o.Q6J("mat-dialog-close",null),o.xp6(1),o.hij(" ",h.DATA.cancelText," ")}}function Br(T,m){if(1&T){const h=o.EpF();o.TgZ(0,"div",26)(1,"button",27),o.NdJ("click",function(){return o.CHM(h),o.oxw().saveData()}),o._uU(2),o.qZA(),o.YNc(3,ms,2,2,"button",28),o.qZA()}if(2&T){const h=o.oxw();o.xp6(1),o.Q6J("disabled",h.submitted||h.fg.invalid||!h.fg.dirty),o.xp6(1),o.hij(" ",h.DATA.confirmText," "),o.xp6(1),o.Q6J("ngIf",h.DATA.cancelText)}}let fr=(()=>{class T{constructor(h,A,se,je,dt,mt,Lt){this.fb=h,this.bs=A,this.imgbb=se,this.nihongo=je,this.dialogRef=dt,this.data=mt,this.gs=Lt,this.submitted=!1,this.image=null,this.imageErrorText=null,this.imageLimitExceeded=null,this.image_url="/assets/img/form/no-image.png",this.image_url_original=null,this.gambar=null,this.subsNihongo=null,this.subsImgbb=null}get DATA(){return this.data}ngOnInit(){var h;this.gs.isBrowser&&(this.gs.log("[DIALOG_DATA_IN]",this.data),this.initForm(null===(h=this.data)||void 0===h?void 0:h.dataset))}ngOnDestroy(){var h,A;null===(h=this.subsImgbb)||void 0===h||h.unsubscribe(),null===(A=this.subsNihongo)||void 0===A||A.unsubscribe()}initForm(h){this.fg=this.fb.group({kana:[null==h?void 0:h.kana,wn.kI.compose([wn.kI.required,wn.kI.pattern(zn.t.regexJapaneseKeyboardKeys)])],romaji:[null==h?void 0:h.romaji,wn.kI.compose([wn.kI.required,wn.kI.pattern(zn.t.regexEnglishKeyboardKeys)])],meaning:[null==h?void 0:h.meaning,wn.kI.compose([wn.kI.required,wn.kI.pattern(zn.t.regexEnglishKeyboardKeys)])],category:[(null==h?void 0:h.category)||this.data.modeTampilan,wn.kI.compose([wn.kI.required,wn.kI.pattern(zn.t.regexEnglishKeyboardKeys)])],image:[null,wn.kI.compose([wn.kI.pattern(zn.t.regexUrl)])]}),h?this.image_url=null==h?void 0:h.image_url:this.fg.controls.image.setValidators([wn.kI.required,wn.kI.pattern(zn.t.regexEnglishKeyboardKeys)]),this.image_url_original=this.image_url}uploadImage(h,A){this.gambar=A,this.image=null,this.imageLimitExceeded=null,this.imageErrorText=null,this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine();const se=h.target.files[0];try{const je=new FileReader;je.readAsDataURL(se),je.onload=dt=>{if(this.gs.log("[IMAGE_SELECTED]",dt),se.size<=zn.t.fileSizeImageLimit){const mt=this.gs.document.createElement("img");mt.onload=()=>{this.image=se,this.image_url=je.result.toString()},mt.src=je.result.toString()}else this.image=null,this.image_url="/assets/img/form/image-error.png",this.imageLimitExceeded=zn.t.fileSizeImageLimit,this.gambar.clear(h)}}catch(je){this.image=null,this.image_url=this.image_url_original,this.gambar.clear(h)}}submitImage(){this.submitted=!0,this.subsImgbb=this.imgbb.uploadImage({file:this.image}).subscribe({next:h=>{this.gs.log("[IMAGE_SUCCESS]",h),this.fg.controls.image.patchValue(h.result.url),this.fg.controls.image.markAsDirty(),this.submitted=!1},error:h=>{var A;this.gs.log("[IMAGE_ERROR]",h,"error"),this.fg.controls.image.patchValue(null),this.fg.controls.image.markAsPristine(),this.submitted=!1,this.imageErrorText=(null===(A=h.result)||void 0===A?void 0:A.message)||h.info}})}saveData(){var h;this.bs.busy(),this.submitted=!0;let A=null;if((null===(h=this.data)||void 0===h?void 0:h.dataset)&&(A=this.gs.getDirtyValues(this.fg),this.gs.log("[NIHONGO_ADD_OR_EDIT_DIRTY]",A)),this.fg.invalid)return this.submitted=!1,void this.bs.idle();this.subsNihongo=A?this.nihongo.updateNihongo(this.data.dataset.id,{...A}):this.nihongo.createNihongo({image:this.fg.value.image,kana:this.fg.value.kana,romaji:this.fg.value.romaji,meaning:this.fg.value.meaning,category:this.fg.value.category}),this.subsNihongo=this.subsNihongo.subscribe({next:se=>{this.gs.log("[NIHONGO_ADD_OR_EDIT_SUCCESS]",se),this.submitted=!1,this.bs.idle(),this.dialogRef.close(se)},error:se=>{this.gs.log("[NIHONGO_ADD_OR_EDIT_ERROR]",se,"error"),this.submitted=!1,this.bs.idle()}})}}return T.\u0275fac=function(h){return new(h||T)(o.Y36(wn.qu),o.Y36(Wn.z),o.Y36(qn.X),o.Y36(Bi.a),o.Y36(u.so),o.Y36(u.WI),o.Y36(S.U))},T.\u0275cmp=o.Xpm({type:T,selectors:[["app-material-dialog-belajar"]],decls:5,vars:4,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"text-break","text-warning"],[3,"formGroup",4,"ngIf"],["mat-dialog-actions","",4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-12","col-md-5","col-xl-4","p-3"],[1,"col-12"],[1,"w-100","border",3,"src"],["appearance","outline",1,"pt-3","w-100",3,"color"],[1,"w-100",3,"disabled","accept","change"],["gambar",""],["matSuffix",""],[1,"px-3","pb-3","w-100"],[4,"ngIf"],["class","col-12",4,"ngIf"],[1,"col-12","col-md-7","col-xl-8","pt-3"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","","formControlName","kana","placeholder","\u8910\u8272"],["matInput","","formControlName","romaji","placeholder","Kasshoku"],["matInput","","formControlName","meaning","placeholder","Coklat"],["class","row",4,"ngIf"],["type","button","mat-raised-button","","color","primary","type","button",1,"w-100",3,"disabled","click"],[1,"me-1"],[1,"col","text-end"],[1,"text-success",2,"text-decoration","none",3,"routerLink"],["mat-dialog-actions",""],["type","button","mat-button","",1,"ms-auto","text-success",3,"disabled","click"],["type","button","mat-button","",3,"mat-dialog-close",4,"ngIf"],["type","button","mat-button","",3,"mat-dialog-close"]],template:function(h,A){1&h&&(o.TgZ(0,"h1",0),o._uU(1),o.qZA(),o.TgZ(2,"div",1),o.YNc(3,Fi,49,19,"form",2),o.qZA(),o.YNc(4,Br,4,3,"div",3)),2&h&&(o.xp6(1),o.AsE("",A.DATA.title," '",A.DATA.dataset?A.DATA.dataset.kana:A.DATA.modeTampilan,"'"),o.xp6(2),o.Q6J("ngIf",A.fg),o.xp6(1),o.Q6J("ngIf",A.fg))},directives:[u.uh,u.xY,E.O5,wn._Y,wn.JL,wn.sg,di.KE,di.hX,hi.Yh,w.Hw,di.R9,di.TO,d.lW,_i.Nt,wn.Fj,wn.JJ,wn.u,we.yS,u.H8,u.ZT],pipes:[ae.$],styles:[""]}),T})();function ls(T,m){if(1&T&&(o.TgZ(0,"div"),o._uU(1),o.qZA()),2&T){const h=o.oxw().$implicit;o.xp6(1),o.hij("",h.value.inputLabel," Tidak Boleh Kosong")}}function cs(T,m){if(1&T&&(o.TgZ(0,"div"),o._uU(1),o.qZA()),2&T){const h=o.oxw().$implicit;o.xp6(1),o.hij("",h.value.inputLabel," Hanya Boleh Huruf Standar Papan Ketik")}}function Os(T,m){if(1&T&&(o.TgZ(0,"mat-form-field",9)(1,"mat-label"),o._uU(2),o.qZA(),o._UZ(3,"input",10),o.TgZ(4,"mat-icon",11),o._uU(5,"wysiwyg"),o.qZA(),o.TgZ(6,"mat-error"),o.YNc(7,ls,2,1,"div",12),o.YNc(8,cs,2,1,"div",12),o.qZA()()),2&T){const h=m.$implicit,A=o.oxw(2);o.Q6J("color","accent"),o.xp6(2),o.Oqu(h.value.inputLabel),o.xp6(1),o.s9C("placeholder",h.value.inputPlaceholder),o.Q6J("formControlName",h.key)("required",h.value.inputRequired),o.xp6(4),o.Q6J("ngIf",A.fg.get(h.key).hasError("required")),o.xp6(1),o.Q6J("ngIf",A.fg.get(h.key).hasError("pattern"))}}function Kr(T,m){if(1&T&&(o.TgZ(0,"form",7),o.YNc(1,Os,9,7,"mat-form-field",8),o.ALo(2,"keyvalue"),o.qZA()),2&T){const h=o.oxw();o.Q6J("formGroup",h.fg),o.xp6(1),o.Q6J("ngForOf",o.lcZ(2,2,h.DATA.input))}}function Nr(T,m){if(1&T&&(o.TgZ(0,"small",13)(1,"i"),o._uU(2),o.qZA()()),2&T){const h=o.oxw();o.xp6(2),o.hij("* ",h.DATA.infoText,"")}}function Ur(T,m){if(1&T&&(o.TgZ(0,"button",14),o._uU(1),o.qZA()),2&T){const h=o.oxw();o.Q6J("mat-dialog-close",!1),o.xp6(1),o.hij(" ",h.DATA.cancelText," ")}}let Zi=(()=>{class T{constructor(h,A,se){this.data=h,this.fb=A,this.gs=se}get DATA(){return this.data}get BALIKAN(){return this.fg.value}ngOnInit(){this.gs.log("[DIALOG_DATA_IN]",this.data);const h={};for(const[A,se]of Object.entries(this.data.input)){const je=[wn.kI.pattern(zn.t.regexEnglishKeyboardKeys)];se.inputRequired&&je.push(wn.kI.required),h[A]=[se.inputValue,wn.kI.compose(je)]}this.fg=this.fb.group(h)}}return T.\u0275fac=function(h){return new(h||T)(o.Y36(u.WI),o.Y36(wn.qu),o.Y36(S.U))},T.\u0275cmp=o.Xpm({type:T,selectors:[["app-material-dialog-input"]],decls:9,vars:7,consts:[["mat-dialog-title",""],["mat-dialog-content","",1,"text-break","text-warning"],[3,"formGroup",4,"ngIf"],["mat-dialog-actions",""],["class","text-start m-2",4,"ngIf"],["type","button","mat-button","",1,"ms-auto","text-success","shiny",3,"mat-dialog-close","disabled"],["type","button","mat-button","",3,"mat-dialog-close",4,"ngIf"],[3,"formGroup"],["appearance","outline","class","p-3 col-12",3,"color",4,"ngFor","ngForOf"],["appearance","outline",1,"p-3","col-12",3,"color"],["matInput","",3,"formControlName","placeholder","required"],["matSuffix",""],[4,"ngIf"],[1,"text-start","m-2"],["type","button","mat-button","",3,"mat-dialog-close"]],template:function(h,A){1&h&&(o.TgZ(0,"h1",0),o._uU(1),o.qZA(),o.TgZ(2,"div",1),o.YNc(3,Kr,3,4,"form",2),o.qZA(),o.TgZ(4,"div",3),o.YNc(5,Nr,3,1,"small",4),o.TgZ(6,"button",5),o._uU(7),o.qZA(),o.YNc(8,Ur,2,2,"button",6),o.qZA()),2&h&&(o.xp6(1),o.Oqu(A.DATA.title),o.xp6(2),o.Q6J("ngIf",A.fg),o.xp6(2),o.Q6J("ngIf",A.DATA.infoText),o.xp6(1),o.Q6J("mat-dialog-close",A.BALIKAN)("disabled",A.fg.invalid),o.xp6(1),o.hij(" ",A.DATA.confirmText," "),o.xp6(1),o.Q6J("ngIf",A.DATA.cancelText))},directives:[u.uh,u.xY,E.O5,wn._Y,wn.JL,wn.sg,E.sg,di.KE,di.hX,_i.Nt,wn.Fj,wn.JJ,wn.u,wn.Q7,w.Hw,di.R9,di.TO,u.H8,d.lW,u.ZT],pipes:[E.Nd],styles:[""]}),T})();var yr=a(7745);let Cs=(()=>{class T{constructor(h,A,se){this.dialog=h,this.gs=A,this.info=se,this.maxWidth="80vw",this.gs.isBrowser&&(this.maxWidth=4===this.gs.gridListBreakpoint?"45vw":3===this.gs.gridListBreakpoint?"50vw":2===this.gs.gridListBreakpoint?"60vw":"80vw")}openInputDialog(h){return"disableClose"in h||(h.disableClose=!0),this.dialog.open(Zi,h)}openInfoDialog(h){return"disableClose"in h||(h.disableClose=!0),"maxWidth"in h||(h.maxWidth=this.maxWidth),this.dialog.open(g,h)}openDmakDialog(h){return"disableClose"in h||(h.disableClose=!0),this.dialog.open(te,h)}openEdictDialog(h){return"disableClose"in h||(h.disableClose=!0),this.dialog.open(En,h)}openBelajarDialog(h){return"disableClose"in h||(h.disableClose=!0),this.dialog.open(fr,h)}leavePageDialog(){var h=this;return(0,n.Z)(function*(){return(yield h.openKonfirmasiDialog("Batal & Keluar","Apakah Yakin Meninggalkan Halaman Ini ?")).afterClosed()})()}openKonfirmasiDialog(h,A,se=!0){var je=this;return(0,n.Z)(function*(){return je.openInfoDialog({data:{title:h,htmlMessage:A,confirmText:"Ya",cancelText:"Tidak"},disableClose:se,maxWidth:je.maxWidth})})()}fetchInformationRegisterMode(h,A=!1){var se=this;return(0,n.Z)(function*(){try{const je=yield l(se.info.getInfo(h.id));h.data.title=je.result.title,h.data.htmlMessage=je.result.content,h.disableClose=je.result.close,A&&(h.data.confirmText=je.result.confirm,h.data.cancelText=je.result.cancel,h.disableClose=!0)}catch(je){se.gs.log("[DIALOG_SERVICE-FETCH_DIALOG_ERROR]",je.error,"error")}return se.openInfoDialog(h)})()}fetchInformation(h){var A=this;return(0,n.Z)(function*(){try{const se=yield l(A.info.getInfo(h.id));h.data.title=se.result.title,h.data.htmlMessage=se.result.content,h.data.confirmText=se.result.confirm,h.data.cancelText=se.result.cancel,h.disableClose=se.result.close}catch(se){A.gs.log("[DIALOG_SERVICE-FETCH_DIALOG_ERROR]",se.error,"error")}})()}openMaintenanceDialog(){var h=this;return(0,n.Z)(function*(){const A={id:"MAINTENANCE",data:{title:"Informasi Perbaikan Web & Server",htmlMessage:"Gagal Memuat Perbaikan Web & Server",confirmText:"Ok, Saya Mengerti!",cancelText:null},disableClose:!1,maxWidth:h.maxWidth};return yield h.fetchInformation(A),h.openInfoDialog(A)})()}openCorsExtension(){var h=this;return(0,n.Z)(function*(){const A={id:"CORS-EXTENSION",data:{title:"Ekstensi CORS Unblock",htmlMessage:"Gagal Memuat Metode Verifikasi",confirmText:"Ya",cancelText:"Tidak"},disableClose:!1,maxWidth:h.maxWidth};return yield h.fetchInformation(A),h.openInfoDialog(A)})()}}return T.\u0275fac=function(h){return new(h||T)(o.LFG(u.uw),o.LFG(S.U),o.LFG(yr.O))},T.\u0275prov=o.Yz7({token:T,factory:T.\u0275fac,providedIn:"root"}),T})()},8439:(rt,B,a)=>{"use strict";a.d(B,{X:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}searchDorama(E,d=""){return this.api.getData(`/dorama?q=${E}&type=${d}`)}getDorama(E){return this.api.getData(`/dorama/${E}`)}addNewDorama(E){return this.api.patchData("/dorama",E)}getSeasonalDorama(E,d){return this.api.getData(`/dorama-seasonal?year=${E}&season=${d}`)}getBerkasDorama(E=[],d="",v=1,y=10,_="",g=""){return this.api.patchData(`/dorama-berkas?q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`,{id:E})}getFansubDorama(E=[],d=1,v=10){return this.api.patchData(`/dorama-fansub?page=${d}&row=${v}`,{id:E})}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},6382:(rt,B,a)=>{"use strict";a.d(B,{r:()=>o});var n=a(5e3),r=a(8406),l=a(8696),u=a(8020);let o=(()=>{class S{constructor(d,v,y){this.router=d,this.gs=v,this.wb=y,this.isHidden=!0,this.newTab=!0,this.targetUrl=null,this.backgroundImage=null,this.backgroundIcon=null,this.tooltipText=null}toggleFab(){this.isHidden=!this.isHidden}showFab(){this.isHidden=!1}hideFab(){this.isHidden=!0}removeFab(){this.isHidden=!0,this.tooltipText=null,this.backgroundIcon=null,this.backgroundImage=null,this.targetUrl=null,this.newTab=null}initializeFab(d,v,y,_,g){this.backgroundIcon=d,this.backgroundImage=v,this.tooltipText=y,this.targetUrl=_,this.newTab=g,this.isHidden=!1}setTooltipText(d){this.tooltipText=d}setNewTab(d){this.newTab=d}setTargetUrl(d){this.targetUrl=d}setBackgroundImage(d){this.backgroundImage=d}setBackgroundIcon(d){this.backgroundIcon=d}buttonClicked(){this.newTab?this.wb.winboxOpenUri(this.targetUrl):this.router.navigateByUrl(this.targetUrl)}}return S.\u0275fac=function(d){return new(d||S)(n.LFG(r.F0),n.LFG(l.U),n.LFG(u.N))},S.\u0275prov=n.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"}),S})()},6781:(rt,B,a)=>{"use strict";a.d(B,{T:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}searchFansub(E="",d=1,v=10,y="",_=""){return this.api.getData(`/fansub?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}`)}createFansub(E){return this.api.postData("/fansub",E)}updateFansub(E,d){return this.api.putData(`/fansub/${E}`,d)}getFansub(E){return this.api.getData(`/fansub/${E}`)}getAllFansub(){return this.api.getData("/fansub-all")}cekSlug(E){return this.api.patchData("/fansub-slug",E)}getBerkasFansub(E=[],d="",v=1,y=10,_="",g=""){return this.api.patchData(`/fansub-berkas?q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`,{id:E})}getAnimeFansub(E=[],d=1,v=10){return this.api.patchData(`/fansub-anime?page=${d}&row=${v}`,{id:E})}getDoramaFansub(E=[],d=1,v=10){return this.api.patchData(`/fansub-dorama?page=${d}&row=${v}`,{id:E})}getRssFeedFansubAllActiveOnly(){return this.api.getData("/fansub-rss-feed-active")}getRssFeedFansubAll(){return this.api.getData("/fansub-rss-feed-all")}getRssFeedFansub(E){return this.api.getData(`/fansub/${E}/rss`)}getFansubMember(E){return this.api.getData(`/fansub/${E}/member`)}getAllFansubMember(E="",d=1,v=10,y="",_=""){return this.api.getData(`/fansub-member?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}`)}requestJoinFansubMember(E){return this.api.postData("/fansub-member",E)}approveRejectFansubMember(E,d){return this.api.putData(`/fansub-member/${E}`,d)}leaveFansubMember(E){return this.api.deleteData(`/fansub-member/${E}`)}getAllSubDomain(E="",d=1,v=12,y="",_=""){return this.api.getData(`/fansub-dns?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}`)}claimSubDomain(E){return this.api.postData("/fansub-dns",E)}getSubDomain(E){return this.api.getData(`/fansub-dns/${E}`)}updateSubDomain(E,d){return this.api.putData(`/fansub-dns/${E}`,d)}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},8696:(rt,B,a)=>{"use strict";a.d(B,{U:()=>zt});var n=a(5e3),r=a(9808),l=a(1159),u=a(6905),o=a(6963),S=a(4799),E=a(2221),y={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function _(Ae,ct){if(!Array.isArray(Ae)||!Ae.length)return Ae;let oe,Q,pe={...y,...ct};if(pe.strictlyTwoElementsInRangeArrays&&!Ae.every((Ce,Ve)=>!(!Array.isArray(Ce)||2!==Ce.length)||(oe=Ve,Q=Ce.length,!1)))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${oe}th range (${JSON.stringify(Ae[oe],null,4)}) has not two but ${Q} elements!`);if(!Ae.every((Ce,Ve)=>!(!Array.isArray(Ce)||!Number.isInteger(Ce[0])||Ce[0]<0||!Number.isInteger(Ce[1])||Ce[1]<0)||(oe=Ve,!1)))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${oe}th range (${JSON.stringify(Ae[oe],null,4)}) does not consist of only natural numbers!`);let fe=Ae.length**2,Re=0;return Array.from(Ae).sort((Ce,Ve)=>(pe.progressFn&&(Re+=1,pe.progressFn(Math.floor(100*Re/fe))),Ce[0]===Ve[0]?Ce[1]Ve[1]?1:0:Ce[0]Array.isArray(Ge)).map(Ge=>[...Ge]).filter(Ge=>void 0!==Ge[2]||Ge[0]!==Ge[1]);fe=oe.progressFn?_(Q,{progressFn:Ge=>{Ce=Math.floor(Ge/5),Ce!==Re&&(Re=Ce,oe.progressFn(Ce))}}):_(Q);let Ve=fe.length-1;for(let Ge=Ve;Ge>0;Ge--)oe.progressFn&&(Ce=Math.floor(78*(1-Ge/Ve))+21,Ce!==Re&&Ce>Re&&(Re=Ce,oe.progressFn(Ce))),(fe[Ge][0]<=fe[Ge-1][0]||!oe.joinRangesThatTouchEdges&&fe[Ge][0]=fe[Ge][0]||fe[Ge-1][1]<=fe[Ge][1])&&null!==fe[Ge-1][2]&&(null===fe[Ge][2]&&null!==fe[Ge-1][2]?fe[Ge-1][2]=null:null!=fe[Ge-1][2]?2==+oe.mergeType&&fe[Ge-1][0]===fe[Ge][0]?fe[Ge-1][2]=fe[Ge][2]:fe[Ge-1][2]+=fe[Ge][2]:fe[Ge-1][2]=fe[Ge][2]),fe.splice(Ge,1),Ge=fe.length);return fe.length?fe:null}function K(Ae,ct){if(!Ae)throw new Error("Invariant failed")}function G(Ae,ct,pe){let fe,oe=0,Q=0;if(0===arguments.length)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if("string"!=typeof Ae)throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof Ae}, equal to: ${JSON.stringify(Ae,null,4)}`);if(ct&&!Array.isArray(ct))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof ct}, equal to: ${JSON.stringify(ct,null,4)}`);if(pe&&"function"!=typeof pe)throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof pe}, equal to: ${JSON.stringify(pe,null,4)}`);if(!ct||!ct.filter(xt=>xt).length)return Ae;fe=Array.isArray(ct)&&Number.isInteger(ct[0])&&Number.isInteger(ct[1])?[Array.from(ct)]:Array.from(ct);let Re=fe.length,Ce=0;fe.filter(xt=>xt).forEach((xt,Mt)=>{if(pe&&(oe=Math.floor(Ce/Re*10),oe!==Q&&(Q=oe,pe(oe))),!Array.isArray(xt))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${Mt}th element not an array: ${JSON.stringify(xt,null,4)}, which is ${typeof xt}`);if(!Number.isInteger(xt[0])){if(!Number.isInteger(+xt[0])||+xt[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${Mt}th element, array ${JSON.stringify(xt,null,0)}. Its first element is not an integer, string index, but ${typeof xt[0]}, equal to: ${JSON.stringify(xt[0],null,4)}.`);fe[Mt][0]=+fe[Mt][0]}if(!Number.isInteger(xt[1])){if(!Number.isInteger(+xt[1])||+xt[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${Mt}th element, array ${JSON.stringify(xt,null,0)}. Its second element is not an integer, string index, but ${typeof xt[1]}, equal to: ${JSON.stringify(xt[1],null,4)}.`);fe[Mt][1]=+fe[Mt][1]}Ce+=1});let Ve=V(fe,{progressFn:xt=>{pe&&(oe=10+Math.floor(xt/10),oe!==Q&&(Q=oe,pe(oe)))}});K(Ve);let Ge=Ve.length;if(Ge>0){let xt=Ae.slice(Ve[Ge-1][1]);Ae=Ve.reduce((Mt,hn,ft,gt)=>(pe&&(oe=20+Math.floor(ft/Ge*80),oe!==Q&&(Q=oe,pe(oe))),`${Mt}${Ae.slice(0===ft?0:gt[ft-1][1],gt[ft][0])}${gt[ft][2]||""}`),""),Ae+=xt}return Ae}function Me(Ae,ct=1){function oe(fe){return Array.from(fe).reverse().join("")}function Q(fe,Re,Ce){let Ve=Ce?"\n":"\r",Ge=Ce?"\r":"\n";if(!fe)return fe;let xt=0,Mt=0,hn="";for(let ft=0,gt=fe.length;ft=0&&(fe=+ct);let Re="",Ce="";if(Ae.trim()){if(!Ae[0].trim())for(let Ve=0,Ge=Ae.length;Ve!(!Array.isArray(Ce)||2!==Ce.length)||(oe=Ve,Q=Ce.length,!1)))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${oe}th range (${JSON.stringify(Ae[oe],null,4)}) has not two but ${Q} elements!`);if(!Ae.every((Ce,Ve)=>!(!Array.isArray(Ce)||!Number.isInteger(Ce[0])||Ce[0]<0||!Number.isInteger(Ce[1])||Ce[1]<0)||(oe=Ve,!1)))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${oe}th range (${JSON.stringify(Ae[oe],null,4)}) does not consist of only natural numbers!`);let fe=Ae.length**2,Re=0;return Array.from(Ae).sort((Ce,Ve)=>(pe.progressFn&&(Re+=1,pe.progressFn(Math.floor(100*Re/fe))),Ce[0]===Ve[0]?Ce[1]Ve[1]?1:0:Ce[0]=0}function Xe(Ae){return"string"==typeof Ae}var Tt={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function ze(Ae,ct=0){return function X({str:Ae,idx:ct=0,stopAtNewlines:pe=!1,stopAtRawNbsp:oe=!1}){if("string"!=typeof Ae||!Ae.length||((!ct||"number"!=typeof ct)&&(ct=0),!Ae[ct+1]))return null;if(Ae[ct+1]&&(Ae[ct+1].trim()||pe&&"\n\r".includes(Ae[ct+1])||oe&&"\xa0"===Ae[ct+1]))return ct+1;if(Ae[ct+2]&&(Ae[ct+2].trim()||pe&&"\n\r".includes(Ae[ct+2])||oe&&"\xa0"===Ae[ct+2]))return ct+2;for(let Q=ct+1,fe=Ae.length;Q"string"==typeof pe&&pe.trim());if("string"==typeof Ae)return Ae.trim()?[Ae]:[];throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_03] ${ct} must be array containing zero or more strings or something falsey. Currently it's equal to: ${Ae}, that a type of ${typeof Ae}.`)}function Be(Ae,ct,pe){return!Ae||!Ae.quotes||!function ue(Ae,ct,pe,oe){for(let Q=ct,fe=Ae.length;Q")}a(9893);var lt=new Set(["!doctype","abbr","address","area","article","aside","audio","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","param","picture","pre","progress","rb","rp","rt","rtc","ruby","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","ul","var","video","wbr","xml"]),Ct=new Set(["a","b","i","p","q","s","u"]),be=new Set([".",",",";","!","?"]),R=new Set([".",",","?",";",")","\u2026",'"',"\xbb"]),$=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]),Ot={ignoreTags:[],ignoreTagsWithTheirContents:[],onlyStripTags:[],stripTogetherWithTheirContents:["script","style","xml"],skipHtmlDecoding:!1,trimOnlySpaces:!1,stripRecognisedHTMLOnly:!1,dumpLinkHrefsNearby:{enabled:!1,putOnNewLine:!1,wrapHeads:"",wrapTails:""},cb:null};function Nt(Ae,ct){var D,ie,Ue,ot,$t,Qt,On,Pn;let pe=Date.now(),oe=[],Q=[],fe=[],Re=[],Ce={};!function Ve(){Ce={attributes:[]}}();let Ge=null,xt=null,Mt={},hn={tagName:"",hrefValue:"",openingTagEnds:void 0},ft="",gt=!1,nt=null,Dt=!0;function mn(pt){return"string"==typeof pt}function bn(pt,un,en){if(Array.isArray(un.stripTogetherWithTheirContents)&&(un.stripTogetherWithTheirContents.includes(Ce.name)||un.stripTogetherWithTheirContents.includes("*")))if(Ce.slashPresent&&Array.isArray(oe)&&oe.some(dn=>dn.name===Ce.name)){for(let dn=oe.length;dn--;)if(oe[dn].name===Ce.name){Re=Re.filter(([Cn,vn])=>(Cn=pt+1)&&(vn<=oe[dn].lastOpeningBracketAt||vn>pt+1));let gn=pt+1;Ce.lastClosingBracketAt&&(gn=Ce.lastClosingBracketAt+1),Re.push([oe[dn].lastOpeningBracketAt,gn]),R.has(Ae[pt])&&un.cb?un.cb({tag:Ce,deleteFrom:oe[dn].lastOpeningBracketAt,deleteTo:pt+1,insert:null,rangesArr:en,proposedReturn:[oe[dn].lastOpeningBracketAt,pt,null]}):un.cb&&un.cb({tag:Ce,deleteFrom:oe[dn].lastOpeningBracketAt,deleteTo:pt,insert:"",rangesArr:en,proposedReturn:[oe[dn].lastOpeningBracketAt,pt,""]}),oe.splice(dn,1);break}}else Ce.slashPresent||oe.push(Ce);else Array.isArray(un.ignoreTagsWithTheirContents)&&ti(pt,un,Ce)&&(Dt=!1)}function Sn(pt,un,en,dn,gn,Cn){var Ci;if(Array.isArray(ln.current())&&"number"==typeof en&&0===ln.current()[0][0]&&ln.current()[0][1]>=en)return"";if(Ae.length===dn&&Cn&&(!on.dumpLinkHrefsNearby||!(null==(Ci=on.dumpLinkHrefsNearby)?void 0:Ci.enabled)))return null;let vn="";if(Number.isInteger(en)&&enCn+1){let ui=pt.slice(Cn+1,dn);dn&&!ze(Ae,dn-1)&&(ui=ui.trimEnd()),ui.includes("\n")&&Gn(dn,pt)?vn+=" ":vn+=ui}let oi=!R.has(pt[un]),pi=">"!==pt[dn-1]||!pt[en].trim(),ni=!['"',"("].includes(pt[gn-1]),ii=![";",".",":","!"].includes(pt[un]);if((oi||pi&&ni&&ii)&&(pi||ni)&&"!"!==pt[un]&&(!$.has(Ce.name)||"number"==typeof en&&enCn+1)){let ui=vn.match(/\n/g);return Array.isArray(ui)&&ui.length?1===ui.length?"\n":2===ui.length?"\n\n":"\n\n\n":" "}return""}function Vn(pt,un){var en,dn;if((null==(en=pt.dumpLinkHrefsNearby)?void 0:en.enabled)&&hn.tagName&&hn.tagName===Ce.name&&Ce.lastOpeningBracketAt&&(hn.openingTagEnds&&Ce.lastOpeningBracketAt>hn.openingTagEnds||!hn.openingTagEnds)&&(gt=!0),gt){let gn=(null==(dn=pt.dumpLinkHrefsNearby)?void 0:dn.putOnNewLine)?"\n\n":"";ft=`${gn}${hn.hrefValue}`,("number"!=typeof un||ze(Ae,un-1))&&(ft+=gn)}}function Gn(pt,un){return un?"<"===un[pt]&&"%"!==un[pt+1]:"<"===Ae[pt]&&"%"!==Ae[pt+1]}function Rn(pt){return">"===Ae[pt]&&"%"!==Ae[pt-1]}function ti(pt,un,en){if(un.ignoreTagsWithTheirContents.includes("*"))return!0;let dn=Ae.indexOf(`<${en.name}`,pt),gn=Ae.indexOf(`Cn.name===en.name)||gn>-1&&dn>-1&&dn"string"==typeof pt||(cn.el=pt,cn.i=un,!1)))throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_05] Optional Options Object's key stripTogetherWithTheirContents was set to contain not just string elements! For example, element at index ${cn.i} has a value ${cn.el} which is not string but ${(typeof cn.el).toLowerCase()}.`);on.cb||(on.cb=({rangesArr:pt,proposedReturn:un})=>{un&&pt.push(...un)});let ln=new class{constructor(Ae){du(this,"ranges"),du(this,"opts");let ct={...Tt,...Ae};if(ct.mergeType&&1!==ct.mergeType&&2!==ct.mergeType)if(Xe(ct.mergeType)&&"1"===ct.mergeType.trim())ct.mergeType=1;else{if(!Xe(ct.mergeType)||"2"!==ct.mergeType.trim())throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof ct.mergeType}", equal to ${JSON.stringify(ct.mergeType,null,4)}`);ct.mergeType=2}this.opts=ct,this.ranges=[]}add(Ae,ct,pe){if(null==Ae&&null==ct)return;if(he(Ae)&&!he(ct)){if(Array.isArray(Ae)){if(Ae.length){if(Ae.some(fe=>Array.isArray(fe)))return void Ae.forEach(fe=>{Array.isArray(fe)&&this.add(...fe)});Ae.length&&Ie(+Ae[0])&&Ie(+Ae[1])&&this.add(...Ae)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(Ae,null,0)}) but second-one, "to" is not (${JSON.stringify(ct,null,0)})`)}if(!he(Ae)&&he(ct))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(ct,null,0)}) but first-one, "from" is not (${JSON.stringify(Ae,null,0)})`);let oe=+Ae,Q=+ct;if(Ie(pe)&&(pe=String(pe)),!Ie(oe)||!Ie(Q))throw Ie(oe)&&oe>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof Q}" equal to: ${JSON.stringify(Q,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof oe}" equal to: ${JSON.stringify(oe,null,4)}`);if(he(pe)&&!Xe(pe)&&!Ie(pe))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof pe}, equal to:\n${JSON.stringify(pe,null,4)}`);if(he(this.ranges)&&Array.isArray(this.last())&&oe===this.last()[1]){if(this.last()[1]=Q,this.last(),null!==this.last()[2]&&he(pe)){let fe=!this.last()[2]||!this.last()[2].length||this.opts&&this.opts.mergeType&&1!==this.opts.mergeType?pe:`${this.last()[2]}${pe}`;this.opts.limitToBeAddedWhitespace&&(fe=Me(fe,this.opts.limitLinebreaksCount)),Xe(fe)&&!fe.length||(this.last()[2]=fe)}}else{this.ranges||(this.ranges=[]);let fe=void 0===pe||Xe(pe)&&!pe.length?[oe,Q]:[oe,Q,pe&&this.opts.limitToBeAddedWhitespace?Me(pe,this.opts.limitLinebreaksCount):pe];this.ranges.push(fe)}}push(Ae,ct,pe){this.add(Ae,ct,pe)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=function ne(Ae,ct){function pe(Ge){return!!Ge&&"object"==typeof Ge&&!Array.isArray(Ge)}if(!Array.isArray(Ae)||!Ae.length)return null;let oe;if(ct){if(!pe(ct))throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n${JSON.stringify(ct,null,4)} (type ${typeof ct})`);if(oe={...j,...ct},oe.progressFn&&pe(oe.progressFn)&&!Object.keys(oe.progressFn).length)oe.progressFn=null;else if(oe.progressFn&&"function"!=typeof oe.progressFn)throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof oe.progressFn}", equal to ${JSON.stringify(oe.progressFn,null,4)}`);if(![1,2,"1","2"].includes(oe.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof oe.mergeType}", equal to ${JSON.stringify(oe.mergeType,null,4)}`);if("boolean"!=typeof oe.joinRangesThatTouchEdges)throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof oe.joinRangesThatTouchEdges}", equal to ${JSON.stringify(oe.joinRangesThatTouchEdges,null,4)}`)}else oe={...j};let fe,Re,Ce,Q=Ae.filter(Ge=>Array.isArray(Ge)).map(Ge=>[...Ge]).filter(Ge=>void 0!==Ge[2]||Ge[0]!==Ge[1]);fe=oe.progressFn?de(Q,{progressFn:Ge=>{Ce=Math.floor(Ge/5),Ce!==Re&&(Re=Ce,oe.progressFn(Ce))}}):de(Q);let Ve=fe.length-1;for(let Ge=Ve;Ge>0;Ge--)oe.progressFn&&(Ce=Math.floor(78*(1-Ge/Ve))+21,Ce!==Re&&Ce>Re&&(Re=Ce,oe.progressFn(Ce))),(fe[Ge][0]<=fe[Ge-1][0]||!oe.joinRangesThatTouchEdges&&fe[Ge][0]=fe[Ge][0]||fe[Ge-1][1]<=fe[Ge][1])&&null!==fe[Ge-1][2]&&(null===fe[Ge][2]&&null!==fe[Ge-1][2]?fe[Ge-1][2]=null:null!=fe[Ge-1][2]?2==+oe.mergeType&&fe[Ge-1][0]===fe[Ge][0]?fe[Ge-1][2]=fe[Ge][2]:fe[Ge-1][2]+=fe[Ge][2]:fe[Ge-1][2]=fe[Ge][2]),fe.splice(Ge,1),Ge=fe.length);return fe.length?fe:null}(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(Ae=>he(Ae[2])?[Ae[0],Ae[1],Me(Ae[2],this.opts.limitLinebreaksCount)]:Ae):this.ranges):null}wipe(){this.ranges=[]}replace(Ae){if(Array.isArray(Ae)&&Ae.length){if(!Array.isArray(Ae[0])||!Ie(Ae[0][0]))throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(Ae[0],null,4)} should be an array and its first element should be an integer, a string index.`);this.ranges=Array.from(Ae)}else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}}({limitToBeAddedWhitespace:!0,limitLinebreaksCount:2});if(!on.skipHtmlDecoding)for(;Ae!==(0,E.decode)(Ae,{scope:"strict"});)Ae=(0,E.decode)(Ae,{scope:"strict"});let Ye=!1,Pe=!1;for(let pt=0,un=Ae.length;pt1&&Ce.lastClosingBracketAt&&Ce.lastClosingBracketAtpt){pt=en;continue}}if(!Ye&&Rn(pt)&&(!Ce||Object.keys(Ce).length<2)&&pt>1)for(let en=pt;en--;)if(void 0===Ae[en-1]||Rn(en)){let dn=void 0===Ae[en-1]?en:en+1,gn=Ae.slice(dn,pt+1);if(Ae!==`<${o(gn.trim(),"/>")}>`&&[...lt].some(Cn=>o(gn.trim().split(/\s+/).filter(vn=>vn.trim()).filter((vn,oi)=>0===oi),"/>").toLowerCase()===Cn)&&""===Nt(`<${gn.trim()}>`,on).result){(!fe.length||fe[fe.length-1][0]!==Ce.lastOpeningBracketAt)&&fe.push([dn,pt+1]),(!Re.length||Re[Re.length-1][0]!==Ce.lastOpeningBracketAt)&&Re.push([dn,pt+1]);let Cn=Sn(Ae,pt,dn,pt+1,dn,pt+1),vn=pt+1;if(Ae[vn]&&!Ae[vn].trim())for(let oi=vn;oi{var gn,Cn;if("string"==typeof dn.name&&"href"===dn.name.toLowerCase())return en=`${(null==(gn=on.dumpLinkHrefsNearby)?void 0:gn.wrapHeads)||""}${dn.value}${(null==(Cn=on.dumpLinkHrefsNearby)?void 0:Cn.wrapTails)||""}`,!0})&&(hn={tagName:Ce.name,hrefValue:en,openingTagEnds:void 0})}else!Pe&&!Ce.quotes&&Ce.nameStarts&&(Ce.quotes={},Ce.quotes.value=Ae[pt],Ce.quotes.start=pt,Mt.nameStarts&&Mt.nameEnds&&Mt.nameEnds!(dn===Ce.leftOuterWhitespace&&gn===pt))),on.cb({tag:Ce,deleteFrom:Ce.leftOuterWhitespace,deleteTo:pt,insert:`${en}${ft}${en}`,rangesArr:ln,proposedReturn:[Ce.leftOuterWhitespace,pt,`${en}${ft}${en}`]}),Jn(),bn(pt,on,ln)}}if((null==(Ue=Ce.quotes)?void 0:Ue.start)&&Ce.quotes.start/!".includes(Ae[pt])&&!Mt.nameStarts&&!Ce.lastClosingBracketAt&&(Mt.nameStarts=pt),null!==Ce.lastOpeningBracketAt&&Ce.lastOpeningBracketAt"===Ae[pt])&&void 0!==Ce.lastOpeningBracketAt){if(void 0===Ce.lastClosingBracketAt){if(Ce.lastOpeningBracketAtdn!==en.lastOpeningBracketAt),Re.push([en.lastOpeningBracketAt,pt+1])):Re.push([Ce.lastOpeningBracketAt,pt+1])}else Re.push([Ce.lastOpeningBracketAt,pt+1])}}else if(pt>Ce.lastClosingBracketAt&&Ae[pt].trim()||void 0===Ae[pt+1]){let en=Ce.lastClosingBracketAt===pt?pt+1:pt;on.trimOnlySpaces&&en===un-1&&null!==nt&&ntCn.equalsAt))){(!Re.length||Re[Re.length-1][0]!==Ce.lastOpeningBracketAt)&&Re.push([Ce.lastOpeningBracketAt,Ce.lastClosingBracketAt+1]);let vn,Cn=Sn(Ae,pt,Ce.leftOuterWhitespace,en,Ce.lastOpeningBracketAt,Ce.lastClosingBracketAt);ft="",gt=!1,Vn(on,en),mn(ft)&&ft.length?(vn=`${Cn}${ft}${"\n\n"===Cn?"\n":Cn}`,en===Ce.lastClosingBracketAt+1&&(!Ae[en]||!be.has(Ae[en]))&&(vn+=" "),Ce.leftOuterWhitespace===Ce.lastOpeningBracketAt&&ln.last()&&ln.last()[1]pt)&&oi++}on.cb({tag:Ce,deleteFrom:Ce.leftOuterWhitespace,deleteTo:en+oi,insert:vn,rangesArr:ln,proposedReturn:[Ce.leftOuterWhitespace,en+oi,vn]}),Jn(),bn(pt,on,ln)}else Ce={};Rn(pt)||(Ce={})}Pe&&(Pe=!1)}if((!Ye||"<"===Ae[pt]&&ze(Ae,ze(Ae,pt))&&"/"===Ae[ze(Ae,pt)]&&Ae.startsWith("script",ze(Ae,ze(Ae,pt))))&&Gn(pt)&&!Gn(pt-1)&&!"'\"".includes(Ae[pt+1])&&(!"'\"".includes(Ae[pt+2])||/\w/.test(Ae[pt+1]))&&("c"!==Ae[pt+1]||":"!==Ae[pt+2])&&("f"!==Ae[pt+1]||"m"!==Ae[pt+2]||"t"!==Ae[pt+3]||":"!==Ae[pt+4])&&("s"!==Ae[pt+1]||"q"!==Ae[pt+2]||"l"!==Ae[pt+3]||":"!==Ae[pt+4])&&("x"!==Ae[pt+1]||":"!==Ae[pt+2])&&("f"!==Ae[pt+1]||"n"!==Ae[pt+2]||":"!==Ae[pt+3])&&Be(Ce,Ae,pt)){if(Rn(ze(Ae,pt)))continue;if(Ce.nameEnds&&Ce.nameEnds"==`${Ae[gn-2]}${Ae[gn-1]}${Ae[gn]}`||!en&&"--\x3e"==`${Ae[gn-2]}${Ae[gn-1]}${Ae[gn]}`)&&(dn=gn),dn&&(dn"===Ae[gn])&&(Cn+=1),(!fe.length||fe[fe.length-1][0]!==Ce.lastOpeningBracketAt)&&fe.push([Ce.lastOpeningBracketAt,dn+1]),(!Re.length||Re[Re.length-1][0]!==Ce.lastOpeningBracketAt)&&Re.push([Ce.lastOpeningBracketAt,dn+1]);let vn=Sn(Ae,gn,Ce.leftOuterWhitespace,Cn,Ce.lastOpeningBracketAt,dn);on.cb({tag:Ce,deleteFrom:Ce.leftOuterWhitespace,deleteTo:Cn,insert:vn,rangesArr:ln,proposedReturn:[Ce.leftOuterWhitespace,Cn,vn]}),pt=gn-1,">"===Ae[gn]&&(pt=gn),Ce={},Mt={};break}}}Ae[pt].trim()?null!==Ge&&(!Ce.quotes&&Mt.equalsAt>Ge-1&&Mt.nameEnds&&Mt.equalsAt>Mt.nameEnds&&'"'!==Ae[pt]&&"'"!==Ae[pt]&&(u(Mt)&&Ce.attributes.push(Mt),Mt={},Ce.equalsSpottedAt=void 0),Ge=null):null===Ge&&(Ge=pt,void 0!==Ce.lastOpeningBracketAt&&Ce.lastOpeningBracketAten.name===Ce.name)&&(Ce.onlyPlausible=!0,Ce.name=void 0,Ce.nameStarts=void 0))," "===Ae[pt]?null===xt&&(xt=pt):null!==xt&&(xt=null),"script"===Ce.name&&(Ye=!Ce.slashPresent)}if(Ae&&(on.trimOnlySpaces&&" "===Ae[0]||!on.trimOnlySpaces&&!Ae[0].trim()))for(let pt=0,un=Ae.length;pt{class Ae{constructor(pe,oe){this.localStorageKeys={AturanTatib:`${yt.N.siteName}_AturanTatib`,DebugLogs:`${yt.N.siteName}_DebugLogs`,DarkMode:`${yt.N.siteName}_DarkMode`,token:`${yt.N.siteName}_Token`,LiveChatResults:`${yt.N.siteName}_LiveChatResults`,SearchResults:`${yt.N.siteName}_SearchResults`,Torrents:`${yt.N.siteName}_Torrents`},this.forceEnableDebugLog=null,this.separatorKeysCodes=[l.K5,l.OC],this.routerData=null,this.previousUrl=null,this.bgImgUrlPath=null,this.bannerImg=null,this.sizeContain=!1,this.bgRepeat=!1,this.leftMenuImage=null,this.rightMenuImage=null,this.isBrowser=null,this.document=null,this.gridListBreakpoint=1,this.isDesktop=!0,this.isDevMode=!0,this.isDarkMode=!1,this.weatherEffect=null,this.weatherRunning=!1,this.angularEditorConfig={editable:!0,minHeight:"256px",placeholder:"Deskripsi, Informasi, Atau Keterangan Lainnya ...",uploadUrl:`${yt.N.apiUrl}/image`,uploadWithCredentials:!0,defaultParagraphSeparator:"div",toolbarHiddenButtons:[[],[]],customClasses:[{name:"white-space-normal-important",class:"white-space-normal-important"},{name:"text-decoration-none",class:"text-decoration-none"}]},this.seasonalWeather=[{id:1,name:bt.F.WINTER,cssClassName:"snow",img:"/assets/img/season/winter.png"},{id:2,name:bt.F.SPRING,cssClassName:"sakura",img:"/assets/img/season/spring.png"},{id:3,name:bt.F.SUMMER,cssClassName:null,img:"/assets/img/season/summer.png"},{id:4,name:bt.F.FALL,cssClassName:"fall",img:"/assets/img/season/fall.png"}],this.isBrowser=(0,r.NF)(pe),this.document=oe,this.isDevMode=(0,n.X6Q)(),this.isBrowser&&(this.onResize(null),this.weatherJS())}log(pe,oe=null,Q="log"){if(this.isBrowser&&(this.forceEnableDebugLog="true"===localStorage.getItem(this.localStorageKeys.DebugLogs)),this.isDevMode||this.forceEnableDebugLog){let fe=null;fe="warn"===Q?console.warn:"error"===Q?console.error:"table"===Q?console.table:console.log,oe?fe(pe,oe):fe(pe)}}getDirtyValues(pe){const oe={};for(const Q of Object.keys(pe.controls)){const fe=pe.get(Q);fe.dirty&&(oe[Q]=fe.value)}return oe}get randomColor(){return(16777215*Math.random()<<0).toString(16)}get bgImgUrl(){return this.isDesktop?this.bgImgUrlPath:null}onResize(pe,oe="APP_COMPONENT"){var Q;if(pe&&this.log(`[WINDOW_RESIZE-${oe}]`,pe),this.isBrowser){const fe=(null===(Q=null==pe?void 0:pe.target)||void 0===Q?void 0:Q.window)||window;this.leftMenuImage="/assets/img/background/left-menu.png",this.rightMenuImage="/assets/img/background/right-panel.png",fe.innerWidth>1200?(this.isDesktop=!0,this.gridListBreakpoint=4):fe.innerWidth>992?(this.isDesktop=!0,this.gridListBreakpoint=3):fe.innerWidth>768?(this.isDesktop=!1,this.gridListBreakpoint=2):(this.isDesktop=!1,this.gridListBreakpoint=1,this.leftMenuImage=null,this.rightMenuImage="")}}htmlToText(pe){return pe?Nt(pe).result:""}shuffle(pe){let oe=pe.length,Q=0,fe=0;for(;0!==oe;)fe=Math.floor(Math.random()*oe),oe-=1,Q=pe[oe],pe[oe]=pe[fe],pe[fe]=Q;return pe}cleanObject(pe){for(const oe in pe)pe[oe]||delete pe[oe]}includesOneOf(pe,oe){for(const Q of oe)if(null==pe?void 0:pe.includes(Q))return!0;return!1}linkify(pe){if(pe){const Q=/(^|[^\/])(www\.[\S]+(\b|$))/gim,fe=/[\w.]+@[a-zA-Z_-]+?(?:\.[a-zA-Z]{2,6})+/gim;return pe.replace(/\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim,'$&').replace(Q,'$1$2').replace(fe,'$&')}return""}toggleDarkTheme(pe=!1){pe?this.isDarkMode?this.document.body.classList.add("bifeldy-dark-theme"):this.document.body.classList.remove("bifeldy-dark-theme"):this.isDarkMode?(this.isDarkMode=!1,this.document.body.classList.remove("bifeldy-dark-theme")):(this.isDarkMode=!0,this.document.body.classList.add("bifeldy-dark-theme"))}rssLink(pe){if("string"==typeof pe)return pe;let oe=pe.findIndex(Q=>"alternate"===Q.rel&&"text/html"===Q.type);return oe<0?pe.length>0?pe[pe.length-1].href:"":pe[oe].href}weatherJS(){const pe=(new Date).getMonth()+1,oe=this.seasonalWeather.find(Q=>Q.id===Math.ceil(pe/3));(null==oe?void 0:oe.cssClassName)&&(this.weatherEffect=new Sakura("body",{className:oe.cssClassName,lifeTime:5e3}),this.weatherRunning=!0)}weatherToggle(){this.weatherRunning?(this.weatherEffect.stop(!0),this.weatherRunning=!1):(this.weatherEffect.start(),this.weatherRunning=!0)}}return Ae.\u0275fac=function(pe){return new(pe||Ae)(n.LFG(n.Lbi),n.LFG(r.K0))},Ae.\u0275prov=n.Yz7({token:Ae,factory:Ae.\u0275fac,providedIn:"root"}),Ae})()},7902:(rt,B,a)=>{"use strict";a.d(B,{X:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}uploadImage(E){return this.api.postData("/image",E,!0,{headers:{"ngsw-bypass":"true"}})}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},7745:(rt,B,a)=>{"use strict";a.d(B,{O:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}getAllInfo(E,d,v,y,_){return this.api.getData(`/information?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}`)}getInfo(E){return this.api.getData(`/information/${E}`)}createUpdateInfo(E){return this.api.postData("/information",E)}deleteInfo(E){return this.api.deleteData(`/information/${E}`)}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},7:(rt,B,a)=>{"use strict";a.d(B,{S:()=>l});var n=a(5e3),r=a(8696);let l=(()=>{class u{constructor(S){this.gs=S,this.sideNav=null,this.sideNavExpanded=!1,this.linkText=!1,this.opened=!0,this.mainMenus=[{name:"Beranda",link:"/home",icon:"dashboard",badge:null},{name:"Berita & Informasi",link:"/news",icon:"receipt_long",badge:null}],this.contentMenus=[{name:"Anime Musiman",link:"/anime",icon:"live_tv",badge:null},{name:"Film Drama",link:"/dorama",icon:"movie",badge:null},{name:"Katalog Fansub",link:"/fansub",icon:"closed_caption",badge:null},{name:"Berbagi Garapan",link:"/berkas",icon:"file_copy",badge:null}],this.additionalMenus=[{name:"E-Mail@FanSub.ID",link:"/mailbox",icon:"mail_outline",badge:null},{name:"Nihongo \u65e5\u672c\u8a9e",link:"/nihongo",icon:"translate",badge:null},{name:"Admin & Mod Panel",link:"/admin-mod",icon:"admin_panel_settings",badge:null}],this.miscMenus=[{name:"RSS Feed",link:"/rss-feed",icon:"rss_feed",badge:null}],this.otherMenus=[{name:"Kebijakan Privasi",link:"/privacy-policy",icon:"policy",badge:null}],this.gs.isBrowser&&(this.opened=window.innerWidth>=992)}changeSideNavState(){this.linkText=this.sideNavExpanded}forceCloseSideNav(){!this.gs.isDesktop&&this.sideNav.opened&&this.sideNav.close(),this.onMouseHoverOut()}onSideNavToggleView(){this.sideNav.opened?(this.sideNav.close(),this.gs.isDesktop||this.onMouseHoverOut()):(this.sideNav.open(),this.gs.isDesktop||this.onMouseHoverIn())}onSideNavToggleExpanded(){this.sideNavExpanded=!this.sideNavExpanded,this.changeSideNavState()}onMouseHoverIn(){!1===this.sideNavExpanded&&(this.sideNavExpanded=!0,this.changeSideNavState())}onMouseHoverOut(){!0===this.sideNavExpanded&&(this.sideNavExpanded=!1,this.changeSideNavState())}}return u.\u0275fac=function(S){return new(S||u)(n.LFG(r.U))},u.\u0275prov=n.Yz7({token:u,factory:u.\u0275fac,providedIn:"root"}),u})()},3379:(rt,B,a)=>{"use strict";a.d(B,{n:()=>u});var n=a(5e3),r=a(8379),l=a(8696);let u=(()=>{class o{constructor(E,d){this.cs=E,this.gs=d}getItem(E,d=!1){if(!this.gs.isBrowser)return null;if(!d)return localStorage.getItem(E);try{const v=localStorage.getItem(E),y=this.cs.msgDecrypt(v);return JSON.parse(y)}catch(v){return this.removeItem(E),null}}setItem(E,d){if(this.gs.isBrowser)if("string"==typeof d)localStorage.setItem(E,d);else{const v=JSON.stringify(d),y=this.cs.msgEncrypt(v);localStorage.setItem(E,y)}}removeItem(E){this.gs.isBrowser&&localStorage.removeItem(E)}clear(){if(this.gs.isBrowser)for(const E of Object.keys(this.gs.localStorageKeys))"Torrents"!==E&&this.removeItem(this.gs.localStorageKeys[E])}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.$),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},9618:(rt,B,a)=>{"use strict";a.d(B,{Y:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}getAllNews(E="",d=1,v=10,y="",_=""){return this.api.getData(`/news?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}`)}createNews(E){return this.api.postData("/news",E)}updateNews(E,d){return this.api.putData(`/news/${E}`,d)}getNews(E){return this.api.getData(`/news/${E}`)}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},2663:(rt,B,a)=>{"use strict";a.d(B,{a:()=>u});var n=a(5e3),r=a(9731),l=a(8696);let u=(()=>{class o{constructor(E,d){this.api=E,this.gs=d}getAllNihongo(E="",d="",v=1,y=10,_="",g=""){return this.api.getData(`/nihongo?category=${E}&q=${d}&page=${v}&row=${y}&sort=${_}&order=${g}`)}getAllKategori(){return this.api.patchData("/nihongo")}createNihongo(E){return this.api.postData("/nihongo",E)}updateNihongo(E,d){return this.api.putData(`/nihongo/${E}`,d)}getHirakata(){return this.api.getData("/nihongo-hirakata-all")}getAllKanji(E="",d="",v="",y=1,_=10,g="",C=""){return this.api.getData(`/nihongo-kanji?jlpt=${E}&school=${d}&q=${v}&page=${y}&row=${_}&sort=${g}&order=${C}`)}getAllEdict(E="",d=1,v=10,y="",_=""){return this.api.getData(`/nihongo-edict?q=${E}&page=${d}&row=${v}&sort=${y}&order=${_}`)}}return o.\u0275fac=function(E){return new(E||o)(n.LFG(r.s),n.LFG(l.U))},o.\u0275prov=n.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},7140:(rt,B,a)=>{"use strict";a.d(B,{T:()=>u});var n=a(5934),r=a(5e3),l=a(8696);let u=(()=>{class o{constructor(E){this.gs=E,this.notifications=[],this.dissmissTimeout={},this.timedOut=null,this.gs.isBrowser&&this.notifications.push({notifCreator:null,notifData:{id:`${n.N.siteName.toUpperCase()}_UNDER_DEVELOPMENT`,type:"info",title:"Pemberitahuan!",content:'\n Jika ingin request fitur baru ataupun melaporkan Bug dapat menulis pesan di kanal Discord\n \'#dev-prog\'.\n Terima kasih. ^_^\n ',dismissible:!0}})}addNotif(E,d,v,y,_,g=!0){g&&(this.dissmissTimeout[d]=setTimeout(()=>this.removeNotif(d),1e4)),this.notifications.splice(0,0,{notifCreator:E,notifData:{id:d,type:v,title:y,content:_,dismissible:g}})}removeNotif(E){this.dissmissTimeout[E]&&(clearTimeout(this.dissmissTimeout[E]),this.dissmissTimeout[E]=null,delete this.dissmissTimeout[E]),this.timedOut=setTimeout(()=>{const d=this.notifications.findIndex(v=>v.notifData.id===E);d>=0&&(this.notifications=this.notifications.slice(0,d).concat(this.notifications.slice(d+1,this.notifications.length)))},500)}}return o.\u0275fac=function(E){return new(E||o)(r.LFG(l.U))},o.\u0275prov=r.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})()},8745:(rt,B,a)=>{"use strict";a.d(B,{Z:()=>S});var n=a(5934),r=a(5e3),l=a(2313),u=a(8696),o=a(8406);let S=(()=>{class E{constructor(v,y,_,g){this.t=v,this.m=y,this.gs=_,this.router=g,this.siteName=n.N.siteName,this.title="",this.description="",this.keywords="",this.image="",this.author="",this.header=""}get getHeaderTitle(){return this.header!==this.title?this.header:this.title}get getDescription(){return this.description}get getKeywords(){return this.keywords}updatePageMetaData(v,y,_,g=`${n.N.baseUrl}/assets/img/favicon.png`,C="\u300c\u{1f4a4} Fansub \u2728 ID \u{1f31e}\u300d"){this.title=v,this.updatePageHeader(),this.description=this.gs.htmlToText(y),this.keywords=_,this.image=g.startsWith("/")?n.N.baseUrl+g:g,this.author=C,this.t.setTitle(`${this.title} | ${this.siteName}`),this.m.updateTag({name:"keywords",content:this.keywords}),this.m.updateTag({name:"author",content:this.author}),this.m.updateTag({property:"og:title",content:`${this.title} | ${this.siteName}`}),this.m.updateTag({property:"og:image",content:this.image}),this.m.updateTag({name:"twitter:title",content:`${this.title} | ${this.siteName}`}),this.description&&(this.m.updateTag({name:"description",content:this.description}),this.m.updateTag({property:"og:description",content:this.description}),this.m.updateTag({name:"twitter:description",content:this.description})),this.m.updateTag({name:"twitter:image",content:this.image}),this.router.url.split("?")[0].includes("/berkas/")&&!this.image.includes(n.N.baseUrl)&&this.m.updateTag({name:"twitter:card",content:"summary_large_image"})}updateStatusBarTheme(v){this.m.updateTag(v?{name:"theme-color",content:"#673ab7"}:{name:"theme-color",content:"#3f51b5"})}updatePageHeader(v=null){this.header=v||this.title}}return E.\u0275fac=function(v){return new(v||E)(r.LFG(l.Dx),r.LFG(l.h_),r.LFG(u.U),r.LFG(o.F0))},E.\u0275prov=r.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"}),E})()},7814:(rt,B,a)=>{"use strict";a.d(B,{C:()=>ye});var n=a(5e3),r=a(8696),l=a(9618),u=a(7845),o=a(2663),S=a(519),E=a(8439),d=a(6781),v=a(8987),y=a(8058),_=a(3379),g=a(7322),C=a(7531),w=a(3075),V=a(5245),te=a(9808),U=a(4623),K=a(8406),ce=a(508);function le(X,ze){if(1&X&&(n.TgZ(0,"mat-list-option",11),n._UZ(1,"img",12),n.TgZ(2,"h4",13),n._uU(3),n.qZA(),n.TgZ(4,"h5",13)(5,"span",14),n._uU(6),n.qZA(),n._uU(7," \xa0 "),n.TgZ(8,"span",15),n._uU(9),n.ALo(10,"date"),n.qZA()()()),2&X){const re=ze.$implicit;n.MGl("routerLink","/news/",re.id,""),n.xp6(1),n.s9C("src",re.image_url,n.LSH),n.xp6(2),n.Oqu(re.title),n.xp6(3),n.Oqu(re.user_.username),n.xp6(3),n.Oqu(n.xi3(10,5,re.created_at,"d-MM-y"))}}function G(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Berita"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,le,11,8,"mat-list-option",10),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.beritaResults,0,5))}}function W(X,ze){if(1&X){const re=n.EpF();n.TgZ(0,"mat-list-option",17),n.NdJ("click",function(){const I=n.CHM(re).$implicit;return n.oxw(2).openEdict(I)}),n.TgZ(1,"h4",18),n._uU(2),n.qZA(),n.TgZ(3,"h5",18)(4,"span",14),n._uU(5),n.qZA(),n._uU(6," \xa0 "),n.TgZ(7,"span",15),n._uU(8),n.qZA()()()}if(2&X){const re=ze.$implicit;n.xp6(2),n.lnq(" ",re.character," | ",re.v_kunyomi,"| ",re.v_onyomi," "),n.xp6(3),n.hij("N",re.jlpt,""),n.xp6(3),n.Oqu(re.translate)}}function H(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Kanji"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,W,9,5,"mat-list-option",16),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.kanjiResults,0,5))}}function Me(X,ze){if(1&X&&(n.TgZ(0,"mat-list-option",11),n._UZ(1,"img",12),n.TgZ(2,"h4",13),n._uU(3),n.qZA(),n.TgZ(4,"h5",13)(5,"span",14),n._uU(6),n.qZA(),n._uU(7," \xa0 "),n.TgZ(8,"span",15),n._uU(9),n.qZA()()()),2&X){const re=ze.$implicit,He=n.oxw(2);n.hYB("routerLink","/anime/",re.id,"-",He.getAnimeTitle(re.title),""),n.xp6(1),n.s9C("src",re.image_url,n.LSH),n.xp6(2),n.Oqu(re.title),n.xp6(3),n.Oqu(re.id),n.xp6(3),n.AsE("",re.num_episodes," Eps ",null==re.media_type?null:re.media_type.toUpperCase(),"")}}function q(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Anime"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,Me,10,7,"mat-list-option",10),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.animeResults,0,5))}}function de(X,ze){if(1&X&&(n.TgZ(0,"mat-list-option",11),n._UZ(1,"img",12),n.TgZ(2,"h4",13),n._uU(3),n.qZA(),n.TgZ(4,"h5",13)(5,"span",14),n._uU(6),n.qZA(),n._uU(7," \xa0 "),n.TgZ(8,"span",15),n._uU(9),n.qZA()()()),2&X){const re=ze.$implicit;n.MGl("routerLink","/dorama/",re.slug,""),n.xp6(1),n.s9C("src",re.thumb,n.LSH),n.xp6(2),n.Oqu(re.title),n.xp6(3),n.Oqu(re.mdl_id),n.xp6(3),n.Oqu(re.type)}}function Te(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Dorama"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,de,10,5,"mat-list-option",10),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.doramaResults,0,5))}}function j(X,ze){if(1&X&&(n.TgZ(0,"mat-list-option",11),n._UZ(1,"img",12),n.TgZ(2,"h4",13),n._uU(3),n.qZA(),n.TgZ(4,"h5",13)(5,"span",14),n._uU(6),n.qZA(),n._uU(7," \xa0 "),n.TgZ(8,"span",15),n._uU(9),n.ALo(10,"date"),n.qZA()()()),2&X){const re=ze.$implicit;n.MGl("routerLink","/fansub/",re.slug,""),n.xp6(1),n.s9C("src",re.image_url,n.LSH),n.xp6(2),n.Oqu(re.name),n.xp6(3),n.Oqu(re.active?"Aktif":"Tidak Aktif"),n.xp6(3),n.Oqu(n.xi3(10,5,re.born,"d-MM-y"))}}function ne(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Fansub"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,j,11,8,"mat-list-option",10),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.fansubResults,0,5))}}function Z(X,ze){if(1&X&&(n.TgZ(0,"mat-list-option",11),n._UZ(1,"img",12),n.TgZ(2,"h4",13),n._uU(3),n.qZA(),n.TgZ(4,"h5",13)(5,"span",14),n._uU(6),n.qZA(),n._uU(7," \xa0 "),n.TgZ(8,"span",15),n._uU(9),n.ALo(10,"date"),n.qZA()()()),2&X){const re=ze.$implicit;n.MGl("routerLink","/berkas/",re.id,""),n.xp6(1),n.s9C("src",re.image_url,n.LSH),n.xp6(2),n.Oqu(re.name),n.xp6(3),n.Oqu(re.user_.username),n.xp6(3),n.Oqu(n.xi3(10,5,re.created_at,"d-MM-y"))}}function he(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Berkas"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,Z,11,8,"mat-list-option",10),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.berkasResults,0,5))}}function Ie(X,ze){if(1&X&&(n.TgZ(0,"mat-list-option",11),n._UZ(1,"img",12),n.TgZ(2,"h4",13),n._uU(3),n.qZA(),n.TgZ(4,"h5",13)(5,"span",14),n._uU(6),n.qZA(),n._uU(7," \xa0 "),n.TgZ(8,"span",15),n._uU(9),n.ALo(10,"date"),n.qZA()()()),2&X){const re=ze.$implicit;n.MGl("routerLink","/user/",re.username,""),n.xp6(1),n.s9C("src",re.image_url,n.LSH),n.xp6(2),n.Oqu(re.kartu_tanda_penduduk_.nama),n.xp6(3),n.Oqu(re.id),n.xp6(3),n.Oqu(n.xi3(10,5,re.created_at,"d-MM-y"))}}function Xe(X,ze){if(1&X&&(n.TgZ(0,"div",0)(1,"div",5)(2,"h2",7)(3,"b",8),n._uU(4,"Pengguna"),n.qZA()()(),n.TgZ(5,"div",5)(6,"mat-selection-list",9),n.YNc(7,Ie,11,8,"mat-list-option",10),n.ALo(8,"slice"),n.qZA()()()),2&X){const re=n.oxw();n.xp6(6),n.Q6J("multiple",!1),n.xp6(1),n.Q6J("ngForOf",n.Dn7(8,2,re.searchResult.penggunaResults,0,5))}}let Tt=(()=>{class X{constructor(re,He,_e,I,L,ke,at,Bt,jt,Ht){this.gs=re,this.news=He,this.ds=_e,this.nihon=I,this.anime=L,this.dorama=ke,this.fansub=at,this.berkas=Bt,this.user=jt,this.ls=Ht,this.searchResult={q:"",beritaResults:[],kanjiResults:[],animeResults:[],doramaResults:[],fansubResults:[],berkasResults:[],penggunaResults:[]},this.subsBerita=null,this.subsKanji=null,this.subsAnime=null,this.subsDorama=null,this.subsFansub=null,this.subsBerkas=null,this.subsPengguna=null,this.subsDialog=null,this.timedOut1=null,this.timedOut2=null,this.timedOut3=null,this.timedOut4=null,this.timedOut5=null,this.timedOut6=null,this.timedOut7=null}ngOnInit(){this.gs.isBrowser&&(this.searchResult=this.ls.getItem(this.gs.localStorageKeys.SearchResults,!0)||this.searchResult)}ngOnDestroy(){var re,He,_e,I,L,ke,at,Bt;this.ls.setItem(this.gs.localStorageKeys.SearchResults,this.searchResult),null===(re=this.subsBerita)||void 0===re||re.unsubscribe(),null===(He=this.subsKanji)||void 0===He||He.unsubscribe(),null===(_e=this.subsAnime)||void 0===_e||_e.unsubscribe(),null===(I=this.subsDorama)||void 0===I||I.unsubscribe(),null===(L=this.subsFansub)||void 0===L||L.unsubscribe(),null===(ke=this.subsBerkas)||void 0===ke||ke.unsubscribe(),null===(at=this.subsPengguna)||void 0===at||at.unsubscribe(),null===(Bt=this.subsDialog)||void 0===Bt||Bt.unsubscribe(),this.timedOut1&&(clearTimeout(this.timedOut1),this.timedOut1=null),this.timedOut2&&(clearTimeout(this.timedOut2),this.timedOut2=null),this.timedOut3&&(clearTimeout(this.timedOut3),this.timedOut3=null),this.timedOut4&&(clearTimeout(this.timedOut4),this.timedOut4=null),this.timedOut5&&(clearTimeout(this.timedOut5),this.timedOut5=null),this.timedOut6&&(clearTimeout(this.timedOut6),this.timedOut6=null),this.timedOut7&&(clearTimeout(this.timedOut7),this.timedOut7=null)}applyFilter(re){this.gs.log("[SEARCH_VALUE_CHANGED]",re),this.searchResult.q=re.target.value.trim().toLowerCase(),this.searchResult.beritaResults=[],this.searchResult.kanjiResults=[],this.searchResult.animeResults=[],this.searchResult.doramaResults=[],this.searchResult.fansubResults=[],this.searchResult.berkasResults=[],this.searchResult.penggunaResults=[],this.searchResult.q&&(this.timedOut1=setTimeout(()=>{this.getNews()},250),this.timedOut2=setTimeout(()=>{this.getKanji()},500),this.timedOut3=setTimeout(()=>{this.getAnime()},750),this.timedOut4=setTimeout(()=>{this.getDorama()},1e3),this.timedOut5=setTimeout(()=>{this.getFansub()},1250),this.timedOut6=setTimeout(()=>{this.getBerkas()},1500),this.timedOut7=setTimeout(()=>{this.getPengguna()},1750))}openEdict(re){this.gs.log("[HIRAKATA_OPEN_EDICT]",re),this.subsDialog=this.ds.openEdictDialog({data:{character:re.character,context:re.context,freq:re.freq,gakken:re.gakken,harlpern_kkld:re.harlpern_kkld,harlpern_njecd:re.harlpern_njecd,jlpt:re.jlpt,maniette:re.maniette,nelson_c:re.nelson_c,nelson_n:re.nelson_n,remember:re.remember,school:re.school,skip:re.skip,stroke:re.stroke,translate:re.translate,v_kunyomi:re.v_kunyomi,v_onyomi:re.v_onyomi},disableClose:!1}).afterClosed().subscribe({next:He=>{this.gs.log("[EDICT_DIALOG_CLOSED]",He),this.subsDialog.unsubscribe()}})}getNews(){this.subsBerita&&this.subsBerita.unsubscribe(),this.subsBerita=this.news.getAllNews(this.searchResult.q,1,5).subscribe({next:re=>{this.gs.log("[NEWS_SEARCH_SUCCESS]",re),this.searchResult.beritaResults=re.results},error:re=>{this.gs.log("[NEWS_SEARCH_ERROR]",re,"error")}})}getKanji(){this.subsKanji&&this.subsKanji.unsubscribe(),this.subsKanji=this.nihon.getAllKanji("","",this.searchResult.q,1,5).subscribe({next:re=>{this.gs.log("[KANJI_SEARCH_SUCCESS]",re),this.searchResult.kanjiResults=re.results},error:re=>{this.gs.log("[KANJI_SEARCH_ERROR]",re,"error")}})}getAnimeTitle(re){return re.replace(/[^a-zA-Z0-9]/g,"-")}getAnime(){this.subsAnime&&this.subsAnime.unsubscribe(),this.subsAnime=this.anime.searchAnime(this.searchResult.q).subscribe({next:re=>{this.gs.log("[ANIME_SEARCH_SUCCESS]",re),this.searchResult.animeResults=re.results},error:re=>{this.gs.log("[ANIME_SEARCH_ERROR]",re,"error")}})}getDorama(){this.subsDorama&&this.subsDorama.unsubscribe(),this.subsDorama=this.dorama.searchDorama(this.searchResult.q).subscribe({next:re=>{this.gs.log("[DORAMA_SEARCH_SUCCESS]",re),this.searchResult.doramaResults=re.results},error:re=>{this.gs.log("[DORAMA_SEARCH_ERROR]",re,"error")}})}getFansub(){this.subsFansub&&this.subsFansub.unsubscribe(),this.subsFansub=this.fansub.searchFansub(this.searchResult.q,1,5).subscribe({next:re=>{this.gs.log("[FANSUB_SEARCH_SUCCESS]",re),this.searchResult.fansubResults=re.results},error:re=>{this.gs.log("[FANSUB_SEARCH_ERROR]",re,"error")}})}getBerkas(){this.subsBerkas&&this.subsBerkas.unsubscribe(),this.subsBerkas=this.berkas.getAllBerkas(this.searchResult.q,1,5,"","",!0).subscribe({next:re=>{this.gs.log("[BERKAS_SEARCH_SUCCESS]",re),this.searchResult.berkasResults=re.results},error:re=>{this.gs.log("[BERKAS_SEARCH_ERROR]",re,"error")}})}getPengguna(){this.subsPengguna&&this.subsPengguna.unsubscribe(),this.subsPengguna=this.user.getAllUser(this.searchResult.q,1,5).subscribe({next:re=>{this.gs.log("[PENGGUNA_SEARCH_SUCCESS]",re),this.searchResult.penggunaResults=re.results},error:re=>{this.gs.log("[PENGGUNA_SEARCH_ERROR]",re,"error")}})}}return X.\u0275fac=function(re){return new(re||X)(n.Y36(r.U),n.Y36(l.Y),n.Y36(u.x),n.Y36(o.a),n.Y36(S.o),n.Y36(E.X),n.Y36(d.T),n.Y36(v.A),n.Y36(y.K),n.Y36(_.n))},X.\u0275cmp=n.Xpm({type:X,selectors:[["app-search-all"]],decls:16,vars:9,consts:[[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"ms-auto","pt-3","col-12",3,"color"],["matInput","","maxlength","200","placeholder","Ex. \u3070\u30fc\u304b\u30fc\uff01",3,"ngModel","keyup.enter","ngModelChange"],["matSuffix",""],[1,"col-12"],["class","row",4,"ngIf"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"pt-0",3,"multiple"],[3,"routerLink",4,"ngFor","ngForOf"],[3,"routerLink"],["matListAvatar","",1,"ms-3",2,"border-radius","0",3,"src"],["matLine",""],[1,"text-warning"],[1,"text-success"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["matLine","",1,"ms-3"]],template:function(re,He){1&re&&(n.TgZ(0,"div",0)(1,"div",1)(2,"mat-form-field",2)(3,"mat-label"),n._uU(4,"Cari Apapun Di Sini ..."),n.qZA(),n.TgZ(5,"input",3),n.NdJ("keyup.enter",function(I){return He.applyFilter(I)})("ngModelChange",function(I){return He.searchResult.q=I}),n.qZA(),n.TgZ(6,"mat-icon",4),n._uU(7,"search"),n.qZA()()(),n.TgZ(8,"div",5),n.YNc(9,G,9,6,"div",6),n.YNc(10,H,9,6,"div",6),n.YNc(11,q,9,6,"div",6),n.YNc(12,Te,9,6,"div",6),n.YNc(13,ne,9,6,"div",6),n.YNc(14,he,9,6,"div",6),n.YNc(15,Xe,9,6,"div",6),n.qZA()()),2&re&&(n.xp6(2),n.Q6J("color","accent"),n.xp6(3),n.Q6J("ngModel",He.searchResult.q),n.xp6(4),n.Q6J("ngIf",He.searchResult.beritaResults.length>0),n.xp6(1),n.Q6J("ngIf",He.searchResult.kanjiResults.length>0),n.xp6(1),n.Q6J("ngIf",He.searchResult.animeResults.length>0),n.xp6(1),n.Q6J("ngIf",He.searchResult.doramaResults.length>0),n.xp6(1),n.Q6J("ngIf",He.searchResult.fansubResults.length>0),n.xp6(1),n.Q6J("ngIf",He.searchResult.berkasResults.length>0),n.xp6(1),n.Q6J("ngIf",He.searchResult.penggunaResults.length>0))},directives:[g.KE,g.hX,C.Nt,w.Fj,w.nD,w.JJ,w.On,V.Hw,g.R9,te.O5,U.Ub,te.sg,U.vS,K.rH,U.eA,ce.X2],pipes:[te.OU,te.uU],styles:[""]}),X})();var Ft=a(466),vt=a(9224);function ht(X,ze){if(1&X&&(n.TgZ(0,"mat-icon",12),n._uU(1),n.qZA()),2&X){const re=n.oxw().$implicit;n.xp6(1),n.Oqu(re.icon)}}function Le(X,ze){if(1&X&&(n.TgZ(0,"div",6)(1,"mat-card")(2,"mat-card-header",7)(3,"div",8),n.YNc(4,ht,2,1,"mat-icon",9),n.qZA(),n.TgZ(5,"mat-card-title",10)(6,"h3",11),n._uU(7),n.qZA()(),n.TgZ(8,"mat-card-subtitle",11),n._uU(9),n.qZA()()()()),2&X){const re=ze.$implicit;n.xp6(2),n.MGl("routerLink","/admin-mod/",re.url,""),n.xp6(1),n.Udp("background-image","url("+(re.image_url?re.image_url:"")+")"),n.xp6(1),n.Q6J("ngIf",re.icon),n.xp6(3),n.Oqu(re.name),n.xp6(2),n.Oqu(re.deskripsi)}}let et=(()=>{class X{constructor(re,He){this.gs=re,this.adm=He}get ADM(){return this.adm}ngOnInit(){}}return X.\u0275fac=function(re){return new(re||X)(n.Y36(r.U),n.Y36(Ft.l))},X.\u0275cmp=n.Xpm({type:X,selectors:[["app-admin-navigation"]],decls:7,vars:1,consts:[[1,"row"],[1,"col-12","sticky-top","bg-bifeldy"],[1,"pt-3","border-bottom-dotted"],[1,"text-bifeldy"],[1,"col-12","px-3"],["class","col-12 p-2",4,"ngFor","ngForOf"],[1,"col-12","p-2"],[2,"cursor","pointer",3,"routerLink"],["mat-card-avatar","",2,"background-size","cover","border-radius","0"],["style","font-size: 300%;",4,"ngIf"],[1,"text-warning","mb-1",2,"cursor","pointer"],[1,"mb-0"],[2,"font-size","300%"]],template:function(re,He){1&re&&(n.TgZ(0,"div",0)(1,"div",1)(2,"h2",2)(3,"b",3),n._uU(4,"Menu Admin Lainnya"),n.qZA()()(),n.TgZ(5,"div",4),n.YNc(6,Le,10,6,"div",5),n.qZA()()),2&re&&(n.xp6(6),n.Q6J("ngForOf",He.ADM.menuList))},directives:[te.sg,vt.a8,vt.dk,K.rH,vt.kc,te.O5,V.Hw,vt.n5,vt.$j],styles:[""]}),X})();var z=a(1617),xe=a(8381);let ye=(()=>{class X{constructor(re,He){this.gs=re,this.ss=He,this.sidePanel=null,this.componentView=null}toggleSidePanel(re){this.componentView?this.closeSidePanel():this.openSidePanel(re)}closeSidePanel(){this.sidePanel.close()}onClose(){this.componentView=null}openSidePanel(re){if("string"!=typeof re)this.componentView=re;else if("SearchAllComponent"===re)this.componentView=Tt;else if("AdminNavigationComponent"===re)this.componentView=et;else if("LiveChatComponent"===re){if(!this.ss.mySocket.id)return;this.componentView=z.u}this.sidePanel.open()}}return X.\u0275fac=function(re){return new(re||X)(n.LFG(r.U),n.LFG(xe.R))},X.\u0275prov=n.Yz7({token:X,factory:X.\u0275fac,providedIn:"root"}),X})()},9775:(rt,B,a)=>{"use strict";a.d(B,{H:()=>S});var n=a(5861),r=a(5e3),l=a(3988),u=a(8696),o=a(7845);let S=(()=>{class E{constructor(v,y,_,g){this.su=v,this.sp=y,this.gs=_,this.ds=g,this.isUpdateAvailable=!1,this.swuVerUpd=null,this.swuUnRecv=null,this.dialogRef=null,this.subsDialog=null,this.gs.isBrowser&&this.initialize()}get swEnabled(){return this.su.isEnabled&&this.sp.isEnabled}checkForUpdate(){var v=this;return(0,n.Z)(function*(){if(!v.isUpdateAvailable){v.isUpdateAvailable=!0;try{v.isUpdateAvailable=yield v.su.checkForUpdate()}catch(y){v.gs.log("[SERVICE_WORKER_CHECK_FOR_UPDATE_ERROR]",y,"error")}}return v.gs.log("[SERVICE_WORKER_UPDATE_AVAILABLE]",v.isUpdateAvailable),v.isUpdateAvailable})()}activateUpdate(){var v=this;return(0,n.Z)(function*(){var y,_,g;let C=!1;if(v.isUpdateAvailable)try{C=yield v.su.activateUpdate(),v.isUpdateAvailable=!1,null===(y=v.dialogRef)||void 0===y||y.close(null),null===(_=v.subsDialog)||void 0===_||_.unsubscribe(),v.dialogRef=v.ds.openInfoDialog({data:{title:"Pembaharuan "+(C?"Berhasil":"Gagal"),htmlMessage:"Ingin Refresh Halaman (?)",confirmText:"Ya",cancelText:"Tidak"}}),v.subsDialog=null===(g=v.dialogRef)||void 0===g?void 0:g.afterClosed().subscribe({next:w=>{v.gs.log("[INFO_DIALOG_CLOSED]",w),v.dialogRef=null,v.subsDialog.unsubscribe(),!0===w&&window.location.reload()}})}catch(w){v.gs.log("[SERVICE_WORKER_ACTIVATE_UPDATE_ERROR]",w,"error")}return v.gs.log("[SERVICE_WORKER_UPDATE_FINISH]",C),C})()}initialize(){var v=this;return(0,n.Z)(function*(){var y;v.swuVerUpd=v.su.versionUpdates.subscribe({next:(y=(0,n.Z)(function*(_){var g,C,w,V,te,U,K,ce,le;v.gs.log(`[SERVICE_WORKER_${_.type}]`,_),"VERSION_DETECTED"===_.type&&(null===(g=v.dialogRef)||void 0===g||g.close(null),null===(C=v.subsDialog)||void 0===C||C.unsubscribe()),"VERSION_READY"===_.type&&(v.dialogRef=v.ds.openInfoDialog({data:{title:"Ada Pembaharuan Tersedia",htmlMessage:`\n
Sekarang :: ${null===(V=null===(w=_.currentVersion)||void 0===w?void 0:w.hash)||void 0===V?void 0:V.slice(0,8)}
\n
Tersedia :: ${null===(U=null===(te=_.latestVersion)||void 0===te?void 0:te.hash)||void 0===U?void 0:U.slice(0,8)}
\n `,confirmText:"OK"}})),"VERSION_INSTALLATION_FAILED"===_.type&&(v.dialogRef=v.ds.openInfoDialog({data:{title:"Pembaharuan Gagal",htmlMessage:`\n
Versi :: ${null===(ce=null===(K=_.version)||void 0===K?void 0:K.hash)||void 0===ce?void 0:ce.slice(0,8)}
\n
Error :: ${_.error}
\n `,confirmText:"Ulangi",cancelText:"Lewati"}})),v.subsDialog=null===(le=v.dialogRef)||void 0===le?void 0:le.afterClosed().subscribe({next:G=>{v.gs.log("[INFO_DIALOG_CLOSED]",G),!0===G&&v.activateUpdate(),v.dialogRef=null,v.subsDialog.unsubscribe()}})}),function(g){return y.apply(this,arguments)})}),v.swuUnRecv=v.su.unrecoverable.subscribe({next:y=>{var _,g,C;v.gs.log(`[SERVICE_WORKER_${y.type}]`,y.reason),null===(_=v.dialogRef)||void 0===_||_.close(null),null===(g=v.subsDialog)||void 0===g||g.unsubscribe(),v.dialogRef=v.ds.openInfoDialog({data:{title:"Service Worker Bermasalah",htmlMessage:`Kesalahan :: ${y.reason}`,confirmText:"Refresh Halaman"}}),v.subsDialog=null===(C=v.dialogRef)||void 0===C?void 0:C.afterClosed().subscribe({next:w=>{v.gs.log("[INFO_DIALOG_CLOSED]",w),v.dialogRef=null,v.subsDialog.unsubscribe(),window.location.reload()}})}})})()}}return E.\u0275fac=function(v){return new(v||E)(r.LFG(l.yO),r.LFG(l.Mk),r.LFG(u.U),r.LFG(o.x))},E.\u0275prov=r.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"}),E})()},8381:(rt,B,a)=>{"use strict";a.d(B,{R:()=>U});var n=a(5861),r=a(685),l=a.n(r),u=a(1135),o=a(6271),S=a(5934),E=a(5e3),d=a(4137),v=a(8406),y=a(8696),_=a(3e3),g=a(7140),C=a(7),w=a(6925),V=a(7845),te=a(9775);let U=(()=>{class K{constructor(le,G,W,H,Me,q,de,Te,j){this.as=le,this.router=G,this.gs=W,this.bs=H,this.notif=Me,this.lms=q,this.toast=de,this.ds=Te,this.sw=j,this.mySocket=null,this.visitor=0,this.latency=0,this.statsServer={mainSite:{cpus:0,mem_ram:0,disk_io:0,net_tx:0,net_rx:0}},this.messageChatUnreadCount=0,this.badgeNews=[],this.badgeBerkas=[],this.badgeFansub=[],this.github=null,this.currentServerSubject=new u.X(null),this.currentServer=this.currentServerSubject.asObservable(),this.currentServerValue=null,this.currentRoomSubject=new u.X(null),this.currentRoom=this.currentRoomSubject.asObservable(),this.currentChatRoom=[],this.globalRoomSubject=new u.X(null),this.globalRoom=this.globalRoomSubject.asObservable(),this.globalChatRoom=[],this.fansubRoomSubject=new u.X(null),this.fansubRoom=this.fansubRoomSubject.asObservable(),this.fansubChatRoom=[],this.serverLog="// Tidak Ada Catatan Log~",this.quizRoom={},this.subsServer=null,this.subsDialog=null,this.timedOut=null,this.gs.isBrowser&&(this.mySocket=l()("//",{query:{"ngsw-bypass":!0,token:this.as.token},transports:["websocket","polling"],transportOptions:{polling:{extraHeaders:{"x-access-token":this.as.token}}}}),this.socketListen(),this.checkServerMaintenance())}get currentRoomValue(){var le;return(null===(le=this.currentRoomSubject)||void 0===le?void 0:le.value)||null}get globalRoomValue(){var le;return(null===(le=this.globalRoomSubject)||void 0===le?void 0:le.value)||null}checkServerMaintenance(){var G,le=this;this.subsServer=this.currentServer.subscribe({next:(G=(0,n.Z)(function*(W){var H;W&&W.isMaintenance&&(null===(H=le.currentServerValue)||void 0===H?void 0:H.isMaintenance)!==W.isMaintenance&&(le.subsDialog=(yield le.ds.openMaintenanceDialog()).afterClosed().subscribe({next:Me=>{le.gs.log("[INFO_DIALOG_CLOSED]",Me),le.subsDialog.unsubscribe()}})),le.currentServerValue=W}),function(H){return G.apply(this,arguments)})})}pingPong(){this.socketEmitVolatile("ping-pong",{},le=>{this.gs.log("[SOCKET_PING_PONG]",le),"github"in le&&le.github&&(this.github=le.github),"server"in le&&le.server&&this.currentServerSubject.next(le.server)}),this.socketEmitVolatile("stats-server",{},le=>{this.gs.log("[SOCKET_STATS_SERVER]",le),this.statsServer=le})}socketListen(){var le=this;this.mySocket.on("connect",()=>{this.gs.log("[SOCKET_CONNECTED]",this.mySocket.id),this.pingPong(),this.notif.removeNotif(`${S.N.siteName.toUpperCase()}_SOCKET_DISCONNECTED`),this.timedOut=setTimeout(()=>{this.socketLeaveAndJoinNewRoom(null,this.router.url.split("?")[0])},1234)}),this.mySocket.on("connect_error",()=>{this.gs.log("[SOCKET_CONNECT_ERROR]",this.mySocket.io.opts,"error"),this.mySocket.io.opts.transports=["polling","websocket"]}),this.mySocket.on("disconnect",G=>{this.gs.log("[SOCKET_DISCONNECTED]",G),this.notif.addNotif(null,`${S.N.siteName.toUpperCase()}_SOCKET_DISCONNECTED`,"warning","Sambungan Terputus","Tidak dapat terhubung dengan Server melalui WebSocket !!",!1),this.sw.isUpdateAvailable=!1}),this.mySocket.on("ping",()=>{this.gs.log("[SOCKET_PING]",Date.now())}),this.mySocket.on("server-config",G=>{this.currentServerSubject.next(G)}),this.mySocket.on("pong",G=>{this.latency=G,this.gs.log("[SOCKET_PONG]",`${Date.now()} => ${G} ms`),this.pingPong(),this.sw.checkForUpdate()}),this.mySocket.on("visitors",G=>{this.gs.log("[SOCKET_VISITOR]",this.visitor),this.visitor=G}),this.mySocket.on("console-log",G=>{this.gs.log("[SOCKET_CONSOLE_LOG]",G),this.serverLog=`${G}\r\n${this.serverLog}`}),this.mySocket.on("force-redirect",G=>{this.gs.log("[SOCKET_REDIRECT]",G.message),this.toast.info(G.message,G.title,null,!0),this.router.navigateByUrl(G.url)}),this.mySocket.on("force-logout",G=>{this.gs.log("[SOCKET_EXIT]",G),this.toast.info(G,"Keluar Paksa!",null,!0),this.as.logout()}),this.mySocket.on("new-notification",G=>{this.gs.log("[SOCKET_NOTIFICATION]",G),this.notif.addNotif(G.notifCreator,G.notifData.id,G.notifData.type,G.notifData.title,G.notifData.content,G.notifData.dismissible)}),this.mySocket.on("new-information",function(){var G=(0,n.Z)(function*(W){le.gs.log("[SOCKET_INFORMATION]",W),le.subsDialog=le.ds.openInfoDialog({data:{title:W.infoData.title,htmlMessage:W.infoData.content,confirmText:W.infoData.confirm,cancelText:W.infoData.cancel},disableClose:W.infoData.close}).afterClosed().subscribe({next:H=>{le.gs.log("[INFO_DIALOG_CLOSED]",H),le.subsDialog.unsubscribe()}})});return function(W){return G.apply(this,arguments)}}()),this.mySocket.on("new-berkas",G=>{this.gs.log("[SOCKET_BERKAS]",G),this.badgeBerkas.push(G);const W=this.lms.contentMenus.find(H=>"/berkas"===H.link);W&&(W.badge=this.badgeBerkas.length>0?this.badgeBerkas.length:null)}),this.mySocket.on("new-fansub",G=>{this.gs.log("[SOCKET_FANSUB]",G),this.badgeFansub.push(G);const W=this.lms.contentMenus.find(H=>"/fansub"===H.link);W&&(W.badge=this.badgeFansub.length>0?this.badgeFansub.length:null)}),this.mySocket.on("new-news",G=>{this.gs.log("[SOCKET_NEWS]",G),this.badgeNews.push(G);const W=this.lms.mainMenus.find(H=>"/news"===H.link);W&&(W.badge=this.badgeNews.length>0?this.badgeNews.length:null)}),this.mySocket.on("receive-chat",G=>{this.gs.log("[SOCKET_RECEIVE-CHAT]",G),G.room_id===o.t.socketRoomNameGlobalPublic?this.globalChatRoom.push(G):G.room_id===o.t.socketRoomNameGlobalFansub?this.fansubChatRoom.push(G):G.room_id!==o.t.socketRoomNameServerLogs&&this.currentChatRoom.push(G),this.messageChatUnreadCount++}),this.mySocket.on("room-info",G=>{this.gs.log("[SOCKET_ROOM-INFO]",G),this.gs.cleanObject(null==G?void 0:G.member_list),G.room_id===o.t.socketRoomNameGlobalPublic?this.globalRoomSubject.next(G):G.room_id===o.t.socketRoomNameGlobalFansub?this.fansubRoomSubject.next(G):G.room_id!==o.t.socketRoomNameServerLogs&&this.currentRoomSubject.next(G)}),this.mySocket.on("multiple-connection",(G,W)=>{this.gs.log("[SOCKET_MULTIPLE-CONNECTION]",G),this.toast.warning("Sesi lain telah aktif!","Koneksi Duplikat",null,!0),this.mySocket.io.reconnection(!1),this.bs.clear(),W&&W()}),this.mySocket.on("quiz-question",G=>{if(this.gs.log("[SOCKET_QUIZ]",G),this.gs.routerData.question&&this.gs.routerData.options){const{room_id:W,...H}=G;this.quizRoom[W]=H,this.quizRoom[W].options=this.gs.shuffle(this.quizRoom[W].options)}})}socketEmit(le,G={},W=null){var H,Me;this.as.token&&(G.token=this.as.token),W?null===(H=this.mySocket)||void 0===H||H.emit(le,G,W):null===(Me=this.mySocket)||void 0===Me||Me.emit(le,G)}socketEmitVolatile(le,G={},W=null){this.socketEmit(le,G,W)}socketLeaveAndJoinNewRoom(le,G){this.gs.log(`[SOCKET_LEAVE-JOIN-ROOM] ${le} => ${G}`),this.socketEmit("leave-join-room",{oldRoom:le,newRoom:G})}}return K.\u0275fac=function(le){return new(le||K)(E.LFG(d.e),E.LFG(v.F0),E.LFG(y.U),E.LFG(_.z),E.LFG(g.T),E.LFG(C.S),E.LFG(w.k),E.LFG(V.x),E.LFG(te.H))},K.\u0275prov=E.Yz7({token:K,factory:K.\u0275fac,providedIn:"root"}),K})()},6925:(rt,B,a)=>{"use strict";a.d(B,{k:()=>o});var n=a(5e3),r=a(8696),l=a(2290),u=a(7140);let o=(()=>{class S{constructor(d,v,y){this.gs=d,this.toast=v,this.notif=y}remove(d){return this.toast.remove(d)}success(d,v,y,_=!1){return _&&this.notif.addNotif(null,(new Date).getTime(),"success",v,d),this.gs.isDesktop||_?this.toast.success(d,v,y):null}warning(d,v,y,_=!1){return _&&this.notif.addNotif(null,(new Date).getTime(),"warning",v,d),this.gs.isDesktop||_?this.toast.warning(d,v,y):null}info(d,v,y,_=!1){return _&&this.notif.addNotif(null,(new Date).getTime(),"info",v,d),this.gs.isDesktop||_?this.toast.info(d,v,y):null}error(d,v,y,_=!1){return _&&this.notif.addNotif(null,(new Date).getTime(),"danger",v,d),this.gs.isDesktop||_?this.toast.error(d,v,y):null}}return S.\u0275fac=function(d){return new(d||S)(n.LFG(r.U),n.LFG(l._W),n.LFG(u.T))},S.\u0275prov=n.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"}),S})()},8058:(rt,B,a)=>{"use strict";a.d(B,{K:()=>S});var n=a(8505),r=a(5e3),l=a(9731),u=a(4137),o=a(8696);let S=(()=>{class E{constructor(v,y,_){this.api=v,this.as=y,this.gs=_}checkBanned(v){return this.api.getData(`/banned?username=${v}`)}getAllUser(v="",y=1,_=10,g="",C=""){return this.api.getData(`/user?q=${v}&page=${y}&row=${_}&sort=${g}&order=${C}`)}getUserData(v){return this.api.getData(`/user/${v}`)}updateUser(v,y){return this.api.putData(`/user/${v}`,y).pipe((0,n.b)(_=>{this.as.token=_.result.token}))}getUserBerkas(v,y="",_=1,g=10,C="",w=""){return this.api.getData(`/user/${v}/feed-berkas?q=${y}&page=${_}&row=${g}&sort=${C}&order=${w}`)}getUserFeedComment(v,y="",_=1,g=10,C="",w=""){return this.api.getData(`/user/${v}/feed-comment?q=${y}&page=${_}&row=${g}&sort=${C}&order=${w}`)}getUserFeedLikeDislike(v,y="",_=1,g=10,C="",w=""){return this.api.getData(`/user/${v}/feed-likedislike?q=${y}&page=${_}&row=${g}&sort=${C}&order=${w}`)}getUserFeedVisit(v,y="",_=1,g=10,C="",w=""){return this.api.getData(`/user/${v}/feed-visit?q=${y}&page=${_}&row=${g}&sort=${C}&order=${w}`)}sosmedLogin(v){return this.api.postData("/verify-sosmed",v)}getUserGroup(v){return this.api.getData(`/user/${v}/group`)}findLostAccount(v){return this.api.postData("/lost-account-find",v)}resetLostAccount(v){return this.api.postData("/lost-account-reset",v)}}return E.\u0275fac=function(v){return new(v||E)(r.LFG(l.s),r.LFG(u.e),r.LFG(o.U))},E.\u0275prov=r.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"}),E})()},8020:(rt,B,a)=>{"use strict";a.d(B,{N:()=>S});var n=a(5861),r=a(5e3),l=a(8696),u=a(7845),o=a(8381);let S=(()=>{class E{constructor(v,y,_){this.gs=v,this.ds=y,this.ss=_,this.currentServer=null,this.openedWindow={},this.subsDialog=null,this.subsServer=null,this.gs.isBrowser&&(this.subsServer=this.ss.currentServer.subscribe({next:g=>this.currentServer=g}))}confirmationOpenUrl(v,y){var _=this;return(0,n.Z)(function*(){_.subsDialog=(yield _.ds.openKonfirmasiDialog(`Ingin Buka Di Tab ${"_self"===y?"Ini":"Baru"} ?`,v,!1)).afterClosed().subscribe({next:g=>{_.gs.log("[INFO_DIALOG_CLOSED]",g),!0===g&&window.open(v,y),_.subsDialog.unsubscribe()}})})()}winboxOpenUri(v,y="_blank",_=!1){var g;if(v.startsWith("http://")&&(v="https://"+v.slice(7,v.length)),v.startsWith("/api/"))this.confirmationOpenUrl(v,"_self");else if((null===(g=this.currentServer)||void 0===g?void 0:g.winboxOpenLink)&&!this.gs.includesOneOf(v,["ftp://","mailto:"])||_){const C=(new Date).getTime();this.openedWindow[C]=new WinBox(v,{id:C,title:v,url:v,class:"no-full no-shadow no-max",background:"#7b1fa2",x:"center",y:"center",top:56,right:0,bottom:32,left:64,onclose:w=>(this.confirmationOpenUrl(v,y),!1)})}else this.confirmationOpenUrl(v,y)}}return E.\u0275fac=function(v){return new(v||E)(r.LFG(l.U),r.LFG(u.x),r.LFG(o.R))},E.\u0275prov=r.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"}),E})()},6271:(rt,B,a)=>{"use strict";a.d(B,{t:()=>n});const n={apiTagAnime:"Anime",apiTagApiKey:"API Key",apiTagAttachment:"Attachment",apiTagBanned:"Banned",apiTagBerkas:"Berkas",apiTagDorama:"Dorama",apiTagDdlFile:"DDL File",apiTagFansub:"Fansub",apiTagMail:"Surat Elektronik",apiTagNews:"News",apiTagNihongo:"Nihongo",apiTagQuiz:"Quiz",apiTagSession:"Session",apiTagUser:"User",attachmentSpeedLimiterBps:256e3,blacklistedWords:["*","www","fansub","fansub.id","fansubid","fansub-id","crawl","crawler","localhost","mail","email","e-mail","tracker","fansub","fansubber","ferdion","bifeldy","dev","api","docs","cs","help","support","proxy","admin","administrator","info","information","noreply","mod","moderator"],cronFansubRssFeed:"CRON_FANSUB_RSS_FEED",cronTrackerStatistics:"CRON_TRACKER_STATISTICS",cronSitemap:"CRON_SITEMAP",cronStatsServer:"CRON_STATS_SERVER",decoratorFilterApiKeyAccess:"filter-api-key-access",decoratorRoles:"roles",decoratorVerifiedOnly:"verified-only",extSubs:["ass","srt"],extFonts:["ttf","otf","woff","woff2"],fileTypeAttachmentAllowed:["video/x-msvideo","video/x-matroska","video/mp4","application/zip","application/zip-compressed","application/x-zip","application/x-zip-compressed"],fileSizeAttachmentChunkCloudflareLimit:64e6,fileSizeAttachmentChunkDiscordLimit:8e6,fileTypeAttachmentStreamable:["mkv","mp4"],fileSizeAttachmentTotalLimit:2e9,fileSizeImageLimit:512e3,freeTimeStart:"02:00:00",freeTimeEnd:"02:30:00",gCaptchaSiteKey:"6Ld4Bt4UAAAAAKJQ_jfqtWdsq9BuARLHag2DBvqK",jwtAlgorithm:"HS512",jwtExpiredIn:86400,quizOptionsCountHirakata:5,quizOptionsCountCategory:6,quizOptionsCountKanji:6,regexIpAddress:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,regexAllKeyboardKeys:/^[\P{Cc}\P{Cn}\P{Cs}]*$/,regexEmail:/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/,regexEmailMulti:/^[^a-z0-9_]*([a-z0-9_+\-.%]+@[a-z0-9_\-.]+\.[a-z]+[^a-z0-9_]*,{1}[^a-z0-9_]*)*([a-z0-9_+\-.%]+@[a-z0-9_\-.]+\.[a-z]+)[^a-z0-9_]*$/,regexEnglishKeyboardKeys:/^[a-zA-Z0-9~`!@#\$%\^&\*\(\)_\-\+={\[\}\]\|\\:;"'<,>\.\?\/ \n]*$/,regexJapaneseKeyboardKeys:/[\u4e00-\u9fa0\u3041-\u3094\u30a1-\u30f4\u30fc\uff41-\uff5a\uff21-\uff3a\uff10-\uff19\u3005\u3006\u3024\u3001\u3002]+/u,regexUrl:/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/,retryDdlUploadMaxCount:5,socketRoomNameGlobalPublic:"GLOBAL_PUBLIK",socketRoomNameGlobalFansub:"GLOBAL_FANSUB",socketRoomNameServerLogs:"SERVER_LOGS",timeoutCancelRegisterKey:"TIMEOUT_CANCEL_REGISTER",timeoutCancelRegisterTime:3e5,timeoutDeleteTempAttachmentKey:"TIMEOUT_DELETE_TEMP_ATTACHMENT",timeoutDeleteTempAttachmentTime:6e5,timeoutMailWebhookTime:6e4,timeoutReconnectSocketKey:"TIMEOUT_RECONNECT_SOCKET",timeoutReconnectSocketTime:5e3,timeJwtEncryption:180,timeLoginRememberMe:604800,timeResetAccount:300,timeMaxDaysNotification:6048e5,verificationDomain:["ghs.google.com"]}},5934:(rt,B,a)=>{"use strict";a.d(B,{N:()=>n});const n={production:!0,siteName:"FansubID",siteDescription:"Di Kamar Saja!",author:"Bifeldy",domain:"fansub.id",baseUrl:"https://www.fansub.id",apiUrl:"/api",apiKey:"00000000-0000-0000-0000-000000000000",discord:{client_id:"789831990433153034",join_url:"https://discord.gg/xGWdExk",guild_id:"342220398022098944"},saweria:"https://saweria.co/Bifeldy",trakteer:"https://teer.id/bifeldy",github:"https://github.com/sponsors/bifeldy",torrent:{trackerAnnounce:["wss://tracker.fansub.id","wss://tracker.btorrent.xyz","wss://tracker.openwebtorrent.com"],iceServers:[{urls:["stun:tracker.fansub.id:11111","stun:openrelay.metered.ca:80","stun:stun.l.google.com:19302"]}]}}},1800:(rt,B,a)=>{"use strict";var n=a(2313),r=a(5e3),l=a(520),u=a(9646),o=a(9300),S=a(5698),E=a(8505);function d(Je){const Yt={};for(const Se of Je.keys()){const qe=Je.getAll(Se);null!==qe&&(Yt[Se]=qe)}return Yt}let v=(()=>{class Je{constructor(Se,qe){this.transferState=qe,this.isCacheActive=!0,Se.isStable.pipe((0,o.h)(At=>At),(0,S.q)(1)).subscribe(()=>{this.isCacheActive=!1})}invalidateCacheEntry(Se){Object.keys(this.transferState.store).forEach(qe=>qe.includes(Se)?this.transferState.remove((0,n.Cb)(qe)):null)}makeCacheKey(Se,qe,At){const Ne=At.keys().sort().map(Ut=>`${Ut}=${At.getAll(Ut)}`).join("&");return(0,n.Cb)(("GET"===Se?"G.":"H.")+qe+"?"+Ne)}intercept(Se,qe){if("GET"!==Se.method&&"HEAD"!==Se.method&&(this.isCacheActive=!1,this.invalidateCacheEntry(Se.url)),!this.isCacheActive)return qe.handle(Se);const At=this.makeCacheKey(Se.method,Se.url,Se.params);if(this.transferState.hasKey(At)){const Ne=this.transferState.get(At,{});return(0,u.of)(new l.Zn({body:Ne.body,headers:new l.WM(Ne.headers),status:Ne.status,statusText:Ne.statusText,url:Ne.url}))}return qe.handle(Se).pipe((0,E.b)(Rt=>{Rt instanceof l.Zn&&this.transferState.set(At,{body:Rt.body,headers:d(Rt.headers),status:Rt.status,statusText:Rt.statusText,url:Rt.url||""})}))}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(r.z2F),r.LFG(n.ki))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac}),Je})(),y=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({providers:[v,{provide:l.TP,useExisting:v,multi:!0}],imports:[[n.Cu]]}),Je})();var C=a(6360),w=a(3075),V=a(7261),te=a(7322),U=a(7238),K=a(3988),ce=a(72),le=a(2290),G=a(7579),W=a(727),H=a(1135),Me=a(9841),q=a(2805),de=a(515),Te=a(4482),j=a(5032),ne=a(5403),Z=a(8421),Ie=a(3900),Xe=a(1005),Tt=a(8746),Ft=a(2722),vt=a(4004),ht=a(9808);function Le(Je,Yt){if(1&Je&&r._UZ(0,"div",6),2&Je){const Se=r.oxw(2);r.Udp("box-shadow","0 0 10px "+Se.color+", 0 0 5px "+Se.color)}}function et(Je,Yt){if(1&Je&&(r.TgZ(0,"div",7),r._UZ(1,"div",8),r.qZA()),2&Je){const Se=r.oxw(2);r.xp6(1),r.Udp("border-top-color",Se.color)("border-left-color",Se.color)}}function z(Je,Yt){if(1&Je&&(r.ynx(0),r.TgZ(1,"div",1)(2,"div",2)(3,"div",3),r.YNc(4,Le,1,2,"div",4),r.qZA()(),r.YNc(5,et,2,4,"div",5),r.qZA(),r.BQk()),2&Je){const Se=Yt.$implicit,qe=r.oxw();r.xp6(1),r.Udp("transition","opacity "+qe.speed+"ms "+qe.ease),r.uIk("active",Se.active),r.xp6(2),r.Udp("transform",Se.transform)("background-color",qe.color)("transition",Se.active?"all "+qe.speed+"ms "+qe.ease:"none"),r.xp6(1),r.Q6J("ngIf",qe.meteor),r.xp6(1),r.Q6J("ngIf",qe.spinner)}}class xe{constructor(Yt,Se){this._onDestroyCallback=Se,this._started=new G.x,this.started=this._started.pipe((0,o.h)(()=>!this.isStarted)),this._completed=new G.x,this.completed=this._completed.pipe((0,o.h)(()=>this.isStarted)),this._trickling=new G.x,this._worker=W.w0.EMPTY,this._state=new H.X({active:!1,value:0}),this._config=new H.X(Yt),this.state=this._state.asObservable(),this.config=this._config.asObservable(),this._worker=(0,Me.a)([this._trickling,this._config]).pipe(function he(Je){return(0,Te.e)((Yt,Se)=>{let qe=!1,At=null,Ne=null;const Rt=()=>{if(null==Ne||Ne.unsubscribe(),Ne=null,qe){qe=!1;const Ut=At;At=null,Se.next(Ut)}};Yt.subscribe((0,ne.x)(Se,Ut=>{null==Ne||Ne.unsubscribe(),qe=!0,At=Ut,Ne=(0,ne.x)(Se,Rt,j.Z),(0,Z.Xf)(Je(Ut)).subscribe(Ne)},()=>{Rt(),Se.complete()},void 0,()=>{At=Ne=null}))})}(([qe,At])=>(0,q.H)(qe?At.debounceTime:0)),(0,Ie.w)(([qe,At])=>qe?this.onTrickling(At):this.onComplete(At))).subscribe()}get snapshot(){return this._state.value}get isStarted(){return this.snapshot.active}start(){this._started.next(),this._trickling.next(!0)}complete(){this._trickling.next(!1)}inc(Yt){const Se=this.snapshot.value;this.isStarted?("number"!=typeof Yt&&(Yt=this._config.value.trickleFunc(Se)),this.set(Se+Yt)):this.start()}set(Yt){this.setState({value:this.clamp(Yt),active:!0})}setConfig(Yt){this._config.next(Object.assign(Object.assign({},this._config.value),Yt))}destroy(){this._worker.unsubscribe(),this._trickling.complete(),this._state.complete(),this._config.complete(),this._started.complete(),this._completed.complete(),this._onDestroyCallback()}setState(Yt){this._state.next(Object.assign(Object.assign({},this.snapshot),Yt))}clamp(Yt){return Math.max(this._config.value.min,Math.min(this._config.value.max,Yt))}onTrickling(Yt){return this.isStarted||this.set(this._config.value.min),(0,q.H)(0,Yt.trickleSpeed).pipe((0,E.b)(()=>this.inc()))}onComplete(Yt){return this._completed.next(),this.isStarted?(0,u.of)({}).pipe((0,E.b)(()=>this.setState({value:100})),(0,Xe.g)(1.7*Yt.speed),(0,E.b)(()=>this.setState({active:!1})),(0,Xe.g)(Yt.speed),(0,Tt.x)(()=>this.setState({value:0})),(0,Ft.R)(this._started)):de.E}}const ye=new r.OlP("ngProgressConfig"),X={min:8,max:100,speed:200,debounceTime:0,trickleSpeed:300,fixed:!0,meteor:!0,thick:!1,spinner:!0,ease:"linear",color:"#1B95E0",direction:"ltr+",spinnerPosition:"right",trickleFunc:Je=>Je>=0&&Je<20?10:Je>=20&&Je<50?4:Je>=50&&Je<80?2:Je>=80&&Je<99?.5:0};let ze=(()=>{class Je{constructor(Se){this._instances=new Map,this.config=Se?Object.assign(Object.assign({},X),Se):X}ref(Se="root",qe){if(this._instances.has(Se)){const At=this._instances.get(Se);return qe&&At.setConfig(Object.assign(Object.assign({},this.config),qe)),At}{const At=new xe(Object.assign(Object.assign({},this.config),qe),this.deleteInstance(Se));return this._instances.set(Se,At).get(Se)}}destroyAll(){this._instances.forEach(Se=>Se.destroy())}deleteInstance(Se){return()=>{this._instances.delete(Se)}}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(ye,8))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac,providedIn:"root"}),Je})(),re=(()=>{class Je{constructor(Se){this._ngProgress=Se,this.id="root",this.min=this._ngProgress.config.min,this.max=this._ngProgress.config.max,this.ease=this._ngProgress.config.ease,this.color=this._ngProgress.config.color,this.speed=this._ngProgress.config.speed,this.thick=this._ngProgress.config.thick,this.fixed=this._ngProgress.config.fixed,this.meteor=this._ngProgress.config.meteor,this.spinner=this._ngProgress.config.spinner,this.trickleSpeed=this._ngProgress.config.trickleSpeed,this.debounceTime=this._ngProgress.config.debounceTime,this.trickleFunc=this._ngProgress.config.trickleFunc,this.spinnerPosition=this._ngProgress.config.spinnerPosition,this.direction=this._ngProgress.config.direction,this.started=new r.vpe,this.completed=new r.vpe}get isStarted(){var Se;return null===(Se=this.progressRef)||void 0===Se?void 0:Se.isStarted}ngOnChanges(){var Se;null===(Se=this.progressRef)||void 0===Se||Se.setConfig({max:this.max>0&&this.max<=100?this.max:100,min:this.min<100&&this.min>=0?this.min:0,speed:this.speed,trickleSpeed:this.trickleSpeed,trickleFunc:this.trickleFunc,debounceTime:this.debounceTime})}ngOnInit(){this.progressRef=this._ngProgress.ref(this.id,{max:this.max,min:this.min,speed:this.speed,trickleSpeed:this.trickleSpeed,debounceTime:this.debounceTime}),this.state$=this.progressRef.state.pipe((0,vt.U)(Se=>({active:Se.active,transform:`translate3d(${Se.value}%,0,0)`}))),this.started.observed&&(this._started=this.progressRef.started.subscribe(()=>this.started.emit())),this.completed.observed&&(this._completed=this.progressRef.completed.subscribe(()=>this.completed.emit()))}ngOnDestroy(){var Se,qe,At;null===(Se=this._started)||void 0===Se||Se.unsubscribe(),null===(qe=this._completed)||void 0===qe||qe.unsubscribe(),null===(At=this.progressRef)||void 0===At||At.destroy()}start(){this.progressRef.start()}complete(){this.progressRef.complete()}inc(Se){this.progressRef.inc(Se)}set(Se){this.progressRef.set(Se)}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(ze))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["ng-progress"]],hostAttrs:["role","progressbar"],hostVars:4,hostBindings:function(Se,qe){2&Se&&r.uIk("spinnerPosition",qe.spinnerPosition)("direction",qe.direction)("thick",qe.thick)("fixed",qe.fixed)},inputs:{id:"id",min:"min",max:"max",ease:"ease",color:"color",speed:"speed",thick:"thick",fixed:"fixed",meteor:"meteor",spinner:"spinner",trickleSpeed:"trickleSpeed",debounceTime:"debounceTime",trickleFunc:"trickleFunc",spinnerPosition:"spinnerPosition",direction:"direction"},outputs:{started:"started",completed:"completed"},features:[r.TTD],decls:2,vars:3,consts:[[4,"ngIf"],[1,"ng-progress-bar"],[1,"ng-bar-placeholder"],[1,"ng-bar"],["class","ng-meteor",3,"boxShadow",4,"ngIf"],["class","ng-spinner",4,"ngIf"],[1,"ng-meteor"],[1,"ng-spinner"],[1,"ng-spinner-icon"]],template:function(Se,qe){1&Se&&(r.YNc(0,z,6,11,"ng-container",0),r.ALo(1,"async")),2&Se&&r.Q6J("ngIf",r.lcZ(1,1,qe.state$))},directives:[ht.O5],pipes:[ht.Ov],styles:['[_nghost-%COMP%]{z-index:999999;pointer-events:none}[fixed=true][_nghost-%COMP%] .ng-progress-bar[_ngcontent-%COMP%], [fixed=true][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{position:fixed}[fixed=true][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{top:15px}[fixed=true][spinnerPosition=left][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{left:15px}[fixed=true][spinnerPosition=right][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{right:15px}[thick=true][_nghost-%COMP%] .ng-spinner-icon[_ngcontent-%COMP%]{width:24px;height:24px;border-width:3px}[thick=true][_nghost-%COMP%] .ng-bar-placeholder[_ngcontent-%COMP%]{height:3px!important}[direction="ltr+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=ltr-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(3deg)}[direction="ltr+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=ltr-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(4deg)}[direction="ltr+"][_nghost-%COMP%] .ng-bar[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-bar[_ngcontent-%COMP%]{margin-left:-100%}[direction="ltr+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{right:0}[direction="ltr+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{top:-3px}[direction="ltr+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{top:-4px}[direction=ltr-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{bottom:-3px}[direction=ltr-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction="rtl+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{bottom:-4px}[direction=ltr-][_nghost-%COMP%] .ng-bar-placeholder[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-bar-placeholder[_ngcontent-%COMP%]{transform:rotate(180deg)}[direction=ltr-][_nghost-%COMP%] .ng-spinner-icon[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-spinner-icon[_ngcontent-%COMP%]{animation-directionection:reverse}[direction="rtl+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(-3deg)}[direction="rtl+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(-4deg)}[spinnerPosition=left][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{left:10px}[spinnerPosition=right][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{right:10px}.ng-progress-bar[_ngcontent-%COMP%]{position:relative;z-index:999999;top:0;left:0;width:100%;transform:scale(1);filter:alpha(opacity=0);opacity:0}.ng-progress-bar[active=true][_ngcontent-%COMP%]{filter:alpha(opacity=100);opacity:1;transition:none}.ng-bar-placeholder[_ngcontent-%COMP%]{position:absolute;height:2px;width:100%}.ng-bar[_ngcontent-%COMP%]{width:100%;height:100%;transform:translate(-100%,0,0)}.ng-meteor[_ngcontent-%COMP%]{display:block;position:absolute;width:100px;height:100%;opacity:1}.ng-spinner[_ngcontent-%COMP%]{position:absolute;display:block;z-index:1031;top:10px}.ng-spinner-icon[_ngcontent-%COMP%]{width:18px;height:18px;box-sizing:border-box;-webkit-animation:spinner-animation .25s linear infinite;animation:spinner-animation .25s linear infinite;border:2px solid transparent;border-radius:50%}@-webkit-keyframes spinner-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spinner-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}'],changeDetection:0}),Je})(),He=(()=>{class Je{static withConfig(Se){return{ngModule:Je,providers:[{provide:ye,useValue:Se}]}}}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez]]}),Je})();const _e=new r.OlP("ngProgressHttpConfig");let I=(()=>{class Je{constructor(Se,qe){this.ngProgress=Se,this._inProgressCount=0,this._config={id:"root",silentApis:[],matcher:void 0},this._config=qe?Object.assign(Object.assign({},this._config),qe):this._config}intercept(Se,qe){return Se.headers.has("ignoreProgressBar")?qe.handle(Se.clone({headers:Se.headers.delete("ignoreProgressBar")})):this.checkUrl(Se)?qe.handle(Se):(this._inProgressCount++,this._progressRef=this.ngProgress.ref(this._config.id),this._progressRef.isStarted||this._progressRef.start(),qe.handle(Se).pipe((0,Tt.x)(()=>{this._inProgressCount--,0===this._inProgressCount&&this._progressRef.complete()})))}checkUrl(Se){var qe,At;const Ne=Se.url.toLowerCase();return this._config.matcher&&(null===(qe=this._config.silentApis)||void 0===qe?void 0:qe.length)?ke(Ne,this._config.matcher)&&L(Ne,this._config.silentApis):(null===(At=this._config.silentApis)||void 0===At?void 0:At.length)?L(Ne,this._config.silentApis):!!this._config.matcher&&ke(Ne,this._config.matcher)}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(ze),r.LFG(_e,8))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac}),Je})();function L(Je,Yt){return!!Yt.find(Se=>Je.includes(Se.toLowerCase()))}function ke(Je,Yt){return!!Je.match(Yt)}let at=(()=>{class Je{static withConfig(Se){return{ngModule:Je,providers:[{provide:_e,useValue:Se}]}}}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({providers:[{provide:l.TP,useClass:I,multi:!0}]}),Je})();var Bt=a(6493),jt=a(6271),Ht=a(8406),St=a(4249),ve=a(2777),M=a(5094);const N=[{path:"",pathMatch:"full",redirectTo:"home"},{path:"admin-mod",loadChildren:()=>Promise.all([a.e(471),a.e(345),a.e(592),a.e(438)]).then(a.bind(a,4438)).then(Je=>Je.AdminModule),canActivate:[M.H,ve.t],data:{title:"Admin & Moderator Panel Management",description:"Halaman Khusus Untuk Administrasi & Moderasi",keywords:"Admin Moderator Fansub Database",[jt.t.decoratorVerifiedOnly]:!0,[jt.t.decoratorRoles]:[St.yS.ADMIN,St.yS.MODERATOR]}},{path:"create",loadChildren:()=>Promise.all([a.e(345),a.e(592),a.e(939)]).then(a.bind(a,9939)).then(Je=>Je.CreateModule),canActivate:[ve.t],data:{title:"Membuat Konten Baru",description:"Membuat Konten Baru",keywords:"Add New Content",[jt.t.decoratorRoles]:[St.yS.ADMIN,St.yS.MODERATOR,St.yS.FANSUBBER,St.yS.USER]}},{path:"login",loadChildren:()=>a.e(146).then(a.bind(a,8146)).then(Je=>Je.LoginModule),data:{title:"Masuk",description:"Halaman Login",keywords:"Login"}},{path:"register",loadChildren:()=>Promise.all([a.e(592),a.e(839)]).then(a.bind(a,3839)).then(Je=>Je.RegisterModule),data:{title:"Pendaftaran",description:"Halaman Pembuatan Akun Baru",keywords:"Register"}},{path:"reset-password",loadChildren:()=>Promise.all([a.e(592),a.e(960)]).then(a.bind(a,5960)).then(Je=>Je.ResetPasswordModule),data:{title:"Reset Akun",description:"Halaman Atur Ulang Kata Sandi",keywords:"Reset Password"}},{path:"privacy-policy",loadChildren:()=>a.e(772).then(a.bind(a,5772)).then(Je=>Je.PrivacyPolicyModule),data:{title:"Privacy Policy",description:"Halaman Kebijakan Privasi",keywords:"privacy-policy"}},{path:"verify",loadChildren:()=>Promise.all([a.e(592),a.e(628)]).then(a.bind(a,7628)).then(Je=>Je.VerifyModule),canActivate:[ve.t],data:{title:"Verifikasi",description:"Halaman Verifikasi Akun",keywords:"Verify",[jt.t.decoratorRoles]:[St.yS.ADMIN,St.yS.MODERATOR,St.yS.FANSUBBER,St.yS.USER]}},{path:"home",loadChildren:()=>Promise.all([a.e(592),a.e(915)]).then(a.bind(a,2915)).then(Je=>Je.HomeModule),data:{title:"Database Fansub Indonesia",description:"Database Fansub Indonesia",keywords:"Fansub DB"}},{path:"news",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(345),a.e(592),a.e(108)]).then(a.bind(a,6108)).then(Je=>Je.NewsModule),data:{title:"Berita & Informasi",description:"Papan Pengumuman",keywords:"News"}},{path:"mailbox",loadChildren:()=>Promise.all([a.e(471),a.e(592),a.e(297)]).then(a.bind(a,2297)).then(Je=>Je.MailboxModule),canActivate:[ve.t,M.H],data:{title:"Surat Elektronik",description:"E-Mail & DM's",keywords:"Surel Email DM",[jt.t.decoratorVerifiedOnly]:!0,[jt.t.decoratorRoles]:[St.yS.ADMIN,St.yS.MODERATOR,St.yS.FANSUBBER,St.yS.USER]}},{path:"nihongo",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(345),a.e(592),a.e(750)]).then(a.bind(a,6750)).then(Je=>Je.NihongoModule),data:{title:"Belajar Bahasa Jepang",description:"Jejepangan Lebih Seru Dengan Bahasa Aslinya",keywords:"Bahasa Jepang"}},{path:"berkas",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(345),a.e(268),a.e(219),a.e(592),a.e(635)]).then(a.bind(a,8635)).then(Je=>Je.BerkasModule),data:{title:"Semua Berkas",description:"Kelola Arsip Berkas",keywords:"Berkas File"}},{path:"anime",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(268),a.e(925),a.e(32)]).then(a.bind(a,32)).then(Je=>Je.AnimeModule),data:{title:"List Anime & Garapan Musiman",description:"Daftar Isi Anime Musiman Yang Baru Saja Rilis Subtitle Indonesianya",keywords:"Anime Subtitle Indonesia"}},{path:"dorama",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(268),a.e(925),a.e(469)]).then(a.bind(a,8469)).then(Je=>Je.DoramaModule),data:{title:"List Dorama & Garapan Musiman",description:"Daftar Isi Dorama Musiman Yang Baru Saja Rilis Subtitle Indonesianya",keywords:"Dorama Subtitle Indonesia"}},{path:"fansub",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(345),a.e(268),a.e(219),a.e(478)]).then(a.bind(a,8478)).then(Je=>Je.FansubModule),data:{title:"Katalog Informasi Seluruh Fansub Indonesia",description:"Daftar Isi Seluruh Fansub Indonesia",keywords:"Fansub Indonesia"}},{path:"user",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(345),a.e(268),a.e(219),a.e(794)]).then(a.bind(a,2794)).then(Je=>Je.UserModule),data:{title:"User Profile",description:"Halaman Informasi Pengguna",keywords:"User"}},{path:"rss-feed",loadChildren:()=>Promise.all([a.e(471),a.e(847),a.e(592),a.e(534)]).then(a.bind(a,6534)).then(Je=>Je.RssFeedModule),data:{title:"Loper Koran RSS Feed",description:"Halaman Rangkuman Berita Acara Fansub Indonesia",keywords:"RSS Feed"}},{path:"torrent",loadChildren:()=>Promise.all([a.e(592),a.e(58)]).then(a.bind(a,4058)).then(Je=>Je.TorrentModule),data:{title:"Web-SocketRTC Torrent",description:"Halaman Peer-to-Peer Berbagi Berkas",keywords:"Web Torrent"}},{path:"docs",loadChildren:()=>Promise.all([a.e(592),a.e(938)]).then(a.bind(a,7938)).then(Je=>Je.DocsModule),data:{title:"Developers Documentation",description:"For Developers Only",keywords:"Domain & API Keys"}},{path:"error",loadChildren:()=>a.e(255).then(a.bind(a,255)).then(Je=>Je.NotFoundModule),data:{title:"Error - 404",description:"Whoops! Halaman Tidak Ditemukan",keywords:"404 - Not Found"}},{path:"**",redirectTo:"error"}];let F=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[Ht.Bz.forRoot(N,{initialNavigation:"enabledBlocking",scrollPositionRestoration:"enabled",relativeLinkResolution:"corrected"})],Ht.Bz]}),Je})(),ue=(()=>{class Je extends n.hm{constructor(){super(...arguments),this.overrides={pinch:{enable:!1},rotate:{enable:!1}}}}return Je.\u0275fac=function(){let Yt;return function(qe){return(Yt||(Yt=r.n5z(Je)))(qe||Je)}}(),Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac,providedIn:"root"}),Je})();const Be={showDelay:250,hideDelay:0,touchendHideDelay:0,touchGestures:"off"};var lt=a(210),Ct=a(8696),be=a(3e3);let R=(()=>{class Je{constructor(Se,qe){this.gs=Se,this.bs=qe}intercept(Se,qe){return qe.handle(Se).pipe((0,Ft.R)(this.bs.onCancelPendingRequests))}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(Ct.U),r.LFG(be.z))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac}),Je})();var $=a(5934),Ke=a(8381),ut=a(4137);let Ot=(()=>{class Je{constructor(Se,qe,At){this.gs=Se,this.ss=qe,this.as=At}intercept(Se,qe){var At;const Ne=Se.url,Rt=Ne.startsWith($.N.baseUrl)||Ne.startsWith($.N.apiUrl);if(this.gs.isBrowser&&Rt){if(Se=Se.clone({withCredentials:!this.gs.isDevMode}),this.as.token){const Ut=this.as.token.length,an=this.as.token.slice(0,5)+"....."+this.as.token.slice(Ut-5,Ut);this.gs.log("[INTERCEPT_JWT]",an),Se=Se.clone({headers:Se.headers.append("Authorization",`Bearer ${this.as.token}`)})}(null===(At=this.ss.mySocket)||void 0===At?void 0:At.id)&&(this.gs.log("[INTERCEPT_SOCKET]",this.ss.mySocket.id),Se=Se.clone({headers:Se.headers.append("x-socket-id",this.ss.mySocket.id)}))}return qe.handle(Se)}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(Ct.U),r.LFG(Ke.R),r.LFG(ut.e))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac}),Je})();var Nt=a(262),yt=a(2843),bt=a(6925),zt=a(3379);let Ae=(()=>{class Je{constructor(Se,qe,At,Ne,Rt,Ut,an,jn){this.gs=Se,this.router=qe,this.as=At,this.toast=Ne,this.bs=Rt,this.ss=Ut,this.ls=an,this.activatedRoute=jn}intercept(Se,qe){return qe.handle(Se).pipe((0,E.b)(At=>{if(At instanceof l.Zn&&this.gs.isBrowser){let Ne="UwUu~ Berhasil~",Rt="Yeay, Selesai!";switch(At&&At.body&&(At.body.info&&(Rt=At.body.info),At.body.result&&At.body.result.message&&(Ne=At.body.result.message)),At.status){case 200:this.toast.success(Ne,Rt);break;case 201:case 202:this.toast.info(Ne,Rt);break;default:this.toast.warning(Ne,Rt)}if("GET"===Se.method){this.gs.log("[SOCKET_TRACK-SET]",Se.url);let Ut=Se.url;Ut.startsWith($.N.baseUrl)&&(Ut=Ut.slice($.N.baseUrl.length)),Ut.startsWith($.N.apiUrl)&&(Ut=Ut.slice($.N.apiUrl.length)),this.ss.socketEmitVolatile("track-set",{pathUrl:Ut.split("?")[0]})}}}),(0,Nt.K)(At=>{var Ne;if(this.gs.log(`[INTERCEPT_ERROR-${At.status}]`,At.statusText,"error"),this.gs.isBrowser){let Rt="Terjadi Kesalahan Pada Jaringan~",Ut="Whoops, Server Sibuk T.T";switch(At&&At.error&&(At.error.info&&(Ut=At.error.info),At.error.result&&At.error.result.message&&(Rt=At.error.result.message)),this.toast.error(Rt,Ut,null,!0),At.status){case 401:this.as.removeUser(),this.ls.clear(),this.bs.idle(),this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url.split("?")[0]||"/"}});break;case 404:this.bs.idle(),this.router.navigate(["/error"],{queryParams:{returnUrl:(null===(Ne=this.activatedRoute.snapshot.parent)||void 0===Ne?void 0:Ne.url)||"/"}});break;case 418:this.bs.idle(),this.router.navigate(["/verify"],{queryParams:{returnUrl:this.router.url.split("?")[0]||"/"}})}}return(0,yt._)(()=>At.error)}))}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(Ct.U),r.LFG(Ht.F0),r.LFG(ut.e),r.LFG(bt.k),r.LFG(be.z),r.LFG(Ke.R),r.LFG(zt.n),r.LFG(Ht.gz))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac}),Je})();var ct=a(5861),pe=a(1777);const oe=(0,pe.X$)("onSideNavChange",[(0,pe.SB)("close",(0,pe.oB)({"min-width":"50px"})),(0,pe.SB)("open",(0,pe.oB)({"min-width":"200px"})),(0,pe.eR)("close => open",(0,pe.jt)("250ms ease-in")),(0,pe.eR)("open => close",(0,pe.jt)("250ms ease-out"))]),Q=(0,pe.X$)("onMainContentChange",[(0,pe.SB)("close",(0,pe.oB)({"margin-left":"62px"})),(0,pe.SB)("open",(0,pe.oB)({"margin-left":"200px"})),(0,pe.eR)("close => open",(0,pe.jt)("250ms ease-in")),(0,pe.eR)("open => close",(0,pe.jt)("250ms ease-out"))]),fe=(0,pe.X$)("animateText",[(0,pe.SB)("hide",(0,pe.oB)({display:"none",opacity:0})),(0,pe.SB)("show",(0,pe.oB)({display:"block",opacity:1})),(0,pe.eR)("close => open",(0,pe.jt)("350ms ease-in")),(0,pe.eR)("open => close",(0,pe.jt)("200ms ease-out"))]);var Re=a(8745),Ce=a(6382),Ve=a(7),Ge=a(7814),xt=a(8020),Mt=a(7845),hn=a(9775);let ft=(()=>{class Je{constructor(Se){this.gs=Se,this.currentViewer=null}viewImage(Se){this.currentViewer=new Viewer(Se,{url:"src",navbar:!1,title:!0,toolbar:{zoomIn:!0,zoomOut:!0,oneToOne:!0,reset:!0,prev:!1,play:{show:!1,size:"large"},next:!1,rotateLeft:!0,rotateRight:!0,flipHorizontal:!0,flipVertical:!0},ready:qe=>{this.gs.log("[VIEWERJS]",qe.type),this.currentViewer.show()},show:qe=>{this.gs.log("[VIEWERJS]",qe.type)},shown:qe=>{this.gs.log("[VIEWERJS]",qe.type)},view:qe=>{this.gs.log("[VIEWERJS]",qe.type)},viewed:qe=>{this.gs.log("[VIEWERJS]",qe.type)},move:qe=>{this.gs.log("[VIEWERJS]",qe.type)},moved:qe=>{this.gs.log("[VIEWERJS]",qe.type)},rotate:qe=>{this.gs.log("[VIEWERJS]",qe.type)},rotated:qe=>{this.gs.log("[VIEWERJS]",qe.type)},scale:qe=>{this.gs.log("[VIEWERJS]",qe.type)},scaled:qe=>{this.gs.log("[VIEWERJS]",qe.type)},play:qe=>{this.gs.log("[VIEWERJS]",qe.type)},stop:qe=>{this.gs.log("[VIEWERJS]",qe.type)},hide:qe=>{this.gs.log("[VIEWERJS]",qe.type)},zoom:qe=>{this.gs.log("[VIEWERJS]",qe.type)},zoomed:qe=>{this.gs.log("[VIEWERJS]",qe.type)},hidden:qe=>{this.gs.log("[VIEWERJS]",qe.type),this.currentViewer.destroy(),this.currentViewer=null}})}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(Ct.U))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac,providedIn:"root"}),Je})();var gt=a(4594),nt=a(7423),Dt=a(5245),Gt=a(508),mn=a(7544);function bn(Je,Yt){if(1&Je&&(r.TgZ(0,"button",12)(1,"mat-icon",13),r._uU(2,"sports_score"),r.qZA(),r._uU(3),r.qZA()),2&Je){const Se=r.oxw();r.xp6(3),r.hij(" ",Se.myPoints," ")}}function Sn(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"button",14),r.NdJ("click",function(){return r.CHM(Se),r.oxw().toggleWeather()}),r.TgZ(1,"mat-icon"),r._uU(2,"filter_vintage"),r.qZA()()}}function Vn(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"button",15),r.NdJ("click",function(){return r.CHM(Se),r.oxw().openAdminNavigation()}),r.TgZ(1,"mat-icon"),r._uU(2,"apps"),r.qZA()()}}function Gn(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"button",16),r.NdJ("click",function(){return r.CHM(Se),r.oxw().reloadPage()}),r.TgZ(1,"mat-icon"),r._uU(2,"replay"),r.qZA()()}}let Rn=(()=>{class Je{constructor(Se,qe,At,Ne,Rt,Ut,an,jn,ai){this.snackBar=Se,this.lms=qe,this.rps=At,this.router=Ne,this.pi=Rt,this.gs=Ut,this.ss=an,this.bs=jn,this.ls=ai,this.myPoints=0,this.subsGlobalRoom=null}get GS(){return this.gs}get ROUTER(){return this.router}get PI(){return this.pi}get SS(){return this.ss}ngOnInit(){if(this.gs.isBrowser){const Se=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;this.gs.isDarkMode=Se||"true"===this.ls.getItem(this.gs.localStorageKeys.DarkMode),this.toggleDarkTheme(!0),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",qe=>{this.gs.isDarkMode=qe.matches,this.toggleDarkTheme(!0)}),this.subsGlobalRoom=this.ss.globalRoom.subscribe({next:qe=>{var At,Ne;this.myPoints=(null===(Ne=null===(At=null==qe?void 0:qe.member_list[this.ss.mySocket.id])||void 0===At?void 0:At.profile_)||void 0===Ne?void 0:Ne.points)||0}})}}ngOnDestroy(){var Se;null===(Se=this.subsGlobalRoom)||void 0===Se||Se.unsubscribe()}get discordUrl(){return $.N.discord.join_url}toggleSideNav(){this.lms.onSideNavToggleView()}toggleWeather(){this.gs.weatherToggle(),this.snackBar.open(`Berhasil ${this.gs.weatherRunning?"Menyalakan":"Mematikan"} Efek Musiman`,"Ok")}reloadPage(){this.bs.busy(),window.location.reload()}openSearch(){this.rps.toggleSidePanel("SearchAllComponent")}openLiveChat(){this.rps.toggleSidePanel("LiveChatComponent")}openAdminNavigation(){this.rps.toggleSidePanel("AdminNavigationComponent")}toggleDarkTheme(Se=!1){this.gs.toggleDarkTheme(Se),this.ls.setItem(this.gs.localStorageKeys.DarkMode,JSON.stringify(this.gs.isDarkMode)),this.pi.updateStatusBarTheme(this.gs.isDarkMode),this.snackBar.open("Menggunakan Mode "+(this.gs.isDarkMode?"Gelap":"Terang"),"Ok")}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(V.ux),r.Y36(Ve.S),r.Y36(Ge.C),r.Y36(Ht.F0),r.Y36(Re.Z),r.Y36(Ct.U),r.Y36(Ke.R),r.Y36(be.z),r.Y36(zt.n))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["app-header"]],decls:20,vars:7,consts:[["color","primary",2,"height","56px","padding","0 12px"],["type","button","mat-icon-button","","matTooltip","Menu",1,"shiny",3,"click"],["matLine","",1,"text-truncate",2,"margin-left","1rem","margin-right","1rem"],[1,"spacer"],["type","button","mat-stroked-button","","matTooltip","Points",4,"ngIf"],["type","button","class","animate__animated animate__tada animate__infinite animate__slower","mat-icon-button","","matTooltip","Weather Effect",3,"click",4,"ngIf"],["type","button","mat-icon-button","","matTooltip","Ganti Warna",1,"animate__animated","animate__flash","animate__infinite","animate__slower",3,"click"],["type","button","mat-icon-button","","matTooltip","Obrolan",3,"click"],["matBadgePosition","before",3,"matBadge","matBadgeColor"],["type","button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-icon-button","","matTooltip","Pencarian",1,"animate__animated","animate__heartBeat","animate__infinite","animate__slower",3,"click"],["type","button","mat-icon-button","","matTooltip","Refresh",3,"click",4,"ngIf"],["type","button","mat-stroked-button","","matTooltip","Points"],[1,"me-1"],["type","button","mat-icon-button","","matTooltip","Weather Effect",1,"animate__animated","animate__tada","animate__infinite","animate__slower",3,"click"],["type","button","mat-icon-button","",3,"click"],["type","button","mat-icon-button","","matTooltip","Refresh",3,"click"]],template:function(Se,qe){1&Se&&(r.TgZ(0,"mat-toolbar",0)(1,"button",1),r.NdJ("click",function(){return qe.toggleSideNav()}),r.TgZ(2,"mat-icon"),r._uU(3,"menu"),r.qZA()(),r.TgZ(4,"span",2),r._uU(5),r.qZA(),r._UZ(6,"span",3),r.YNc(7,bn,4,1,"button",4),r.YNc(8,Sn,3,0,"button",5),r.TgZ(9,"button",6),r.NdJ("click",function(){return qe.toggleDarkTheme()}),r.TgZ(10,"mat-icon"),r._uU(11,"nights_stay"),r.qZA()(),r.TgZ(12,"button",7),r.NdJ("click",function(){return qe.openLiveChat()}),r.TgZ(13,"mat-icon",8),r._uU(14," forum "),r.qZA()(),r.YNc(15,Vn,3,0,"button",9),r.TgZ(16,"button",10),r.NdJ("click",function(){return qe.openSearch()}),r.TgZ(17,"mat-icon"),r._uU(18,"search"),r.qZA()(),r.YNc(19,Gn,3,0,"button",11),r.qZA()),2&Se&&(r.xp6(5),r.hij(" ",qe.PI.getHeaderTitle," "),r.xp6(2),r.Q6J("ngIf",qe.ROUTER.url.includes("/nihongo")&&qe.GS.isDesktop),r.xp6(1),r.Q6J("ngIf",qe.GS.weatherEffect),r.xp6(5),r.Q6J("matBadge",qe.SS.messageChatUnreadCount)("matBadgeColor","warn"),r.xp6(2),r.Q6J("ngIf",qe.ROUTER.url.includes("/admin-mod/")),r.xp6(4),r.Q6J("ngIf",!(null!=qe.SS.mySocket&&qe.SS.mySocket.id)))},directives:[gt.Ye,nt.lW,U.gM,Dt.Hw,Gt.X2,ht.O5,mn.k],styles:[""]}),Je})();var ti=a(2638),Jn=a(4623),on=a(4834),$n=a(2368);function cn(Je,Yt){1&Je&&r._UZ(0,"div")}function ln(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",11),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r._UZ(1,"img",12),r.TgZ(2,"span",13),r._uU(3),r._UZ(4,"br"),r._uU(5),r.qZA()(),r.TgZ(6,"a",14),r.NdJ("click",function(){return r.CHM(Se),r.oxw().logout()}),r.TgZ(7,"mat-icon",7),r._uU(8,"power_settings_new"),r.qZA(),r.TgZ(9,"span",8),r._uU(10),r.qZA()()}if(2&Je){const Se=r.oxw();r.Tol(Se.TRUSTED?"gradient-border":""),r.xp6(1),r.s9C("src",null==Se.AS.currentUserSubject||null==Se.AS.currentUserSubject.value?null:Se.AS.currentUserSubject.value.image_url,r.LSH),r.xp6(1),r.Q6J("@animateText",Se.linkText?"show":"hide"),r.xp6(1),r.hij(" ",null==Se.AS.currentUserSubject||null==Se.AS.currentUserSubject.value?null:Se.AS.currentUserSubject.value.kartu_tanda_penduduk_.nama," "),r.xp6(2),r.hij(" ",null==Se.AS.currentUserSubject||null==Se.AS.currentUserSubject.value?null:Se.AS.currentUserSubject.value._email," "),r.xp6(4),r.Q6J("@animateText",Se.linkText?"show":"hide"),r.xp6(1),r.hij(" Keluar ",Se.AS.logoutTimerText," ")}}function Ye(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",15),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(1,"mat-icon",7),r._uU(2,"login"),r.qZA(),r.TgZ(3,"span",8),r._uU(4,"Masuk"),r.qZA()(),r.TgZ(5,"a",16),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(6,"mat-icon",7),r._uU(7,"group_add"),r.qZA(),r.TgZ(8,"span",8),r._uU(9,"Daftar"),r.qZA()()}if(2&Je){const Se=r.oxw();r.xp6(3),r.Q6J("@animateText",Se.linkText?"show":"hide"),r.xp6(5),r.Q6J("@animateText",Se.linkText?"show":"hide")}}function Pe(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",17),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(1,"mat-icon",18),r._uU(2),r.qZA(),r.TgZ(3,"span",8),r._uU(4),r.qZA()()}if(2&Je){const Se=Yt.$implicit,qe=r.oxw();r.s9C("routerLink",Se.link),r.xp6(1),r.Q6J("matBadge",Se.badge),r.xp6(1),r.Oqu(Se.icon),r.xp6(1),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(1),r.Oqu(Se.name)}}function De(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",17),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(1,"mat-icon",18),r._uU(2),r.qZA(),r.TgZ(3,"span",8),r._uU(4),r.qZA()()}if(2&Je){const Se=Yt.$implicit,qe=r.oxw();r.s9C("routerLink",Se.link),r.xp6(1),r.Q6J("matBadge",Se.badge),r.xp6(1),r.Oqu(Se.icon),r.xp6(1),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(1),r.Oqu(Se.name)}}function D(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",17),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(1,"mat-icon",18),r._uU(2),r.qZA(),r.TgZ(3,"span",8),r._uU(4),r.qZA()()}if(2&Je){const Se=Yt.$implicit,qe=r.oxw();r.s9C("routerLink",Se.link),r.xp6(1),r.Q6J("matBadge",Se.badge),r.xp6(1),r.Oqu(Se.icon),r.xp6(1),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(1),r.Oqu(Se.name)}}function ie(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",17),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(1,"mat-icon",18),r._uU(2),r.qZA(),r.TgZ(3,"span",8),r._uU(4),r.qZA()()}if(2&Je){const Se=Yt.$implicit,qe=r.oxw();r.s9C("routerLink",Se.link),r.xp6(1),r.Q6J("matBadge",Se.badge),r.xp6(1),r.Oqu(Se.icon),r.xp6(1),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(1),r.Oqu(Se.name)}}function Ue(Je,Yt){if(1&Je){const Se=r.EpF();r.TgZ(0,"a",17),r.NdJ("click",function(){return r.CHM(Se),r.oxw().forceCloseSideNav()}),r.TgZ(1,"mat-icon",18),r._uU(2),r.qZA(),r.TgZ(3,"span",8),r._uU(4),r.qZA()()}if(2&Je){const Se=Yt.$implicit,qe=r.oxw();r.s9C("routerLink",Se.link),r.xp6(1),r.Q6J("matBadge",Se.badge),r.xp6(1),r.Oqu(Se.icon),r.xp6(1),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(1),r.Oqu(Se.name)}}const ot=function(Je){return{"overflow-y":Je,"overflow-x":"hidden"}};let $t=(()=>{class Je{constructor(Se,qe,At,Ne,Rt,Ut){this.router=Se,this.lms=qe,this.as=At,this.gs=Ne,this.ds=Rt,this.ls=Ut,this.subsDialog=null}get AS(){return this.as}get GS(){return this.gs}get mainMenus(){return this.lms.mainMenus}get contentMenus(){return this.lms.contentMenus}get additionalMenus(){return this.lms.additionalMenus}get miscMenus(){return this.lms.miscMenus}get otherMenus(){return this.lms.otherMenus}get TRUSTED(){var Se;return!!(null===(Se=this.as.currentUserSubject)||void 0===Se?void 0:Se.value)&&(this.as.currentUserSubject.value.role===St.yS.ADMIN||this.as.currentUserSubject.value.role===St.yS.MODERATOR||this.as.currentUserSubject.value.role===St.yS.FANSUBBER)}ngOnDestroy(){var Se;null===(Se=this.subsDialog)||void 0===Se||Se.unsubscribe()}ngOnInit(){}get sideNavExpanded(){return this.lms.sideNavExpanded}get linkText(){return this.lms.linkText}onMouseHoverIn(){this.gs.isDesktop&&this.lms.onMouseHoverIn()}onMouseHoverOut(){this.gs.isDesktop&&this.lms.onMouseHoverOut()}forceCloseSideNav(){this.lms.forceCloseSideNav()}logout(){this.as.logout()}openDocumentation(){this.forceCloseSideNav(),this.router.navigateByUrl("/docs")}openWebTorrent(){this.forceCloseSideNav(),this.gs.isDesktop?this.router.navigateByUrl("/torrent"):this.subsDialog=this.ds.openInfoDialog({data:{title:".: Web-Torrent :.",htmlMessage:"Fitur Ini Tergolong Cukup Berat Karena Dikhususkan Untuk Pengguna Desktop, Akan Ada Kemungkinan Juga Tampilan Menjadi Berantakan, Yakin Ingin Melanjutkan ?",confirmText:"Ya, Lanjutkan",cancelText:"Tidak, Batal"},disableClose:!1}).afterClosed().subscribe({next:Se=>{this.gs.log("[INFO_DIALOG_CLOSED]",Se),!0===Se&&this.router.navigateByUrl("/torrent"),this.subsDialog.unsubscribe()}})}toggleDebugLog(Se){this.gs.forceEnableDebugLog=Se.checked,this.ls.setItem(this.gs.localStorageKeys.DebugLogs,JSON.stringify(Se.checked))}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(Ht.F0),r.Y36(Ve.S),r.Y36(ut.e),r.Y36(Ct.U),r.Y36(Mt.x),r.Y36(zt.n))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["app-left-menu"]],decls:35,vars:15,consts:[[1,"sidenav_container",3,"ngStyle","mouseenter","mouseleave"],[4,"ngIf","ngIfThen","ngIfElse"],["sudahLogin",""],["belumLogin",""],[2,"margin-top","8px"],["mat-list-item","","routerLinkActive","side-menu-link-active",3,"routerLink","click",4,"ngFor","ngForOf"],["mat-list-item","","routerLinkActive","side-menu-link-active",3,"click"],[2,"padding-left","0.2em"],[2,"padding-left","1.75em","padding-right","0.2em"],[2,"right","1em !important","position","absolute"],[3,"ngModel","ngModelChange","click","change"],["mat-list-item","","routerLink","/user","routerLinkActive","side-menu-link-active",3,"click"],[1,"jim",3,"src"],[1,"text-truncate",2,"padding-left","1.2em","padding-right","0.2em"],["mat-list-item","",3,"click"],["mat-list-item","","routerLink","/login","routerLinkActive","side-menu-link-active",3,"click"],["mat-list-item","","routerLink","/register","routerLinkActive","side-menu-link-active",3,"click"],["mat-list-item","","routerLinkActive","side-menu-link-active",3,"routerLink","click"],["matBadgeColor","warn","matBadgePosition","before",2,"padding-left","0.2em",3,"matBadge"]],template:function(Se,qe){if(1&Se&&(r.TgZ(0,"div",0),r.NdJ("mouseenter",function(){return qe.onMouseHoverIn()})("mouseleave",function(){return qe.onMouseHoverOut()}),r.TgZ(1,"mat-nav-list"),r.YNc(2,cn,1,0,"div",1),r.YNc(3,ln,11,9,"ng-template",null,2,r.W1O),r.YNc(5,Ye,10,2,"ng-template",null,3,r.W1O),r.qZA(),r._UZ(7,"mat-divider",4),r.TgZ(8,"mat-nav-list"),r.YNc(9,Pe,5,5,"a",5),r.qZA(),r._UZ(10,"mat-divider",4),r.TgZ(11,"mat-nav-list"),r.YNc(12,De,5,5,"a",5),r.qZA(),r._UZ(13,"mat-divider",4),r.TgZ(14,"mat-nav-list"),r.YNc(15,D,5,5,"a",5),r.qZA(),r._UZ(16,"mat-divider",4),r.TgZ(17,"mat-nav-list")(18,"a",6),r.NdJ("click",function(){return qe.openWebTorrent()}),r.TgZ(19,"mat-icon",7),r._uU(20,"sailing"),r.qZA(),r.TgZ(21,"span",8),r._uU(22,"Web Torrent"),r.qZA()(),r.YNc(23,ie,5,5,"a",5),r.qZA(),r._UZ(24,"mat-divider",4),r.TgZ(25,"mat-nav-list"),r.YNc(26,Ue,5,5,"a",5),r.TgZ(27,"a",6),r.NdJ("click",function(){return qe.openDocumentation()}),r.TgZ(28,"mat-icon",7),r._uU(29,"settings_ethernet"),r.qZA(),r.TgZ(30,"span",8),r._uU(31," Dev. Mode "),r.TgZ(32,"span",9)(33,"mat-slide-toggle",10),r.NdJ("ngModelChange",function(Ne){return qe.GS.forceEnableDebugLog=Ne})("click",function(Ne){return Ne.stopPropagation()})("change",function(Ne){return qe.toggleDebugLog(Ne)}),r.qZA()()()()(),r._UZ(34,"div",4),r.qZA()),2&Se){const At=r.MAs(4),Ne=r.MAs(6);r.Q6J("@onSideNavChange",qe.sideNavExpanded?"open":"close")("ngStyle",r.VKq(13,ot,qe.sideNavExpanded?"auto":"hidden")),r.xp6(2),r.Q6J("ngIf",null==qe.AS.currentUserSubject?null:qe.AS.currentUserSubject.value)("ngIfThen",At)("ngIfElse",Ne),r.xp6(7),r.Q6J("ngForOf",qe.mainMenus),r.xp6(3),r.Q6J("ngForOf",qe.contentMenus),r.xp6(3),r.Q6J("ngForOf",qe.additionalMenus),r.xp6(6),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(2),r.Q6J("ngForOf",qe.miscMenus),r.xp6(3),r.Q6J("ngForOf",qe.otherMenus),r.xp6(4),r.Q6J("@animateText",qe.linkText?"show":"hide"),r.xp6(3),r.Q6J("ngModel",qe.GS.forceEnableDebugLog)}},directives:[ht.PC,Jn.Hk,ht.O5,Jn.Tg,Ht.yS,Ht.Od,Dt.Hw,on.d,ht.sg,mn.k,$n.Rr,w.JJ,w.On],styles:[".sidenav_container[_ngcontent-%COMP%]{min-width:64px!important;max-width:320px;height:calc(100vh - 88px)}.jim[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:cover;border-radius:50%}.side-menu-link-active[_ngcontent-%COMP%]{background:rgba(255,64,129,.15);color:#ff4081!important;font-weight:700}.mat-list-item-content[_ngcontent-%COMP%]{padding:0!important}"],data:{animation:[oe,fe]}}),Je})();function Qt(Je,Yt){1&Je&&r.GkF(0,4)}let On=(()=>{class Je{constructor(Se,qe){this.rps=Se,this.gs=qe}get RPS(){return this.rps}ngOnInit(){}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(Ge.C),r.Y36(Ct.U))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["app-right-panel"]],decls:4,vars:1,consts:[[1,"sidepanel_container","p-3"],[1,"row"],[1,"col-12"],["ngIf","rps.component",4,"ngComponentOutlet"],["ngIf","rps.component"]],template:function(Se,qe){1&Se&&(r.TgZ(0,"div",0)(1,"div",1)(2,"div",2),r.YNc(3,Qt,1,0,"ng-container",3),r.qZA()()()),2&Se&&(r.xp6(3),r.Q6J("ngComponentOutlet",qe.RPS.componentView))},directives:[ht.$G,ht.O5],styles:[".sidepanel_container[_ngcontent-%COMP%]{max-width:320px}.mat-list-item-content[_ngcontent-%COMP%]{padding:0!important}"]}),Je})(),Pn=(()=>{class Je{constructor(Se,qe){this.fs=Se,this.gs=qe}ngOnInit(){}get isHidden(){return this.fs.isHidden}get tooltipText(){return this.fs.tooltipText}get backgroundImage(){return this.fs.backgroundImage}get backgroundIcon(){return this.fs.backgroundIcon}buttonClicked(){this.fs.buttonClicked()}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(Ce.r),r.Y36(Ct.U))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["app-material-fab"]],decls:3,vars:6,consts:[["type","button","mat-fab","","color","warn",1,"me-3","mb-5","fab-button","animate__animated","animate__bounce","animate__infinite","animate__slow",3,"matTooltip","click"]],template:function(Se,qe){1&Se&&(r.TgZ(0,"button",0),r.NdJ("click",function(){return qe.buttonClicked()}),r.TgZ(1,"mat-icon"),r._uU(2),r.qZA()()),2&Se&&(r.Udp("display",qe.isHidden?"none":"")("background-image",qe.backgroundImage?"url("+qe.backgroundImage+")":""),r.s9C("matTooltip",qe.tooltipText),r.xp6(2),r.Oqu(qe.backgroundIcon))},directives:[nt.lW,U.gM,Dt.Hw],styles:[".fab-button[_ngcontent-%COMP%]{z-index:9999;position:fixed;bottom:0;right:0;background-size:contain;background-position:center}"]}),Je})();function pt(Je,Yt){1&Je&&r.GkF(0)}function un(Je,Yt){if(1&Je&&(r.ynx(0),r._uU(1),r.BQk()),2&Je){const Se=r.oxw(2).$implicit;r.xp6(1),r.Oqu(Se.label)}}const en=function(Je){return{"xng-breadcrumb-link-disabled":Je}},dn=function(Je,Yt,Se,qe,At,Ne){return{$implicit:Je,info:Yt,last:Se,first:qe,index:At,count:Ne}};function gn(Je,Yt){if(1&Je&&(r.TgZ(0,"a",7),r.YNc(1,pt,1,0,"ng-container",8),r.YNc(2,un,2,1,"ng-container",9),r.qZA()),2&Je){const Se=r.oxw(),qe=Se.$implicit,At=Se.last,Ne=Se.first,Rt=Se.index,Ut=Se.count,an=r.oxw();r.Q6J("ngClass",r.VKq(10,en,qe.disable))("routerLink",qe.routeInterceptor?qe.routeInterceptor(qe.routeLink,qe):qe.routeLink)("queryParams",an.preserveQueryParams?qe.queryParams:void 0)("fragment",an.preserveFragment?qe.fragment:void 0)("target",an.anchorTarget?an.anchorTarget:"_self"),r.uIk("aria-disabled",qe.disable)("tabIndex",qe.disable?-1:0),r.xp6(1),r.Q6J("ngTemplateOutlet",an.itemTemplate)("ngTemplateOutletContext",r.HTZ(12,dn,qe.label,qe.info,At,Ne,Rt,Ut)),r.xp6(1),r.Q6J("ngIf",!an.itemTemplate)}}function Cn(Je,Yt){1&Je&&r.GkF(0)}function vn(Je,Yt){if(1&Je&&(r.ynx(0),r._uU(1),r.BQk()),2&Je){const Se=r.oxw(2).$implicit;r.xp6(1),r.Oqu(Se.label)}}function oi(Je,Yt){if(1&Je&&(r.TgZ(0,"label",10),r.YNc(1,Cn,1,0,"ng-container",8),r.YNc(2,vn,2,1,"ng-container",9),r.qZA()),2&Je){const Se=r.oxw(),qe=Se.$implicit,At=Se.last,Ne=Se.first,Rt=Se.index,Ut=Se.count,an=r.oxw();r.xp6(1),r.Q6J("ngTemplateOutlet",an.itemTemplate)("ngTemplateOutletContext",r.HTZ(3,dn,qe.label,qe.info,At,Ne,Rt,Ut)),r.xp6(1),r.Q6J("ngIf",!an.itemTemplate)}}function pi(Je,Yt){1&Je&&r.GkF(0)}function ni(Je,Yt){if(1&Je&&(r.ynx(0),r._uU(1),r.BQk()),2&Je){const Se=r.oxw(3);r.xp6(1),r.Oqu(Se.separator)}}function ii(Je,Yt){if(1&Je&&(r.TgZ(0,"li",11),r.YNc(1,pi,1,0,"ng-container",12),r.YNc(2,ni,2,1,"ng-container",9),r.qZA()),2&Je){const Se=r.oxw(2);r.xp6(1),r.Q6J("ngTemplateOutlet",Se.separatorTemplate),r.xp6(1),r.Q6J("ngIf",!Se.separatorTemplate)}}function Ci(Je,Yt){if(1&Je&&(r.ynx(0),r.TgZ(1,"li",3),r.YNc(2,gn,3,19,"a",4),r.YNc(3,oi,3,10,"label",5),r.qZA(),r.YNc(4,ii,3,2,"li",6),r.BQk()),2&Je){const Se=Yt.last;r.xp6(2),r.Q6J("ngIf",!Se),r.xp6(1),r.Q6J("ngIf",Se),r.xp6(1),r.Q6J("ngIf",!Se)}}let ui=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275dir=r.lG2({type:Je,selectors:[["","xngBreadcrumbItem",""]]}),Je})();const ki=Je=>Je&&Object.keys(Je).length>0;let Ni=(()=>{class Je{constructor(Se,qe){this.activatedRoute=Se,this.router=qe,this.baseHref="/",this.dynamicBreadcrumbStore=[],this.currentBreadcrumbs=[],this.previousBreadcrumbs=[],this.breadcrumbs=new H.X([]),this.breadcrumbs$=this.breadcrumbs.asObservable(),this.detectRouteChanges()}detectRouteChanges(){this.setupBreadcrumbs(this.activatedRoute.snapshot),this.router.events.pipe((0,o.h)(Se=>Se instanceof Ht.c9)).subscribe(Se=>{Se instanceof Ht.c9&&Se.shouldActivate&&this.setupBreadcrumbs(Se.state.root)})}setupBreadcrumbs(Se){this.previousBreadcrumbs=this.currentBreadcrumbs;const qe=this.getRootBreadcrumb();this.currentBreadcrumbs=qe?[qe]:[],this.prepareBreadcrumbList(Se,this.baseHref)}getRootBreadcrumb(){var Se;const qe=this.router.config.find(Rt=>""===Rt.path),At=this.extractObject(null===(Se=null==qe?void 0:qe.data)||void 0===Se?void 0:Se.breadcrumb),Ne=this.getFromStore(At.alias,"/");if(ki(At)||ki(Ne))return Object.assign(Object.assign(Object.assign(Object.assign({},Ne),At),{routeLink:this.baseHref}),this.getQueryParamsFromPreviousList("/"))}prepareBreadcrumbItem(Se,qe){const{path:At,breadcrumb:Ne}=this.parseRouteData(Se.routeConfig),Rt=this.resolvePathSegment(At,Se),Ut=`${qe}${Rt}`,an=this.getFromStore(Ne.alias,Ut),jn=this.extractLabel((null==an?void 0:an.label)||(null==Ne?void 0:Ne.label),Rt);let ai=!1,Ei="";return jn||(ai=!0,Ei=Rt),Object.assign(Object.assign(Object.assign(Object.assign({},an),Ne),{label:ai?Ei:jn,routeLink:Ut,isAutoGeneratedLabel:ai}),this.getQueryParamsFromPreviousList(Ut))}prepareBreadcrumbList(Se,qe){var At;if(null===(At=Se.routeConfig)||void 0===At?void 0:At.path){const Ut=this.prepareBreadcrumbItem(Se,qe);if(this.currentBreadcrumbs.push(Ut),Se.firstChild)return this.prepareBreadcrumbList(Se.firstChild,Ut.routeLink+"/")}else if(Se.firstChild)return this.prepareBreadcrumbList(Se.firstChild,qe);this.setQueryParamsForActiveBreadcrumb(this.currentBreadcrumbs[this.currentBreadcrumbs.length-1],Se);const Rt=this.currentBreadcrumbs.filter(Ut=>!Ut.skip);this.breadcrumbs.next(Rt)}getFromStore(Se,qe){return this.dynamicBreadcrumbStore.find(At=>Se&&Se===At.alias||qe&&qe===At.routeLink||this.matchRegex(qe,At.routeRegex))}matchRegex(Se,qe){const At=Se.match(new RegExp(qe));return(null==At?void 0:At[0])===Se}resolvePathSegment(Se,qe){return Se.includes(":")&&Object.entries(qe.params).forEach(([At,Ne])=>{Se=Se.replace(`:${At}`,`${Ne}`)}),Se}getQueryParamsFromPreviousList(Se){const{queryParams:qe,fragment:At}=this.previousBreadcrumbs.find(Ne=>Ne.routeLink===Se)||{};return{queryParams:qe,fragment:At}}setQueryParamsForActiveBreadcrumb(Se,qe){if(Se){const{queryParams:At,fragment:Ne}=qe;Se.queryParams=At?Object.assign({},At):void 0,Se.fragment=Ne}}parseRouteData(Se){const{path:qe,data:At}=Se;return{path:qe,breadcrumb:this.mergeWithBaseChildData(Se,null==At?void 0:At.breadcrumb)}}mergeWithBaseChildData(Se,qe){var At;if(!Se)return this.extractObject(qe);let Ne;Se.loadChildren?Ne=Se._loadedConfig.routes.find(Ut=>""===Ut.path):Se.children&&(Ne=Se.children.find(Ut=>""===Ut.path));const Rt=null===(At=null==Ne?void 0:Ne.data)||void 0===At?void 0:At.breadcrumb;return Rt?this.mergeWithBaseChildData(Ne,Object.assign(Object.assign({},this.extractObject(qe)),this.extractObject(Rt))):this.extractObject(qe)}set(Se,qe){const At=this.extractObject(qe);let Ne;Ne=Se.startsWith("@")?["alias",Object.assign(Object.assign({},At),{alias:Se.slice(1)})]:Se.includes(":")?["routeRegex",Object.assign(Object.assign({},At),{routeRegex:this.buildRegex(Se)})]:["routeLink",Object.assign(Object.assign({},At),{routeLink:this.ensureLeadingSlash(Se)})],Ne[1].isAutoGeneratedLabel=!1,this.updateStore(...Ne),this.updateCurrentBreadcrumbs(...Ne)}updateStore(Se,qe){const At=this.dynamicBreadcrumbStore.findIndex(Ne=>qe[Se]===Ne[Se]);At>-1?this.dynamicBreadcrumbStore[At]=Object.assign(Object.assign({},this.dynamicBreadcrumbStore[At]),qe):this.dynamicBreadcrumbStore.push(Object.assign({},qe))}updateCurrentBreadcrumbs(Se,qe){const At=this.currentBreadcrumbs.findIndex(Ne=>"routeRegex"===Se?this.matchRegex(Ne.routeLink,qe[Se]):qe[Se]===Ne[Se]);if(At>-1){this.currentBreadcrumbs[At]=Object.assign(Object.assign({},this.currentBreadcrumbs[At]),qe);const Ne=this.currentBreadcrumbs.filter(Rt=>!Rt.skip);this.breadcrumbs.next([...Ne])}}buildRegex(Se){return this.ensureLeadingSlash(Se).replace(new RegExp("/:[^/]+","g"),"/[^/]+")}ensureLeadingSlash(Se){return Se.startsWith("/")?Se:`/${Se}`}extractLabel(Se,qe){const At="object"==typeof Se?Se.label:Se;return"function"==typeof At?At(qe):At}extractObject(Se){return!Se||"string"!=typeof Se&&"function"!=typeof Se?Se||{}:{label:Se}}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.LFG(Ht.gz),r.LFG(Ht.F0))},Je.\u0275prov=r.Yz7({token:Je,factory:Je.\u0275fac,providedIn:"root"}),Je})(),Hi=(()=>{class Je{constructor(Se,qe){this.breadcrumbService=Se,this._separator="/",this.autoGenerate=!0,this.preserveQueryParams=!0,this.preserveFragment=!0,this.class="",this.setupMessage="not set up yet",this.someParameterValue=null,qe.params.subscribe(At=>{this.setupComponent(At.someParam)})}set separator(Se){Se instanceof r.Rgc?(this.separatorTemplate=Se,this._separator=void 0):(this.separatorTemplate=void 0,this._separator=Se||"/")}get separator(){return this._separator}setupComponent(Se){this.setupMessage="set up at "+new Date,this.someParameterValue=Se}ngOnInit(){this.breadcrumbs$=this.breadcrumbService.breadcrumbs$.pipe((0,vt.U)(Se=>Se.filter(qe=>!!this.autoGenerate||!qe.isAutoGeneratedLabel).map(qe=>{const{routeInterceptor:At,routeLink:Ne}=qe;return Object.assign(Object.assign({},qe),{routeLink:(null==At?void 0:At(Ne,qe))||Ne})})))}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(Ni),r.Y36(Ht.gz))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["xng-breadcrumb"]],contentQueries:function(Se,qe,At){if(1&Se&&r.Suo(At,ui,5,r.Rgc),2&Se){let Ne;r.iGM(Ne=r.CRH())&&(qe.itemTemplate=Ne.first)}},inputs:{autoGenerate:"autoGenerate",preserveQueryParams:"preserveQueryParams",preserveFragment:"preserveFragment",class:"class",anchorTarget:"anchorTarget",separator:"separator"},decls:4,vars:4,consts:[["aria-label","breadcrumb",1,"xng-breadcrumb-root",3,"ngClass"],[1,"xng-breadcrumb-list"],[4,"ngFor","ngForOf"],[1,"xng-breadcrumb-item"],["class","xng-breadcrumb-link","role","button","rel","noopener noreferrer",3,"ngClass","routerLink","queryParams","fragment","target",4,"ngIf"],["class","xng-breadcrumb-trail",4,"ngIf"],["class","xng-breadcrumb-separator","aria-hidden","true","role","separator",4,"ngIf"],["role","button","rel","noopener noreferrer",1,"xng-breadcrumb-link",3,"ngClass","routerLink","queryParams","fragment","target"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf"],[1,"xng-breadcrumb-trail"],["aria-hidden","true","role","separator",1,"xng-breadcrumb-separator"],[4,"ngTemplateOutlet"]],template:function(Se,qe){1&Se&&(r.TgZ(0,"nav",0)(1,"ol",1),r.YNc(2,Ci,5,3,"ng-container",2),r.ALo(3,"async"),r.qZA()()),2&Se&&(r.Q6J("ngClass",qe.class),r.xp6(2),r.Q6J("ngForOf",r.lcZ(3,2,qe.breadcrumbs$)))},directives:[ht.mk,ht.sg,ht.O5,Ht.yS,ht.tP],pipes:[ht.Ov],styles:[".xng-breadcrumb-root{margin:0;color:#0009}.xng-breadcrumb-list{display:flex;align-items:center;flex-wrap:wrap;margin:0;padding:0}.xng-breadcrumb-item{list-style:none}.xng-breadcrumb-trail{display:flex;align-items:center;color:#000000e6}.xng-breadcrumb-link{display:flex;align-items:center;white-space:nowrap;color:inherit;text-decoration:none;transition:-webkit-text-decoration .3s;transition:text-decoration .3s;transition:text-decoration .3s,-webkit-text-decoration .3s;cursor:pointer}.xng-breadcrumb-link:hover{text-decoration:underline}.xng-breadcrumb-link-disabled{pointer-events:none;cursor:disabled}.xng-breadcrumb-separator{display:flex;-webkit-user-select:none;user-select:none;margin-left:8px;margin-right:8px}\n"],encapsulation:2}),Je})(),$e=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez,Ht.Bz]]}),Je})(),st=(()=>{class Je{constructor(Se,qe,At){this.gs=Se,this.ss=qe,this.wb=At}get SS(){return this.ss}ngOnInit(){}get discordUrl(){return $.N.discord.join_url}get author(){return $.N.author}get siteName(){return $.N.siteName}openGithub(){this.wb.winboxOpenUri(`https://github.com/${this.author}/${this.siteName}`)}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(Ct.U),r.Y36(Ke.R),r.Y36(xt.N))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["app-footer"]],decls:14,vars:6,consts:[["color","primary",2,"height","32px","padding","0 12px"],[2,"font-size","small"],[2,"text-decoration","none","color","whitesmoke","cursor","pointer",3,"click"],[2,"display","inline-block","transform","rotateY(180deg)"],[2,"display","inline-block"],[1,"spacer","px-1"],["target","_blank",2,"text-decoration","none","color","whitesmoke",3,"href"]],template:function(Se,qe){1&Se&&(r.TgZ(0,"mat-toolbar",0)(1,"span",1)(2,"div",2),r.NdJ("click",function(){return qe.openGithub()}),r.TgZ(3,"div",3),r._uU(4,"\xa9"),r.qZA(),r.TgZ(5,"div",4),r._uU(6),r.ALo(7,"slice"),r.qZA()()(),r._UZ(8,"span",5)(9,"xng-breadcrumb")(10,"span",5),r.TgZ(11,"span",1)(12,"a",6),r._uU(13," With \u{1f498} Just For You~ "),r.qZA()()()),2&Se&&(r.xp6(6),r.hij("\xa0 2013 | ",r.Dn7(7,2,null==qe.SS.github?null:qe.SS.github.sha,0,7),""),r.xp6(6),r.s9C("href",qe.discordUrl,r.LSH))},directives:[gt.Ye,Hi],pipes:[ht.OU],styles:[""]}),Je})();const wt=["leftSideNav"],Wt=["rightSidePanel"],nn=["siteContent"],_n=function(Je){return{"background-image":Je}};let Nn=(()=>{class Je{constructor(Se,qe,At,Ne,Rt,Ut,an,jn,ai,Ei,Yn,nr,Yi,wi,Si,Ki,$i){this.snackBar=Se,this.renderer=qe,this.router=At,this.activatedRoute=Ne,this.bs=Rt,this.pi=Ut,this.as=an,this.fs=jn,this.ls=ai,this.gs=Ei,this.lms=Yn,this.rps=nr,this.ss=Yi,this.wb=wi,this.ds=Si,this.sw=Ki,this.viewer=$i,this.subsRouter=null,this.subsRouterChild=null,this.subsUrl=null,this.subsVerify=null,this.subsDialog=null,this.timedOut=null}get sideNavType(){return this.gs.isDesktop?"side":"over"}onResize(Se){this.gs.onResize(Se)}get ROUTER(){return this.router}get GS(){return this.gs}get LMS(){return this.lms}get RPS(){return this.rps}ngOnDestroy(){var Se,qe,At,Ne,Rt;null===(Se=this.subsRouter)||void 0===Se||Se.unsubscribe(),null===(qe=this.subsRouterChild)||void 0===qe||qe.unsubscribe(),null===(At=this.subsUrl)||void 0===At||At.unsubscribe(),null===(Ne=this.subsVerify)||void 0===Ne||Ne.unsubscribe(),null===(Rt=this.subsDialog)||void 0===Rt||Rt.unsubscribe(),this.timedOut&&(clearTimeout(this.timedOut),this.timedOut=null)}ngAfterViewInit(){if(this.lms.sideNav=this.leftSideNav,this.rps.sidePanel=this.rightSidePanel,this.gs.isBrowser){const Se=this.renderer.selectRootElement("#app-loading");Se&&(Se.style.visibility="hidden",Se.style.opacity=0)}}ngOnInit(){var Se=this;this.gs.log(`[APP_BUILD_STATUS] \u{1f498} ${$.N.siteName} :: ${$.N.production?"Production":"Development"} With Logging Enabled \u{1f4cc}`),this.gs.log(`[SERVICE_WORKER_STATUS] \u{1f498} isEnabled :: ${this.sw.swEnabled} \u{1f4cc}`),this.pi.updatePageMetaData(`\u300c\u{1f4a4} ${$.N.siteName}\u300d`,`\u300c\u2728 ${$.N.siteDescription}\u300d`,`\u300c\u{1f4a4} ${$.N.siteName} \u2728\u{1f31e}\u300d`,`${$.N.baseUrl}/assets/img/favicon.png`),this.subsRouter=this.router.events.subscribe({next:qe=>{if(qe instanceof Ht.xV)this.gs.isBrowser&&this.bs.busy();else if(qe instanceof Ht.GH)this.gs.isBrowser&&this.bs.idle();else if(qe instanceof Ht.OD){if(this.gs.isBrowser&&qe.url){const At=qe.url.split("/")[1];if(At){const Ne=`badge${At[0].toUpperCase()}${At.slice(1)}`;if(this.ss[Ne]){this.ss[Ne]=[];const Rt=this.lms.mainMenus.find(jn=>jn.link===qe.url),Ut=this.lms.contentMenus.find(jn=>jn.link===qe.url),an=this.lms.miscMenus.find(jn=>jn.link===qe.url);Rt&&(Rt.badge=null),Ut&&(Ut.badge=null),an&&(an.badge=null)}}this.gs.previousUrl=this.router.url.split("?")[0]}}else if(qe instanceof Ht.m2){let At=this.activatedRoute.firstChild;for(const Ne of At.children)At=Ne;this.subsRouterChild=At.data.subscribe({next:Ne=>{if(this.updateBackgroundImage(),this.gs.routerData=Ne,this.pi.updatePageMetaData(Ne.title,Ne.description,Ne.keywords,this.gs.bgImgUrl||`${$.N.baseUrl}/assets/img/favicon.png`),this.fs.removeFab(),this.gs.isBrowser){this.siteContent&&(this.siteContent.elementRef.nativeElement.scrollTop=0);const Rt=qe.url.split("?")[0];this.gs.previousUrl!==Rt&&(this.ss.currentChatRoom=[]),this.ss.socketLeaveAndJoinNewRoom(this.gs.previousUrl,Rt)}}})}}}),this.gs.isBrowser&&(this.checkStorage(),this.windowRightClick=this.onWindowRightClick,this.windowLeftClick=this.onWindowLeftClick,this.windowDoubleClick=this.onWindowDoubleClick,this.windowBeforeUnloaded=this.onWindowBeforeUnloaded,this.timedOut=setTimeout((0,ct.Z)(function*(){if("true"!==Se.ls.getItem(Se.gs.localStorageKeys.AturanTatib)){const At={id:"ATURAN-TATA-TERTIB",data:{title:"Aturan Dan Tata Tertib Komunitas",htmlMessage:"Gagal Memuat Aturan Dan Tata Tertib Komunitas",confirmText:"Ok, Saya Mengerti!",cancelText:null},disableClose:!1,maxWidth:Se.ds.maxWidth};Se.subsDialog=(yield Se.ds.fetchInformationRegisterMode(At)).afterClosed().subscribe({next:Ne=>{Se.gs.log("[ATURAN_TATA_TERTIB_DIALOG_CLOSED]",Ne),"boolean"==typeof Ne&&Se.ls.setItem(Se.gs.localStorageKeys.AturanTatib,JSON.stringify(Ne)),Se.subsDialog.unsubscribe()}})}Se.injectServerTimeClock(),Se.gs.weatherEffect&&Se.snackBar.open("Gunakan Menu Di Kanan Atas (Gambar Bunga) Untuk Mematikan Animasi Efek Musiman!","Ok")}),1234))}updateBackgroundImage(){const Se=this.router.url.split("?")[0].substring(1).split("/")[0];this.gs.bgImgUrlPath=Se?`/assets/img/router/${Se}.png`:""}checkStorage(){this.bs.busy(),this.subsVerify=this.as.verify(this.as.token).subscribe({next:Se=>{this.gs.log("[VERIFY_SUCCESS]",Se),this.ss.socketLeaveAndJoinNewRoom(this.gs.previousUrl,this.router.url.split("?")[0]),this.bs.idle()},error:Se=>{this.gs.log("[VERIFY_ERROR]",Se,"error"),this.bs.idle(),this.as.removeUser()}})}resetLoading(){this.bs.clear()}onWindowRightClick(Se){this.gs.log("[MOUSE_RIGHT_CLICK]",Se)}onWindowLeftClick(Se){this.gs.log("[MOUSE_LEFT_CLICK]",Se);const qe=Se||window.event;let At=qe.target||qe.srcElement;if(At){let Ne=5;const Rt=["A","a"];for(;![...Rt].includes(At.tagName)&&Ne>0;)if(At=At.parentElement||At.parentNode,Ne--,!At)return!0;if(Rt.includes(At.tagName)){const Ut=At.getAttribute("href");if(Ut&&this.gs.isDesktop&&this.gs.includesOneOf(Ut,["http","ftp","mailto"])&&!Ut.includes($.N.baseUrl))return qe.preventDefault(),qe.stopPropagation(),this.winboxOpenUri(Ut),!1}}return!0}onWindowDoubleClick(Se){this.gs.log("[MOUSE_DOUBLE_CLICK]",Se);const qe=Se||window.event,At=qe.target||qe.srcElement;("IMG"===At.tagName||"img"===At.tagName)&&this.gs.isDesktop&&this.viewer.viewImage(At)}onWindowBeforeUnloaded(Se){this.as.token&&(this.gs.log("[BROWSER_EXIT_CLOSE_SAVE_JWT]",this.as.token),this.ls.setItem(this.gs.localStorageKeys.token,this.as.token))}winboxOpenUri(Se){this.wb.winboxOpenUri(Se)}injectServerTimeClock(){if(this.gs.isDesktop){const Se=this.gs.document.getElementsByClassName("mat-drawer-backdrop");if(Se.length>0){Se[0].innerHTML='\n
\n
\n

~ Kalender (\uff61>\ufe4f<\uff61) Server ~

\n

\n

\n
\n
\n ';const At=this.gs.document.createElement("script");At.type="text/javascript",At.textContent="\n function runCalendar() {\n const calendar = new Date();\n const serverTime = document.getElementById('serverTime');\n serverTime.innerHTML = calendar.toLocaleTimeString('ja-JP', {\n timeZone: 'Asia/Tokyo',\n timeZoneName: 'longGeneric'\n });\n const serverDate = document.getElementById('serverDate');\n serverDate.innerHTML = calendar.toLocaleDateString('id-ID', {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n timeZone: 'Asia/Tokyo'\n });\n setTimeout(runCalendar, 1000);\n }\n runCalendar();\n ",this.gs.document.head.appendChild(At)}}}}return Je.\u0275fac=function(Se){return new(Se||Je)(r.Y36(V.ux),r.Y36(r.Qsj),r.Y36(Ht.F0),r.Y36(Ht.gz),r.Y36(be.z),r.Y36(Re.Z),r.Y36(ut.e),r.Y36(Ce.r),r.Y36(zt.n),r.Y36(Ct.U),r.Y36(Ve.S),r.Y36(Ge.C),r.Y36(Ke.R),r.Y36(xt.N),r.Y36(Mt.x),r.Y36(hn.H),r.Y36(ft))},Je.\u0275cmp=r.Xpm({type:Je,selectors:[["app-root"]],viewQuery:function(Se,qe){if(1&Se&&(r.Gf(wt,7),r.Gf(Wt,7),r.Gf(nn,7)),2&Se){let At;r.iGM(At=r.CRH())&&(qe.leftSideNav=At.first),r.iGM(At=r.CRH())&&(qe.rightSidePanel=At.first),r.iGM(At=r.CRH())&&(qe.siteContent=At.first)}},hostBindings:function(Se,qe){1&Se&&r.NdJ("contextmenu",function(Ne){return qe.windowRightClick(Ne)},!1,r.Jf7)("click",function(Ne){return qe.windowLeftClick(Ne)},!1,r.Jf7)("dblclick",function(Ne){return qe.windowDoubleClick(Ne)},!1,r.Jf7)("beforeunload",function(Ne){return qe.windowBeforeUnloaded(Ne)},!1,r.Jf7)("resize",function(Ne){return qe.onResize(Ne)},!1,r.Jf7)},decls:24,vars:27,consts:[[3,"color","fixed","meteor","thick"],[1,"sidenav-container",3,"hasBackdrop"],["disableClose","",2,"background-position","bottom center","background-size","128px","background-repeat","no-repeat",3,"mode","opened","ngStyle"],["leftSideNav",""],["position","end",1,"bg-bifeldy",2,"background-position","bottom center","background-size","128px","background-repeat","no-repeat",3,"mode","opened","ngStyle","closedStart"],["rightSidePanel",""],["siteContent",""],[1,"main_content"],[3,"bdColor","type","size","color"],[1,"text-light","text-center"],[1,"text-info","text-decoration-none",3,"click"],[2,"cursor","pointer"]],template:function(Se,qe){if(1&Se&&(r._UZ(0,"app-header")(1,"ng-progress",0),r.TgZ(2,"mat-sidenav-container",1)(3,"mat-sidenav",2,3),r._UZ(5,"app-left-menu"),r.qZA(),r.TgZ(6,"mat-sidenav",4,5),r.NdJ("closedStart",function(){return qe.RPS.onClose()}),r._UZ(8,"app-right-panel"),r.qZA(),r.TgZ(9,"mat-sidenav-content",null,6)(11,"div",7),r._UZ(12,"router-outlet"),r.qZA(),r._UZ(13,"app-material-fab"),r.qZA()(),r._UZ(14,"app-footer"),r.TgZ(15,"ngx-spinner",8)(16,"p",9),r._uU(17," Sedang Memuat Data ^_^ "),r._UZ(18,"br"),r._uU(19," Mohon Menunggu ... "),r._UZ(20,"br"),r.TgZ(21,"span",10),r.NdJ("click",function(){return qe.resetLoading()}),r.TgZ(22,"b",11),r._uU(23,"Batalkan"),r.qZA()()()()),2&Se){const At=r.MAs(7);r.xp6(1),r.Q6J("color","#ff4081")("fixed",!1)("meteor",!1)("thick",!0),r.xp6(1),r.Q6J("hasBackdrop",qe.LMS.sideNavExpanded||At.isOpen),r.xp6(1),r.Q6J("mode",qe.sideNavType)("opened",qe.LMS.opened)("ngStyle",r.VKq(23,_n,"url("+qe.GS.leftMenuImage+")")),r.xp6(3),r.Q6J("mode","over")("opened",!1)("ngStyle",r.VKq(25,_n,"url("+qe.GS.rightMenuImage+")")),r.xp6(3),r.Udp("background-repeat","no-repeat")("background-size","128px"+("/login"===qe.ROUTER.url||qe.ROUTER.url.includes("/login?")||"/register"===qe.ROUTER.url||qe.ROUTER.url.includes("/register?")||"/home"===qe.ROUTER.url||qe.ROUTER.url.includes("/home?")||"/verify"===qe.ROUTER.url||qe.ROUTER.url.includes("/verify?")||"/privacy-policy"===qe.ROUTER.url||qe.ROUTER.url.includes("/privacy-policy?")||"/reset-password"===qe.ROUTER.url||qe.ROUTER.url.includes("/reset-password?")?", cover":""))("background-position","bottom right"+("/login"===qe.ROUTER.url||qe.ROUTER.url.includes("/login?")||"/register"===qe.ROUTER.url||qe.ROUTER.url.includes("/register?")||"/home"===qe.ROUTER.url||qe.ROUTER.url.includes("/home?")||"/verify"===qe.ROUTER.url||qe.ROUTER.url.includes("/verify?")||"/privacy-policy"===qe.ROUTER.url||qe.ROUTER.url.includes("/privacy-policy?")||"/reset-password"===qe.ROUTER.url||qe.ROUTER.url.includes("/reset-password?")?", center":""))("background-image","url("+qe.GS.bgImgUrl+")"+("/login"===qe.ROUTER.url||qe.ROUTER.url.includes("/login?")||"/register"===qe.ROUTER.url||qe.ROUTER.url.includes("/register?")||"/home"===qe.ROUTER.url||qe.ROUTER.url.includes("/home?")||"/verify"===qe.ROUTER.url||qe.ROUTER.url.includes("/verify?")||"/privacy-policy"===qe.ROUTER.url||qe.ROUTER.url.includes("/privacy-policy?")||"/reset-password"===qe.ROUTER.url||qe.ROUTER.url.includes("/reset-password?")?", url(/assets/img/background/paint.svg)":"")),r.xp6(6),r.Q6J("bdColor","#0000007f")("type","square-jelly-box")("size","medium")("color","#e84360")}},directives:[Rn,re,ti.TM,ti.JX,ht.PC,$t,On,ti.Rh,Ht.lC,Pn,st,ce.Ro],styles:[".main_content[_ngcontent-%COMP%]{width:100%;height:calc(100vh - 88px)}"],data:{animation:[Q]}}),Je})(),li=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez,Ht.Bz,lt.m]]}),Je})(),Di=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez,Ht.Bz,lt.m,w.u5]]}),Je})();var Zn=a(5116);let Li=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez,lt.m]]}),Je})(),qi=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez,lt.m,$e]]}),Je})();var vr=a(1385),er=a(7355),lr=a(2438);let tr=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je}),Je.\u0275inj=r.cJS({imports:[[ht.ez,Ht.Bz,lt.m,w.u5,w.UX,vr.Ad,lr.d,er.T]]}),Je})(),Vi=(()=>{class Je{}return Je.\u0275fac=function(Se){return new(Se||Je)},Je.\u0275mod=r.oAB({type:Je,bootstrap:[Nn]}),Je.\u0275inj=r.cJS({providers:[{provide:n.ok,useClass:ue},{provide:U.Jm,useValue:Be},{provide:te.o2,useValue:{floatLabel:"always"}},{provide:V.Ve,useValue:{duration:1e4}},{provide:l.TP,useClass:Ot,multi:!0},{provide:l.TP,useClass:Ae,multi:!0},{provide:l.TP,useClass:R,multi:!0}],imports:[[n.b2.withServerTransition({appId:"serverApp"}),F,C.PW,y,w.UX,l.JF,lt.m,n.t6,ce.ef,le.Rh.forRoot({timeOut:3e3,positionClass:"toast-top-right",closeButton:!0,progressBar:!0,progressAnimation:"increasing"}),He,at,li,Di,Zn.d,Li,qi,tr,K.Wr.register("/ngsw-worker.js",{enabled:$.N.production,registrationStrategy:"registerWhenStable:30000"}),Bt.zO.withConfig({autoUpload:!1,concurrency:1,endpoint:`${$.N.apiUrl}/attachment`,headers:{"ngsw-bypass":"true"},retryConfig:{maxAttempts:3},maxChunkSize:jt.t.fileSizeAttachmentChunkCloudflareLimit})]]}),Je})();function cr(){n.q6().bootstrapModule(Vi).catch(Je=>console.error(Je))}a(5386),$.N.production&&(0,r.G48)(),"complete"===document.readyState?cr():document.addEventListener("DOMContentLoaded",cr)},4249:(rt,B,a)=>{"use strict";a.d(B,{Bp:()=>E,eK:()=>S,yS:()=>n});var n=(()=>{return(d=n||(n={})).ADMIN="ADMIN",d.MODERATOR="MODERATOR",d.FANSUBBER="FANSUBBER",d.USER="USER",n;var d})(),S=(()=>{return(d=S||(S={})).LIKE="LIKE",d.DISLIKE="DISLIKE",S;var d})(),E=(()=>{return(d=E||(E={})).DISCORD="DISCORD",d.DISQUS="DISQUS",d.FACEBOOK="FACEBOOK",d.GOOGLE="GOOGLE",E;var d})()},6022:(rt,B,a)=>{"use strict";a.d(B,{F:()=>n});var n=(()=>{return(r=n||(n={})).WINTER="winter",r.SPRING="spring",r.SUMMER="summer",r.FALL="fall",n;var r})()},8498:rt=>{function a(){}rt.exports=function B(n,r,l){var u=!1;return l=l||a,o.count=n,0===n?r():o;function o(S,E){if(o.count<=0)throw new Error("after called too many times");--o.count,S?(u=!0,r(S),r=l):0===o.count&&!u&&r(null,E)}}},9933:rt=>{rt.exports=function(B,a,n){var r=B.byteLength;if(a=a||0,n=n||r,B.slice)return B.slice(a,n);if(a<0&&(a+=r),n<0&&(n+=r),n>r&&(n=r),a>=r||a>=n||0===r)return new ArrayBuffer(0);for(var l=new Uint8Array(B),u=new Uint8Array(n-a),o=a,S=0;o{function B(a){this.ms=(a=a||{}).min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}rt.exports=B,B.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*a);a=0==(1&Math.floor(10*n))?a-r:a+r}return 0|Math.min(a,this.max)},B.prototype.reset=function(){this.attempts=0},B.prototype.setMin=function(a){this.ms=a},B.prototype.setMax=function(a){this.max=a},B.prototype.setJitter=function(a){this.jitter=a}},390:(rt,B)=>{!function(a){"use strict";B.encode=function(n){var l,r=new Uint8Array(n),u=r.length,o="";for(l=0;l>2],o+=a[(3&r[l])<<4|r[l+1]>>4],o+=a[(15&r[l+1])<<2|r[l+2]>>6],o+=a[63&r[l+2]];return u%3==2?o=o.substring(0,o.length-1)+"=":u%3==1&&(o=o.substring(0,o.length-2)+"=="),o},B.decode=function(n){var u,S,E,d,v,r=.75*n.length,l=n.length,o=0;"="===n[n.length-1]&&(r--,"="===n[n.length-2]&&r--);var y=new ArrayBuffer(r),_=new Uint8Array(y);for(u=0;u>4,_[o++]=(15&E)<<4|d>>2,_[o++]=(3&d)<<6|63&v;return y}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},5343:(rt,B)=>{"use strict";B.byteLength=function E(C){var w=S(C),te=w[1];return 3*(w[0]+te)/4-te},B.toByteArray=function v(C){var w,G,V=S(C),te=V[0],U=V[1],K=new r(function d(C,w,V){return 3*(w+V)/4-V}(0,te,U)),ce=0,le=U>0?te-4:te;for(G=0;G>16&255,K[ce++]=w>>8&255,K[ce++]=255&w;return 2===U&&(w=n[C.charCodeAt(G)]<<2|n[C.charCodeAt(G+1)]>>4,K[ce++]=255&w),1===U&&(w=n[C.charCodeAt(G)]<<10|n[C.charCodeAt(G+1)]<<4|n[C.charCodeAt(G+2)]>>2,K[ce++]=w>>8&255,K[ce++]=255&w),K},B.fromByteArray=function g(C){for(var w,V=C.length,te=V%3,U=[],K=16383,ce=0,le=V-te;cele?le:ce+K));return 1===te?U.push(a[(w=C[V-1])>>2]+a[w<<4&63]+"=="):2===te&&U.push(a[(w=(C[V-2]<<8)+C[V-1])>>10]+a[w>>4&63]+a[w<<2&63]+"="),U.join("")};for(var a=[],n=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,o=l.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var V=C.indexOf("=");return-1===V&&(V=w),[V,V===w?0:4-V%4]}function y(C){return a[C>>18&63]+a[C>>12&63]+a[C>>6&63]+a[63&C]}function _(C,w,V){for(var U=[],K=w;K{var B=void 0!==B?B:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,a=function(){try{return 2===new Blob(["hi"]).size}catch(E){return!1}}(),n=a&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(E){return!1}}(),r=B&&B.prototype.append&&B.prototype.getBlob;function l(S){return S.map(function(E){if(E.buffer instanceof ArrayBuffer){var d=E.buffer;if(E.byteLength!==d.byteLength){var v=new Uint8Array(E.byteLength);v.set(new Uint8Array(d,E.byteOffset,E.byteLength)),d=v.buffer}return d}return E})}function u(S,E){E=E||{};var d=new B;return l(S).forEach(function(v){d.append(v)}),E.type?d.getBlob(E.type):d.getBlob()}function o(S,E){return new Blob(l(S),E||{})}"undefined"!=typeof Blob&&(u.prototype=Blob.prototype,o.prototype=Blob.prototype),rt.exports=a?n?Blob:o:r?u:void 0},3172:(rt,B,a)=>{"use strict";const r=a(5343),l=a(8461),u="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;B.lW=d,B.h2=50;const o=2147483647;function E(be){if(be>o)throw new RangeError('The value "'+be+'" is invalid for option "size"');const R=new Uint8Array(be);return Object.setPrototypeOf(R,d.prototype),R}function d(be,R,$){if("number"==typeof be){if("string"==typeof R)throw new TypeError('The "string" argument must be of type string. Received type number');return g(be)}return v(be,R,$)}function v(be,R,$){if("string"==typeof be)return function C(be,R){if(("string"!=typeof R||""===R)&&(R="utf8"),!d.isEncoding(R))throw new TypeError("Unknown encoding: "+R);const $=0|le(be,R);let Ke=E($);const ut=Ke.write(be,R);return ut!==$&&(Ke=Ke.slice(0,ut)),Ke}(be,R);if(ArrayBuffer.isView(be))return function V(be){if(F(be,Uint8Array)){const R=new Uint8Array(be);return te(R.buffer,R.byteOffset,R.byteLength)}return w(be)}(be);if(null==be)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof be);if(F(be,ArrayBuffer)||be&&F(be.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(F(be,SharedArrayBuffer)||be&&F(be.buffer,SharedArrayBuffer)))return te(be,R,$);if("number"==typeof be)throw new TypeError('The "value" argument must not be of type number. Received type number');const Ke=be.valueOf&&be.valueOf();if(null!=Ke&&Ke!==be)return d.from(Ke,R,$);const ut=function U(be){if(d.isBuffer(be)){const R=0|K(be.length),$=E(R);return 0===$.length||be.copy($,0,0,R),$}return void 0!==be.length?"number"!=typeof be.length||ue(be.length)?E(0):w(be):"Buffer"===be.type&&Array.isArray(be.data)?w(be.data):void 0}(be);if(ut)return ut;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof be[Symbol.toPrimitive])return d.from(be[Symbol.toPrimitive]("string"),R,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof be)}function y(be){if("number"!=typeof be)throw new TypeError('"size" argument must be of type number');if(be<0)throw new RangeError('The value "'+be+'" is invalid for option "size"')}function g(be){return y(be),E(be<0?0:0|K(be))}function w(be){const R=be.length<0?0:0|K(be.length),$=E(R);for(let Ke=0;Ke=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|be}function le(be,R){if(d.isBuffer(be))return be.length;if(ArrayBuffer.isView(be)||F(be,ArrayBuffer))return be.byteLength;if("string"!=typeof be)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof be);const $=be.length,Ke=arguments.length>2&&!0===arguments[2];if(!Ke&&0===$)return 0;let ut=!1;for(;;)switch(R){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return Ht(be).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*$;case"hex":return $>>>1;case"base64":return M(be).length;default:if(ut)return Ke?-1:Ht(be).length;R=(""+R).toLowerCase(),ut=!0}}function G(be,R,$){let Ke=!1;if((void 0===R||R<0)&&(R=0),R>this.length||((void 0===$||$>this.length)&&($=this.length),$<=0)||($>>>=0)<=(R>>>=0))return"";for(be||(be="utf8");;)switch(be){case"hex":return vt(this,R,$);case"utf8":case"utf-8":return he(this,R,$);case"ascii":return Tt(this,R,$);case"latin1":case"binary":return Ft(this,R,$);case"base64":return Z(this,R,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,R,$);default:if(Ke)throw new TypeError("Unknown encoding: "+be);be=(be+"").toLowerCase(),Ke=!0}}function W(be,R,$){const Ke=be[R];be[R]=be[$],be[$]=Ke}function H(be,R,$,Ke,ut){if(0===be.length)return-1;if("string"==typeof $?(Ke=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),ue($=+$)&&($=ut?0:be.length-1),$<0&&($=be.length+$),$>=be.length){if(ut)return-1;$=be.length-1}else if($<0){if(!ut)return-1;$=0}if("string"==typeof R&&(R=d.from(R,Ke)),d.isBuffer(R))return 0===R.length?-1:Me(be,R,$,Ke,ut);if("number"==typeof R)return R&=255,"function"==typeof Uint8Array.prototype.indexOf?ut?Uint8Array.prototype.indexOf.call(be,R,$):Uint8Array.prototype.lastIndexOf.call(be,R,$):Me(be,[R],$,Ke,ut);throw new TypeError("val must be string, number or Buffer")}function Me(be,R,$,Ke,ut){let zt,Ot=1,Nt=be.length,yt=R.length;if(void 0!==Ke&&("ucs2"===(Ke=String(Ke).toLowerCase())||"ucs-2"===Ke||"utf16le"===Ke||"utf-16le"===Ke)){if(be.length<2||R.length<2)return-1;Ot=2,Nt/=2,yt/=2,$/=2}function bt(Ae,ct){return 1===Ot?Ae[ct]:Ae.readUInt16BE(ct*Ot)}if(ut){let Ae=-1;for(zt=$;ztNt&&($=Nt-yt),zt=$;zt>=0;zt--){let Ae=!0;for(let ct=0;ctut&&(Ke=ut):Ke=ut;const Ot=R.length;let Nt;for(Ke>Ot/2&&(Ke=Ot/2),Nt=0;Nt>8,ut=$%256,Ot.push(ut),Ot.push(Ke);return Ot}(R,be.length-$),be,$,Ke)}function Z(be,R,$){return r.fromByteArray(0===R&&$===be.length?be:be.slice(R,$))}function he(be,R,$){$=Math.min(be.length,$);const Ke=[];let ut=R;for(;ut<$;){const Ot=be[ut];let Nt=null,yt=Ot>239?4:Ot>223?3:Ot>191?2:1;if(ut+yt<=$){let bt,zt,Ae,ct;switch(yt){case 1:Ot<128&&(Nt=Ot);break;case 2:bt=be[ut+1],128==(192&bt)&&(ct=(31&Ot)<<6|63&bt,ct>127&&(Nt=ct));break;case 3:bt=be[ut+1],zt=be[ut+2],128==(192&bt)&&128==(192&zt)&&(ct=(15&Ot)<<12|(63&bt)<<6|63&zt,ct>2047&&(ct<55296||ct>57343)&&(Nt=ct));break;case 4:bt=be[ut+1],zt=be[ut+2],Ae=be[ut+3],128==(192&bt)&&128==(192&zt)&&128==(192&Ae)&&(ct=(15&Ot)<<18|(63&bt)<<12|(63&zt)<<6|63&Ae,ct>65535&&ct<1114112&&(Nt=ct))}}null===Nt?(Nt=65533,yt=1):Nt>65535&&(Nt-=65536,Ke.push(Nt>>>10&1023|55296),Nt=56320|1023&Nt),Ke.push(Nt),ut+=yt}return function Xe(be){const R=be.length;if(R<=4096)return String.fromCharCode.apply(String,be);let $="",Ke=0;for(;KeKe)&&($=Ke);let ut="";for(let Ot=R;Ot<$;++Ot)ut+=Be[be[Ot]];return ut}function ht(be,R,$){const Ke=be.slice(R,$);let ut="";for(let Ot=0;Ot$)throw new RangeError("Trying to access beyond buffer length")}function et(be,R,$,Ke,ut,Ot){if(!d.isBuffer(be))throw new TypeError('"buffer" argument must be a Buffer instance');if(R>ut||Rbe.length)throw new RangeError("Index out of range")}function z(be,R,$,Ke,ut){L(R,Ke,ut,be,$,7);let Ot=Number(R&BigInt(4294967295));be[$++]=Ot,Ot>>=8,be[$++]=Ot,Ot>>=8,be[$++]=Ot,Ot>>=8,be[$++]=Ot;let Nt=Number(R>>BigInt(32)&BigInt(4294967295));return be[$++]=Nt,Nt>>=8,be[$++]=Nt,Nt>>=8,be[$++]=Nt,Nt>>=8,be[$++]=Nt,$}function xe(be,R,$,Ke,ut){L(R,Ke,ut,be,$,7);let Ot=Number(R&BigInt(4294967295));be[$+7]=Ot,Ot>>=8,be[$+6]=Ot,Ot>>=8,be[$+5]=Ot,Ot>>=8,be[$+4]=Ot;let Nt=Number(R>>BigInt(32)&BigInt(4294967295));return be[$+3]=Nt,Nt>>=8,be[$+2]=Nt,Nt>>=8,be[$+1]=Nt,Nt>>=8,be[$]=Nt,$+8}function ye(be,R,$,Ke,ut,Ot){if($+Ke>be.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function X(be,R,$,Ke,ut){return R=+R,$>>>=0,ut||ye(be,0,$,4),l.write(be,R,$,Ke,23,4),$+4}function ze(be,R,$,Ke,ut){return R=+R,$>>>=0,ut||ye(be,0,$,8),l.write(be,R,$,Ke,52,8),$+8}!(d.TYPED_ARRAY_SUPPORT=function S(){try{const be=new Uint8Array(1),R={foo:function(){return 42}};return Object.setPrototypeOf(R,Uint8Array.prototype),Object.setPrototypeOf(be,R),42===be.foo()}catch(be){return!1}}())&&"undefined"!=typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(be,R,$){return v(be,R,$)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(be,R,$){return function _(be,R,$){return y(be),be<=0?E(be):void 0!==R?"string"==typeof $?E(be).fill(R,$):E(be).fill(R):E(be)}(be,R,$)},d.allocUnsafe=function(be){return g(be)},d.allocUnsafeSlow=function(be){return g(be)},d.isBuffer=function(R){return null!=R&&!0===R._isBuffer&&R!==d.prototype},d.compare=function(R,$){if(F(R,Uint8Array)&&(R=d.from(R,R.offset,R.byteLength)),F($,Uint8Array)&&($=d.from($,$.offset,$.byteLength)),!d.isBuffer(R)||!d.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(R===$)return 0;let Ke=R.length,ut=$.length;for(let Ot=0,Nt=Math.min(Ke,ut);Otut.length?(d.isBuffer(Nt)||(Nt=d.from(Nt)),Nt.copy(ut,Ot)):Uint8Array.prototype.set.call(ut,Nt,Ot);else{if(!d.isBuffer(Nt))throw new TypeError('"list" argument must be an Array of Buffers');Nt.copy(ut,Ot)}Ot+=Nt.length}return ut},d.byteLength=le,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const R=this.length;if(R%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$$&&(R+=" ... "),""},u&&(d.prototype[u]=d.prototype.inspect),d.prototype.compare=function(R,$,Ke,ut,Ot){if(F(R,Uint8Array)&&(R=d.from(R,R.offset,R.byteLength)),!d.isBuffer(R))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof R);if(void 0===$&&($=0),void 0===Ke&&(Ke=R?R.length:0),void 0===ut&&(ut=0),void 0===Ot&&(Ot=this.length),$<0||Ke>R.length||ut<0||Ot>this.length)throw new RangeError("out of range index");if(ut>=Ot&&$>=Ke)return 0;if(ut>=Ot)return-1;if($>=Ke)return 1;if(this===R)return 0;let Nt=(Ot>>>=0)-(ut>>>=0),yt=(Ke>>>=0)-($>>>=0);const bt=Math.min(Nt,yt),zt=this.slice(ut,Ot),Ae=R.slice($,Ke);for(let ct=0;ct>>=0,isFinite(Ke)?(Ke>>>=0,void 0===ut&&(ut="utf8")):(ut=Ke,Ke=void 0)}const Ot=this.length-$;if((void 0===Ke||Ke>Ot)&&(Ke=Ot),R.length>0&&(Ke<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");ut||(ut="utf8");let Nt=!1;for(;;)switch(ut){case"hex":return q(this,R,$,Ke);case"utf8":case"utf-8":return de(this,R,$,Ke);case"ascii":case"latin1":case"binary":return Te(this,R,$,Ke);case"base64":return j(this,R,$,Ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,R,$,Ke);default:if(Nt)throw new TypeError("Unknown encoding: "+ut);ut=(""+ut).toLowerCase(),Nt=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},d.prototype.slice=function(R,$){const Ke=this.length;(R=~~R)<0?(R+=Ke)<0&&(R=0):R>Ke&&(R=Ke),($=void 0===$?Ke:~~$)<0?($+=Ke)<0&&($=0):$>Ke&&($=Ke),$>>=0,$>>>=0,Ke||Le(R,$,this.length);let ut=this[R],Ot=1,Nt=0;for(;++Nt<$&&(Ot*=256);)ut+=this[R+Nt]*Ot;return ut},d.prototype.readUintBE=d.prototype.readUIntBE=function(R,$,Ke){R>>>=0,$>>>=0,Ke||Le(R,$,this.length);let ut=this[R+--$],Ot=1;for(;$>0&&(Ot*=256);)ut+=this[R+--$]*Ot;return ut},d.prototype.readUint8=d.prototype.readUInt8=function(R,$){return R>>>=0,$||Le(R,1,this.length),this[R]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(R,$){return R>>>=0,$||Le(R,2,this.length),this[R]|this[R+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(R,$){return R>>>=0,$||Le(R,2,this.length),this[R]<<8|this[R+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(R,$){return R>>>=0,$||Le(R,4,this.length),(this[R]|this[R+1]<<8|this[R+2]<<16)+16777216*this[R+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(R,$){return R>>>=0,$||Le(R,4,this.length),16777216*this[R]+(this[R+1]<<16|this[R+2]<<8|this[R+3])},d.prototype.readBigUInt64LE=lt(function(R){ke(R>>>=0,"offset");const $=this[R],Ke=this[R+7];(void 0===$||void 0===Ke)&&at(R,this.length-8);const ut=$+256*this[++R]+65536*this[++R]+this[++R]*2**24,Ot=this[++R]+256*this[++R]+65536*this[++R]+Ke*2**24;return BigInt(ut)+(BigInt(Ot)<>>=0,"offset");const $=this[R],Ke=this[R+7];(void 0===$||void 0===Ke)&&at(R,this.length-8);const ut=$*2**24+65536*this[++R]+256*this[++R]+this[++R],Ot=this[++R]*2**24+65536*this[++R]+256*this[++R]+Ke;return(BigInt(ut)<>>=0,$>>>=0,Ke||Le(R,$,this.length);let ut=this[R],Ot=1,Nt=0;for(;++Nt<$&&(Ot*=256);)ut+=this[R+Nt]*Ot;return Ot*=128,ut>=Ot&&(ut-=Math.pow(2,8*$)),ut},d.prototype.readIntBE=function(R,$,Ke){R>>>=0,$>>>=0,Ke||Le(R,$,this.length);let ut=$,Ot=1,Nt=this[R+--ut];for(;ut>0&&(Ot*=256);)Nt+=this[R+--ut]*Ot;return Ot*=128,Nt>=Ot&&(Nt-=Math.pow(2,8*$)),Nt},d.prototype.readInt8=function(R,$){return R>>>=0,$||Le(R,1,this.length),128&this[R]?-1*(255-this[R]+1):this[R]},d.prototype.readInt16LE=function(R,$){R>>>=0,$||Le(R,2,this.length);const Ke=this[R]|this[R+1]<<8;return 32768&Ke?4294901760|Ke:Ke},d.prototype.readInt16BE=function(R,$){R>>>=0,$||Le(R,2,this.length);const Ke=this[R+1]|this[R]<<8;return 32768&Ke?4294901760|Ke:Ke},d.prototype.readInt32LE=function(R,$){return R>>>=0,$||Le(R,4,this.length),this[R]|this[R+1]<<8|this[R+2]<<16|this[R+3]<<24},d.prototype.readInt32BE=function(R,$){return R>>>=0,$||Le(R,4,this.length),this[R]<<24|this[R+1]<<16|this[R+2]<<8|this[R+3]},d.prototype.readBigInt64LE=lt(function(R){ke(R>>>=0,"offset");const $=this[R],Ke=this[R+7];return(void 0===$||void 0===Ke)&&at(R,this.length-8),(BigInt(this[R+4]+256*this[R+5]+65536*this[R+6]+(Ke<<24))<>>=0,"offset");const $=this[R],Ke=this[R+7];(void 0===$||void 0===Ke)&&at(R,this.length-8);const ut=($<<24)+65536*this[++R]+256*this[++R]+this[++R];return(BigInt(ut)<>>=0,$||Le(R,4,this.length),l.read(this,R,!0,23,4)},d.prototype.readFloatBE=function(R,$){return R>>>=0,$||Le(R,4,this.length),l.read(this,R,!1,23,4)},d.prototype.readDoubleLE=function(R,$){return R>>>=0,$||Le(R,8,this.length),l.read(this,R,!0,52,8)},d.prototype.readDoubleBE=function(R,$){return R>>>=0,$||Le(R,8,this.length),l.read(this,R,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(R,$,Ke,ut){R=+R,$>>>=0,Ke>>>=0,ut||et(this,R,$,Ke,Math.pow(2,8*Ke)-1,0);let Ot=1,Nt=0;for(this[$]=255&R;++Nt>>=0,Ke>>>=0,ut||et(this,R,$,Ke,Math.pow(2,8*Ke)-1,0);let Ot=Ke-1,Nt=1;for(this[$+Ot]=255&R;--Ot>=0&&(Nt*=256);)this[$+Ot]=R/Nt&255;return $+Ke},d.prototype.writeUint8=d.prototype.writeUInt8=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,1,255,0),this[$]=255&R,$+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,2,65535,0),this[$]=255&R,this[$+1]=R>>>8,$+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,2,65535,0),this[$]=R>>>8,this[$+1]=255&R,$+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,4,4294967295,0),this[$+3]=R>>>24,this[$+2]=R>>>16,this[$+1]=R>>>8,this[$]=255&R,$+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,4,4294967295,0),this[$]=R>>>24,this[$+1]=R>>>16,this[$+2]=R>>>8,this[$+3]=255&R,$+4},d.prototype.writeBigUInt64LE=lt(function(R,$=0){return z(this,R,$,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=lt(function(R,$=0){return xe(this,R,$,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(R,$,Ke,ut){if(R=+R,$>>>=0,!ut){const bt=Math.pow(2,8*Ke-1);et(this,R,$,Ke,bt-1,-bt)}let Ot=0,Nt=1,yt=0;for(this[$]=255&R;++Ot>0)-yt&255;return $+Ke},d.prototype.writeIntBE=function(R,$,Ke,ut){if(R=+R,$>>>=0,!ut){const bt=Math.pow(2,8*Ke-1);et(this,R,$,Ke,bt-1,-bt)}let Ot=Ke-1,Nt=1,yt=0;for(this[$+Ot]=255&R;--Ot>=0&&(Nt*=256);)R<0&&0===yt&&0!==this[$+Ot+1]&&(yt=1),this[$+Ot]=(R/Nt>>0)-yt&255;return $+Ke},d.prototype.writeInt8=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,1,127,-128),R<0&&(R=255+R+1),this[$]=255&R,$+1},d.prototype.writeInt16LE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,2,32767,-32768),this[$]=255&R,this[$+1]=R>>>8,$+2},d.prototype.writeInt16BE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,2,32767,-32768),this[$]=R>>>8,this[$+1]=255&R,$+2},d.prototype.writeInt32LE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,4,2147483647,-2147483648),this[$]=255&R,this[$+1]=R>>>8,this[$+2]=R>>>16,this[$+3]=R>>>24,$+4},d.prototype.writeInt32BE=function(R,$,Ke){return R=+R,$>>>=0,Ke||et(this,R,$,4,2147483647,-2147483648),R<0&&(R=4294967295+R+1),this[$]=R>>>24,this[$+1]=R>>>16,this[$+2]=R>>>8,this[$+3]=255&R,$+4},d.prototype.writeBigInt64LE=lt(function(R,$=0){return z(this,R,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=lt(function(R,$=0){return xe(this,R,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(R,$,Ke){return X(this,R,$,!0,Ke)},d.prototype.writeFloatBE=function(R,$,Ke){return X(this,R,$,!1,Ke)},d.prototype.writeDoubleLE=function(R,$,Ke){return ze(this,R,$,!0,Ke)},d.prototype.writeDoubleBE=function(R,$,Ke){return ze(this,R,$,!1,Ke)},d.prototype.copy=function(R,$,Ke,ut){if(!d.isBuffer(R))throw new TypeError("argument should be a Buffer");if(Ke||(Ke=0),!ut&&0!==ut&&(ut=this.length),$>=R.length&&($=R.length),$||($=0),ut>0&&ut=this.length)throw new RangeError("Index out of range");if(ut<0)throw new RangeError("sourceEnd out of bounds");ut>this.length&&(ut=this.length),R.length-$>>=0,Ke=void 0===Ke?this.length:Ke>>>0,R||(R=0),"number"==typeof R)for(Ot=$;Ot=Ke+4;$-=3)R=`_${be.slice($-3,$)}${R}`;return`${be.slice(0,$)}${R}`}function L(be,R,$,Ke,ut,Ot){if(be>$||be3?0===R||R===BigInt(0)?`>= 0${Nt} and < 2${Nt} ** ${8*(Ot+1)}${Nt}`:`>= -(2${Nt} ** ${8*(Ot+1)-1}${Nt}) and < 2 ** ${8*(Ot+1)-1}${Nt}`:`>= ${R}${Nt} and <= ${$}${Nt}`,new re.ERR_OUT_OF_RANGE("value",yt,be)}!function I(be,R,$){ke(R,"offset"),(void 0===be[R]||void 0===be[R+$])&&at(R,be.length-($+1))}(Ke,ut,Ot)}function ke(be,R){if("number"!=typeof be)throw new re.ERR_INVALID_ARG_TYPE(R,"number",be)}function at(be,R,$){throw Math.floor(be)!==be?(ke(be,$),new re.ERR_OUT_OF_RANGE($||"offset","an integer",be)):R<0?new re.ERR_BUFFER_OUT_OF_BOUNDS:new re.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${R}`,be)}He("ERR_BUFFER_OUT_OF_BOUNDS",function(be){return be?`${be} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),He("ERR_INVALID_ARG_TYPE",function(be,R){return`The "${be}" argument must be of type number. Received type ${typeof R}`},TypeError),He("ERR_OUT_OF_RANGE",function(be,R,$){let Ke=`The value of "${be}" is out of range.`,ut=$;return Number.isInteger($)&&Math.abs($)>2**32?ut=_e(String($)):"bigint"==typeof $&&(ut=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(ut=_e(ut)),ut+="n"),Ke+=` It must be ${R}. Received ${ut}`,Ke},RangeError);const Bt=/[^+/0-9A-Za-z-_]/g;function Ht(be,R){let $;R=R||1/0;const Ke=be.length;let ut=null;const Ot=[];for(let Nt=0;Nt55295&&$<57344){if(!ut){if($>56319){(R-=3)>-1&&Ot.push(239,191,189);continue}if(Nt+1===Ke){(R-=3)>-1&&Ot.push(239,191,189);continue}ut=$;continue}if($<56320){(R-=3)>-1&&Ot.push(239,191,189),ut=$;continue}$=65536+(ut-55296<<10|$-56320)}else ut&&(R-=3)>-1&&Ot.push(239,191,189);if(ut=null,$<128){if((R-=1)<0)break;Ot.push($)}else if($<2048){if((R-=2)<0)break;Ot.push($>>6|192,63&$|128)}else if($<65536){if((R-=3)<0)break;Ot.push($>>12|224,$>>6&63|128,63&$|128)}else{if(!($<1114112))throw new Error("Invalid code point");if((R-=4)<0)break;Ot.push($>>18|240,$>>12&63|128,$>>6&63|128,63&$|128)}}return Ot}function M(be){return r.toByteArray(function jt(be){if((be=(be=be.split("=")[0]).trim().replace(Bt,"")).length<2)return"";for(;be.length%4!=0;)be+="=";return be}(be))}function N(be,R,$,Ke){let ut;for(ut=0;ut=R.length||ut>=be.length);++ut)R[ut+$]=be[ut];return ut}function F(be,R){return be instanceof R||null!=be&&null!=be.constructor&&null!=be.constructor.name&&be.constructor.name===R.name}function ue(be){return be!=be}const Be=function(){const be="0123456789abcdef",R=new Array(256);for(let $=0;$<16;++$){const Ke=16*$;for(let ut=0;ut<16;++ut)R[Ke+ut]=be[$]+be[ut]}return R}();function lt(be){return"undefined"==typeof BigInt?Ct:be}function Ct(){throw new Error("BigInt not supported")}},1213:rt=>{var B=[].slice;rt.exports=function(a,n){if("string"==typeof n&&(n=a[n]),"function"!=typeof n)throw new Error("bind() requires a function");var r=B.call(arguments,2);return function(){return n.apply(a,r.concat(B.call(arguments)))}}},1264:rt=>{function B(n){if(n)return function a(n){for(var r in B.prototype)n[r]=B.prototype[r];return n}(n)}rt.exports=B,B.prototype.on=B.prototype.addEventListener=function(n,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(r),this},B.prototype.once=function(n,r){function l(){this.off(n,l),r.apply(this,arguments)}return l.fn=r,this.on(n,l),this},B.prototype.off=B.prototype.removeListener=B.prototype.removeAllListeners=B.prototype.removeEventListener=function(n,r){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var l=this._callbacks["$"+n];if(!l)return this;if(1==arguments.length)return delete this._callbacks["$"+n],this;for(var u,o=0;o{rt.exports=function(B,a){var n=function(){};n.prototype=a.prototype,B.prototype=new n,B.prototype.constructor=B}},7466:function(rt,B,a){var n;rt.exports=(n=a(7585),a(8319),a(9493),a(7865),a(3057),function(){var r=n,u=r.lib.BlockCipher,o=r.algo,S=[],E=[],d=[],v=[],y=[],_=[],g=[],C=[],w=[],V=[];!function(){for(var K=[],ce=0;ce<256;ce++)K[ce]=ce<128?ce<<1:ce<<1^283;var le=0,G=0;for(ce=0;ce<256;ce++){var W=G^G<<1^G<<2^G<<3^G<<4;S[le]=W=W>>>8^255&W^99,E[W]=le;var de,H=K[le],Me=K[H],q=K[Me];d[le]=(de=257*K[W]^16843008*W)<<24|de>>>8,v[le]=de<<16|de>>>16,y[le]=de<<8|de>>>24,_[le]=de,g[W]=(de=16843009*q^65537*Me^257*H^16843008*le)<<24|de>>>8,C[W]=de<<16|de>>>16,w[W]=de<<8|de>>>24,V[W]=de,le?(le=H^K[K[K[q^H]]],G^=K[K[G]]):le=G=1}}();var te=[0,1,2,4,8,16,32,64,128,27,54],U=o.AES=u.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var ce=this._keyPriorReset=this._key,le=ce.words,G=ce.sigBytes/4,H=4*((this._nRounds=G+6)+1),Me=this._keySchedule=[],q=0;q6&&q%G==4&&(K=S[K>>>24]<<24|S[K>>>16&255]<<16|S[K>>>8&255]<<8|S[255&K]):(K=S[(K=K<<8|K>>>24)>>>24]<<24|S[K>>>16&255]<<16|S[K>>>8&255]<<8|S[255&K],K^=te[q/G|0]<<24),Me[q]=Me[q-G]^K);for(var de=this._invKeySchedule=[],Te=0;Te>>24]]^C[S[K>>>16&255]]^w[S[K>>>8&255]]^V[S[255&K]]}}},encryptBlock:function(K,ce){this._doCryptBlock(K,ce,this._keySchedule,d,v,y,_,S)},decryptBlock:function(K,ce){var le=K[ce+1];K[ce+1]=K[ce+3],K[ce+3]=le,this._doCryptBlock(K,ce,this._invKeySchedule,g,C,w,V,E),le=K[ce+1],K[ce+1]=K[ce+3],K[ce+3]=le},_doCryptBlock:function(K,ce,le,G,W,H,Me,q){for(var de=this._nRounds,Te=K[ce]^le[0],j=K[ce+1]^le[1],ne=K[ce+2]^le[2],Z=K[ce+3]^le[3],he=4,Ie=1;Ie>>24]^W[j>>>16&255]^H[ne>>>8&255]^Me[255&Z]^le[he++],Tt=G[j>>>24]^W[ne>>>16&255]^H[Z>>>8&255]^Me[255&Te]^le[he++],Ft=G[ne>>>24]^W[Z>>>16&255]^H[Te>>>8&255]^Me[255&j]^le[he++],vt=G[Z>>>24]^W[Te>>>16&255]^H[j>>>8&255]^Me[255&ne]^le[he++];Te=Xe,j=Tt,ne=Ft,Z=vt}Xe=(q[Te>>>24]<<24|q[j>>>16&255]<<16|q[ne>>>8&255]<<8|q[255&Z])^le[he++],Tt=(q[j>>>24]<<24|q[ne>>>16&255]<<16|q[Z>>>8&255]<<8|q[255&Te])^le[he++],Ft=(q[ne>>>24]<<24|q[Z>>>16&255]<<16|q[Te>>>8&255]<<8|q[255&j])^le[he++],vt=(q[Z>>>24]<<24|q[Te>>>16&255]<<16|q[j>>>8&255]<<8|q[255&ne])^le[he++],K[ce]=Xe,K[ce+1]=Tt,K[ce+2]=Ft,K[ce+3]=vt},keySize:8});r.AES=u._createHelper(U)}(),n.AES)},3057:function(rt,B,a){var l,u,o,S,E,d,y,g,C,V,te,U,ce,G,H,Me,de,Te,n;rt.exports=(n=a(7585),a(7865),void(n.lib.Cipher||(l=n,u=l.lib,o=u.Base,S=u.WordArray,E=u.BufferedBlockAlgorithm,d=l.enc,y=d.Base64,g=l.algo.EvpKDF,C=u.Cipher=E.extend({cfg:o.extend(),createEncryptor:function(j,ne){return this.create(this._ENC_XFORM_MODE,j,ne)},createDecryptor:function(j,ne){return this.create(this._DEC_XFORM_MODE,j,ne)},init:function(j,ne,Z){this.cfg=this.cfg.extend(Z),this._xformMode=j,this._key=ne,this.reset()},reset:function(){E.reset.call(this),this._doReset()},process:function(j){return this._append(j),this._process()},finalize:function(j){return j&&this._append(j),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function j(ne){return"string"==typeof ne?Te:Me}return function(ne){return{encrypt:function(Z,he,Ie){return j(he).encrypt(ne,Z,he,Ie)},decrypt:function(Z,he,Ie){return j(he).decrypt(ne,Z,he,Ie)}}}}()}),u.StreamCipher=C.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),V=l.mode={},te=u.BlockCipherMode=o.extend({createEncryptor:function(j,ne){return this.Encryptor.create(j,ne)},createDecryptor:function(j,ne){return this.Decryptor.create(j,ne)},init:function(j,ne){this._cipher=j,this._iv=ne}}),U=V.CBC=function(){var j=te.extend();function ne(Z,he,Ie){var Xe,Tt=this._iv;Tt?(Xe=Tt,this._iv=undefined):Xe=this._prevBlock;for(var Ft=0;Ft>>2]}},u.BlockCipher=C.extend({cfg:C.cfg.extend({mode:U,padding:ce}),reset:function(){var j;C.reset.call(this);var ne=this.cfg,Z=ne.iv,he=ne.mode;this._xformMode==this._ENC_XFORM_MODE?j=he.createEncryptor:(j=he.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==j?this._mode.init(this,Z&&Z.words):(this._mode=j.call(he,this,Z&&Z.words),this._mode.__creator=j)},_doProcessBlock:function(j,ne){this._mode.processBlock(j,ne)},_doFinalize:function(){var j,ne=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(ne.pad(this._data,this.blockSize),j=this._process(!0)):(j=this._process(!0),ne.unpad(j)),j},blockSize:4}),G=u.CipherParams=o.extend({init:function(j){this.mixIn(j)},toString:function(j){return(j||this.formatter).stringify(this)}}),H=(l.format={}).OpenSSL={stringify:function(j){var Z=j.ciphertext,he=j.salt;return(he?S.create([1398893684,1701076831]).concat(he).concat(Z):Z).toString(y)},parse:function(j){var ne,Z=y.parse(j),he=Z.words;return 1398893684==he[0]&&1701076831==he[1]&&(ne=S.create(he.slice(2,4)),he.splice(0,4),Z.sigBytes-=16),G.create({ciphertext:Z,salt:ne})}},Me=u.SerializableCipher=o.extend({cfg:o.extend({format:H}),encrypt:function(j,ne,Z,he){he=this.cfg.extend(he);var Ie=j.createEncryptor(Z,he),Xe=Ie.finalize(ne),Tt=Ie.cfg;return G.create({ciphertext:Xe,key:Z,iv:Tt.iv,algorithm:j,mode:Tt.mode,padding:Tt.padding,blockSize:j.blockSize,formatter:he.format})},decrypt:function(j,ne,Z,he){return he=this.cfg.extend(he),ne=this._parse(ne,he.format),j.createDecryptor(Z,he).finalize(ne.ciphertext)},_parse:function(j,ne){return"string"==typeof j?ne.parse(j,this):j}}),de=(l.kdf={}).OpenSSL={execute:function(j,ne,Z,he){he||(he=S.random(8));var Ie=g.create({keySize:ne+Z}).compute(j,he),Xe=S.create(Ie.words.slice(ne),4*Z);return Ie.sigBytes=4*ne,G.create({key:Ie,iv:Xe,salt:he})}},Te=u.PasswordBasedCipher=Me.extend({cfg:Me.cfg.extend({kdf:de}),encrypt:function(j,ne,Z,he){var Ie=(he=this.cfg.extend(he)).kdf.execute(Z,j.keySize,j.ivSize);he.iv=Ie.iv;var Xe=Me.encrypt.call(this,j,ne,Ie.key,he);return Xe.mixIn(Ie),Xe},decrypt:function(j,ne,Z,he){he=this.cfg.extend(he),ne=this._parse(ne,he.format);var Ie=he.kdf.execute(Z,j.keySize,j.ivSize,ne.salt);return he.iv=Ie.iv,Me.decrypt.call(this,j,ne,Ie.key,he)}}))))},7585:function(rt,B,a){var n;rt.exports=(n=n||function(r,l){var u;if("undefined"!=typeof window&&window.crypto&&(u=window.crypto),"undefined"!=typeof self&&self.crypto&&(u=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(u=globalThis.crypto),!u&&"undefined"!=typeof window&&window.msCrypto&&(u=window.msCrypto),!u&&"undefined"!=typeof global&&global.crypto&&(u=global.crypto),!u)try{u=a(2480)}catch(K){}var o=function(){if(u){if("function"==typeof u.getRandomValues)try{return u.getRandomValues(new Uint32Array(1))[0]}catch(K){}if("function"==typeof u.randomBytes)try{return u.randomBytes(4).readInt32LE()}catch(K){}}throw new Error("Native crypto module could not be used to get secure random number.")},S=Object.create||function(){function K(){}return function(ce){var le;return K.prototype=ce,le=new K,K.prototype=null,le}}(),E={},d=E.lib={},v=d.Base={extend:function(K){var ce=S(this);return K&&ce.mixIn(K),(!ce.hasOwnProperty("init")||this.init===ce.init)&&(ce.init=function(){ce.$super.init.apply(this,arguments)}),ce.init.prototype=ce,ce.$super=this,ce},create:function(){var K=this.extend();return K.init.apply(K,arguments),K},init:function(){},mixIn:function(K){for(var ce in K)K.hasOwnProperty(ce)&&(this[ce]=K[ce]);K.hasOwnProperty("toString")&&(this.toString=K.toString)},clone:function(){return this.init.prototype.extend(this)}},y=d.WordArray=v.extend({init:function(K,ce){K=this.words=K||[],this.sigBytes=null!=ce?ce:4*K.length},toString:function(K){return(K||g).stringify(this)},concat:function(K){var ce=this.words,le=K.words,G=this.sigBytes,W=K.sigBytes;if(this.clamp(),G%4)for(var H=0;H>>2]|=(le[H>>>2]>>>24-H%4*8&255)<<24-(G+H)%4*8;else for(var q=0;q>>2]=le[q>>>2];return this.sigBytes+=W,this},clamp:function(){var K=this.words,ce=this.sigBytes;K[ce>>>2]&=4294967295<<32-ce%4*8,K.length=r.ceil(ce/4)},clone:function(){var K=v.clone.call(this);return K.words=this.words.slice(0),K},random:function(K){for(var ce=[],le=0;le>>2]>>>24-W%4*8&255;G.push((H>>>4).toString(16)),G.push((15&H).toString(16))}return G.join("")},parse:function(K){for(var ce=K.length,le=[],G=0;G>>3]|=parseInt(K.substr(G,2),16)<<24-G%8*4;return new y.init(le,ce/2)}},C=_.Latin1={stringify:function(K){for(var ce=K.words,le=K.sigBytes,G=[],W=0;W>>2]>>>24-W%4*8&255));return G.join("")},parse:function(K){for(var ce=K.length,le=[],G=0;G>>2]|=(255&K.charCodeAt(G))<<24-G%4*8;return new y.init(le,ce)}},w=_.Utf8={stringify:function(K){try{return decodeURIComponent(escape(C.stringify(K)))}catch(ce){throw new Error("Malformed UTF-8 data")}},parse:function(K){return C.parse(unescape(encodeURIComponent(K)))}},V=d.BufferedBlockAlgorithm=v.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(K){"string"==typeof K&&(K=w.parse(K)),this._data.concat(K),this._nDataBytes+=K.sigBytes},_process:function(K){var ce,le=this._data,G=le.words,W=le.sigBytes,H=this.blockSize,q=W/(4*H),de=(q=K?r.ceil(q):r.max((0|q)-this._minBufferSize,0))*H,Te=r.min(4*de,W);if(de){for(var j=0;j>>2]>>>24-C%4*8&255)<<16|(v[C+1>>>2]>>>24-(C+1)%4*8&255)<<8|v[C+2>>>2]>>>24-(C+2)%4*8&255,K=0;K<4&&C+.75*K>>6*(3-K)&63));var ce=_.charAt(64);if(ce)for(;g.length%4;)g.push(ce);return g.join("")},parse:function(d){var v=d.length,y=this._map,_=this._reverseMap;if(!_){_=this._reverseMap=[];for(var g=0;g>>6-C%4*2;_[g>>>2]|=(w|V)<<24-g%4*8,g++}return u.create(_,g)}(d,v,_)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},4410:function(rt,B,a){var n,u;rt.exports=(n=a(7585),u=n.lib.WordArray,n.enc.Base64url={stringify:function(d,v=!0){var y=d.words,_=d.sigBytes,g=v?this._safe_map:this._map;d.clamp();for(var C=[],w=0;w<_;w+=3)for(var K=(y[w>>>2]>>>24-w%4*8&255)<<16|(y[w+1>>>2]>>>24-(w+1)%4*8&255)<<8|y[w+2>>>2]>>>24-(w+2)%4*8&255,ce=0;ce<4&&w+.75*ce<_;ce++)C.push(g.charAt(K>>>6*(3-ce)&63));var le=g.charAt(64);if(le)for(;C.length%4;)C.push(le);return C.join("")},parse:function(d,v=!0){var y=d.length,_=v?this._safe_map:this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var C=0;C<_.length;C++)g[_.charCodeAt(C)]=C}var w=_.charAt(64);if(w){var V=d.indexOf(w);-1!==V&&(y=V)}return function E(d,v,y){for(var _=[],g=0,C=0;C>>6-C%4*2;_[g>>>2]|=(w|V)<<24-g%4*8,g++}return u.create(_,g)}(d,y,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},n.enc.Base64url)},9012:function(rt,B,a){var n;rt.exports=(n=a(7585),function(){var u=n.lib.WordArray,o=n.enc;function E(d){return d<<8&4278255360|d>>>8&16711935}o.Utf16=o.Utf16BE={stringify:function(d){for(var v=d.words,y=d.sigBytes,_=[],g=0;g>>2]>>>16-g%4*8&65535));return _.join("")},parse:function(d){for(var v=d.length,y=[],_=0;_>>1]|=d.charCodeAt(_)<<16-_%2*16;return u.create(y,2*v)}},o.Utf16LE={stringify:function(d){for(var v=d.words,y=d.sigBytes,_=[],g=0;g>>2]>>>16-g%4*8&65535);_.push(String.fromCharCode(C))}return _.join("")},parse:function(d){for(var v=d.length,y=[],_=0;_>>1]|=E(d.charCodeAt(_)<<16-_%2*16);return u.create(y,2*v)}}}(),n.enc.Utf16)},7865:function(rt,B,a){var r,l,u,o,S,d,n;rt.exports=(n=a(7585),a(5162),a(3764),o=(l=(r=n).lib).WordArray,d=(S=r.algo).EvpKDF=(u=l.Base).extend({cfg:u.extend({keySize:4,hasher:S.MD5,iterations:1}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,y){for(var _,g=this.cfg,C=g.hasher.create(),w=o.create(),V=w.words,te=g.keySize,U=g.iterations;V.lengthg&&(y=v.finalize(y)),y.clamp();for(var C=this._oKey=y.clone(),w=this._iKey=y.clone(),V=C.words,te=w.words,U=0;U<_;U++)V[U]^=1549556828,te[U]^=909522486;C.sigBytes=w.sigBytes=g,this.reset()},reset:function(){var v=this._hasher;v.reset(),v.update(this._iKey)},update:function(v){return this._hasher.update(v),this},finalize:function(v){var y=this._hasher,_=y.finalize(v);return y.reset(),y.finalize(this._oKey.clone().concat(_))}})))},7206:function(rt,B,a){var n;rt.exports=(n=a(7585),a(401),a(7412),a(9012),a(8319),a(4410),a(9493),a(5162),a(1817),a(8769),a(3351),a(6787),a(1971),a(4973),a(3764),a(8812),a(7865),a(3057),a(4424),a(6635),a(3592),a(9354),a(7934),a(4413),a(4630),a(187),a(1691),a(3237),a(1847),a(7466),a(7243),a(486),a(8182),a(3544),n)},7412:function(rt,B,a){var n;rt.exports=(n=a(7585),function(){if("function"==typeof ArrayBuffer){var u=n.lib.WordArray,o=u.init,S=u.init=function(E){if(E instanceof ArrayBuffer&&(E=new Uint8Array(E)),(E instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&E instanceof Uint8ClampedArray||E instanceof Int16Array||E instanceof Uint16Array||E instanceof Int32Array||E instanceof Uint32Array||E instanceof Float32Array||E instanceof Float64Array)&&(E=new Uint8Array(E.buffer,E.byteOffset,E.byteLength)),E instanceof Uint8Array){for(var d=E.byteLength,v=[],y=0;y>>2]|=E[y]<<24-y%4*8;o.call(this,v,d)}else o.apply(this,arguments)};S.prototype=u}}(),n.lib.WordArray)},9493:function(rt,B,a){var n;rt.exports=(n=a(7585),function(r){var l=n,u=l.lib,o=u.WordArray,S=u.Hasher,E=l.algo,d=[];!function(){for(var w=0;w<64;w++)d[w]=4294967296*r.abs(r.sin(w+1))|0}();var v=E.MD5=S.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(w,V){for(var te=0;te<16;te++){var U=V+te,K=w[U];w[U]=16711935&(K<<8|K>>>24)|4278255360&(K<<24|K>>>8)}var ce=this._hash.words,le=w[V+0],G=w[V+1],W=w[V+2],H=w[V+3],Me=w[V+4],q=w[V+5],de=w[V+6],Te=w[V+7],j=w[V+8],ne=w[V+9],Z=w[V+10],he=w[V+11],Ie=w[V+12],Xe=w[V+13],Tt=w[V+14],Ft=w[V+15],vt=ce[0],ht=ce[1],Le=ce[2],et=ce[3];vt=y(vt,ht,Le,et,le,7,d[0]),et=y(et,vt,ht,Le,G,12,d[1]),Le=y(Le,et,vt,ht,W,17,d[2]),ht=y(ht,Le,et,vt,H,22,d[3]),vt=y(vt,ht,Le,et,Me,7,d[4]),et=y(et,vt,ht,Le,q,12,d[5]),Le=y(Le,et,vt,ht,de,17,d[6]),ht=y(ht,Le,et,vt,Te,22,d[7]),vt=y(vt,ht,Le,et,j,7,d[8]),et=y(et,vt,ht,Le,ne,12,d[9]),Le=y(Le,et,vt,ht,Z,17,d[10]),ht=y(ht,Le,et,vt,he,22,d[11]),vt=y(vt,ht,Le,et,Ie,7,d[12]),et=y(et,vt,ht,Le,Xe,12,d[13]),Le=y(Le,et,vt,ht,Tt,17,d[14]),vt=_(vt,ht=y(ht,Le,et,vt,Ft,22,d[15]),Le,et,G,5,d[16]),et=_(et,vt,ht,Le,de,9,d[17]),Le=_(Le,et,vt,ht,he,14,d[18]),ht=_(ht,Le,et,vt,le,20,d[19]),vt=_(vt,ht,Le,et,q,5,d[20]),et=_(et,vt,ht,Le,Z,9,d[21]),Le=_(Le,et,vt,ht,Ft,14,d[22]),ht=_(ht,Le,et,vt,Me,20,d[23]),vt=_(vt,ht,Le,et,ne,5,d[24]),et=_(et,vt,ht,Le,Tt,9,d[25]),Le=_(Le,et,vt,ht,H,14,d[26]),ht=_(ht,Le,et,vt,j,20,d[27]),vt=_(vt,ht,Le,et,Xe,5,d[28]),et=_(et,vt,ht,Le,W,9,d[29]),Le=_(Le,et,vt,ht,Te,14,d[30]),vt=g(vt,ht=_(ht,Le,et,vt,Ie,20,d[31]),Le,et,q,4,d[32]),et=g(et,vt,ht,Le,j,11,d[33]),Le=g(Le,et,vt,ht,he,16,d[34]),ht=g(ht,Le,et,vt,Tt,23,d[35]),vt=g(vt,ht,Le,et,G,4,d[36]),et=g(et,vt,ht,Le,Me,11,d[37]),Le=g(Le,et,vt,ht,Te,16,d[38]),ht=g(ht,Le,et,vt,Z,23,d[39]),vt=g(vt,ht,Le,et,Xe,4,d[40]),et=g(et,vt,ht,Le,le,11,d[41]),Le=g(Le,et,vt,ht,H,16,d[42]),ht=g(ht,Le,et,vt,de,23,d[43]),vt=g(vt,ht,Le,et,ne,4,d[44]),et=g(et,vt,ht,Le,Ie,11,d[45]),Le=g(Le,et,vt,ht,Ft,16,d[46]),vt=C(vt,ht=g(ht,Le,et,vt,W,23,d[47]),Le,et,le,6,d[48]),et=C(et,vt,ht,Le,Te,10,d[49]),Le=C(Le,et,vt,ht,Tt,15,d[50]),ht=C(ht,Le,et,vt,q,21,d[51]),vt=C(vt,ht,Le,et,Ie,6,d[52]),et=C(et,vt,ht,Le,H,10,d[53]),Le=C(Le,et,vt,ht,Z,15,d[54]),ht=C(ht,Le,et,vt,G,21,d[55]),vt=C(vt,ht,Le,et,j,6,d[56]),et=C(et,vt,ht,Le,Ft,10,d[57]),Le=C(Le,et,vt,ht,de,15,d[58]),ht=C(ht,Le,et,vt,Xe,21,d[59]),vt=C(vt,ht,Le,et,Me,6,d[60]),et=C(et,vt,ht,Le,he,10,d[61]),Le=C(Le,et,vt,ht,W,15,d[62]),ht=C(ht,Le,et,vt,ne,21,d[63]),ce[0]=ce[0]+vt|0,ce[1]=ce[1]+ht|0,ce[2]=ce[2]+Le|0,ce[3]=ce[3]+et|0},_doFinalize:function(){var w=this._data,V=w.words,te=8*this._nDataBytes,U=8*w.sigBytes;V[U>>>5]|=128<<24-U%32;var K=r.floor(te/4294967296),ce=te;V[15+(U+64>>>9<<4)]=16711935&(K<<8|K>>>24)|4278255360&(K<<24|K>>>8),V[14+(U+64>>>9<<4)]=16711935&(ce<<8|ce>>>24)|4278255360&(ce<<24|ce>>>8),w.sigBytes=4*(V.length+1),this._process();for(var le=this._hash,G=le.words,W=0;W<4;W++){var H=G[W];G[W]=16711935&(H<<8|H>>>24)|4278255360&(H<<24|H>>>8)}return le},clone:function(){var w=S.clone.call(this);return w._hash=this._hash.clone(),w}});function y(w,V,te,U,K,ce,le){var G=w+(V&te|~V&U)+K+le;return(G<>>32-ce)+V}function _(w,V,te,U,K,ce,le){var G=w+(V&U|te&~U)+K+le;return(G<>>32-ce)+V}function g(w,V,te,U,K,ce,le){var G=w+(V^te^U)+K+le;return(G<>>32-ce)+V}function C(w,V,te,U,K,ce,le){var G=w+(te^(V|~U))+K+le;return(G<>>32-ce)+V}l.MD5=S._createHelper(v),l.HmacMD5=S._createHmacHelper(v)}(Math),n.MD5)},4424:function(rt,B,a){var n;rt.exports=(n=a(7585),a(3057),n.mode.CFB=function(){var r=n.lib.BlockCipherMode.extend();function l(u,o,S,E){var d,v=this._iv;v?(d=v.slice(0),this._iv=void 0):d=this._prevBlock,E.encryptBlock(d,0);for(var y=0;y>24&255)){var E=S>>16&255,d=S>>8&255,v=255&S;255===E?(E=0,255===d?(d=0,255===v?v=0:++v):++d):++E,S=0,S+=E<<16,S+=d<<8,S+=v}else S+=1<<24;return S}var o=r.Encryptor=r.extend({processBlock:function(S,E){var d=this._cipher,v=d.blockSize,y=this._iv,_=this._counter;y&&(_=this._counter=y.slice(0),this._iv=void 0),function u(S){return 0===(S[0]=l(S[0]))&&(S[1]=l(S[1])),S}(_);var g=_.slice(0);d.encryptBlock(g,0);for(var C=0;C>>2]|=S<<24-E%4*8,r.sigBytes+=S},unpad:function(r){r.sigBytes-=255&r.words[r.sigBytes-1>>>2]}},n.pad.Ansix923)},4630:function(rt,B,a){var n;rt.exports=(n=a(7585),a(3057),n.pad.Iso10126={pad:function(r,l){var u=4*l,o=u-r.sigBytes%u;r.concat(n.lib.WordArray.random(o-1)).concat(n.lib.WordArray.create([o<<24],1))},unpad:function(r){r.sigBytes-=255&r.words[r.sigBytes-1>>>2]}},n.pad.Iso10126)},187:function(rt,B,a){var n;rt.exports=(n=a(7585),a(3057),n.pad.Iso97971={pad:function(r,l){r.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(r,l)},unpad:function(r){n.pad.ZeroPadding.unpad(r),r.sigBytes--}},n.pad.Iso97971)},3237:function(rt,B,a){var n;rt.exports=(n=a(7585),a(3057),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},1691:function(rt,B,a){var n;rt.exports=(n=a(7585),a(3057),n.pad.ZeroPadding={pad:function(r,l){var u=4*l;r.clamp(),r.sigBytes+=u-(r.sigBytes%u||u)},unpad:function(r){var l=r.words,u=r.sigBytes-1;for(u=r.sigBytes-1;u>=0;u--)if(l[u>>>2]>>>24-u%4*8&255){r.sigBytes=u+1;break}}},n.pad.ZeroPadding)},8812:function(rt,B,a){var r,l,u,o,S,d,v,n;rt.exports=(n=a(7585),a(5162),a(3764),o=(l=(r=n).lib).WordArray,d=(S=r.algo).HMAC,v=S.PBKDF2=(u=l.Base).extend({cfg:u.extend({keySize:4,hasher:S.SHA1,iterations:1}),init:function(y){this.cfg=this.cfg.extend(y)},compute:function(y,_){for(var g=this.cfg,C=d.create(g.hasher,y),w=o.create(),V=o.create([1]),te=w.words,U=V.words,K=g.keySize,ce=g.iterations;te.length>>16,_[1],_[0]<<16|_[3]>>>16,_[2],_[1]<<16|_[0]>>>16,_[3],_[2]<<16|_[1]>>>16],w=this._C=[_[2]<<16|_[2]>>>16,4294901760&_[0]|65535&_[1],_[3]<<16|_[3]>>>16,4294901760&_[1]|65535&_[2],_[0]<<16|_[0]>>>16,4294901760&_[2]|65535&_[3],_[1]<<16|_[1]>>>16,4294901760&_[3]|65535&_[0]];this._b=0;for(var V=0;V<4;V++)y.call(this);for(V=0;V<8;V++)w[V]^=C[V+4&7];if(g){var te=g.words,U=te[0],K=te[1],ce=16711935&(U<<8|U>>>24)|4278255360&(U<<24|U>>>8),le=16711935&(K<<8|K>>>24)|4278255360&(K<<24|K>>>8),G=ce>>>16|4294901760&le,W=le<<16|65535&ce;for(w[0]^=ce,w[1]^=G,w[2]^=le,w[3]^=W,w[4]^=ce,w[5]^=G,w[6]^=le,w[7]^=W,V=0;V<4;V++)y.call(this)}},_doProcessBlock:function(_,g){var C=this._X;y.call(this),S[0]=C[0]^C[5]>>>16^C[3]<<16,S[1]=C[2]^C[7]>>>16^C[5]<<16,S[2]=C[4]^C[1]>>>16^C[7]<<16,S[3]=C[6]^C[3]>>>16^C[1]<<16;for(var w=0;w<4;w++)S[w]=16711935&(S[w]<<8|S[w]>>>24)|4278255360&(S[w]<<24|S[w]>>>8),_[g+w]^=S[w]},blockSize:4,ivSize:2});function y(){for(var _=this._X,g=this._C,C=0;C<8;C++)E[C]=g[C];for(g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0>>0?1:0)|0,this._b=g[7]>>>0>>0?1:0,C=0;C<8;C++){var w=_[C]+g[C],V=65535&w,te=w>>>16;d[C]=((V*V>>>17)+V*te>>>15)+te*te^((4294901760&w)*w|0)+((65535&w)*w|0)}_[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,_[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,_[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,_[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,_[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,_[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,_[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,_[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}r.RabbitLegacy=u._createHelper(v)}(),n.RabbitLegacy)},8182:function(rt,B,a){var n;rt.exports=(n=a(7585),a(8319),a(9493),a(7865),a(3057),function(){var r=n,u=r.lib.StreamCipher,S=[],E=[],d=[],v=r.algo.Rabbit=u.extend({_doReset:function(){for(var _=this._key.words,g=this.cfg.iv,C=0;C<4;C++)_[C]=16711935&(_[C]<<8|_[C]>>>24)|4278255360&(_[C]<<24|_[C]>>>8);var w=this._X=[_[0],_[3]<<16|_[2]>>>16,_[1],_[0]<<16|_[3]>>>16,_[2],_[1]<<16|_[0]>>>16,_[3],_[2]<<16|_[1]>>>16],V=this._C=[_[2]<<16|_[2]>>>16,4294901760&_[0]|65535&_[1],_[3]<<16|_[3]>>>16,4294901760&_[1]|65535&_[2],_[0]<<16|_[0]>>>16,4294901760&_[2]|65535&_[3],_[1]<<16|_[1]>>>16,4294901760&_[3]|65535&_[0]];for(this._b=0,C=0;C<4;C++)y.call(this);for(C=0;C<8;C++)V[C]^=w[C+4&7];if(g){var te=g.words,U=te[0],K=te[1],ce=16711935&(U<<8|U>>>24)|4278255360&(U<<24|U>>>8),le=16711935&(K<<8|K>>>24)|4278255360&(K<<24|K>>>8),G=ce>>>16|4294901760&le,W=le<<16|65535&ce;for(V[0]^=ce,V[1]^=G,V[2]^=le,V[3]^=W,V[4]^=ce,V[5]^=G,V[6]^=le,V[7]^=W,C=0;C<4;C++)y.call(this)}},_doProcessBlock:function(_,g){var C=this._X;y.call(this),S[0]=C[0]^C[5]>>>16^C[3]<<16,S[1]=C[2]^C[7]>>>16^C[5]<<16,S[2]=C[4]^C[1]>>>16^C[7]<<16,S[3]=C[6]^C[3]>>>16^C[1]<<16;for(var w=0;w<4;w++)S[w]=16711935&(S[w]<<8|S[w]>>>24)|4278255360&(S[w]<<24|S[w]>>>8),_[g+w]^=S[w]},blockSize:4,ivSize:2});function y(){for(var _=this._X,g=this._C,C=0;C<8;C++)E[C]=g[C];for(g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0>>0?1:0)|0,this._b=g[7]>>>0>>0?1:0,C=0;C<8;C++){var w=_[C]+g[C],V=65535&w,te=w>>>16;d[C]=((V*V>>>17)+V*te>>>15)+te*te^((4294901760&w)*w|0)+((65535&w)*w|0)}_[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,_[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,_[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,_[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,_[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,_[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,_[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,_[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}r.Rabbit=u._createHelper(v)}(),n.Rabbit)},486:function(rt,B,a){var n;rt.exports=(n=a(7585),a(8319),a(9493),a(7865),a(3057),function(){var r=n,u=r.lib.StreamCipher,o=r.algo,S=o.RC4=u.extend({_doReset:function(){for(var v=this._key,y=v.words,_=v.sigBytes,g=this._S=[],C=0;C<256;C++)g[C]=C;C=0;for(var w=0;C<256;C++){var V=C%_,U=g[C];g[C]=g[w=(w+g[C]+(y[V>>>2]>>>24-V%4*8&255))%256],g[w]=U}this._i=this._j=0},_doProcessBlock:function(v,y){v[y]^=E.call(this)},keySize:8,ivSize:0});function E(){for(var v=this._S,y=this._i,_=this._j,g=0,C=0;C<4;C++){var w=v[y=(y+1)%256];v[y]=v[_=(_+v[y])%256],v[_]=w,g|=v[(v[y]+v[_])%256]<<24-8*C}return this._i=y,this._j=_,g}r.RC4=u._createHelper(S);var d=o.RC4Drop=S.extend({cfg:S.cfg.extend({drop:192}),_doReset:function(){S._doReset.call(this);for(var v=this.cfg.drop;v>0;v--)E.call(this)}});r.RC4Drop=u._createHelper(d)}(),n.RC4)},4973:function(rt,B,a){var n;rt.exports=(n=a(7585),function(r){var l=n,u=l.lib,o=u.WordArray,S=u.Hasher,E=l.algo,d=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),v=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),y=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),_=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=o.create([0,1518500249,1859775393,2400959708,2840853838]),C=o.create([1352829926,1548603684,1836072691,2053994217,0]),w=E.RIPEMD160=S.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(G,W){for(var H=0;H<16;H++){var Me=W+H,q=G[Me];G[Me]=16711935&(q<<8|q>>>24)|4278255360&(q<<24|q>>>8)}var Xe,Tt,Ft,vt,ht,Le,et,z,xe,ye,X,de=this._hash.words,Te=g.words,j=C.words,ne=d.words,Z=v.words,he=y.words,Ie=_.words;for(Le=Xe=de[0],et=Tt=de[1],z=Ft=de[2],xe=vt=de[3],ye=ht=de[4],H=0;H<80;H+=1)X=Xe+G[W+ne[H]]|0,X+=H<16?V(Tt,Ft,vt)+Te[0]:H<32?te(Tt,Ft,vt)+Te[1]:H<48?U(Tt,Ft,vt)+Te[2]:H<64?K(Tt,Ft,vt)+Te[3]:ce(Tt,Ft,vt)+Te[4],X=(X=le(X|=0,he[H]))+ht|0,Xe=ht,ht=vt,vt=le(Ft,10),Ft=Tt,Tt=X,X=Le+G[W+Z[H]]|0,X+=H<16?ce(et,z,xe)+j[0]:H<32?K(et,z,xe)+j[1]:H<48?U(et,z,xe)+j[2]:H<64?te(et,z,xe)+j[3]:V(et,z,xe)+j[4],X=(X=le(X|=0,Ie[H]))+ye|0,Le=ye,ye=xe,xe=le(z,10),z=et,et=X;X=de[1]+Ft+xe|0,de[1]=de[2]+vt+ye|0,de[2]=de[3]+ht+Le|0,de[3]=de[4]+Xe+et|0,de[4]=de[0]+Tt+z|0,de[0]=X},_doFinalize:function(){var G=this._data,W=G.words,H=8*this._nDataBytes,Me=8*G.sigBytes;W[Me>>>5]|=128<<24-Me%32,W[14+(Me+64>>>9<<4)]=16711935&(H<<8|H>>>24)|4278255360&(H<<24|H>>>8),G.sigBytes=4*(W.length+1),this._process();for(var q=this._hash,de=q.words,Te=0;Te<5;Te++){var j=de[Te];de[Te]=16711935&(j<<8|j>>>24)|4278255360&(j<<24|j>>>8)}return q},clone:function(){var G=S.clone.call(this);return G._hash=this._hash.clone(),G}});function V(G,W,H){return G^W^H}function te(G,W,H){return G&W|~G&H}function U(G,W,H){return(G|~W)^H}function K(G,W,H){return G&H|W&~H}function ce(G,W,H){return G^(W|~H)}function le(G,W){return G<>>32-W}l.RIPEMD160=S._createHelper(w),l.HmacRIPEMD160=S._createHmacHelper(w)}(Math),n.RIPEMD160)},5162:function(rt,B,a){var r,l,u,o,E,d,n;rt.exports=(n=a(7585),u=(l=(r=n).lib).WordArray,E=[],d=r.algo.SHA1=(o=l.Hasher).extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(v,y){for(var _=this._hash.words,g=_[0],C=_[1],w=_[2],V=_[3],te=_[4],U=0;U<80;U++){if(U<16)E[U]=0|v[y+U];else{var K=E[U-3]^E[U-8]^E[U-14]^E[U-16];E[U]=K<<1|K>>>31}var ce=(g<<5|g>>>27)+te+E[U];ce+=U<20?1518500249+(C&w|~C&V):U<40?1859775393+(C^w^V):U<60?(C&w|C&V|w&V)-1894007588:(C^w^V)-899497514,te=V,V=w,w=C<<30|C>>>2,C=g,g=ce}_[0]=_[0]+g|0,_[1]=_[1]+C|0,_[2]=_[2]+w|0,_[3]=_[3]+V|0,_[4]=_[4]+te|0},_doFinalize:function(){var v=this._data,y=v.words,_=8*this._nDataBytes,g=8*v.sigBytes;return y[g>>>5]|=128<<24-g%32,y[14+(g+64>>>9<<4)]=Math.floor(_/4294967296),y[15+(g+64>>>9<<4)]=_,v.sigBytes=4*y.length,this._process(),this._hash},clone:function(){var v=o.clone.call(this);return v._hash=this._hash.clone(),v}}),r.SHA1=o._createHelper(d),r.HmacSHA1=o._createHmacHelper(d),n.SHA1)},8769:function(rt,B,a){var r,u,o,S,E,n;rt.exports=(n=a(7585),a(1817),u=(r=n).lib.WordArray,E=(o=r.algo).SHA224=(S=o.SHA256).extend({_doReset:function(){this._hash=new u.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var d=S._doFinalize.call(this);return d.sigBytes-=4,d}}),r.SHA224=S._createHelper(E),r.HmacSHA224=S._createHmacHelper(E),n.SHA224)},1817:function(rt,B,a){var n;rt.exports=(n=a(7585),function(r){var l=n,u=l.lib,o=u.WordArray,S=u.Hasher,E=l.algo,d=[],v=[];!function(){function g(te){for(var U=r.sqrt(te),K=2;K<=U;K++)if(!(te%K))return!1;return!0}function C(te){return 4294967296*(te-(0|te))|0}for(var w=2,V=0;V<64;)g(w)&&(V<8&&(d[V]=C(r.pow(w,.5))),v[V]=C(r.pow(w,1/3)),V++),w++}();var y=[],_=E.SHA256=S.extend({_doReset:function(){this._hash=new o.init(d.slice(0))},_doProcessBlock:function(g,C){for(var w=this._hash.words,V=w[0],te=w[1],U=w[2],K=w[3],ce=w[4],le=w[5],G=w[6],W=w[7],H=0;H<64;H++){if(H<16)y[H]=0|g[C+H];else{var Me=y[H-15],de=y[H-2];y[H]=((Me<<25|Me>>>7)^(Me<<14|Me>>>18)^Me>>>3)+y[H-7]+((de<<15|de>>>17)^(de<<13|de>>>19)^de>>>10)+y[H-16]}var ne=V&te^V&U^te&U,Ie=W+((ce<<26|ce>>>6)^(ce<<21|ce>>>11)^(ce<<7|ce>>>25))+(ce&le^~ce&G)+v[H]+y[H];W=G,G=le,le=ce,ce=K+Ie|0,K=U,U=te,te=V,V=Ie+(((V<<30|V>>>2)^(V<<19|V>>>13)^(V<<10|V>>>22))+ne)|0}w[0]=w[0]+V|0,w[1]=w[1]+te|0,w[2]=w[2]+U|0,w[3]=w[3]+K|0,w[4]=w[4]+ce|0,w[5]=w[5]+le|0,w[6]=w[6]+G|0,w[7]=w[7]+W|0},_doFinalize:function(){var g=this._data,C=g.words,w=8*this._nDataBytes,V=8*g.sigBytes;return C[V>>>5]|=128<<24-V%32,C[14+(V+64>>>9<<4)]=r.floor(w/4294967296),C[15+(V+64>>>9<<4)]=w,g.sigBytes=4*C.length,this._process(),this._hash},clone:function(){var g=S.clone.call(this);return g._hash=this._hash.clone(),g}});l.SHA256=S._createHelper(_),l.HmacSHA256=S._createHmacHelper(_)}(Math),n.SHA256)},1971:function(rt,B,a){var n;rt.exports=(n=a(7585),a(401),function(r){var l=n,u=l.lib,o=u.WordArray,S=u.Hasher,d=l.x64.Word,v=l.algo,y=[],_=[],g=[];!function(){for(var V=1,te=0,U=0;U<24;U++){y[V+5*te]=(U+1)*(U+2)/2%64;var ce=(2*V+3*te)%5;V=te%5,te=ce}for(V=0;V<5;V++)for(te=0;te<5;te++)_[V+5*te]=te+(2*V+3*te)%5*5;for(var le=1,G=0;G<24;G++){for(var W=0,H=0,Me=0;Me<7;Me++){if(1&le){var q=(1<>>24)|4278255360&(le<<24|le>>>8),(W=U[ce]).high^=G=16711935&(G<<8|G>>>24)|4278255360&(G<<24|G>>>8),W.low^=le}for(var H=0;H<24;H++){for(var Me=0;Me<5;Me++){for(var q=0,de=0,Te=0;Te<5;Te++)q^=(W=U[Me+5*Te]).high,de^=W.low;var j=C[Me];j.high=q,j.low=de}for(Me=0;Me<5;Me++){var ne=C[(Me+4)%5],Z=C[(Me+1)%5],he=Z.high,Ie=Z.low;for(q=ne.high^(he<<1|Ie>>>31),de=ne.low^(Ie<<1|he>>>31),Te=0;Te<5;Te++)(W=U[Me+5*Te]).high^=q,W.low^=de}for(var Xe=1;Xe<25;Xe++){var Tt=(W=U[Xe]).high,Ft=W.low,vt=y[Xe];vt<32?(q=Tt<>>32-vt,de=Ft<>>32-vt):(q=Ft<>>64-vt,de=Tt<>>64-vt);var ht=C[_[Xe]];ht.high=q,ht.low=de}var Le=C[0],et=U[0];for(Le.high=et.high,Le.low=et.low,Me=0;Me<5;Me++)for(Te=0;Te<5;Te++){var z=C[Xe=Me+5*Te],xe=C[(Me+1)%5+5*Te],ye=C[(Me+2)%5+5*Te];(W=U[Xe]).high=z.high^~xe.high&ye.high,W.low=z.low^~xe.low&ye.low}var W,X=g[H];(W=U[0]).high^=X.high,W.low^=X.low}},_doFinalize:function(){var V=this._data,te=V.words,K=8*V.sigBytes,ce=32*this.blockSize;te[K>>>5]|=1<<24-K%32,te[(r.ceil((K+1)/ce)*ce>>>5)-1]|=128,V.sigBytes=4*te.length,this._process();for(var le=this._state,G=this.cfg.outputLength/8,W=G/8,H=[],Me=0;Me>>24)|4278255360&(de<<24|de>>>8),H.push(Te=16711935&(Te<<8|Te>>>24)|4278255360&(Te<<24|Te>>>8)),H.push(de)}return new o.init(H,G)},clone:function(){for(var V=S.clone.call(this),te=V._state=this._state.slice(0),U=0;U<25;U++)te[U]=te[U].clone();return V}});l.SHA3=S._createHelper(w),l.HmacSHA3=S._createHmacHelper(w)}(Math),n.SHA3)},6787:function(rt,B,a){var r,l,u,o,S,E,d,n;rt.exports=(n=a(7585),a(401),a(3351),u=(l=(r=n).x64).Word,o=l.WordArray,d=(S=r.algo).SHA384=(E=S.SHA512).extend({_doReset:function(){this._hash=new o.init([new u.init(3418070365,3238371032),new u.init(1654270250,914150663),new u.init(2438529370,812702999),new u.init(355462360,4144912697),new u.init(1731405415,4290775857),new u.init(2394180231,1750603025),new u.init(3675008525,1694076839),new u.init(1203062813,3204075428)])},_doFinalize:function(){var v=E._doFinalize.call(this);return v.sigBytes-=16,v}}),r.SHA384=E._createHelper(d),r.HmacSHA384=E._createHmacHelper(d),n.SHA384)},3351:function(rt,B,a){var n;rt.exports=(n=a(7585),a(401),function(){var r=n,u=r.lib.Hasher,o=r.x64,S=o.Word,E=o.WordArray,d=r.algo;function v(){return S.create.apply(S,arguments)}var y=[v(1116352408,3609767458),v(1899447441,602891725),v(3049323471,3964484399),v(3921009573,2173295548),v(961987163,4081628472),v(1508970993,3053834265),v(2453635748,2937671579),v(2870763221,3664609560),v(3624381080,2734883394),v(310598401,1164996542),v(607225278,1323610764),v(1426881987,3590304994),v(1925078388,4068182383),v(2162078206,991336113),v(2614888103,633803317),v(3248222580,3479774868),v(3835390401,2666613458),v(4022224774,944711139),v(264347078,2341262773),v(604807628,2007800933),v(770255983,1495990901),v(1249150122,1856431235),v(1555081692,3175218132),v(1996064986,2198950837),v(2554220882,3999719339),v(2821834349,766784016),v(2952996808,2566594879),v(3210313671,3203337956),v(3336571891,1034457026),v(3584528711,2466948901),v(113926993,3758326383),v(338241895,168717936),v(666307205,1188179964),v(773529912,1546045734),v(1294757372,1522805485),v(1396182291,2643833823),v(1695183700,2343527390),v(1986661051,1014477480),v(2177026350,1206759142),v(2456956037,344077627),v(2730485921,1290863460),v(2820302411,3158454273),v(3259730800,3505952657),v(3345764771,106217008),v(3516065817,3606008344),v(3600352804,1432725776),v(4094571909,1467031594),v(275423344,851169720),v(430227734,3100823752),v(506948616,1363258195),v(659060556,3750685593),v(883997877,3785050280),v(958139571,3318307427),v(1322822218,3812723403),v(1537002063,2003034995),v(1747873779,3602036899),v(1955562222,1575990012),v(2024104815,1125592928),v(2227730452,2716904306),v(2361852424,442776044),v(2428436474,593698344),v(2756734187,3733110249),v(3204031479,2999351573),v(3329325298,3815920427),v(3391569614,3928383900),v(3515267271,566280711),v(3940187606,3454069534),v(4118630271,4000239992),v(116418474,1914138554),v(174292421,2731055270),v(289380356,3203993006),v(460393269,320620315),v(685471733,587496836),v(852142971,1086792851),v(1017036298,365543100),v(1126000580,2618297676),v(1288033470,3409855158),v(1501505948,4234509866),v(1607167915,987167468),v(1816402316,1246189591)],_=[];!function(){for(var C=0;C<80;C++)_[C]=v()}();var g=d.SHA512=u.extend({_doReset:function(){this._hash=new E.init([new S.init(1779033703,4089235720),new S.init(3144134277,2227873595),new S.init(1013904242,4271175723),new S.init(2773480762,1595750129),new S.init(1359893119,2917565137),new S.init(2600822924,725511199),new S.init(528734635,4215389547),new S.init(1541459225,327033209)])},_doProcessBlock:function(C,w){for(var V=this._hash.words,te=V[0],U=V[1],K=V[2],ce=V[3],le=V[4],G=V[5],W=V[6],H=V[7],Me=te.high,q=te.low,de=U.high,Te=U.low,j=K.high,ne=K.low,Z=ce.high,he=ce.low,Ie=le.high,Xe=le.low,Tt=G.high,Ft=G.low,vt=W.high,ht=W.low,Le=H.high,et=H.low,z=Me,xe=q,ye=de,X=Te,ze=j,re=ne,He=Z,_e=he,I=Ie,L=Xe,ke=Tt,at=Ft,Bt=vt,jt=ht,Ht=Le,St=et,ve=0;ve<80;ve++){var M,N,F=_[ve];if(ve<16)N=F.high=0|C[w+2*ve],M=F.low=0|C[w+2*ve+1];else{var ue=_[ve-15],Be=ue.high,lt=ue.low,be=(lt>>>1|Be<<31)^(lt>>>8|Be<<24)^(lt>>>7|Be<<25),R=_[ve-2],$=R.high,Ke=R.low,Ot=(Ke>>>19|$<<13)^(Ke<<3|$>>>29)^(Ke>>>6|$<<26),Nt=_[ve-7],zt=_[ve-16],ct=zt.low;F.high=N=(N=(N=((Be>>>1|lt<<31)^(Be>>>8|lt<<24)^Be>>>7)+Nt.high+((M=be+Nt.low)>>>0>>0?1:0))+(($>>>19|Ke<<13)^($<<3|Ke>>>29)^$>>>6)+((M+=Ot)>>>0>>0?1:0))+zt.high+((M+=ct)>>>0>>0?1:0),F.low=M}var ft,pe=I&ke^~I&Bt,oe=L&at^~L&jt,Q=z&ye^z&ze^ye&ze,Ce=(xe>>>28|z<<4)^(xe<<30|z>>>2)^(xe<<25|z>>>7),xt=y[ve],hn=xt.low,gt=Ht+((I>>>14|L<<18)^(I>>>18|L<<14)^(I<<23|L>>>9))+((ft=St+((L>>>14|I<<18)^(L>>>18|I<<14)^(L<<23|I>>>9)))>>>0>>0?1:0),nt=Ce+(xe&X^xe&re^X&re);Ht=Bt,St=jt,Bt=ke,jt=at,ke=I,at=L,I=He+(gt=(gt=(gt=gt+pe+((ft+=oe)>>>0>>0?1:0))+xt.high+((ft+=hn)>>>0>>0?1:0))+N+((ft+=M)>>>0>>0?1:0))+((L=_e+ft|0)>>>0<_e>>>0?1:0)|0,He=ze,_e=re,ze=ye,re=X,ye=z,X=xe,z=gt+(((z>>>28|xe<<4)^(z<<30|xe>>>2)^(z<<25|xe>>>7))+Q+(nt>>>0>>0?1:0))+((xe=ft+nt|0)>>>0>>0?1:0)|0}q=te.low=q+xe,te.high=Me+z+(q>>>0>>0?1:0),Te=U.low=Te+X,U.high=de+ye+(Te>>>0>>0?1:0),ne=K.low=ne+re,K.high=j+ze+(ne>>>0>>0?1:0),he=ce.low=he+_e,ce.high=Z+He+(he>>>0<_e>>>0?1:0),Xe=le.low=Xe+L,le.high=Ie+I+(Xe>>>0>>0?1:0),Ft=G.low=Ft+at,G.high=Tt+ke+(Ft>>>0>>0?1:0),ht=W.low=ht+jt,W.high=vt+Bt+(ht>>>0>>0?1:0),et=H.low=et+St,H.high=Le+Ht+(et>>>0>>0?1:0)},_doFinalize:function(){var C=this._data,w=C.words,V=8*this._nDataBytes,te=8*C.sigBytes;return w[te>>>5]|=128<<24-te%32,w[30+(te+128>>>10<<5)]=Math.floor(V/4294967296),w[31+(te+128>>>10<<5)]=V,C.sigBytes=4*w.length,this._process(),this._hash.toX32()},clone:function(){var C=u.clone.call(this);return C._hash=this._hash.clone(),C},blockSize:32});r.SHA512=u._createHelper(g),r.HmacSHA512=u._createHmacHelper(g)}(),n.SHA512)},7243:function(rt,B,a){var n;rt.exports=(n=a(7585),a(8319),a(9493),a(7865),a(3057),function(){var r=n,l=r.lib,u=l.WordArray,o=l.BlockCipher,S=r.algo,E=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],d=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],v=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],y=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],_=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=S.DES=o.extend({_doReset:function(){for(var U=this._key.words,K=[],ce=0;ce<56;ce++){var le=E[ce]-1;K[ce]=U[le>>>5]>>>31-le%32&1}for(var G=this._subKeys=[],W=0;W<16;W++){var H=G[W]=[],Me=v[W];for(ce=0;ce<24;ce++)H[ce/6|0]|=K[(d[ce]-1+Me)%28]<<31-ce%6,H[4+(ce/6|0)]|=K[28+(d[ce+24]-1+Me)%28]<<31-ce%6;for(H[0]=H[0]<<1|H[0]>>>31,ce=1;ce<7;ce++)H[ce]=H[ce]>>>4*(ce-1)+3;H[7]=H[7]<<5|H[7]>>>27}var q=this._invSubKeys=[];for(ce=0;ce<16;ce++)q[ce]=G[15-ce]},encryptBlock:function(te,U){this._doCryptBlock(te,U,this._subKeys)},decryptBlock:function(te,U){this._doCryptBlock(te,U,this._invSubKeys)},_doCryptBlock:function(te,U,K){this._lBlock=te[U],this._rBlock=te[U+1],C.call(this,4,252645135),C.call(this,16,65535),w.call(this,2,858993459),w.call(this,8,16711935),C.call(this,1,1431655765);for(var ce=0;ce<16;ce++){for(var le=K[ce],G=this._lBlock,W=this._rBlock,H=0,Me=0;Me<8;Me++)H|=y[Me][((W^le[Me])&_[Me])>>>0];this._lBlock=W,this._rBlock=G^H}var q=this._lBlock;this._lBlock=this._rBlock,this._rBlock=q,C.call(this,1,1431655765),w.call(this,8,16711935),w.call(this,2,858993459),C.call(this,16,65535),C.call(this,4,252645135),te[U]=this._lBlock,te[U+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function C(te,U){var K=(this._lBlock>>>te^this._rBlock)&U;this._rBlock^=K,this._lBlock^=K<>>te^this._lBlock)&U;this._lBlock^=K,this._rBlock^=K<192.");var K=U.slice(0,2),ce=U.length<4?U.slice(0,2):U.slice(2,4),le=U.length<6?U.slice(0,2):U.slice(4,6);this._des1=g.createEncryptor(u.create(K)),this._des2=g.createEncryptor(u.create(ce)),this._des3=g.createEncryptor(u.create(le))},encryptBlock:function(te,U){this._des1.encryptBlock(te,U),this._des2.decryptBlock(te,U),this._des3.encryptBlock(te,U)},decryptBlock:function(te,U){this._des3.decryptBlock(te,U),this._des2.encryptBlock(te,U),this._des1.decryptBlock(te,U)},keySize:6,ivSize:2,blockSize:2});r.TripleDES=o._createHelper(V)}(),n.TripleDES)},401:function(rt,B,a){var u,o,S,E,n;rt.exports=(n=a(7585),o=(u=n.lib).Base,S=u.WordArray,(E=n.x64={}).Word=o.extend({init:function(y,_){this.high=y,this.low=_}}),E.WordArray=o.extend({init:function(y,_){y=this.words=y||[],this.sigBytes=null!=_?_:8*y.length},toX32:function(){for(var y=this.words,_=y.length,g=[],C=0;C<_;C++){var w=y[C];g.push(w.high),g.push(w.low)}return S.create(g,this.sigBytes)},clone:function(){for(var y=o.clone.call(this),_=y.words=this.words.slice(0),g=_.length,C=0;C{rt.exports="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},7410:(rt,B,a)=>{rt.exports=a(3213),rt.exports.parser=a(552)},3213:(rt,B,a)=>{var n=a(1497),r=a(1264),l=a(2534)("engine.io-client:socket"),u=a(4068),o=a(552),S=a(1884),E=a(3257);function d(y,_){if(!(this instanceof d))return new d(y,_);_=_||{},y&&"object"==typeof y&&(_=y,y=null),y?(y=S(y),_.hostname=y.host,_.secure="https"===y.protocol||"wss"===y.protocol,_.port=y.port,y.query&&(_.query=y.query)):_.host&&(_.hostname=S(_.host).host),this.secure=null!=_.secure?_.secure:"undefined"!=typeof location&&"https:"===location.protocol,_.hostname&&!_.port&&(_.port=this.secure?"443":"80"),this.agent=_.agent||!1,this.hostname=_.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=_.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=_.query||{},"string"==typeof this.query&&(this.query=E.decode(this.query)),this.upgrade=!1!==_.upgrade,this.path=(_.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!_.forceJSONP,this.jsonp=!1!==_.jsonp,this.forceBase64=!!_.forceBase64,this.enablesXDR=!!_.enablesXDR,this.withCredentials=!1!==_.withCredentials,this.timestampParam=_.timestampParam||"t",this.timestampRequests=_.timestampRequests,this.transports=_.transports||["polling","websocket"],this.transportOptions=_.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=_.policyPort||843,this.rememberUpgrade=_.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=_.onlyBinaryUpgrades,this.perMessageDeflate=!1!==_.perMessageDeflate&&(_.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=_.pfx||void 0,this.key=_.key||void 0,this.passphrase=_.passphrase||void 0,this.cert=_.cert||void 0,this.ca=_.ca||void 0,this.ciphers=_.ciphers||void 0,this.rejectUnauthorized=void 0===_.rejectUnauthorized||_.rejectUnauthorized,this.forceNode=!!_.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(_.extraHeaders&&Object.keys(_.extraHeaders).length>0&&(this.extraHeaders=_.extraHeaders),_.localAddress&&(this.localAddress=_.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}rt.exports=d,d.priorWebsocketSuccess=!1,r(d.prototype),d.protocol=o.protocol,d.Socket=d,d.Transport=a(3330),d.transports=a(1497),d.parser=a(552),d.prototype.createTransport=function(y){l('creating transport "%s"',y);var _=function v(y){var _={};for(var g in y)y.hasOwnProperty(g)&&(_[g]=y[g]);return _}(this.query);_.EIO=o.protocol,_.transport=y;var g=this.transportOptions[y]||{};return this.id&&(_.sid=this.id),new n[y]({query:_,socket:this,agent:g.agent||this.agent,hostname:g.hostname||this.hostname,port:g.port||this.port,secure:g.secure||this.secure,path:g.path||this.path,forceJSONP:g.forceJSONP||this.forceJSONP,jsonp:g.jsonp||this.jsonp,forceBase64:g.forceBase64||this.forceBase64,enablesXDR:g.enablesXDR||this.enablesXDR,withCredentials:g.withCredentials||this.withCredentials,timestampRequests:g.timestampRequests||this.timestampRequests,timestampParam:g.timestampParam||this.timestampParam,policyPort:g.policyPort||this.policyPort,pfx:g.pfx||this.pfx,key:g.key||this.key,passphrase:g.passphrase||this.passphrase,cert:g.cert||this.cert,ca:g.ca||this.ca,ciphers:g.ciphers||this.ciphers,rejectUnauthorized:g.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:g.perMessageDeflate||this.perMessageDeflate,extraHeaders:g.extraHeaders||this.extraHeaders,forceNode:g.forceNode||this.forceNode,localAddress:g.localAddress||this.localAddress,requestTimeout:g.requestTimeout||this.requestTimeout,protocols:g.protocols||void 0,isReactNative:this.isReactNative})},d.prototype.open=function(){var y;if(this.rememberUpgrade&&d.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))y="websocket";else{if(0===this.transports.length){var _=this;return void setTimeout(function(){_.emit("error","No transports available")},0)}y=this.transports[0]}this.readyState="opening";try{y=this.createTransport(y)}catch(g){return this.transports.shift(),void this.open()}y.open(),this.setTransport(y)},d.prototype.setTransport=function(y){l("setting transport %s",y.name);var _=this;this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=y,y.on("drain",function(){_.onDrain()}).on("packet",function(g){_.onPacket(g)}).on("error",function(g){_.onError(g)}).on("close",function(){_.onClose("transport close")})},d.prototype.probe=function(y){l('probing transport "%s"',y);var _=this.createTransport(y,{probe:1}),g=!1,C=this;function w(){C.onlyBinaryUpgrades&&(g=g||!this.supportsBinary&&C.transport.supportsBinary),g||(l('probe transport "%s" opened',y),_.send([{type:"ping",data:"probe"}]),_.once("packet",function(W){if(!g)if("pong"===W.type&&"probe"===W.data){if(l('probe transport "%s" pong',y),C.upgrading=!0,C.emit("upgrading",_),!_)return;d.priorWebsocketSuccess="websocket"===_.name,l('pausing current transport "%s"',C.transport.name),C.transport.pause(function(){g||"closed"!==C.readyState&&(l("changing transport and sending upgrade packet"),le(),C.setTransport(_),_.send([{type:"upgrade"}]),C.emit("upgrade",_),_=null,C.upgrading=!1,C.flush())})}else{l('probe transport "%s" failed',y);var H=new Error("probe error");H.transport=_.name,C.emit("upgradeError",H)}}))}function V(){g||(g=!0,le(),_.close(),_=null)}function te(G){var W=new Error("probe error: "+G);W.transport=_.name,V(),l('probe transport "%s" failed because of error: %s',y,G),C.emit("upgradeError",W)}function U(){te("transport closed")}function K(){te("socket closed")}function ce(G){_&&G.name!==_.name&&(l('"%s" works - aborting "%s"',G.name,_.name),V())}function le(){_.removeListener("open",w),_.removeListener("error",te),_.removeListener("close",U),C.removeListener("close",K),C.removeListener("upgrading",ce)}d.priorWebsocketSuccess=!1,_.once("open",w),_.once("error",te),_.once("close",U),this.once("close",K),this.once("upgrading",ce),_.open()},d.prototype.onOpen=function(){if(l("socket open"),this.readyState="open",d.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){l("starting upgrade probes");for(var y=0,_=this.upgrades.length;y<_;y++)this.probe(this.upgrades[y])}},d.prototype.onPacket=function(y){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(l('socket receive: type "%s", data "%s"',y.type,y.data),this.emit("packet",y),this.emit("heartbeat"),y.type){case"open":this.onHandshake(JSON.parse(y.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var _=new Error("server error");_.code=y.data,this.onError(_);break;case"message":this.emit("data",y.data),this.emit("message",y.data)}else l('packet received with socket readyState "%s"',this.readyState)},d.prototype.onHandshake=function(y){this.emit("handshake",y),this.id=y.sid,this.transport.query.sid=y.sid,this.upgrades=this.filterUpgrades(y.upgrades),this.pingInterval=y.pingInterval,this.pingTimeout=y.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},d.prototype.onHeartbeat=function(y){clearTimeout(this.pingTimeoutTimer);var _=this;_.pingTimeoutTimer=setTimeout(function(){"closed"!==_.readyState&&_.onClose("ping timeout")},y||_.pingInterval+_.pingTimeout)},d.prototype.setPing=function(){var y=this;clearTimeout(y.pingIntervalTimer),y.pingIntervalTimer=setTimeout(function(){l("writing ping packet - expecting pong within %sms",y.pingTimeout),y.ping(),y.onHeartbeat(y.pingTimeout)},y.pingInterval)},d.prototype.ping=function(){var y=this;this.sendPacket("ping",function(){y.emit("ping")})},d.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},d.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(l("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},d.prototype.write=d.prototype.send=function(y,_,g){return this.sendPacket("message",y,_,g),this},d.prototype.sendPacket=function(y,_,g,C){if("function"==typeof _&&(C=_,_=void 0),"function"==typeof g&&(C=g,g=null),"closing"!==this.readyState&&"closed"!==this.readyState){(g=g||{}).compress=!1!==g.compress;var w={type:y,data:_,options:g};this.emit("packetCreate",w),this.writeBuffer.push(w),C&&this.once("flush",C),this.flush()}},d.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var y=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?C():_()}):this.upgrading?C():_()}function _(){y.onClose("forced close"),l("socket closing - telling transport to close"),y.transport.close()}function g(){y.removeListener("upgrade",g),y.removeListener("upgradeError",g),_()}function C(){y.once("upgrade",g),y.once("upgradeError",g)}return this},d.prototype.onError=function(y){l("socket error %j",y),d.priorWebsocketSuccess=!1,this.emit("error",y),this.onClose("transport error",y)},d.prototype.onClose=function(y,_){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(l('socket close with reason: "%s"',y),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",y,_),this.writeBuffer=[],this.prevBufferLen=0)},d.prototype.filterUpgrades=function(y){for(var _=[],g=0,C=y.length;g{var n=a(552),r=a(1264);function l(u){this.path=u.path,this.hostname=u.hostname,this.port=u.port,this.secure=u.secure,this.query=u.query,this.timestampParam=u.timestampParam,this.timestampRequests=u.timestampRequests,this.readyState="",this.agent=u.agent||!1,this.socket=u.socket,this.enablesXDR=u.enablesXDR,this.withCredentials=u.withCredentials,this.pfx=u.pfx,this.key=u.key,this.passphrase=u.passphrase,this.cert=u.cert,this.ca=u.ca,this.ciphers=u.ciphers,this.rejectUnauthorized=u.rejectUnauthorized,this.forceNode=u.forceNode,this.isReactNative=u.isReactNative,this.extraHeaders=u.extraHeaders,this.localAddress=u.localAddress}rt.exports=l,r(l.prototype),l.prototype.onError=function(u,o){var S=new Error(u);return S.type="TransportError",S.description=o,this.emit("error",S),this},l.prototype.open=function(){return("closed"===this.readyState||""===this.readyState)&&(this.readyState="opening",this.doOpen()),this},l.prototype.close=function(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this},l.prototype.send=function(u){if("open"!==this.readyState)throw new Error("Transport not open");this.write(u)},l.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},l.prototype.onData=function(u){var o=n.decodePacket(u,this.socket.binaryType);this.onPacket(o)},l.prototype.onPacket=function(u){this.emit("packet",u)},l.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},1497:(rt,B,a)=>{var n=a(3035),r=a(2889),l=a(6029),u=a(3909);B.polling=function o(S){var d=!1,v=!1,y=!1!==S.jsonp;if("undefined"!=typeof location){var _="https:"===location.protocol,g=location.port;g||(g=_?443:80),d=S.hostname!==location.hostname||g!==S.port,v=S.secure!==_}if(S.xdomain=d,S.xscheme=v,"open"in new n(S)&&!S.forceJSONP)return new r(S);if(!y)throw new Error("JSONP disabled");return new l(S)},B.websocket=u},6029:(rt,B,a)=>{var n=a(3904),r=a(9471),l=a(851);rt.exports=d;var S,u=/\n/g,o=/\\n/g;function E(){}function d(v){n.call(this,v),this.query=this.query||{},S||(S=l.___eio=l.___eio||[]),this.index=S.length;var y=this;S.push(function(_){y.onData(_)}),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",function(){y.script&&(y.script.onerror=E)},!1)}r(d,n),d.prototype.supportsBinary=!1,d.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},d.prototype.doPoll=function(){var v=this,y=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),y.async=!0,y.src=this.uri(),y.onerror=function(C){v.onError("jsonp poll error",C)};var _=document.getElementsByTagName("script")[0];_?_.parentNode.insertBefore(y,_):(document.head||document.body).appendChild(y),this.script=y,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var C=document.createElement("iframe");document.body.appendChild(C),document.body.removeChild(C)},100)},d.prototype.doWrite=function(v,y){var _=this;if(!this.form){var V,g=document.createElement("form"),C=document.createElement("textarea"),w=this.iframeId="eio_iframe_"+this.index;g.className="socketio",g.style.position="absolute",g.style.top="-1000px",g.style.left="-1000px",g.target=w,g.method="POST",g.setAttribute("accept-charset","utf-8"),C.name="d",g.appendChild(C),document.body.appendChild(g),this.form=g,this.area=C}function te(){U(),y()}function U(){if(_.iframe)try{_.form.removeChild(_.iframe)}catch(ce){_.onError("jsonp polling iframe removal error",ce)}try{V=document.createElement('