PageSourceSearch

https://aptos-livepeer-nft-dapp.vercel.app/_next/static/chunks/pages/_app-a98c674208fe5a91.js

js aptos-livepeer-nft-dapp.vercel.app collected 2026-10-03 06:06:59 UTC 900,755 bytes, 173 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{2834:function(e,t,r){"use strict";r.d(t,{L:function(){return p},Q:function(){return f},_:function(){return h},a:function(){return l},b:function(){return s},u:function(){return a}});var n=r(8897),i=r(7294),s=["cacheTime","enabled","networkMode","initialData","initialDataUpdatedAt","isDataEqual","keepPreviousData","meta","notifyOnChangeProps","onError","onSettled","onSuccess","placeholderData","refetchInterval","refetchIntervalInBackground","refetchOnMount","refetchOnReconnect","refetchOnWindowFocus","retry","retryOnMount","retryDelay","select","staleTime","structuralSharing","suspense","useErrorBoundary"];function a(e){var t=(0,n.useQuery)(e),r=t.data,s=t.dataUpdatedAt,a=t.error,o=t.errorUpdatedAt,u=t.failureCount,l=t.isError,c=t.isFetched,h=t.isFetchedAfterMount,d=t.isFetching,f=t.isPaused,p=t.isLoadingError,g=t.isPlaceholderData,v=t.isPreviousData,y=t.isRefetchError,m=t.isRefetching,b=t.isStale,E=t.isSuccess,S=t.refetch,T=t.remove,w=t.status,A=t.fetchStatus,x=(0,i.useMemo)(function(){return"loading"===w&&"idle"===A?"idle":w},[w,A]),_=(0,i.useMemo)(function(){return"idle"===x},[x]),R=(0,i.useMemo)(function(){return"loading"===x&&"fetching"===A},[x,A]);return{data:r,error:a,isError:l,isFetched:c,isFetching:d,isIdle:_,isLoading:R,isRefetching:m,isSuccess:E,refetch:S,status:x,internal:{fetchStatus:A,dataUpdatedAt:s,errorUpdatedAt:o,failureCount:u,isFetchedAfterMount:h,isLoadingError:p,isPaused:f,isPlaceholderData:g,isPreviousData:v,isRefetchError:y,isStale:b,remove:T}}}var o=i.createContext(null),u=function(e){var t=e.theme,r=e.children;return i.createElement(o.Provider,{value:null!=t?t:null},r)};function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ l=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(u){o=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,s,a,o,u=Object.create((t&&t.prototype instanceof f?t:f).prototype),l=new x(n||[]);return u._invoke=(a=l,o="suspendedStart",function(t,n){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===t)throw n;return R()}for(a.method=t,a.arg=n;;){var i=a.delegate;if(i){var s=T(i,a);if(s){if(s===d)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===o)throw o="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o="executing";var u=h(e,r,a);if("normal"===u.type){if(o=a.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(o="completed",a.method="throw",a.arg=u.arg)}}),u}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}e.wrap=c;var d={};function f(){}function p(){}function g(){}var v={};o(v,i,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(_([])));m&&m!==t&&r.call(m,i)&&(v=m);var b=g.prototype=f.prototype=Object.create(v);function E(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;this._invoke=function(i,s){function a(){return new t(function(n,a){!function n(i,s,a,o){var u=h(e[i],e,s);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){n("next",e,a,o)},function(e){n("throw",e,a,o)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return n("throw",e,a,o)})}o(u.arg)}(i,s,n,a)})}return n=n?n.then(a,a):a()}}function T(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method))return d;t.method="throw",t.arg=TypeError("The iterator does not provide a 'throw' method")}return d}var n=h(r,e.iterator,t.arg);
1if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=TypeError("iterator result is not an object"),t.delegate=null,d)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return s.next=s}}return{next:R}}function R(){return{value:void 0,done:!0}}return p.prototype=g,o(b,"constructor",g),o(g,"constructor",p),p.displayName=o(g,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,o(e,a,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},E(S.prototype),o(S.prototype,s,function(){return this}),e.AsyncIterator=S,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var a=new S(c(t,r,n,i),s);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},E(b),o(b,a,"Generator"),o(b,i,function(){return this}),o(b,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var o=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(o&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(o){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function c(e,t,r,n,i,s,a){try{var o=e[s](a),u=o.value}catch(l){r(l);return}o.done?t(u):Promise.resolve(u).then(n,i)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function a(e){c(s,n,i,a,o,"next",e)}function o(e){c(s,n,i,a,o,"throw",e)}a(void 0)})}}var d=i.createContext(void 0),f=i.createContext(void 0);function p(e){var t=e.children,r=e.client,s=e.theme;return i.createElement(d.Provider,{value:r},i.createElement(n.QueryClientProvider,{context:f,client:r.queryClient},i.createElement(u,{theme:s},t)))}},5799:function(e,t,r){"use strict";r.d(t,{Rs:function(){return tZ},Gs:function(){return rg},A2:function(){return rv},RF:function(){return ry}});var n,i,s,a,o,u,l,c,h,d,f,p,g,v,y,m=r(3062);let b=e=>(t,r,n)=>{let i=n.subscribe;n.subscribe=(e,t,r)=>{let s=e;if(t){let a=(null==r?void 0:r.equalityFn)||Object.is,o=e(n.getState());s=r=>{let n=e(r);if(!a(o,n)){let i=o;t(o=n,i)}},(null==r?void 0:r.fireImmediately)&&t(o,o)}return i(s)};let s=e(t,r,n);return s},E=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>E(e)(r),catch(e){return this}}}catch(n){return{then(e){return this},catch:e=>E(e)(n)}}},S=(e,t)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>
1({...t,...e}),...t},a=!1,o=new Set,u=new Set,l;try{l=s.getStorage()}catch(c){}if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...e)},n,i);let h=E(s.serialize),d=()=>{let e=s.partialize({...n()}),t,r=h({state:e,version:s.version}).then(e=>l.setItem(s.name,e)).catch(e=>{t=e});if(t)throw t;return r},f=i.setState;i.setState=(e,t)=>{f(e,t),d()};let p=e((...e)=>{r(...e),d()},n,i),g,v=()=>{var e;if(!l)return;a=!1,o.forEach(e=>e(n()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,n()))||void 0;return E(l.getItem.bind(l))(s.name).then(e=>{if(e)return s.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return e.state;if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return g=s.merge(e,null!=(t=n())?t:p),r(g,!0),d()}).then(()=>{null==t||t(g,void 0),a=!0,u.forEach(e=>e(g))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions(e){s={...s,...e},e.getStorage&&(l=e.getStorage())},clearStorage(){null==l||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>a,onHydrate:e=>(o.add(e),()=>{o.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},v(),g||p},T=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(i!==t){let s=t;t=(null!=n?n:"object"!=typeof i)?i:Object.assign({},t,i),r.forEach(e=>e(t,s))}},i=()=>t,s=e=>(r.add(e),()=>r.delete(e)),a=()=>r.clear(),o={setState:n,getState:i,subscribe:s,destroy:a};return t=e(n,i,o),o},w=e=>e?T(e):T;r(2222);var A=r(3252);r(1539),r(8674),r(9653),r(6699),r(5827),r(4916),r(2023),r(9714);var x=r(7631),_=r.n(x);r(6992),r(3948),r(7941),r(8783),r(285),r(1637),r(3123),r(2772),r(5306);var R,O=r(4098),k=r.n(O),L="colors",C="sizes",I="space",D={gap:I,gridGap:I,columnGap:I,gridColumnGap:I,rowGap:I,gridRowGap:I,inset:I,insetBlock:I,insetBlockEnd:I,insetBlockStart:I,insetInline:I,insetInlineEnd:I,insetInlineStart:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockEnd:I,marginBlockStart:I,marginInline:I,marginInlineEnd:I,marginInlineStart:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockEnd:I,paddingBlockStart:I,paddingInline:I,paddingInlineEnd:I,paddingInlineStart:I,top:I,right:I,bottom:I,left:I,scrollMargin:I,scrollMarginTop:I,scrollMarginRight:I,scrollMarginBottom:I,scrollMarginLeft:I,scrollMarginX:I,scrollMarginY:I,scrollMarginBlock:I,scrollMarginBlockEnd:I,scrollMarginBlockStart:I,scrollMarginInline:I,scrollMarginInlineEnd:I,scrollMarginInlineStart:I,scrollPadding:I,scrollPaddingTop:I,scrollPaddingRight:I,scrollPaddingBottom:I,scrollPaddingLeft:I,scrollPaddingX:I,scrollPaddingY:I,scrollPaddingBlock:I,scrollPaddingBlockEnd:I,scrollPaddingBlockStart:I,scrollPaddingInline:I,scrollPaddingInlineEnd:I,scrollPaddingInlineStart:I,fontSize:"fontSizes",background:L,backgroundColor:L,backgroundImage:L,borderImage:L,border:L,borderBlock:L,borderBlockEnd:L,borderBlockStart:L,borderBottom:L,borderBottomColor:L,borderColor:L,borderInline:L,borderInlineEnd:L,borderInlineStart:L,borderLeft:L,borderLeftColor:L,borderRight:L,borderRightColor:L,borderTop:L,borderTopColor:L,caretColor:L,color:L,columnRuleColor:L,fill:L,outline:L,outlineColor:L,stroke:L,textDecorationColor:L,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:C,minBlockSize:C,maxBlockSize:C,inlineSize:C,minInlineSize:C,maxInlineSize:C,width:C,minWidth:C,maxWidth:C,height:C,minHeight:C,maxHeight:C,flexBasis:C,gridTemplateColumns:C,gridTemplateRows:C,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},P=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,M=()=>{let e=Object.create(null);return(t,r,...n)=>{let i=JSON.stringify(t,P);return i in e?e[i]:e[i]=r(t,...n)}},U=Symbol.for("sxs.internal"),F=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),B=e=>{for(let t in e)return!0;return!1},{hasOwnProperty:N}=Object.prototype,j=e=>e.includes("-")?e:e.replace(/[A-Z]/g,e=>
1"-"+e.toLowerCase()),q=/\s+(?![^()]*\))/,H=e=>t=>e(..."string"==typeof t?String(t).split(q):[t]),z={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:H((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:H((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:H((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:H((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:H((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:H((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},G=/([\d.]+)([^]*)/,K=(e,t)=>e.length?e.reduce((e,r)=>(e.push(...t.map(e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(e)?`:is(${r})`:r):r+" "+e)),e),[]):t,W=(e,t)=>e in V&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(t,r,n,i)=>r+("stretch"===n?`-moz-available${i};${j(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${j(e)}:${r}fit-content`)+i):String(t),V={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},$=e=>e?e+"-":"",Q=(e,t,r)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(e,n,i,s,a)=>"$"==s==!!i?e:(n||"--"==s?"calc(":"")+"var(--"+("$"===s?$(t)+(a.includes("$")?"":$(r))+a.replace(/\$/g,"-"):a)+")"+(n||"--"==s?"*"+(n||"")+(i||"1")+")":"")),Y=/\s*,\s*(?![^()]*\))/,X=Object.prototype.toString,J=(e,t,r,n,i)=>{let s,a,o,u=(e,t,r)=>{let l,c,h=e=>{var d,f;for(l in e){let p=64===l.charCodeAt(0),g=p&&Array.isArray(e[l])?e[l]:[e[l]];for(c of g){let v=/[A-Z]/.test(f=l)?f:f.replace(/-[^]/g,e=>e[1].toUpperCase()),y="object"==typeof c&&c&&c.toString===X&&(!n.utils[v]||!t.length);if(v in n.utils&&!y){let m=n.utils[v];if(m!==a){a=m,h(m(c)),a=null;continue}}else if(v in z){let b=z[v];if(b!==o){o=b,h(b(c)),o=null;continue}}if(p&&(l=(l.slice(1) in n.media?"@media "+n.media[l.slice(1)]:l).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(e,t,r,n,i,s)=>{let a=G.test(t),o=.0625*(a?-1:1),[u,l]=a?[n,t]:[t,n];return"("+("="===r[0]?"":">"===r[0]===a?"max-":"min-")+u+":"+("="!==r[0]&&1===r.length?l.replace(G,(e,t,n)=>Number(t)+o*(">"===r?1:-1)+n):l)+(i?") and ("+(">"===i[0]?"min-":"max-")+u+":"+(1===i.length?s.replace(G,(e,t,r)=>Number(t)+o*(">"===i?-1:1)+r):s):"")+")"})),y){let E=p?r.concat(l):[...r],S=p?[...t]:K(t,l.split(Y));void 0!==s&&i(Z(...s)),s=void 0,u(c,S,E)}else void 0===s&&(s=[[],t,r]),l=p||36!==l.charCodeAt(0)?l:`--${$(n.prefix)}${l.slice(1).replace(/\$/g,"-")}`,c=y?c:"number"==typeof c?c&&v in ee?String(c)+"px":String(c):Q(W(v,null==c?"":c),n.prefix,n.themeMap[v]),s[0].push(`${p?`${l} `:`${j(l)}:`}${c}`)}}};h(e),void 0!==s&&i(Z(...s)),s=void 0};u(e,t,r)},Z=(e,t,r)=>`${r.map(e=>`${e}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(r.length?r.length+1:0).join("}")}`,ee={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},et=e=>String.fromCharCode(e+(e>25?39:97)),er=e=>(e=>{let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=et(t%52)+r;return et(t%52)+r})(((e,t)=>{let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e})(5381,JSON.stringify(e))>>>0),en=["themed","global","styled","onevar","resonevar","allvar","inline"],ei=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(t){return!1}},es=e=>{let t,r=()=>{let{cssRules:e}=t.sheet;return[].map.call(e,(r,n)=>{let{cssText:i}=r,s="";if(i.startsWith("--sxs"))return"";if(e[n-1]&&(s=e[n-1].cssText).startsWith("--sxs")){if(!r.cssRules.length)return"";for(let a in t.rules)if(t.rules[a].group===r)return`--sxs{--sxs:${[...t.rules[a].cache].join(" ")}}${i}`;return r.cssRules.length?`${s}${i}`:""}return i}).join("")},n=()=>
1{if(t){let{rules:i,sheet:s}=t;if(!s.deleteRule){for(;3===Object(Object(s.cssRules)[0]).type;)s.cssRules.splice(0,1);s.cssRules=[]}for(let a in i)delete i[a]}let o=Object(e).styleSheets||[];for(let u of o)if(ei(u)){for(let l=0,c=u.cssRules;c[l];++l){let h=Object(c[l]);if(1!==h.type)continue;let d=Object(c[l+1]);if(4!==d.type)continue;++l;let{cssText:f}=h;if(!f.startsWith("--sxs"))continue;let p=f.slice(14,-3).trim().split(/\s+/),g=en[p[0]];g&&(t||(t={sheet:u,reset:n,rules:{},toString:r}),t.rules[g]={group:d,index:l,cache:new Set(p)})}if(t)break}if(!t){let v=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,v(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,e=>e.cssText).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:v("","text/css"),rules:{},reset:n,toString:r}}let{sheet:y,rules:m}=t;for(let b=en.length-1;b>=0;--b){let E=en[b];if(!m[E]){let S=en[b+1],T=m[S]?m[S].index:y.cssRules.length;y.insertRule("@media{}",T),y.insertRule(`--sxs{--sxs:${b}}`,T),m[E]={group:y.cssRules[T+1],index:T,cache:new Set([b])}}ea(m[E])}};return n(),t},ea=e=>{let t=e.group,r=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,r),++r}catch(n){}}},eo=Symbol(),eu=M(),el=(e,t)=>eu(e,()=>(...r)=>{let n={type:null,composers:new Set};for(let i of r)if(null!=i){if(i[U])for(let s of(null==n.type&&(n.type=i[U].type),i[U].composers))n.composers.add(s);else i.constructor!==Object||i.$$typeof?null==n.type&&(n.type=i):n.composers.add(ec(i,e))}return null==n.type&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),eh(e,n,t)}),ec=({variants:e,compoundVariants:t,defaultVariants:r,...n},i)=>{var s,a;let o=`${$(i.prefix)}c-${er(n)}`,u=[],l=[],c=Object.create(null),h=[];for(let d in r)c[d]=String(r[d]);if("object"==typeof e&&e)for(let f in e){s=c,a=f,N.call(s,a)||(c[f]="undefined");let p=e[f];for(let g in p){let v={[f]:String(g)};"undefined"===String(g)&&h.push(f);let y=p[g],m=[v,y,!B(y)];u.push(m)}}if("object"==typeof t&&t)for(let b of t){let{css:E,...S}=b;for(let T in E="object"==typeof E&&E||{},S)S[T]=String(S[T]);let w=[S,E,!B(E)];l.push(w)}return[o,n,u,l,c,h]},eh=(e,t,r)=>
1{let[n,i,s,a]=ed(t.composers),o="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let r=0;r<t[eo].length;r++){let[n,i]=t[eo][r];e.rules[n].apply(i)}return t[eo]=[],null}return t[eo]=[],t.rules={},en.forEach(e=>t.rules[e]={apply:r=>t[eo].push([e,r])}),t})(r):null,u=(o||r).rules,l=`.${n}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,c=c=>{c="object"==typeof c&&c||ep;let{css:h,...d}=c,f={};for(let p in s)if(delete d[p],p in c){let g=c[p];"object"==typeof g&&g?f[p]={"@initial":s[p],...g}:(g=String(g),f[p]="undefined"!==g||a.has(p)?g:s[p])}else f[p]=s[p];let v=new Set([...i]);for(let[y,m,b,E]of t.composers){r.rules.styled.cache.has(y)||(r.rules.styled.cache.add(y),J(m,[`.${y}`],[],e,e=>{u.styled.apply(e)}));let S=ef(b,f,e.media),T=ef(E,f,e.media,!0);for(let w of S)if(void 0!==w)for(let[A,x,_]of w){let R=`${y}-${er(x)}-${A}`;v.add(R);let O=(_?r.rules.resonevar:r.rules.onevar).cache,k=_?u.resonevar:u.onevar;O.has(R)||(O.add(R),J(x,[`.${R}`],[],e,e=>{k.apply(e)}))}for(let L of T)if(void 0!==L)for(let[C,I]of L){let D=`${y}-${er(I)}-${C}`;v.add(D),r.rules.allvar.cache.has(D)||(r.rules.allvar.cache.add(D),J(I,[`.${D}`],[],e,e=>{u.allvar.apply(e)}))}}if("object"==typeof h&&h){let P=`${n}-i${er(h)}-css`;v.add(P),r.rules.inline.cache.has(P)||(r.rules.inline.cache.add(P),J(h,[`.${P}`],[],e,e=>{u.inline.apply(e)}))}for(let M of String(c.className||"").trim().split(/\s+/))M&&v.add(M);let U=d.className=[...v].join(" ");return{type:t.type,className:U,selector:l,props:d,toString:()=>U,deferredInjector:o}};return F(c,{className:n,selector:l,[U]:t,toString:()=>(r.rules.styled.cache.has(n)||c(),n)})},ed=e=>{let t="",r=[],n={},i=[];for(let[s,,,,a,o]of e)for(let u in""===t&&(t=s),r.push(s),i.push(...o),a){let l=a[u];(void 0===n[u]||"undefined"!==l||o.includes(l))&&(n[u]=l)}return[t,r,n,new Set(i)]},ef=(e,t,r,n)=>{let i=[];e:for(let[s,a,o]of e){if(o)continue;let u,l=0,c=!1;for(u in s){let h=s[u],d=t[u];if(d!==h){if("object"!=typeof d||!d)continue e;{let f,p,g=0;for(let v in d){if(h===String(d[v])){if("@initial"!==v){let y=v.slice(1);(p=p||[]).push(y in r?r[y]:v.replace(/^@media ?/,"")),c=!0}l+=g,f=!0}++g}if(p&&p.length&&(a={["@media "+p.join(", ")]:a}),!f)continue e}}}(i[l]=i[l]||[]).push([n?"cv":`${u}-${s[u]}`,a,c])}return i},ep={},eg=M(),ev=(e,t)=>eg(e,()=>(...r)=>{let n=()=>{for(let n of r){n="object"==typeof n&&n||{};let i=er(n);if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in n){let s=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let a of[].concat(n["@import"]))a=a.includes('"')||a.includes("'")?a:`"${a}"`,t.sheet.insertRule(`@import ${a};`,s++);delete n["@import"]}
1J(n,[],[],e,e=>{t.rules.global.apply(e)})}}return""};return F(n,{toString:n})}),ey=M(),em=(e,t)=>ey(e,()=>r=>{let n=`${$(e.prefix)}k-${er(r)}`,i=()=>{if(!t.rules.global.cache.has(n)){t.rules.global.cache.add(n);let i=[];J(r,[],[],e,e=>i.push(e));let s=`@keyframes ${n}{${i.join("")}}`;t.rules.global.apply(s)}return n};return F(i,{get name(){return i()},toString:i})}),eb=class{constructor(e,t,r,n){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==r?"":String(r),this.prefix=null==n?"":String(n)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+$(this.prefix)+$(this.scale)+this.token}toString(){return this.computedValue}},eE=M(),eS=(e,t)=>eE(e,()=>(r,n)=>{n="object"==typeof r&&r||Object(n);let i=`.${r=(r="string"==typeof r?r:"")||`${$(e.prefix)}t-${er(n)}`}`,s={},a=[];for(let o in n)for(let u in s[o]={},n[o]){let l=`--${$(e.prefix)}${o}-${u}`,c=Q(String(n[o][u]),e.prefix,o);s[o][u]=new eb(u,c,o,e.prefix),a.push(`${l}:${c}`)}let h=()=>{if(a.length&&!t.rules.themed.cache.has(r)){t.rules.themed.cache.add(r);let i=`${n===e.theme?":root,":""}.${r}{${a.join(";")}}`;t.rules.themed.apply(i)}return r};return{...s,get className(){return h()},selector:i,toString:h}}),eT=M(),ew=e=>{let t=!1,r=eT(e,e=>{t=!0;let r="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",n="object"==typeof e.media&&e.media||{},i="object"==typeof e.root?e.root||null:globalThis.document||null,s="object"==typeof e.theme&&e.theme||{},a={prefix:r,media:n,theme:s,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...D},utils:"object"==typeof e.utils&&e.utils||{}},o=es(i),u={css:el(a,o),globalCss:ev(a,o),keyframes:em(a,o),createTheme:eS(a,o),reset(){o.reset(),u.theme.toString()},theme:{},sheet:o,config:a,prefix:r,getCssText:o.toString,toString:o.toString};return String(u.theme=u.createTheme(s)),u});return t||r.reset(),r},eA=()=>R||(R=ew()),ex=(...e)=>eA().keyframes(...e);r(5375),r(4747),r(1038),r(189),r(7327),r(3161);var e_={getItem:function(e){return""},setItem:function(e,t){return null},removeItem:function(e){return null}},eR=function(){var e;function t(e){var r,n,i,s,a=e.provider,o=e.storage,u=void 0===o?(n=(r={storage:"undefined"!=typeof window?window.localStorage:e_}).storage,s=void 0===(i=r.key)?"livepeer":i,(0,m._)((0,m._)({},n),{},{getItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=n.getItem("".concat(s,".").concat(e));try{return r?JSON.parse(r):t}catch(i){return console.warn(i),t}},setItem:function(e,t){if(null===t)n.removeItem("".concat(s,".").concat(e));else try{n.setItem("".concat(s,".").concat(e),JSON.stringify(t))}catch(r){console.error(r)}},removeItem:function(e){return n.removeItem("".concat(s,".").concat(e))}})):o;(0,m.b)(this,t),(0,m.c)(this,"config",void 0),(0,m.c)(this,"storage",void 0),(0,m.c)(this,"store",void 0),this.store=w(b(S(function(){return{provider:a()}},{name:"livepeer-store",getStorage:function(){return u},partialize:function(e){return{}},version:1}))),this.config={provider:a,storage:u},this.storage=u}return(0,m.a)(t,[{key:"error",get:function(){return this.store.getState().error}},{key:"provider",get:function(){return this.store.getState().provider}},{key:"subscribe",get:function(){return this.store.subscribe}},{key:"setState",value:function(e){var t="function"==typeof e?e(this.store.getState()):e;this.store.setState(t,!0)}},{key:"clearState",value:function(){this.setState(function(e){return(0,m._)((0,m._)({},e),{},{data:void 0,error:void 0})})}},{key:"destroy",value:(e=(0,m.d)((0,m.e)().mark(function e(){return(0,m.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.clearState(),this.store.destroy();case 2:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]),t}();function eO(){if(!n)throw Error("No livepeer client found.");return n}function ek(){return eO().provider}function eL(e){return ek().createAsset(e)}function eC(e){return ek().getAsset(e)}function eI(e){return ek().updateAsset(e)}function eD(e){return(eD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eP=function(e){if("object"===eD(e)&&null!==e){if("function"==typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},eM=function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce(function(t,r){if(Array.isArray(r))throw TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(r).forEach(function(n){!["__proto__","constructor","prototype"].includes(n)&&(Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=e.options.mergeArrays?Array.from(new Set(t[n].concat(r[n]))):r[n]:eP(t[n])&&eP(r[n])?t[n]=e(t[n],r[n]):t[n]=r[n])}),t},{})},eU={mergeArrays:!0};eM.options=eU,eM.withOptions=function(e){eM.options=(0,m._)({mergeArrays:!0},e);for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=eM.apply(void 0,r);return eM.options=eU,i};var eF=function(e,t){try{var r=Object.keys(e);return t.filter(function(e){return r.includes(e)}).reduce(function(t,r){return(0,m._)((0,m._)({},t),{},(0,m.c)({},r,e[r]))},{})}catch(n){throw Error("Could not pick keys for object.")}},eB=function(){},eN="undefined"!=typeof window,ej=eN?null===(i=window)||void 0===i?void 0:null===(s=i.navigator)||void 0===s?void 0:null===(a=s.userAgent)||void 0===a?void 0:a.toLowerCase():"",eq=/iphone|ipad|ipod|ios|CriOS|FxiOS/.test(ej),eH=/android/.test(ej),ez=eN&&(eq||eH);eN&&/(iPhone|iPod)/gi.test(null===(o=window)||void 0===o?void 0:null===(u=o.navigator)||void 0===u?void 0:u.platform),/firefox/.test(ej);var eG=eN&&!!(null!==(l=window)&&void 0!==l&&l.chrome);eN&&!eG&&((null===(c=window)||void 0===c?void 0:c.safari)||eq||/(apple|safari)/.test(ej)),eN&&null!==(h=window)&&void 0!==h&&null!==(d=h.location)&&void 0!==d&&d.protocol&&(null===(f=window)||void 0===f?void 0:null===(p=f.location)||void 0===p?void 0:p.protocol)!=="file:"&&null!==(g=window)&&void 0!==g&&null!==(v=g.location)&&void 0!==v&&v.hostname&&"".concat(window.location.protocol,"//").concat(window.location.hostname);var eK=function(e){if(eN)return e.includes("audio")?document.createElement("audio").canPlayType(e).length>0:document.createElement("video").canPlayType(e).length>0;return!0};function eW(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=(0,A.a)(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
1}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw s}}}}var eV=function(e){return e&&!isNaN(e)&&isFinite(e)?e:0},e$=function(e,t){return Math.min(Math.max(0,eV(e)),eV(t)?eV(t)-.01:0)},eQ=function(e){return Math.min(Math.max(0,eV(e)),1)},eY=function(){function e(t){(0,m.b)(this,e),(0,m.c)(this,"active",!1),(0,m.c)(this,"values",[]),(0,m.c)(this,"score",null),(0,m.c)(this,"averagingSteps",20),(0,m.c)(this,"element",void 0),this.element=t}return(0,m.a)(e,[{key:"init",value:function(){this.active||(this.values=[],this.score=null,this.active=!0)}},{key:"reset",value:function(){this.active?this.values=[]:this.init()}},{key:"destroy",value:function(){this.active&&(this.values=[],this.score=null,this.active=!1)}},{key:"calculateScore",value:function(){if(this.active){var e=this.values.length>0?this.values[this.values.length-1]:void 0,t={clockTime:.001*Date.now(),mediaTime:this.element.currentTime,score:e?this.valueToScore(e):0};if(this.values.push(t),this.values.length<2)return null;var r=this.values[0];if(void 0!==r&&void 0!==t){var n=this.valueToScore(r,t);return this.values.length>this.averagingSteps&&this.values.shift(),this.score=Math.max(n,t.score),Math.round(10*this.score)/10}}return null}},{key:"valueToScore",value:function(e,t){var r,n,i,s=this!==null&&void 0!==this&&null!==(r=this.element)&&void 0!==r&&r.playbackRate?this.element.playbackRate:1;return(null!==(n=null==t?void 0:t.mediaTime)&&void 0!==n?n:this.element.currentTime-e.mediaTime)/(null!==(i=null==t?void 0:t.clockTime)&&void 0!==i?i:.001*Date.now()-e.clockTime)/s}}]),e}(),eX=function(){function e(t){var r=this;(0,m.b)(this,e),(0,m.c)(this,"retryCount",0),(0,m.c)(this,"connected",!1),(0,m.c)(this,"element",void 0),(0,m.c)(this,"currentMetrics",void 0),(0,m.c)(this,"previousMetrics",null),(0,m.c)(this,"timeWaiting",0),(0,m.c)(this,"waitingSince",0),(0,m.c)(this,"timeStalled",0),(0,m.c)(this,"stalledSince",0),(0,m.c)(this,"timeUnpaused",0),(0,m.c)(this,"unpausedSince",0),this.element=t,this.currentMetrics={firstPlayback:0,nWaiting:0,timeWaiting:0,nStalled:0,timeStalled:0,timeUnpaused:0,nError:0,videoHeight:null,videoWidth:null,playerHeight:null,playerWidth:null,player:"generic",pageUrl:"",sourceUrl:"",playbackScore:null,duration:null},t.addEventListener("waiting",function(){r.timeWaiting=r._getTimeWaiting(),r.waitingSince=Date.now()}),t.addEventListener("stalled",function(){r.timeStalled=r._getTimeStalled(),r.stalledSince=Date.now()});var n,i=eW(["playing","pause"]);try{for(i.s();!(n=i.n()).done;){var s=n.value;t.addEventListener(s,function(){r.timeWaiting=r._getTimeWaiting(),r.timeStalled=r._getTimeStalled(),r.waitingSince=0,r.stalledSince=0})}}catch(a){i.e(a)}finally{i.f()}t.addEventListener("playing",function(){r.timeUnpaused=r._getTimeUnpaused(),r.unpausedSince=Date.now()}),t.addEventListener("pause",function(){r.timeUnpaused=r._getTimeUnpaused(),r.unpausedSince=0})}return(0,m.a)(e,[{key:"_getTimeWaiting",value:function(){return this.timeWaiting+(this.waitingSince?Date.now()-this.waitingSince:0)}},{key:"_getTimeStalled",value:function(){return this.timeStalled+(this.stalledSince?Date.now()-this.stalledSince:0)}},{key:"_getTimeUnpaused",value:function(){return this.timeUnpaused+(this.unpausedSince?Date.now()-this.unpausedSince:0)}},{key:"addError",value:function(e){this.currentMetrics.nError++,this.currentMetrics.lastError=e}},{key:"incrementStalled",value:function(){this.currentMetrics.nStalled++}},{key:"incrementWaiting",value:function(){this.currentMetrics.nWaiting++}},{key:"setFirstPlayback",value:function(){this.currentMetrics.firstPlayback=Date.now()-eJ}},{key:"setPlaybackScore",value:function(e){this.currentMetrics.playbackScore=e}},{key:"setConnected",value:function(e){this.connected=e}},{key:"getMetrics",value:function(){var e,t,r,n,i=(0,m._)((0,m._)({},this.currentMetrics),{}
1,{playerHeight:this.element?this.element.clientHeight:null,playerWidth:this.element?this.element.clientWidth:null,videoWidth:null!==(e=this.element)&&void 0!==e&&e.videoWidth?null===(t=this.element)||void 0===t?void 0:t.videoWidth:null,videoHeight:null!==(r=this.element)&&void 0!==r&&r.videoHeight?null===(n=this.element)||void 0===n?void 0:n.videoHeight:null,duration:this.element.duration,timeWaiting:this._getTimeWaiting(),timeStalled:this._getTimeStalled(),timeUnpaused:this._getTimeUnpaused()}),s=this.previousMetrics;return this.previousMetrics=i,{current:i,previous:s}}}]),e}(),eJ=Date.now(),eZ="data-metrics-initialized";function e0(e,t){var r={metrics:null,websocket:null,report:null};if("true"===e.getAttribute(eZ))return r;if(e.setAttribute(eZ,"true"),!window.WebSocket)return console.log("Browser does not support WebSocket"),r;if(!("play"in e)||!("currentTime"in e))return console.log("Element provided is not a media element"),r;var n=new eX(e);try{var i=function(){var r=function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=new WebSocket(t);return n.onopen=function(){E()},n.onclose=function(){i&&(clearTimeout(i),i=null,s=!1),setTimeout(function(){e(r++)},1e3*Math.pow(2,r))},n}(),i=null,s=!0,a=function t(){n.setFirstPlayback(),e.removeEventListener("playing",t)};e.addEventListener("playing",a),e.addEventListener("waiting",function(){n.incrementWaiting()}),e.addEventListener("stalled",function(){n.incrementStalled()}),e.addEventListener("error",function(){var t;n.addError(null!=e&&null!==(t=e.error)&&void 0!==t&&t.message?e.error.message:"unknown")});var o,u=new eY(e),l=eW(["loadstart","play","playing"]);try{for(l.s();!(o=l.n()).done;){var c=o.value;e.addEventListener(c,function(){u.init()})}}catch(h){l.e(h)}finally{l.f()}var d,f=eW(["loadeddata","pause","abort","emptied","ended"]);try{for(f.s();!(d=f.n()).done;){var p=d.value;e.addEventListener(p,function(){u.destroy()})}}catch(g){f.e(g)}finally{f.f()}var v,y=eW(["seeking","seeked","ratechange"]);try{for(y.s();!(v=y.n()).done;){var m=v.value;e.addEventListener(m,function(){u.reset()})}}catch(b){y.e(b)}finally{y.f()}var E=function e(){if(s){var t,a,o=u.calculateScore();null!==o&&n.setPlaybackScore(o);var l=n.getMetrics(),c={};for(h in l.current){var h,d,f=l.current[h];f!==(null==l?void 0:null===(d=l.previous)||void 0===d?void 0:d[h])&&(c[h]=f)}Object.keys(c).length>0&&(t=r,a=c,t.readyState===t.OPEN&&t.send(JSON.stringify(a))),i=setTimeout(function(){e()},1e3)}};return{v:{metrics:n,websocket:r,report:E}}}();if("object"===eD(i))return i.v}catch(s){console.log(s)}return r}var e1,e2=["livepeer","livepeercdn","lp-playback"],e5=(e1=(0,m.d)((0,m.e)().mark(function e(t){var r,n,i,s,a,o,u,l,c,h,d,f,p,g,v,y;return(0,m.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o=(a=(s=new URL(t)).pathname.split("/")).indexOf("index.m3u8"),u=a.includes("hls"),l=a.includes("recordings"),c=(u||l)&&-1!==o&&null!==(r=null==a?void 0:a[o-1])&&void 0!==r?r:null,h=s.host.split("."),d=e2.includes(null!==(n=null==h?void 0:h[h.length-2])&&void 0!==n?n:""),p="com"===(f=null!==(i=null==h?void 0:h[(null==h?void 0:h.length)-1])&&void 0!==i?i:null)?"studio":"studio"===f?"studio":"fun"===f?"fun":"monster"===f?"monster":null,!(c&&d&&p)){e.next=23;break}return e.prev=12,e.next=15,k()("https://playback.livepeer.".concat(p,"/json_video+").concat(c,".js"));case 15:return y=null==(v=e.sent)?void 0:null===(g=v.url)||void 0===g?void 0:g.replace("https:","wss:"),e.abrupt("return",null!=y?y:null);case 20:e.prev=20,e.t0=e.catch(12),console.log("Could not fetch metrics reporting URL.",e.t0);case 23:e.next=28;break;case 25:return e.prev=25,e.t1=e.catch(0),e.abrupt("return",null);case 28:return e.abrupt("return",null);case 29:case"end":return e.stop()}},e,null,[[0,25],[12,20]])})),function(e){return e1.apply(this,arguments)}),e3="data-hls-initialized",e6=function(e,t,r,n,i,s){if("true"===t.getAttribute(e3))return{destroy:eB};t.setAttribute(e3,"true");var a,o=new(_())((0,m._)({maxBufferLength:15,maxMaxBufferLength:60},s)),u=function(){var e,r;null==o||null===(e=o.destroy)||void 0===e||e.call(o),null==t||null===(r=t.removeAttribute)||void 0===r||r.call(t,e3)};t&&o.attachMedia(t),o.on(x.Events.LEVEL_LOADED,(a=(0,m.d)((0,m.e)().mark(function e(t,i){var s,a,o;return(0,m.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=(s=i.details).live,o=s.totalduration,r(Boolean(a)),n(null!=o?o:0);case 3:case"end":return e.stop()}},e)})),function(e,t){return a.apply(this,arguments)}
1)),o.on(x.Events.MEDIA_ATTACHED,(0,m.d)((0,m.e)().mark(function r(){var n;return(0,m.e)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return o.loadSource(e.src),o.on(x.Events.MANIFEST_PARSED,function(e,r){if(i(),null!=s&&s.autoplay&&t)try{t.muted=!0}catch(n){console.log("Unable to autoplay prior to user interaction with the dom.")}}),r.next=4,e5(e.src);case 4:(n=r.sent)?e0(t,n):console.log("Not able to report player metrics given the source url",e);case 6:case"end":return r.stop()}},r)})));var l,c=0;return o.on(x.Events.ERROR,(l=(0,m.d)((0,m.e)().mark(function e(t,r){var n,i,s;return(0,m.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.fatal){e.next=16;break}e.t0=r.type,e.next=e.t0===x.ErrorTypes.NETWORK_ERROR?4:e.t0===x.ErrorTypes.MEDIA_ERROR?12:14;break;case 4:if(!(null!=r&&null!==(n=r.response)&&void 0!==n&&null!==(i=n.data)&&void 0!==i&&null!==(s=i.toString())&&void 0!==s&&s.includes("Stream open failed"))){e.next=10;break}return e.next=7,new Promise(function(e){return setTimeout(e,1e3*++c)});case 7:null==o||o.recoverMediaError(),e.next=11;break;case 10:null==o||o.startLoad();case 11:return e.abrupt("break",16);case 12:return null==o||o.recoverMediaError(),e.abrupt("break",16);case 14:return u(),e.abrupt("break",16);case 16:case"end":return e.stop()}},e)})),function(e,t){return l.apply(this,arguments)})),{destroy:u}},e4=ew({media:{sm:"(min-width: 640px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)"},theme:{borderStyles:{containerBorderStyle:"hidden"},borderWidths:{containerBorderWidth:0,loadingWidth:"3px"},colors:{accent:"#00a55f",background:"#000000",containerBorderColor:"transparent",icon:"rgba(255,255,255,1)",iconHover:"rgba(255,255,255,0.8)",liveIndicator:"#e5484d"},fonts:{display:"ui-sans-serif"},fontSizes:{timeFontSize:"1.0rem",timeFontSizeMd:"0.95rem",timeFontSizeSm:"0.85rem",titleFontSize:"1.1rem",titleFontSizeMd:"1rem",titleFontSizeSm:"0.9rem"},fontWeights:{titleFontWeight:400},shadows:{containerShadow:"rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px",containerShadowHover:"$containerShadow"},sizes:{iconButtonSize:"42px",iconButtonSizeSm:"36px",liveIndicatorSize:"5px",loading:"64px",thumb:"12px",trackActive:"5px",trackContainerHeight:"15px",trackContainerHeightSm:"20px",trackInactive:"3px"},space:{controlsBottomMarginX:"10px",controlsBottomMarginY:"5px",controlsTopMarginX:"15px",controlsTopMarginY:"10px",timeMarginX:"8px"},radii:{containerBorderRadius:"5px",slider:"3px"}}}),e8=e4.css;e4.createTheme,e4.theme,e4.getCssText;var e9=ex({"0%":{transform:"scale(1)"},"100%":{transform:"scale(1.1)"}}),e7=e8("button",{background:"none",border:"none",cursor:"pointer",outline:"inherit",padding:0,height:"$iconButtonSizeSm",width:"$iconButtonSizeSm",minHeight:"$iconButtonSizeSm",minWidth:"$iconButtonSizeSm","@lg":{height:"$iconButtonSize",width:"$iconButtonSize",minHeight:"$iconButtonSize",minWidth:"$iconButtonSize"},color:"$icon","&:hover":{color:"$iconHover",animation:ez?void 0:"".concat(e9," 200ms")}}),te=[{key:"16to9",value:"16 / 9"},{key:"1to1",value:"1 / 1"},{key:"9to16",value:"9 / 16"},{key:"4to5",value:"4 / 5"},{key:"21to9",value:"21 / 9"}],tt=e8("div",{variants:{aspectRatio:(y={},(0,m.c)(y,te[0].key,(0,m.c)({aspectRatio:te[0].value},"@supports not (aspect-ratio: ".concat(te[0].value,")"),{"&:before":{float:"left",paddingTop:"calc(".concat(te[0].value,")%"),content:""},"&:after":{display:"block",content:"",clear:"both"}})),(0,m.c)(y,te[1].key,(0,m.c)({aspectRatio:te[1].value},"@supports not (aspect-ratio: ".concat(te[1].value,")"),{"&:before":{float:"left",paddingTop:"calc(".concat(te[1].value,")%"),content:""},"&:after":{display:"block",content:"",clear:"both"}})),(0,m.c)(y,te[2].key,(0,m.c)({aspectRatio:te[2].value},"@supports not (aspect-ratio: ".concat(te[2].value,")"),{"&:before":{float:"left",paddingTop:"calc(".concat(te[2].value,")%"),content:""},"&:after":{display:"block",content:"",clear:"both"}})),(0,m.c)(y,te[3].key,(0,m.c)({aspectRatio:te[3].value},"@supports not (aspect-ratio: ".concat(te[3].value,")"),{"&:before":{float:"left",paddingTop:"calc(".concat(te[3].value,")%"),content:""},"&:after":{display:"block",content:"",clear:"both"}})),(0,m.c)(y,te[4].key,(0,m.c)({aspectRatio:te[4].value},"@supports not (aspect-ratio: ".concat(te[4].value,")"),{"&:before":{float:"left",paddingTop:"calc(".concat(te[4].value,")%"),content:""},"&:after":{display:"block",content:"",clear:"both"}})),y)}}),tr=e8(tt,{fontFamily:"$display, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji",backgroundColor:"$background",overflow:"hidden",maxWidth:"100%",maxHeight:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flex:1,svg:{pointerEvents:"none"},zIndex:2147483647,variants:{size:{fullscreen:{},default:{"&:hover":{boxShadow:"$containerShadowHover"},boxShadow:"$containerShadow",borderStyle:"$containerBorderStyle",borderColor:"$containerBorderColor",borderRadius:"$containerBorderRadius",borderWidth:"$containerBorderWidth"}}},defaultVariants:{size:"default"}}),tn=ex({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ti=e8("div",{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%","&:after":{content:" ",display:"block",width:"$loading",height:"$loading",maxWidth:"100%",maxHeight:"100%",borderRadius:"50%",borderWidth:"$loadingWidth",borderStyle:"solid",borderColor:"$accent transparent $accent transparent",animation:"".concat(tn," 1.4s ease-in-out infinite")}}),ts=ex({"0%":{opacity:1},"100%":{opacity:0}
1}),ta=ex({"0%":{opacity:0},"100%":{opacity:1}}),to=e8("div",{variants:{display:{shown:{opacity:1,animation:ez?void 0:"".concat(ta," 0.2s")},hidden:{opacity:0,animation:ez?void 0:"".concat(ts," 0.2s")}}},defaultVariants:{display:"shown"}}),tu=e8(to,{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",bottom:0,left:0,right:0,top:0,height:"100%"}),tl=e8(to,{position:"absolute",bottom:0,left:0,right:0,height:233,marginBottom:-1,maxWidth:"100%",maxHeight:"100%",overflow:"hidden",backgroundImage:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADpCAYAAADlAl1mAAAAAXNSR0IArs4c6QAAAexJREFUOE9V0ftrzXEcx/H3x+43l9lmGGaz65ld2YUZG2YYKUlJUpKSpNZSkpSkJClJSVKSkj9Sj8/3nJ12fnie5/v9en/en+/3nIjik6rfNOU6YwfJqNGp0ctWGylSLavTqzNe72S9YYgGaYOysYJodKxJ2uSeZseaC4uUWpQt0lbWWlhEtFnVZv1O5RbSLkHGbifKiBR7XJnR7kS7dG+BSNlSh7TDvZ02d5rL6DLXxfYZriCiW69bbz+rIKUDyoyDW+hxB0RPpJQOCTIOb8cRZUavB+r1QCyOVpD6WJ97s/Wb67f5GINsMaA3YG6QDbIh7zZUWEQaNjesHHHRiB7EqLlRx0qsZKQkHdMb0zturopx5bhgwqoJJaRJNmnBlGBKj8W0YNq+GTbjFzrBqjipzJh1bNYxFnNsjs1bMF9YpFhgC3qnCkQkiNMMYlGwqDzDyoiIJc+35O85a66MFHFOmbHsjmVnM1Y884rgvLKClC4oIS5ux6pg1ZZLgow1v9pa2SIus4wrBVKkbFedhVhn67Zku2bBdcENr3CT3ZLe9oJ32F12T3DfCz7QewiP9B7b8kT5VPmMbVi6yZ7DCwtemnvFXrvoDXtr7p3gPXxQfhR8suqz8gv7Kv3mZb5Lf+j91PvFfsMf+Av//gMAXDGpZ05jKQAAAABJRU5ErkJggg==")'}),tc=e8(to,{top:0,marginTop:"$controlsTopMarginY",marginBottom:"$controlsTopMarginY",marginLeft:"$controlsTopMarginX",marginRight:"$controlsTopMarginX",display:"inline-flex",alignItems:"center",justifyContent:"space-between",position:"absolute",left:0,right:0}),th=e8(to,{justifyContent:"center",bottom:0,marginTop:"$controlsBottomMarginY",marginBottom:"$controlsBottomMarginY",marginLeft:"$controlsBottomMarginX",marginRight:"$controlsBottomMarginX",display:"inline-flex",alignItems:"center",position:"absolute",flexDirection:"column",left:0,right:0}),td=e8("div",{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"space-between"}),tf=e8(td,{width:"auto"}),tp=e8(td,{width:"auto"}),tg=e8("img",{maxWidth:"100%",width:"100%",maxHeight:"100%",height:"100%",pointerEvents:"none",userSelect:"none",objectPosition:"center",objectFit:"cover",variants:{size:{fullscreen:{width:"100% !important",height:"100% !important"},default:{}}},defaultVariants:{size:"default"}}),tv=e8("video",{width:"100% !important",height:"100% !important",objectPosition:"center",variants:{size:{fullscreen:{objectFit:"contain","&::-webkit-media-overlay-enclosure":{display:"none !important"},"&::-webkit-media-controls-enclosure":{display:"none !important"}},contain:{objectFit:"contain"},cover:{objectFit:"cover"}}},defaultVariants:{size:"cover"}}),ty=e8("audio",tv),tm=ex({"0%":{height:"$trackInactive"},"100%":{height:"$trackActive"}}),tb=ex({"0%":{height:"$trackActive"},"100%":{height:"$trackInactive"}}),tE=e8("div",{minHeight:"$trackContainerHeightSm","@lg":{minHeight:"$trackContainerHeight"},"@media (hover: none)":{minHeight:"$trackContainerHeightSm"},display:"flex",alignItems:"center",minWidth:80,touchAction:"none",cursor:"pointer",height:"100%",width:"100%"}),tS=e8("div",{variants:{size:{default:{height:"$trackInactive",animation:"".concat(tb," 0.1s")},active:{height:"$trackActive",animation:"".concat(tm," 0.1s")}},rounded:{full:{borderRadius:"$slider"},left:{borderTopLeftRadius:"$slider",borderBottomLeftRadius:"$slider"},right:{borderTopRightRadius:"$slider",borderBottomRightRadius:"$slider"},none:{}}},defaultVariants:{size:"default",rounded:"none"}}),tT=e8(tS,{backgroundColor:"$accent",opacity:.95}),tw=e8(tS,{backgroundColor:"$accent",opacity:.55}),tA=e8(tS,{backgroundColor:"$accent",opacity:.2}),tx=e8("div",{width:"$thumb",height:"$thumb",backgroundColor:"$icon",borderRadius:"100%"}),t_=e8("span",{color:"$icon",userSelect:"none"}),tR=e8("div",{display:"flex",alignItems:"center"}),tO=e8("div",{backgroundColor:"$liveIndicator",borderRadius:"100%",width:"$liveIndicatorSize",height:"$liveIndicatorSize"}),tk=e8(t_,{marginLeft:"$timeMarginX",marginRight:"$timeMarginX",fontVariant:"tabular-nums",fontSize:"$timeFontSizeSm","@md":{fontSize:"$timeFontSizeMd"},"@lg":{fontSize:"$timeFontSize"}}),tL=e8(t_,{fontWeight:"$titleFontWeight",fontSize:"$titleFontSizeSm","@md":{fontSize:"$titleFontSizeMd"},"@lg":{fontSize:"$titleFontSize"}}),tC=e8("div",{display:"inline-flex",alignItems:"center",justifyContent:"center"}),tI={container:tr,controlsContainer:{background:tu,gradient:tl,loading:ti,top:{container:tc},bottom:{container:th,middle:{container:td},lower:{container:td,left:tp,right:tf}}},iconButton:e7,media:{audio:ty,poster:tg,video:tv},slider:{container:tE,thumb:tx,track:{left:tT,middle:tw,right:tA}},time:{container:tR,text:tk,liveIndicator:tO},title:tL,volume:{container:tC}};r(4965),r(9601);var tD=r(1052),tP=r(8897),tM=r(3156);r(7042),r(561);var tU=r(2834),tF=r(7294),tB=r(2798);
1let{useSyncExternalStoreWithSelector:tN}=tB,tj=e=>{let t="function"==typeof e?w(e):e,r=(e,r)=>(function(e,t=e.getState,r){let n=tN(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,tF.useDebugValue)(n),n})(t,e,r);return Object.assign(r,t),r};function tq(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function tH(e){return JSON.parse(e)}function tz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tG(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tK(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tG(Object(r),!0).forEach(function(t){tz(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tG(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}r(1249),r(3112);var tW=["cacheTime","networkMode","onError","onMutate","onSettled","onSuccess","retry","retryDelay","useErrorBoundary","meta"];function tV(e,t){var r,n=(0,tP.useMutation)(e,tK(tK({},t),{},{useErrorBoundary:!1})),i=n.data,s=n.error,a=n.isError,o=n.isIdle,u=n.isLoading,l=n.isSuccess,c=n.mutate,h=n.mutateAsync,d=n.reset;return{data:i,error:s,isError:a,isIdle:o,isLoading:u,isSuccess:l,mutate:c,mutateAsync:h,variables:n.variables,status:n.status,internal:{reset:d}}}function t$(e){return(t$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tQ(e,t){return e.slice(0,t).join(".")||"."}function tY(e,t){for(var r=e.length,n=0;n<r;++n)if(e[n]===t)return n+1;return 0}function tX(e,t,r,n){var i,s,a,o,u,l;return JSON.stringify(e,(a="function"==typeof t,o="function"==typeof n,u=[],l=[],function(e,r){if("object"===t$(r)){if(u.length){var i=tY(u,this);0===i?u[u.length]=this:(u.splice(i),l.splice(i)),l[l.length]=e;var s=tY(u,r);if(0!==s)return o?n.call(this,e,r,tQ(l,s)):"[ref=".concat(tQ(l,s),"]")}else u[0]=r,l[0]=e}return a?t.call(this,e,r):r}),null!=r?r:void 0)}var tJ=["queryClient"];function tZ(e){var t,r,i,s=e.queryClient,a=void 0===s?new tP.QueryClient({defaultOptions:{queries:{cacheTime:864e5,networkMode:"offlineFirst",refetchOnWindowFocus:!1,retry:0},mutations:{networkMode:"offlineFirst"}}}):s,o=tq(e,tJ),u=(n=i=new eR(o),i),l="undefined"!=typeof window?(0,tD.createSyncStoragePersister)({key:"livepeer.cache",storage:null!==(t=null==o?void 0:o.storage)&&void 0!==t?t:window.localStorage,serialize:tX,deserialize:tH}):void 0;return l&&(0,tM.persistQueryClient)({queryClient:a,persister:l,dehydrateOptions:{shouldDehydrateQuery:function(e){return 0!==e.cacheTime}}}),Object.assign(u,{queryClient:a})}var t0,t1,t2,t5,t3=tF.createContext((t1=null,t5=(t2=w(S(function(e,t){var r,n,i;return{_element:t1,canPlay:!1,hidden:!1,live:!1,hasPlayed:!1,playing:!(null!=t1&&t1.paused),fullscreen:!1,device:{isMobile:ez,isIos:eq,isAndroid:eH},progress:eV(null==t1?void 0:t1.currentTime),duration:eV(null==t1?void 0:t1.duration),buffered:0,volume:null!==(r=null==t1?void 0:t1.volume)&&void 0!==r?r:.2,muted:null===(n=null!==(i=null==t1?void 0:t1.muted)&&void 0!==i?i:null==t1?void 0:t1.defaultMuted)||void 0===n||n,isVolumeChangeSupported:!1,_lastInteraction:Date.now(),_requestedRangeToSeekTo:0,_requestedFullscreenLastTime:Date.now(),setHidden:function(t){return e(function(e){return{hidden:!!e.playing&&t}})},_updateLastInteraction:function(){return e(function(){return{_lastInteraction:Date.now()}})},onCanPlay:function(){return e(function(){return{canPlay:!0}})},onPlay:function(){return e(function(){return{playing:!0,_lastInteraction:Date.now(),hasPlayed:!0}})},onPause:function(){return e(function(){return{playing:!1,hidden:!1}})},togglePlay:function(){return e(function(e){return{playing:!e.playing}})},onProgress:function(t){return e(function(){return{progress:eV(t)}})},requestSeek:function(t){return e(function(e){var r=e.duration;return{_requestedRangeToSeekTo:e$(t,r),progress:e$(t,r)}})},onDurationChange:function(t){return e(function(e){var r=e.live;return{duration:t,live:t===Number.POSITIVE_INFINITY||r}})},_updateBuffered:function(t){return e(function(){return{buffered:t}})},_requestSeekDiff:function(t){return e(function(e){var r,n=e.duration;return{_requestedRangeToSeekTo:e$(eV(null!==(r=null==t1?void 0:t1.currentTime)&&void 0!==r?r:0)+t/1e3,n)}})},requestSeekBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;return t()._requestSeekDiff(-e)},requestSeekForward:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;return t()._requestSeekDiff(e)},setFullscreen:function(t){return e(function(){return{fullscreen:t}})},requestToggleFullscreen:function(){return e(function(){return{_requestedFullscreenLastTime:Date.now()}})}
1,setLive:function(t){return e(function(){return{live:t}})},requestVolume:function(t){return e(function(e){var r=e.volume;return{volume:0===t?r:eQ(t),muted:0===t}})},_setVolume:function(t){return e(function(){return{volume:eQ(t)}})},requestToggleMute:function(){return e(function(e){return{muted:!e.muted}})},setIsVolumeChangeSupported:function(t){return e(function(){return{isVolumeChangeSupported:t}})}}},{name:"livepeer-player",version:1,partialize:function(e){return{volume:e.volume}}}))).getState(),!t1||t1.muted||t1.defaultMuted||(t1.volume=t5.volume),(t0=t2)?tj(t0):tj)),t6=function(e){return tF.useContext(t3)(e)};function t4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var s=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);a=!0);}catch(u){o=!0,n=u}finally{try{a||null==i.return||i.return()}finally{if(o)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t4(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var t9=function(e,t,r,n,i){var s=tF.useMemo(function(){return e?null!=t?t:r:null!=n?n:i},[e,t,r,n,i]);return tF.useMemo(function(){return tF.isValidElement(s)?tF.cloneElement(s):null},[s])},t7=function(e){return{device:e.device}},re=function(e){var t,r,n,i=t6(t7).device,s=tF.useRef(null),a=t8(tF.useState(!1),2),o=a[0],u=a[1],l=t8(tF.useState(!1),2),c=l[0],h=l[1],d=tF.useMemo(function(){return(null==i?void 0:i.isMobile)||o||c},[null==i?void 0:i.isMobile,o,c]),f=tF.useCallback((t=(0,tU._)((0,tU.a)().mark(function t(r){var n,i,a,o,u;return(0,tU.a)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i=null===(n=s.current)||void 0===n?void 0:n.getBoundingClientRect())){t.next=6;break}return u=Math.min(Math.max(0,(r-i.left)/i.width),1),t.next=6,null==e?void 0:null===(a=e.onChange)||void 0===a?void 0:a.call(e,u);case 6:case"end":return t.stop()}},t)})),function(e){return t.apply(this,arguments)}),[e]);tF.useEffect(function(){if(c){var t,r,n,i,s,a,o,u,l=(t=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(t.clientX);case 2:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),d=(a=(0,tU._)((0,tU.a)().mark(function e(t){var r,n,i,s;return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(s=null===(r=t.touches)||void 0===r?void 0:null===(n=r.item)||void 0===n?void 0:null===(i=n.call(r,0))||void 0===i?void 0:i.clientX)){e.next=4;break}return e.next=4,f(s);case 4:case"end":return e.stop()}},e)})),function(e){return a.apply(this,arguments)}),p=(o=(0,tU._)((0,tU.a)().mark(function t(r){var n;return(0,tU.a)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return h(!1),t.next=3,f(r.clientX);case 3:return t.next=5,null==e?void 0:null===(n=e.onDone)||void 0===n?void 0:n.call(e);case 5:case"end":return t.stop()}},t)})),function(e){return o.apply(this,arguments)}),g=(u=(0,tU._)((0,tU.a)().mark(function t(r){var n,i,s,a,o;return(0,tU.a)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(h(!1),!(o=null===(n=r.touches)||void 0===n?void 0:null===(i=n.item)||void 0===i?void 0:null===(s=i.call(n,0))||void 0===s?void 0:s.clientX)){t.next=5;break}return t.next=5,f(o);case 5:return t.next=7,null==e?void 0:null===(a=e.onDone)||void 0===a?void 0:a.call(e);case 7:case"end":return t.stop()}},t)})),function(e){return u.apply(this,arguments)});return null===(r=document)||void 0===r||r.addEventListener("mousemove",l),null===(n=document)||void 0===n||n.addEventListener("mouseup",p),null===(i=document)||void 0===i||i.addEventListener("touchmove",d),null===(s=document)||void 0===s||s.addEventListener("touchend",g),function(){var e,t,r,n;null===(e=document)||void 0===e||e.removeEventListener("mousemove",l),null===(t=document)||void 0===t||t.removeEventListener("mouseup",p),null===(r=document)||void 0===r||r.removeEventListener("touchmove",d),null===(n=document)||void 0===n||n.removeEventListener("touchend",g)}}},[c,f,e]);var p,g=(r=null==e?void 0:e.thumbIcon,n=tF.createElement("div",{className:tI.slider.thumb()}),tF.useMemo(function(){return r&&tF.isValidElement(r)?tF.cloneElement(r):n},[r,n])),v=tF.useMemo(function(){return[isNaN(e.value)?0:e.value,!e.secondaryValue||isNaN(e.value)||isNaN(e.secondaryValue)?0:e.secondaryValue-e.value]},[e.value,e.secondaryValue]),y=t8(v,2),m=y[0],b=y[1],E=tF.useMemo(function(){return 1-(m+b)},[m,b]),S=tF.useCallback((p=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(t.clientX);case 2:h(!0);case 3:case"end":return e.stop()}},e)})),function(e){return p.apply(this,arguments)}),[f]),T=tF.useCallback((0,tU._)((0,tU.a)().mark(function e(){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u(!0);case 1:case"end":return e.stop()}},e)})),[u]),w=tF.useCallback((0,tU._)((0,tU.a)().mark(function e(){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u(!1);case 1:case"end":return e.stop()}},e)})),[u]),A=tF.useMemo(function(){return Math.round(100*m)},[m]);return tF.createElement("div",{ref:s,onPointerDown:S,onMouseEnter:T,onMouseLeave:w,role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":A,"aria-valuetext":"".concat(A,"% ").concat(e.ariaName),"aria-orientation":"horizontal",className:tI.slider.container()},m>.001&&tF.createElement("div",{className:tI.slider.track.left({size:d?"active":"default",rounded:1!==m||d?"left":"full",css:{flex:m}})}),d&&g,(null!=b?b:0)>0&&tF.createElement("div",{className:tI.slider.track.middle({size:d?"active":"default",rounded:1===b?d?"right":"full":m<=.001?"left":0===E?"right":"none",css:{flex:b}}
1)}),(null!=E?E:0)>0&&tF.createElement("div",{className:tI.slider.track.right({size:d?"active":"default",rounded:m<=.001&&!d?"full":"right",css:{flex:E}})}))},rt=function(e){return{fullscreen:e.fullscreen}};tF.forwardRef(function(e,t){var r=e.children,n=e.className,i=e.aspectRatio,s=t6(rt).fullscreen;return tF.createElement("div",{style:{display:"contents"},className:n},tF.createElement("div",{className:tI.container({aspectRatio:i,size:s?"fullscreen":"default"}),ref:t,tabIndex:0},r))}).displayName="Container";var rr=function(e){var t,r=e.hidden,n=e.togglePlay,i=e.canPlay;return{hidden:r,togglePlay:n,canPlay:i,hasPlayed:e.hasPlayed,buffered:e.buffered}};function rn(){return(rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}tF.forwardRef(function(e,t){var r=e.top,n=e.middle,i=e.left,s=e.right,a=e.poster,o=e.showLoadingSpinner,u=e.hidePosterOnPlayed,l=t6(rr),c=l.hidden,h=l.togglePlay,d=l.canPlay,f=l.hasPlayed,p=l.buffered,g=tF.useMemo(function(){return d||0!==p},[d,p]),v=tF.useCallback(function(){g&&h()},[h,g]);return tF.createElement(tF.Fragment,null,a?tF.createElement("div",{className:tI.controlsContainer.background({display:f&&(void 0===u||u)?"hidden":"shown"}),onMouseUp:v},a):tF.createElement("div",{className:tI.controlsContainer.background({display:"hidden"}),onMouseUp:v}),(void 0===o||o)&&!g&&tF.createElement("div",{className:tI.controlsContainer.background(),onMouseUp:v},tF.createElement("div",{className:tI.controlsContainer.loading()})),g&&tF.createElement(tF.Fragment,null,tF.createElement("div",{className:tI.controlsContainer.gradient({display:c?"hidden":"shown"}),onMouseUp:v}),tF.createElement("div",{className:tI.controlsContainer.top.container({display:c?"hidden":"shown"})},r),tF.createElement("div",{className:tI.controlsContainer.bottom.container({display:c?"hidden":"shown"}),ref:t},tF.createElement("div",{className:tI.controlsContainer.bottom.middle.container()},n),tF.createElement("div",{className:tI.controlsContainer.bottom.lower.container()},tF.createElement("div",{className:tI.controlsContainer.bottom.lower.left()},i),tF.createElement("div",{className:tI.controlsContainer.bottom.lower.right()},s)))))}).displayName="ControlsContainer";var ri=["enterIcon","exitIcon","onClick"],rs=function(){return tF.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tF.createElement("path",{fill:"currentColor",d:"m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z"}),tF.createElement("path",{fill:"currentColor",d:"m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z"}),tF.createElement("path",{fill:"currentColor",d:"m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z"}),tF.createElement("path",{fill:"currentColor",d:"M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z"}))},ra=function(){return tF.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 36 36",xmlns:"http://www.w3.org/2000/svg"},tF.createElement("path",{fill:"currentColor",d:"m 14,14 -4,0 0,2 6,0 0,-6 -2,0 0,4 0,0 z"}),tF.createElement("path",{fill:"currentColor",d:"m 22,14 0,-4 -2,0 0,6 6,0 0,-2 -4,0 0,0 z"}),tF.createElement("path",{fill:"currentColor",d:"m 20,26 2,0 0,-4 4,0 0,-2 -6,0 0,6 0,0 z"}),tF.createElement("path",{fill:"currentColor",d:"m 10,22 4,0 0,4 2,0 0,-6 -6,0 0,2 0,0 z"}))},ro=function(e){var t;return{fullscreen:e.fullscreen,requestToggleFullscreen:e.requestToggleFullscreen}};tF.forwardRef(function(e,t){var r,n=t6(ro),i=n.fullscreen,s=n.requestToggleFullscreen,a=e.enterIcon,o=e.exitIcon,u=e.onClick,l=tq(e,ri),c=tF.useCallback((r=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==u?void 0:u(t);case 2:return e.next=4,s();case 4:case"end":return e.stop()}},e)})),function(e){return r.apply(this,arguments)}),[u,s]),h=t9(i,o,tF.createElement(ra,null),a,tF.createElement(rs,null)),d=tF.useMemo(function(){return i?"Exit full screen (f)":"Full screen (f)"},[i]);return tF.createElement("button",rn({},l,{className:tI.iconButton(),title:d,"aria-label":d,ref:t,onClick:c}),h)}).displayName="FullscreenButton";var ru=["unmutedIcon","mutedIcon","onClick","showSlider"],rl=function(){return tF.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 36 36"},tF.createElement("path",{d:"M 9.25,9 7.98,10.27 24.71,27 l 1.27,-1.27 Z",fill:"currentColor"}),tF.createElement("path",{fill:"currentColor",d:"M8,21 L12,21 L17,26 L17,10 L12,15 L8,15 L8,21 Z M19,14 L19,22 C20.48,21.32 21.5,19.77 21.5,18 C21.5,16.26 20.48,14.74 19,14 ZM19,11.29 C21.89,12.15 24,14.83 24,18 C24,21.17 21.89,23.85 19,24.71 L19,26.77 C23.01,25.86 26,22.28 26,18 C26,13.72 23.01,10.14 19,9.23 L19,11.29 Z"}))},rc=function(){return tF.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 36 36"},tF.createElement("path",{fill:"currentColor",d:"M8,21 L12,21 L17,26 L17,10 L12,15 L8,15 L8,21 Z M19,14 L19,22 C20.48,21.32 21.5,19.77 21.5,18 C21.5,16.26 20.48,14.74 19,14 ZM19,11.29 C21.89,12.15 24,14.83 24,18 C24,21.17 21.89,23.85 19,24.71 L19,26.77 C23.01,25.86 26,22.28 26,18 C26,13.72 23.01,10.14 19,9.23 L19,11.29 Z"}))},rh=function(e){var t,r=e.isVolumeChangeSupported,n=e.requestToggleMute;return{isVolumeChangeSupported:r,requestToggleMute:n,requestVolume:e.requestVolume,muted:e.muted}};tF.forwardRef(function(e,t){var r,n=t6(rh),i=n.requestToggleMute,s=n.muted,a=n.requestVolume,o=n.isVolumeChangeSupported,u=e.unmutedIcon,l=e.mutedIcon,c=e.onClick,h=e.showSlider,d=void 0===h||h,f=tq(e,ru),p=tF.useCallback((r=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==c?void 0:c(t);case 2:!d&&o?s?a(1):a(0):i();case 3:case"end":return e.stop()}},e)})),function(e){return r.apply(this,arguments)}),[c,i,a,d,o,s]),g=t9(!s,u,tF.createElement(rc,null),l,tF.createElement(rl,null)),v=tF.useMemo(function(){return s?"Unmute (m)":"Mute (m)"},[s]);return tF.createElement("div",{className:tI.volume.container()},tF.createElement("button",rn({className:tI.iconButton(),title:v,"aria-label":v,ref:t,onClick:p},f),g),o&&d&&tF.createElement(rf,null))}).displayName="Volume";var rd=function(e){var t,r=e.volume;return{volume:r,requestVolume:e.requestVolume,muted:e.muted}}
1,rf=function(){var e,t=t6(rd),r=t.volume,n=t.requestVolume,i=t.muted,s=tF.useCallback((e=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n(t);case 1:case"end":return e.stop()}},e)})),function(t){return e.apply(this,arguments)}),[n]);return tF.createElement(re,{ariaName:"volume",value:i?0:r,onChange:s})};function rp(){return(0,tB.useSyncExternalStoreWithSelector)(function(e){var t,r,n,i;return r=eO(),n=(0,m.d)((0,m.e)().mark(function t(){return(0,m.e)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e(ek()));case 1:case"end":return t.stop()}},t)})),i=function(){return n.apply(this,arguments)},r.subscribe(function(e){return e.provider},i)},function(){return ek()},function(){return ek()},function(e){return e})}function rg(e){var t,r,n,i=rp(),s=(0,tF.useMemo)(function(){var t;return"string"==typeof e?e:{assetId:null!==(t=null==e?void 0:e.assetId)&&void 0!==t?t:""}},[e]);return(0,tU.u)(tK({context:tU.Q,queryKey:[{entity:"getAsset",args:s,livepeerProvider:i}],queryFn:(n=(0,tU._)((0,tU.a)().mark(function e(){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",eC(s));case 1:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)}),enabled:Boolean("string"==typeof e?e:null==e?void 0:e.assetId)},"object"===t$(e)?eF(e,tU.b):{}))}function rv(e){var t,r=rp(),n=t8((0,tF.useState)(void 0),2),i=n[0],s=n[1],a=tV((t=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",eL(tK(tK({},t),{},{onUploadProgress:function(e){return s(1===e?void 0:e)}})));case 1:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),tK({context:tU.Q,mutationKey:[{entity:"createAsset",livepeerProvider:r}]},"object"===t$(e)?eF(e,tW):{}));return tK(tK({},a),{},{uploadProgress:i})}function ry(e){var t,r=rp();return tV((t=(0,tU._)((0,tU.a)().mark(function e(t){return(0,tU.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",eI(t));case 1:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),tK({context:tU.Q,mutationKey:[{entity:"updateAsset",livepeerProvider:r}]},"object"===t$(e)?eF(e,tW):{}))}var rm=function(e){return{fullscreen:e.fullscreen}};tF.forwardRef(function(e,t){var r=e.src,n=e.autoPlay,i=e.title,s=e.loop,a=e.muted,o=e.objectFit,u=t6(rm).fullscreen,l=tF.useMemo(function(){return r.filter(function(e){return(null==e?void 0:e.mime)&&eK(e.mime)})},[r]);return tF.createElement("audio",{className:tI.media.audio({size:u?"fullscreen":o}),loop:s,"aria-label":null!=i?i:"Audio player",role:"audio",autoPlay:n,ref:t,"webkit-playsinline":"true",playsInl
1ine:!0,muted:a},l.map(function(e){return tF.createElement("source",{key:e.src,src:e.src,type:e.mime})}),"Your browser doesn't support the HTML5 <code>audio</code> tag, or the audio format.")}).displayName="AudioPlayer";var rb=function(e){return{fullscreen:e.fullscreen}},rE=tF.forwardRef(function(e,t){var r=e.src,n=e.autoPlay,i=e.title,s=e.loop,a=e.muted,o=e.poster,u=e.objectFit,l=t6(rb).fullscreen,c=tF.useMemo(function(){return null==r?void 0:r.filter(function(e){return(null==e?void 0:e.mime)&&eK(e.mime)})},[r]);return tF.createElement("video",{className:tI.media.video({size:l?"fullscreen":u}),loop:s,"aria-label":null!=i?i:"Video player",role:"video",autoPlay:n,width:"100%",height:"100%",ref:t,"webkit-playsinline":"true",playsInline:!0,muted:a,poster:o},null==c?void 0:c.map(function(e){return tF.createElement("source",{key:e.src,src:e.src,type:e.mime})}),"Your browser doesn't support the HTML5 <code>video</code> tag, or the video format.")});rE.displayName="VideoPlayer";var rS=function(e){var t,r=e._element,n=e.fullscreen,i=e.setLive;return{element:r,fullscreen:n,setLive:i,onDurationChange:e.onDurationChange,onCanPlay:e.onCanPlay}};tF.forwardRef(function(e,t){var r=e.hlsConfig,n=e.src,i=e.autoPlay,s=e.title,a=e.loop,o=e.muted,u=e.poster,l=e.objectFit,c=t6(rS),h=c.element,d=c.fullscreen,f=c.setLive,p=c.onDurationChange,g=c.onCanPlay,v=tF.useMemo(function(){return[!eN||_().isSupported(),eK("application/vnd.apple.mpegurl")]},[]),y=t8(v,2),m=y[0],b=y[1];return tF.useEffect(function(){if(h&&m&&!b&&n){var e=e6(n,h,f,p,g,tK({autoplay:i},r)).destroy;return function(){e()}}},[i,r,n,h,m,b,f,p,g]),!b&&m?tF.createElement("video",{className:tI.media.video({size:d?"fullscreen":l}),loop:a,"aria-label":null!=s?s:"Video player",role:"video",width:"100%",height:"100%",ref:t,"webkit-playsinline":"true",playsInl
1ine:!0,autoPlay:i,muted:o,poster:u}):tF.createElement(rE,rn({},e,{ref:t,src:[tK(tK({},n),{},{type:"video"})]}))}).displayName="HlsPlayer"},8897:function(e,t,r){var n;(n=function(e,t,r){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(t);/**
2   * query-core
3   *
4   * Copyright (c) TanStack
5   *
6   * This source code is licensed under the MIT license found in the
7   * LICENSE.md file in the root directory of this source tree.
8   *
9   * @license MIT
10   */ class i{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.push(e),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(t=>t!==e),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}let s="undefined"==typeof window;function a(){}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function u(e,t){return e.filter(e=>-1===t.indexOf(e))}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t,r){return w(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function h(e,t,r){return w(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}function d(e,t,r){return w(e)?[{...t,queryKey:e},r]:[e||{},t]}function f(e,t,r){return w(e)?[{...t,mutationKey:e},r]:[e||{},t]}function p(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(w(a)){if(n){if(t.queryHash!==v(a,t.options))return!1}else{var u,l;if(u=t.queryKey,l=a,!m(u,l))return!1}}if("all"!==r){let c=t.isActive();if("active"===r&&!c||"inactive"===r&&c)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(void 0===i||i===t.state.fetchStatus)&&!(s&&!s(t))}function g(e,t){let{exact:r,fetching:n,predicate:i,mutationKey:s}=e;if(w(s)){if(!t.options.mutationKey)return!1;if(r){if(y(t.options.mutationKey)!==y(s))return!1}else{var a,o;if(a=t.options.mutationKey,o=s,!m(a,o))return!1}}return("boolean"!=typeof n||"loading"===t.state.status===n)&&!(i&&!i(t))}function v(e,t){return((null==t?void 0:t.queryKeyHashFn)||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>S(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some(r=>!m(e[r],t[r]))}function b(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function E(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!T(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!T(r)&&!!r.hasOwnProperty("isPrototypeOf")}function T(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return Array.isArray(e)}function A(e){return new Promise(t=>{setTimeout(t,e)})}function x(e){A(0).then(e)}function _(e,t,r){return null!=r.isDataEqual&&r.isDataEqual(e,t)?e:"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=E(t)&&E(r);if(n||S(t)&&S(r)){let i=n?t.length:Object.keys(t).length,s=n?r:Object.keys(r),a=s.length,o=n?[]:{},u=0;for(let l=0;l<a;l++){let c=n?l:s[l];o[c]=e(t[c],r[c]),o[c]===t[c]&&u++}return i===a&&u===i?t:o}return r}(e,t):t}let R=new class extends i{constructor(){super(),this.setup=e=>{if(!s&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.focused=e,e&&this.onFocus()}
10onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},O=new class extends i{constructor(){super(),this.setup=e=>{if(!s&&window.addEventListener){let t=()=>e();return window.addEventListener("online",t,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){this.online=e,e&&this.onOnline()}onOnline(){this.listeners.forEach(e=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};function k(e){return Math.min(1e3*2**e,3e4)}function L(e){return"online"!==(null!=e?e:"online")||O.isOnline()}class C{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function I(e){return e instanceof C}function D(e){let t,r,n,i=!1,s=0,a=!1,o=new Promise((e,t)=>{r=e,n=t}),u=()=>!R.isFocused()||"always"!==e.networkMode&&!O.isOnline(),l=n=>{a||(a=!0,null==e.onSuccess||e.onSuccess(n),null==t||t(),r(n))},c=r=>{a||(a=!0,null==e.onError||e.onError(r),null==t||t(),n(r))},h=()=>new Promise(r=>{t=e=>{if(a||!u())return r(e)},null==e.onPause||e.onPause()}).then(()=>{t=void 0,a||null==e.onContinue||e.onContinue()}),d=()=>{if(a)return;let t;try{t=e.fn()}catch(r){t=Promise.reject(r)}Promise.resolve(t).then(l).catch(t=>{var r,n;if(a)return;let o=null!=(r=e.retry)?r:3,l=null!=(n=e.retryDelay)?n:k,f="function"==typeof l?l(s,t):l,p=!0===o||"number"==typeof o&&s<o||"function"==typeof o&&o(s,t);!i&&p?(s++,null==e.onFail||e.onFail(s,t),A(f).then(()=>{if(u())return h()}).then(()=>{i?c(t):d()})):c(t)})};return L(e.networkMode)?d():h().then(d),{promise:o,cancel(t){a||(c(new C(t)),null==e.abort||e.abort())},continue(){null==t||t()},cancelRetry(){i=!0},continueRetry(){i=!1}}}let P=console,M=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=n=>{t?e.push(n):x(()=>{r(n)})},s=()=>{let t=e;e=[],t.length&&x(()=>{n(()=>{t.forEach(e=>{r(e)})})})};return{batch(e){let r;t++;try{r=e()}finally{--t||s()}return r},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction(e){r=e},setBatchNotifyFunction(e){n=e}}}();class U{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:s?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class F extends U{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||P,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==e.initialData?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0,n=void 0!==t;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.meta=e.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.meta=null==e?void 0:e.meta,this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){let r=_(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then(a).catch(a):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!l(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){-1!==this.observers.indexOf(e)&&(this.observers=this.observers.filter(t=>
10t!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,n,i,s;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let a=this.observers.find(e=>e.options.queryFn);a&&this.setOptions(a.options)}Array.isArray(this.options.queryKey);let o=function(){if("function"==typeof AbortController)return new AbortController}(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};l(u);let c={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn"),meta:this.meta};l(c),null==(r=this.options.behavior)||r.onFetch(c),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=c.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(s=c.fetchOptions)?void 0:s.meta});let h=e=>{var t,r;I(e)&&e.silent||this.dispatch({type:"error",error:e}),I(e)||null==(t=(r=this.cache.config).onError)||t.call(r,e,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=D({fn:c.fetchFn,abort:null==o?void 0:o.abort.bind(o),onSuccess:e=>{var t,r;void 0!==e?(this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):h(Error("Query data cannot be undefined"))},onError:h,onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var r,n;switch(e.type){case"failed":return{...t,fetchFailureCount:t.fetchFailureCount+1};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:L(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(n=e.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0}};case"error":let i=e.error;return I(i)&&i.revert&&this.revertState?{...this.revertState}:{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),M.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}class B extends i{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var n;let i=t.queryKey,s=null!=(n=t.queryHash)?n:v(i,t),a=this.get(s);return a||(a=new F({cache:this,logger:e.getLogger(),queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i),meta:t.meta}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){M.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=d(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>p(r,e))}findAll(e,t){let[r]=d(e,t);return Object.keys(r).length>0?this.queries.filter(e=>p(r,e)):this.queries}notify(e){M.batch(()=>
10{this.listeners.forEach(t=>{t(e)})})}onFocus(){M.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){M.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class N extends U{constructor(e){super(),this.options={...e.defaultOptions,...e.options},this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||P,this.observers=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0},this.meta=e.meta,this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){var e,t,r,n,i,s,a,o,u,l,c,h,d,f,p,g;let v="loading"===this.state.status;try{if(!v){this.dispatch({type:"loading",variables:this.options.variables}),null==(a=(o=this.mutationCache.config).onMutate)||a.call(o,this.state.variables,this);let y=await (null==(u=(l=this.options).onMutate)?void 0:u.call(l,this.state.variables));y!==this.state.context&&this.dispatch({type:"loading",context:y,variables:this.state.variables})}let m=await (()=>{var e;return this.retryer=D({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return null==(e=(t=this.mutationCache.config).onSuccess)||e.call(t,m,this.state.variables,this.state.context,this),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,m,this.state.variables,this.state.context)),await (null==(i=(s=this.options).onSettled)?void 0:i.call(s,m,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:m}),m}catch(b){try{throw null==(c=(h=this.mutationCache.config).onError)||c.call(h,b,this.state.variables,this.state.context,this),await (null==(d=(f=this.options).onError)?void 0:d.call(f,b,this.state.variables,this.state.context)),await (null==(p=(g=this.options).onSettled)?void 0:p.call(g,void 0,b,this.state.variables,this.state.context)),b}finally{this.dispatch({type:"error",error:b})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:t.failureCount+1};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,error:null,isPaused:!L(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),M.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}class j extends i{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let n=new N({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0,meta:t.meta});return this.add(n),n}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){M.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>g(e,t))}findAll(e){return this.mutations.filter(t=>g(e,t))}notify(e){M.batch(()=>
10{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.mutations.filter(e=>e.state.isPaused);return M.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch(a)),Promise.resolve()))}}function q(){return{onFetch(e){e.fetchFn=()=>{var t,r,n,i,s,a;let o=null==(t=e.fetchOptions)||null==(r=t.meta)?void 0:r.refetchPage,u=null==(n=e.fetchOptions)||null==(i=n.meta)?void 0:i.fetchMore,l=null==u?void 0:u.pageParam,c="forward"===(null==u?void 0:u.direction),h="backward"===(null==u?void 0:u.direction),d=(null==(s=e.state.data)?void 0:s.pages)||[],f=(null==(a=e.state.data)?void 0:a.pageParams)||[],p=f,g=!1,v=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),y=(e,t,r,n)=>(p=n?[t,...p]:[...p,t],n?[r,...e]:[...e,r]),m=(t,r,n,i)=>{if(g)return Promise.reject("Cancelled");if(void 0===n&&!r&&t.length)return Promise.resolve(t);let s={queryKey:e.queryKey,pageParam:n,meta:e.meta};Object.defineProperty(s,"signal",{enumerable:!0,get(){var t,r;return null!=(t=e.signal)&&t.aborted?g=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{g=!0}),e.signal}});let a=v(s);return Promise.resolve(a).then(e=>y(t,n,e,i))},b;if(d.length){if(c){let E=void 0!==l,S=E?l:H(e.options,d);b=m(d,E,S)}else if(h){let T=void 0!==l,w=T?l:z(e.options,d);b=m(d,T,w,!0)}else{p=[];let A=void 0===e.options.getNextPageParam;b=!o||!d[0]||o(d[0],0,d)?m([],A,f[0]):Promise.resolve(y([],f[0],d[0]));for(let x=1;x<d.length;x++)b=b.then(t=>{if(!o||!d[x]||o(d[x],x,d)){let r=A?f[x]:H(e.options,t);return m(t,A,r)}return Promise.resolve(y(t,f[x],d[x]))})}}else b=m([]);return b.then(e=>({pages:e,pageParams:p}))}}}}function H(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}function z(e,t){return null==e.getPreviousPageParam?void 0:e.getPreviousPageParam(t[0],t)}class G extends i{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.length&&(this.currentQuery.addObserver(this),K(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return W(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){let r=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),b(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let i=this.hasListeners();i&&V(this.currentQuery,n,this.options,r)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let s=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(e){let t=this.client.getQueryCache().build(this.client,e);return this.createResult(t,e)}getCurrentResult(){return this.currentResult}trackResult(e){let t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){let t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(a)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),s||this.currentResult.isStale||!o(this.options.staleTime))return;let e=l(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},e)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!s&&!1!==this.options.enabled&&o(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>
10{(this.options.refetchIntervalInBackground||R.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){let r=this.currentQuery,n=this.options,i=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,o=e!==r,u=o?e.state:this.currentQueryInitialState,l=o?this.currentResult:this.previousQueryResult,{state:c}=e,h,{dataUpdatedAt:d,error:f,errorUpdatedAt:p,fetchStatus:g,status:v}=c,y=!1,m=!1;if(t._optimisticResults){let b=this.hasListeners(),E=!b&&K(e,t),S=b&&V(e,r,t,n);(E||S)&&(g=L(e.options.networkMode)?"fetching":"paused",d||(v="loading")),"isRestoring"===t._optimisticResults&&(g="idle")}if(t.keepPreviousData&&!c.dataUpdateCount&&null!=l&&l.isSuccess&&"error"!==v)h=l.data,d=l.dataUpdatedAt,v=l.status,y=!0;else if(t.select&&void 0!==c.data){if(i&&c.data===(null==s?void 0:s.data)&&t.select===this.selectFn)h=this.selectResult;else try{this.selectFn=t.select,h=t.select(c.data),h=_(null==i?void 0:i.data,h,t),this.selectResult=h,this.selectError=null}catch(T){this.selectError=T}}else h=c.data;if(void 0!==t.placeholderData&&void 0===h&&"loading"===v){let w;if(null!=i&&i.isPlaceholderData&&t.placeholderData===(null==a?void 0:a.placeholderData))w=i.data;else if(w="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==w)try{w=t.select(w),w=_(null==i?void 0:i.data,w,t),this.selectError=null}catch(A){this.selectError=A}void 0!==w&&(v="success",h=w,m=!0)}this.selectError&&(f=this.selectError,h=this.selectResult,p=Date.now(),v="error");let x="fetching"===g;return{status:v,fetchStatus:g,isLoading:"loading"===v,isSuccess:"success"===v,isError:"error"===v,data:h,dataUpdatedAt:d,error:f,errorUpdatedAt:p,failureCount:c.fetchFailureCount,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&"loading"!==v,isLoadingError:"error"===v&&0===c.dataUpdatedAt,isPaused:"paused"===g,isPlaceholderData:m,isPreviousData:y,isRefetchError:"error"===v&&0!==c.dataUpdatedAt,isStale:$(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){let t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,b(r,t))return;this.currentResult=r;let n={cache:!0};!1!==(null==e?void 0:e.listeners)&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options;if("all"===e||!e&&!this.trackedProps.size)return!0;let r=new Set(null!=e?e:this.trackedProps);return this.options.useErrorBoundary&&r.add("error"),Object.keys(this.currentResult).some(e=>this.currentResult[e]!==t[e]&&r.has(e))})()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){let e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;let t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){let t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||I(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){M.batch(()=>{var t,r,n,i,s,a,o,u;e.onSuccess?(null==(t=(r=this.options).onSuccess)||t.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):e.onError&&(null==(s=(a=this.options).onError)||s.call(a,this.currentResult.error),null==(o=(u=this.options).onSettled)||o.call(u,void 0,this.currentResult.error)),e.listeners&&this.listeners.forEach(e=>{e(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function K(e,t){var r,n;return!(!1===t.enabled||e.state.dataUpdatedAt||"error"===e.state.status&&!1===t.retryOn
10Mount)||e.state.dataUpdatedAt>0&&W(e,t,t.refetchOnMount)}function W(e,t,r){if(!1!==t.enabled){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&$(e,t)}return!1}function V(e,t,r,n){return!1!==r.enabled&&(e!==t||!1===n.enabled)&&(!r.suspense||"error"!==e.state.status)&&$(e,r)}function $(e,t){return e.isStaleByTime(t.staleTime)}class Q extends i{constructor(e,t){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},t&&this.setQueries(t)}onSubscribe(){1===this.listeners.length&&this.observers.forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})})}onUnsubscribe(){this.listeners.length||this.destroy()}destroy(){this.listeners=[],this.observers.forEach(e=>{e.destroy()})}setQueries(e,t){this.queries=e,M.batch(()=>{let e=this.observers,r=this.findMatchingObservers(this.queries);r.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions,t));let n=r.map(e=>e.observer),i=Object.fromEntries(n.map(e=>[e.options.queryHash,e])),s=n.map(e=>e.getCurrentResult()),a=n.some((t,r)=>t!==e[r]);(e.length!==n.length||a)&&(this.observers=n,this.observersMap=i,this.result=s,this.hasListeners()&&(u(e,n).forEach(e=>{e.destroy()}),u(n,e).forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})}),this.notify()))})}getCurrentResult(){return this.result}getOptimisticResult(e){return this.findMatchingObservers(e).map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions))}
10findMatchingObservers(e){let t=this.observers,r=e.map(e=>this.client.defaultQueryOptions(e)),n=r.flatMap(e=>{let r=t.find(t=>t.options.queryHash===e.queryHash);return null!=r?[{defaultedQueryOptions:e,observer:r}]:[]}),i=n.map(e=>e.defaultedQueryOptions.queryHash),s=r.filter(e=>!i.includes(e.queryHash)),a=t.filter(e=>!n.some(t=>t.observer===e)),o=e=>{let t=this.client.defaultQueryOptions(e),r=this.observersMap[t.queryHash];return null!=r?r:new G(this.client,t)},u=s.map((e,t)=>{if(e.keepPreviousData){let r=a[t];if(void 0!==r)return{defaultedQueryOptions:e,observer:r}}return{defaultedQueryOptions:e,observer:o(e)}});return n.concat(u).sort((e,t)=>r.indexOf(e.defaultedQueryOptions)-r.indexOf(t.defaultedQueryOptions))}onUpdate(e,t){let r=this.observers.indexOf(e);-1!==r&&(this.result=function(e,t,r){let n=e.slice(0);return n[t]=r,n}(this.result,r,t),this.notify())}notify(){M.batch(()=>{this.listeners.forEach(e=>{e(this.result)})})}}class Y extends G{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:q()},t)}getOptimisticResult(e){return e.behavior=q(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,t){var r,n,i,s,a,o;let{state:u}=e;return{...super.createResult(e,t),fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:function(e,t){if(e.getNextPageParam&&Array.isArray(t)){let r=H(e,t);return null!=r&&!1!==r}}(t,null==(r=u.data)?void 0:r.pages),hasPreviousPage:function(e,t){if(e.getPreviousPageParam&&Array.isArray(t)){let r=z(e,t);return null!=r&&!1!==r}}(t,null==(n=u.data)?void 0:n.pages),isFetchingNextPage:"fetching"===u.fetchStatus&&"forward"===(null==(i=u.fetchMeta)||null==(s=i.fetchMore)?void 0:s.direction),isFetchingPreviousPage:"fetching"===u.fetchStatus&&"backward"===(null==(a=u.fetchMeta)||null==(o=a.fetchMore)?void 0:o.direction)}}}class X extends i{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.client.defaultMutationOptions(e),b(t,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){var e;this.listeners.length||null==(e=this.currentMutation)||e.removeObserver(this)}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0},t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){M.batch(()=>{var t,r,n,i,s,a,o,u;this.mutateOptions&&(e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(s=(a=this.mutateOptions).onError)||s.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(o=(u=this.mutateOptions).onSettled)||o.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))),e.listeners&&this.listeners.forEac
10h(e=>{e(this.currentResult)})})}}function J(e){return e.state.isPaused}function Z(e){return"success"===e.state.status}function ee(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),s=t.mutations||[],a=t.queries||[];s.forEach(t=>{var i;n.build(e,{...null==r||null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),a.forEach(t=>{var n;let s=i.get(t.queryHash);s?s.state.dataUpdatedAt<t.state.dataUpdatedAt&&s.setState(t.state):i.build(e,{...null==r||null==(n=r.defaultOptions)?void 0:n.queries,queryKey:t.queryKey,queryHash:t.queryHash},t.state)})}let et=n.createContext(void 0),er=n.createContext(!1);function en(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=et),window.ReactQueryClientContext):et)}let ei=({context:e}={})=>{let t=n.useContext(en(e,n.useContext(er)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},es=n.createContext(!1),ea=()=>n.useContext(es),eo=es.Provider;function eu(){let e=!1;return{clearReset(){e=!1},reset(){e=!0},isReset:()=>e}}let el=n.createContext(eu()),ec=()=>n.useContext(el);function eh(e,t){return"function"==typeof e?e(...t):!!e}function ed(e,t){let i=ei({context:e.context}),s=ea(),a=ec(),o=i.defaultQueryOptions(e);o._optimisticResults=s?"isRestoring":"optimistic",o.onError&&(o.onError=M.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=M.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=M.batchCalls(o.onSettled)),o.suspense&&"number"!=typeof o.staleTime&&(o.staleTime=1e3),(o.suspense||o.useErrorBoundary)&&(a.isReset()||(o.retryOnMount=!1));let[u]=n.useState(()=>new t(i,o)),l=u.getOptimisticResult(o);if(r.useSyncExternalStore(n.useCallback(e=>s?()=>{}:u.subscribe(M.batchCalls(e)),[u,s]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),n.useEffect(()=>{a.clearReset()},[a]),n.useEffect(()=>{u.setOptions(o,{listeners:!1})},[o,u]),o.suspense&&l.isLoading&&l.isFetching&&!s)throw u.fetchOptimistic(o).then(({data:e})=>{null==o.onSuccess||o.onSuccess(e),null==o.onSettled||o.onSettled(e,null)}
10).catch(e=>{a.clearReset(),null==o.onError||o.onError(e),null==o.onSettled||o.onSettled(void 0,e)});if(l.isError&&!a.isReset()&&!l.isFetching&&eh(o.useErrorBoundary,[l.error,u.getCurrentQuery()]))throw l.error;return o.notifyOnChangeProps?l:u.trackResult(l)}function ef(e,t={}){let r=ei({context:t.context}),i=n.useRef(t);i.current=t,n.useMemo(()=>{e&&ee(r,e,i.current)},[r,e])}function ep(){}e.CancelledError=C,e.Hydrate=({children:e,options:t,state:r})=>(ef(r,t),e),e.InfiniteQueryObserver=Y,e.IsRestoringProvider=eo,e.MutationCache=j,e.MutationObserver=X,e.QueriesObserver=Q,e.QueryCache=B,e.QueryClient=class{constructor(e={}){this.queryCache=e.queryCache||new B,this.mutationCache=e.mutationCache||new j,this.logger=e.logger||P,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=R.subscribe(()=>{R.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=O.subscribe(()=>{O.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var e,t;null==(e=this.unsubscribeFocus)||e.call(this),null==(t=this.unsubscribeOnline)||t.call(this)}isFetching(e,t){let[r]=d(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){var n,i;let s=this.queryCache.find(e),a=(i=null==s?void 0:s.state.data,"function"==typeof t?t(i):t);if(void 0===a)return;let o=c(e),u=this.defaultQueryOptions(o);return this.queryCache.build(this,u).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return M.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=d(e,t),n=this.queryCache;M.batch(()=>{n.findAll(r).forEach(e=>{n.remove(e)})})}resetQueries(e,t,r){let[n,i]=d(e,t,r),s=this.queryCache,a={type:"active",...n};return M.batch(()=>(s.findAll(n).forEach(e=>{e.reset()}),this.refetchQueries(a,i)))}cancelQueries(e,t,r){let[n,i={}]=d(e,t,r);void 0===i.revert&&(i.revert=!0);let s=M.batch(()=>this.queryCache.findAll(n).map(e=>e.cancel(i)));return Promise.all(s).then(a).catch(a)}invalidateQueries(e,t,r){let[n,i]=d(e,t,r);return M.batch(()=>{var e,t;if(this.queryCache.findAll(n).forEach(e=>{e.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(e=null!=(t=n.refetchType)?t:n.type)?e:"active"};return this.refetchQueries(r,i)})}refetchQueries(e,t,r){let[n,i]=d(e,t,r),s=M.batch(()=>this.queryCache.findAll(n).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:n.refetchPage}})})),o=Promise.all(s).then(a);return null!=i&&i.throwOnError||(o=o.catch(a)),o}fetchQuery(e,t,r){let n=c(e,t,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let s=this.queryCache.build(this,i);return s.isStaleByTime(i.staleTime)?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(a).catch(a)}fetchInfiniteQuery(e,t,r){let n=c(e,t,r);return n.behavior=q(),this.fetchQuery(n)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(a).catch(a)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>y(e)===y(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>{var r,n;return m(e,n=t.queryKey)});return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>y(e)===y(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>{var r,n;return m(e,n=t.mutationKey)});return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=v(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}},e.QueryClientProvider=({client:e,children:t,context:r,contextSharing:i=!1})=>{n.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);let s=en(r,i);return n.createElement(er.Provider,{value:!r&&i},n.createElement(s.Provider,{value:e},t))},e.QueryErrorResetBoundary=({children:e})=>{let[t]=n.useState(()=>eu());return n.createElement(el.Provider,{value:t},"function"==typeof e?e(t):e)},e.QueryObserver=G,e.defaultContext=et,e.dehydrate=function(e,t={}){let r=[],n=[];if(!1!==t.dehydrateMutations){let i=t.shouldDehydrateMutation||J;
10e.getMutationCache().getAll().forEach(e=>{var t;i(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let s=t.shouldDehydrateQuery||Z;e.getQueryCache().getAll().forEach(e=>{var t;s(e)&&n.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:n}},e.focusManager=R,e.hashQueryKey=y,e.hydrate=ee,e.isCancelledError=I,e.isError=function(e){return e instanceof Error},e.notifyManager=M,e.onlineManager=O,e.parseFilterArgs=d,e.parseMutationArgs=h,e.parseMutationFilterArgs=f,e.parseQueryArgs=c,e.useHydrate=ef,e.useInfiniteQuery=function(e,t,r){return ed(c(e,t,r),Y)},e.useIsFetching=function(e,t,i){let[s,a={}]=d(e,t,i),o=ei({context:a.context}),u=o.getQueryCache();return r.useSyncExternalStore(n.useCallback(e=>u.subscribe(M.batchCalls(e)),[u]),()=>o.isFetching(s),()=>o.isFetching(s))},e.useIsMutating=function(e,t,i){let[s,a={}]=f(e,t,i),o=ei({context:a.context}),u=o.getMutationCache();return r.useSyncExternalStore(n.useCallback(e=>u.subscribe(M.batchCalls(e)),[u]),()=>o.isMutating(s),()=>o.isMutating(s))},e.useIsRestoring=ea,e.useMutation=function(e,t,i){let s=h(e,t,i),a=ei({context:s.context}),[o]=n.useState(()=>new X(a,s));n.useEffect(()=>{o.setOptions(s)},[o,s]);let u=r.useSyncExternalStore(n.useCallback(e=>o.subscribe(M.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=n.useCallback((e,t)=>{o.mutate(e,t).catch(ep)},[o]);if(u.error&&eh(o.options.useErrorBoundary,[u.error]))throw u.error;return{...u,mutate:l,mutateAsync:u.mutate}},e.useQueries=function({queries:e,context:t}){let i=ei({context:t}),s=ea(),a=n.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=s?"isRestoring":"optimistic",t}),[e,i,s]),[o]=n.useState(()=>new Q(i,a)),u=o.getOptimisticResult(a);return r.useSyncExternalStore(n.useCallback(e=>s?()=>{}:o.subscribe(M.batchCalls(e)),[o,s]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),n.useEffect(()=>{o.setQueries(a,{listeners:!1})},[a,o]),u},e.useQuery=function(e,t,r){return ed(c(e,t,r),G)},e.useQueryClient=ei,e.useQueryErrorResetBoundary=ec,Object.defineProperty(e,"__esModule",{value:!0})})(t,r(7294),r(1688))},7320:function(e,t){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function o(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=s,t.exists=a,t.output=o,t.default={number:r,bool:n,bytes:i,hash:s,exists:a,output:o}},7505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(7320),i=r(8089);class s extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);let{view:t,buffer:r,blockLen:s}=this;e=(0,i.toBytes)(e);let a=e.length;for(let o=0;o<a;){let u=Math.min(s-this.pos,a-o);if(u===s){let l=(0,i.createView)(e);for(;s<=a-o;o+=s)this.process(l,o);continue}r.set(e.subarray(o,o+u),this.pos),this.pos+=u,o+=u,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let u=o;u<s;u++)t[u]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s);e.setUint32(t+(n?4:0),a,n),e.setUint32(t+(n?0:4),o,n)}(r,s-8,BigInt(8*this.length),a),this.process(r,0);let l=(0,i.createView)(e);
10this.get().forEach((e,t)=>l.setUint32(4*t,e,a))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}t.SHA2=s},6873:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;let r=BigInt(4294967296-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){let{h:a,l:o}=i(e[s],t);[r[s],n[s]]=[a,o]}return[r,n]}t.fromBig=i,t.split=s;let a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);function o(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/4294967296|0)|0,l:0|i}}t.toBig=a,t.add=o;let u={fromBig:i,split:s,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:o,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/4294967296|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/4294967296|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=u},4421:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},9569:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;let n=r(7320),i=r(8089);class s extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);let r=(0,i.toBytes)(t);if(this.iHash=e.create(),!(this.iHash instanceof i.Hash))throw TypeError("Expected instance of class which extends utils.Hash");let s=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;let a=new Uint8Array(s);a.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=e.create();for(let u=0;u<a.length;u++)a[u]^=106;this.oHash.update(a),a.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let a=(e,t,r)=>new s(e,t).update(r).digest();t.hmac=a,t.hmac.create=(e,t)=>new s(e,t)},9023:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;let n=r(7320),i=r(9569),s=r(8089);function a(e,t,r,a){n.default.hash(e);let o=(0,s.checkOpts)({dkLen:32,asyncTick:10},a),{c:u,dkLen:l,asyncTick:c}=o;if(n.default.number(u),n.default.number(l),n.default.number(c),u<1)throw Error("PBKDF2: iterations (c) should be >= 1");let h=(0,s.toBytes)(t),d=(0,s.toBytes)(r),f=new Uint8Array(l),p=i.hmac.create(e,h),g=p._cloneInto().update(d);return{c:u,dkLen:l,asyncTick:c,DK:f,PRF:p,PRFSalt:g}}function o(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}async function u(e,t,r,n){let{c:i,dkLen:u,asyncTick:l,DK:c,PRF:h,PRFSalt:d}=a(e,t,r,n),f,p=new Uint8Array(4),g=(0,s.createView)(p),v=new Uint8Array(h.outputLen);for(let y=1,m=0;m<u;y++,m+=h.outputLen){let b=c.subarray(m,m+h.outputLen);g.setInt32(0,y,!1),(f=d._cloneInto(f)).update(p).digestInto(v),b.set(v.subarray(0,b.length)),await (0,s.asyncLoop)(i-1,l,e=>{h._cloneInto(f).update(v).digestInto(v);for(let t=0;t<b.length;t++)b[t]^=v[t]})}return o(h,d,c,f,v)}t.pbkdf2=function(e,t,r,n){let{c:i,dkLen:u,DK:l,PRF:c,PRFSalt:h}=a(e,t,r,n),d,f=new Uint8Array(4),p=(0,s.createView)(f),g=new Uint8Array(c.outputLen);for(let v=1,y=0;y<u;v++,y+=c.outputLen){let m=l.subarray(y,y+c.outputLen);p.setInt32(0,v,!1),(d=h._cloneInto(d)).update(f).digestInto(g),m.set(g.subarray(0,m.length));for(let b=1;b<i;b++){c._cloneInto(d).update(g).digestInto(g);for(let E=0;E<m.length;E++)m[E]^=g[E]}}return o(c,h,l,d,g)}
10,t.pbkdf2Async=u},3061:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;let n=r(7505),i=r(8089),s=(e,t,r)=>e&t^~e&r,a=(e,t,r)=>e&t^e&r^t&r,o=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),u=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),l=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|u[0],this.B=0|u[1],this.C=0|u[2],this.D=0|u[3],this.E=0|u[4],this.F=0|u[5],this.G=0|u[6],this.H=0|u[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)l[r]=e.getUint32(t,!1);for(let n=16;n<64;n++){let u=l[n-15],c=l[n-2],h=(0,i.rotr)(u,7)^(0,i.rotr)(u,18)^u>>>3,d=(0,i.rotr)(c,17)^(0,i.rotr)(c,19)^c>>>10;l[n]=d+l[n-7]+h+l[n-16]|0}let{A:f,B:p,C:g,D:v,E:y,F:m,G:b,H:E}=this;for(let S=0;S<64;S++){let T=(0,i.rotr)(y,6)^(0,i.rotr)(y,11)^(0,i.rotr)(y,25),w=E+T+s(y,m,b)+o[S]+l[S]|0,A=(0,i.rotr)(f,2)^(0,i.rotr)(f,13)^(0,i.rotr)(f,22),x=A+a(f,p,g)|0;E=b,b=m,m=y,y=v+w|0,v=g,g=p,p=f,f=w+x|0}f=f+this.A|0,p=p+this.B|0,g=g+this.C|0,v=v+this.D|0,y=y+this.E|0,m=m+this.F|0,b=b+this.G|0,E=E+this.H|0,this.set(f,p,g,v,y,m,b,E)}roundClean(){l.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,i.wrapConstructor)(()=>new c)},6262:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512=t.SHA512=void 0;let n=r(7505),i=r(6873),s=r(8089),[a,o]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
105771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),u=new Uint32Array(80),l=new Uint32Array(80);class c extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:u,El:l,Fh:c,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,a,o,u,l,c,h,d,f,p,g]}set(e,t,r,n,i,s,a,o,u,l,c,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|u,this.El=0|l,this.Fh=0|c,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),l[r]=e.getUint32(t+=4);for(let n=16;n<80;n++){let s=0|u[n-15],c=0|l[n-15],h=i.default.rotrSH(s,c,1)^i.default.rotrSH(s,c,8)^i.default.shrSH(s,c,7),d=i.default.rotrSL(s,c,1)^i.default.rotrSL(s,c,8)^i.default.shrSL(s,c,7),f=0|u[n-2],p=0|l[n-2],g=i.default.rotrSH(f,p,19)^i.default.rotrBH(f,p,61)^i.default.shrSH(f,p,6),v=i.default.rotrSL(f,p,19)^i.default.rotrBL(f,p,61)^i.default.shrSL(f,p,6),y=i.default.add4L(d,v,l[n-7],l[n-16]),m=i.default.add4H(y,h,g,u[n-7],u[n-16]);u[n]=0|m,l[n]=0|y}let{Ah:b,Al:E,Bh:S,Bl:T,Ch:w,Cl:A,Dh:x,Dl:_,Eh:R,El:O,Fh:k,Fl:L,Gh:C,Gl:I,Hh:D,Hl:P}=this;for(let M=0;M<80;M++){let U=i.default.rotrSH(R,O,14)^i.default.rotrSH(R,O,18)^i.default.rotrBH(R,O,41),F=i.default.rotrSL(R,O,14)^i.default.rotrSL(R,O,18)^i.default.rotrBL(R,O,41),B=R&k^~R&C,N=O&L^~O&I,j=i.default.add5L(P,F,N,o[M],l[M]),q=i.default.add5H(j,D,U,B,a[M],u[M]),H=0|j,z=i.default.rotrSH(b,E,28)^i.default.rotrBH(b,E,34)^i.default.rotrBH(b,E,39),G=i.default.rotrSL(b,E,28)^i.default.rotrBL(b,E,34)^i.default.rotrBL(b,E,39),K=b&S^b&w^S&w,W=E&T^E&A^T&A;D=0|C,P=0|I,C=0|k,I=0|L,k=0|R,L=0|O,({h:R,l:O}=i.default.add(0|x,0|_,0|q,0|H)),x=0|w,_=0|A,w=0|S,A=0|T,S=0|b,T=0|E;let V=i.default.add3L(H,G,W);b=i.default.add3H(V,q,z,K),E=0|V}({h:b,l:E}=i.default.add(0|this.Ah,0|this.Al,0|b,0|E)),({h:S,l:T}=i.default.add(0|this.Bh,0|this.Bl,0|S,0|T)),({h:w,l:A}=i.default.add(0|this.Ch,0|this.Cl,0|w,0|A)),({h:x,l:_}=i.default.add(0|this.Dh,0|this.Dl,0|x,0|_)),({h:R,l:O}=i.default.add(0|this.Eh,0|this.El,0|R,0|O)),({h:k,l:L}=i.default.add(0|this.Fh,0|this.Fl,0|k,0|L)),({h:C,l:I}=i.default.add(0|this.Gh,0|this.Gl,0|C,0|I)),({h:D,l:P}=i.default.add(0|this.Hh,0|this.Hl,0|D,0|P)),this.set(b,E,S,T,w,A,x,_,R,O,k,L,C,I,D,P)}roundClean(){u.fill(0),l.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=c;class h extends c{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class d extends c{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,s.wrapConstructor)(()=>new c),t.sha512_256=(0,s.wrapConstructor)(()=>new h),t.sha384=(0,s.wrapConstructor)(()=>new d)},8089:function(e,t,r){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ Object.defineProperty(t,"__esMo
10dule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(4421),i=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u8=i;let s=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.u32=s;let a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.createView=a,t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){let n=2*r,i=e.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw Error("Invalid byte sequence");t[r]=s}return t};let u=async()=>{};async function l(e,r,n){let i=Date.now();for(let s=0;s<e;s++){n(s);let a=Date.now()-i;a>=0&&a<r||(await (0,t.nextTick)(),i+=a)}}function c(e){if("string"!=typeof e)throw TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}function h(e){if("string"==typeof e&&(e=c(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.nextTick=u,t.asyncLoop=l,t.utf8ToBytes=c,t.toBytes=h,t.concatBytes=function(...e){if(!e.every(e=>e instanceof Uint8Array))throw Error("Uint8Array list expected");if(1===e.length)return e[0];let t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let s=e[n];r.set(s,i),i+=s.length}return r},t.Hash=class{clone(){return this._cloneInto()}};let d=e=>"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object;t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||!d(t)))throw TypeError("Options should be object or undefined");let r=Object.assign(e,t);return r},t.wrapConstructor=function(e){let t=t=>e().update(h(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){let t=(t,r)=>e(r).update(h(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw Error("The environment doesn't have randomBytes function")}},9187:function(e,t){"use strict";function r(e){if(!Number.isSafeInteger(e))throw Error(`Wrong integer: ${e}`)}function n(...e){let t=(e,t)=>r=>e(t(r)),r=Array.from(e).reverse().reduce((e,r)=>e?t(e,r.encode):r.encode,void 0),n=e.reduce((e,r)=>e?t(e,r.decode):r.decode,void 0);return{encode:r,decode:n}}function i(e){return{encode(t){if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw Error("alphabet.encode input should be an array of numbers");return t.map(t=>{if(r(t),t<0||t>=e.length)throw Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw Error("alphabet.decode input should be array of strings");return t.map(t=>{if("string"!=typeof t)throw Error(`alphabet.decode: not string element=${t}`);let r=e.indexOf(t);if(-1===r)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return r})}}}function s(e=""){if("string"!=typeof e)throw Error("join separator should be string");return{encode(t){if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw Error("join.encode input should be array of strings");for(let r of t)if("string"!=typeof r)throw Error(`join.encode: non-string input=${r}`);return t.join(e)},decode(t){if("string"!=typeof t)throw Error("join.decode input should be string");return t.split(e)}}}function a(e,t="="){if(r(e),"string"!=typeof t)throw Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw Error("padding.encode input should be array of str
10ings");for(let n of r)if("string"!=typeof n)throw Error(`padding.encode: non-string input=${n}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw Error("padding.encode input should be array of strings");for(let n of r)if("string"!=typeof n)throw Error(`padding.decode: non-string input=${n}`);let i=r.length;if(i*e%8)throw Error("Invalid padding: string should have whole number of bytes");for(;i>0&&r[i-1]===t;i--)if(!((i-1)*e%8))throw Error("Invalid padding: string has too much padding");return r.slice(0,i)}}}function o(e){if("function"!=typeof e)throw Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,n){if(t<2)throw Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw Error("convertRadix: data should be array");if(!e.length)return[];let i=0,s=[],a=Array.from(e);for(a.forEach(e=>{if(r(e),e<0||e>=t)throw Error(`Wrong integer: ${e}`)});;){let o=0,u=!0;for(let l=i;l<a.length;l++){let c=a[l],h=t*o+c;if(!Number.isSafeInteger(h)||t*o/t!==o||h-c!=t*o||(o=h%n,a[l]=Math.floor(h/n),!Number.isSafeInteger(a[l])||a[l]*n+o!==h))throw Error("convertRadix: carry overflow");u&&(a[l]?u=!1:i=l)}if(s.push(o),u)break}for(let d=0;d<e.length-1&&0===e[d];d++)s.push(0);return s.reverse()}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64url=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0,t.assertNumber=r;let l=(e,t)=>t?l(t,e%t):e,c=(e,t)=>e+(t-l(e,t));function h(e,t,n,i){if(!Array.isArray(e))throw Error("convertRadix2: data should be array");if(t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw Error(`convertRadix2: wrong to=${n}`);if(c(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${c(t,n)}`);let s=0,a=0,o=2**n-1,u=[];for(let l of e){if(r(l),l>=2**t)throw Error(`convertRadix2: invalid data word=${l} from=${t}`);if(s=s<<t|l,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)u.push((s>>a-n&o)>>>0);s&=2**a-1}if(s=s<<n-a&o,!i&&a>=t)throw Error("Excess padding");if(!i&&s)throw Error(`Non-zero padding: ${s}`);return i&&a>0&&u.push(s>>>0),u}function d(e){return r(e),{encode(t){if(!(t instanceof Uint8Array))throw Error("radix.encode input should be Uint8Array");return u(Array.from(t),256,e)},decode(t){if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw Error("radix.decode input should be array of strings");return Uint8Array.from(u(t,e,256))}}}function f(e,t=!1){if(r(e),e<=0||e>32)throw Error("radix2: bits should be in (0..32]");if(c(8,e)>32||c(e,8)>32)throw Error("radix2: carry overflow");return{encode(r){if(!(r instanceof Uint8Array))throw Error("radix2.encode input should be Uint8Array");return h(Array.from(r),8,e,!t)},decode(r){if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw Error("radix2.decode input should be array of strings");return Uint8Array.from(h(r,e,8,t))}}}function p(e){if("function"!=typeof e)throw Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(r){}}}function g(e,t){if(r(e),"function"!=typeof t)throw Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw Error("checksum.encode: input should be Uint8Array");let n=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(n,r.length),i},decode(r){if(!(r instanceof Uint8Array))throw Error("checksum.decode: input should be Uint8Array");let n=r.slice(0,-e),i=t(n).slice(0,e),s=r.slice(-e);for(let a=0;a<e;a++)if(i[a]!==s[a])throw Error("Invalid checksum");return n}}}t.utils={alphabet:i,chain:n,checksum:g,radix:d,radix2:f,join:s,padding:a},t.base16=n(f(4),i("0123456789ABCDEF"),s("")),t.base32=n(f(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),a(5),s("")),t.base32hex=n(f(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),a(5),s("")),t.base32crockford=n(f(5),i("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),o(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),t.base64=n(f(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
10+/"),a(6),s("")),t.base64url=n(f(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),s(""));let v=e=>n(d(58),i(e),s(""));t.base58=v("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=v("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=v("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");let y=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){let i=e.subarray(n,n+8);r+=t.base58.encode(i).padStart(y[i.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){let i=e.slice(n,n+11),s=y.indexOf(i.length),a=t.base58.decode(i);for(let o=0;o<a.length-s;o++)if(0!==a[o])throw Error("base58xmr: wrong padding");r=r.concat(Array.from(a.slice(a.length-s)))}return Uint8Array.from(r)}};let m=e=>n(g(4,t=>e(e(t))),t.base58);t.base58check=m;let b=n(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),E=[996825010,642813549,513874426,1027748829,705979059];function S(e){let t=e>>25,r=(33554431&e)<<5;for(let n=0;n<E.length;n++)(t>>n&1)==1&&(r^=E[n]);return r}function T(e,t,r=1){let n=e.length,i=1;for(let s=0;s<n;s++){let a=e.charCodeAt(s);if(a<33||a>126)throw Error(`Invalid prefix (${e})`);i=S(i)^a>>5}i=S(i);for(let o=0;o<n;o++)i=S(i)^31&e.charCodeAt(o);for(let u of t)i=S(i)^u;for(let l=0;l<6;l++)i=S(i);return i^=r,b.encode(h([i%1073741824],30,5,!1))}function w(e){let t="bech32"===e?1:734539939,r=f(5),n=r.decode,i=r.encode,s=p(n);function a(e,r=90){if("string"!=typeof e)throw Error(`bech32.decode input should be string, not ${typeof e}`);if(e.length<8||!1!==r&&e.length>r)throw TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);let n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw Error("String must be lowercase or uppercase");e=n;let i=e.lastIndexOf("1");if(0===i||-1===i)throw Error('Letter "1" must be present between prefix and data only');let s=e.slice(0,i),a=e.slice(i+1);if(a.length<6)throw Error("Data must be at least 6 characters long");let o=b.decode(a).slice(0,-6),u=T(s,o,t);if(!a.endsWith(u))throw Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:s,words:o}}let o=p(a);return{encode:function(e,r,n=90){if("string"!=typeof e)throw Error(`bech32.encode prefix should be string, not ${typeof e}`);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw Error(`bech32.encode words should be array of numbers, not ${typeof r}`);let i=e.length+7+r.length;if(!1!==n&&i>n)throw TypeError(`Length ${i} exceeds limit ${n}`);return e=e.toLowerCase(),`${e}1${b.encode(r)}${T(e,r,t)}`},decode:a,decodeToBytes:function(e){let{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:o,fromWords:n,fromWordsUnsafe:s,toWords:i}}t.bech32=w("bech32"),t.bech32m=w("bech32m"),t.utf8={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},t.hex=n(f(4),i("0123456789abcdef"),s(""),o(e=>{if("string"!=typeof e||e.length%2)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));let A={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},x=`Invalid encoding type. Available types: ${Object.keys(A).join(", ")}`,_=(e,t)=>{if("string"!=typeof e||!A.hasOwnProperty(e))throw TypeError(x);if(!(t instanceof Uint8Array))throw TypeError("bytesToString() expects Uint8Array");return A[e].encode(t)};t.bytesToString=_,t.str=t.bytesToString;let R=(e,t)=>{if(!A.hasOwnProperty(e))throw TypeError(x);if("string"!=typeof t)throw TypeError("stringToBytes() expects string");return A[e].decode(t)};t.stringToBytes=R,t.bytes=t.stringToBytes},7286:function(e,t,r){"use strict";t.Z1=void 0,r(7320);/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */ let n=r(9023),i=(r(3061),r(6262));function s(e){if("string"!=typeof e)throw TypeError(`Invalid mnemonic type: ${typeof e}`);return e.normalize("NFKD")}r(8089),r(9187);let a=e=>s(`mnemonic${e}`);t.Z1=function(e,t=""){return(0,n.pbkdf2)(i.sha512,function e(t){let r=s(t),n=r.split(" ");if(![12,15,18,21,24].includes(n.length))throw Error("Invalid mnemonic");return{nfkd:r,words:n}}(e).nfkd,a(t),{c:2048,dkLen:64})}},4979:function(e,t,r){"use strict";
10Object.defineProperty(t,"__esModule",{value:!0});var n=r(8902),i=r(9095);class s extends n.Subscribable{constructor(){super(),this.setup=e=>{if(!i.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.focused=e,e&&this.onFocus()}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}}let a=new s;t.FocusManager=s,t.focusManager=a},7967:function(e,t){"use strict";
10function r(e){return e.state.isPaused}function n(e){return"success"===e.state.status}Object.defineProperty(t,"__esModule",{value:!0}),t.dehydrate=function(e,t={}){let i=[],s=[];if(!1!==t.dehydrateMutations){let a=t.shouldDehydrateMutation||r;e.getMutationCache().getAll().forEach(e=>{if(a(e)){var t;i.push({mutationKey:e.options.mutationKey,state:e.state})}})}if(!1!==t.dehydrateQueries){let o=t.shouldDehydrateQuery||n;e.getQueryCache().getAll().forEach(e=>{if(o(e)){var t;s.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})}})}return{mutations:i,queries:s}},t.hydrate=function(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),s=t.mutations||[],a=t.queries||[];s.forEach(t=>{var i;n.build(e,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),a.forEach(t=>{var n;let s=i.get(t.queryHash);if(s){s.state.dataUpdatedAt<t.state.dataUpdatedAt&&s.setState(t.state);return}i.build(e,{...null==r?void 0:null==(n=r.defaultOptions)?void 0:n.queries,queryKey:t.queryKey,queryHash:t.queryHash},t.state)})}},3097:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7007),i=r(2642),s=r(9989),a=r(9735),o=r(1309),u=r(1856),l=r(1348),c=r(8883),h=r(305),d=r(4979),f=r(8378),p=r(9095),g=r(7967);t.CancelledError=n.CancelledError,t.isCancelledError=n.isCancelledError,t.QueryCache=i.QueryCache,t.QueryClient=s.QueryClient,t.QueryObserver=a.QueryObserver,t.QueriesObserver=o.QueriesObserver,t.InfiniteQueryObserver=u.InfiniteQueryObserver,t.MutationCache=l.MutationCache,t.MutationObserver=c.MutationObserver,t.notifyManager=h.notifyManager,t.focusManager=d.focusManager,t.onlineManager=f.onlineManager,t.hashQueryKey=p.hashQueryKey,t.isError=p.isError,t.isServer=p.isServer,t.parseFilterArgs=p.parseFilterArgs,t.parseMutationArgs=p.parseMutationArgs,t.parseMutationFilterArgs=p.parseMutationFilterArgs,t.parseQueryArgs=p.parseQueryArgs,t.dehydrate=g.dehydrate,t.hydrate=g.hydrate},3008:function(e,t){"use strict";function r(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}function n(e,t){return null==e.getPreviousPageParam?void 0:e.getPreviousPageParam(t[0],t)}Object.defineProperty(t,"__esModule",{value:!0}),t.getNextPageParam=r,t.getPreviousPageParam=n,t.hasNextPage=function(e,t){if(e.getNextPageParam&&Array.isArray(t)){let n=r(e,t);return null!=n&&!1!==n}},t.hasPreviousPage=function(e,t){if(e.getPreviousPageParam&&Array.isArray(t)){let r=n(e,t);return null!=r&&!1!==r}},t.infiniteQueryBehavior=function(){return{onFetch(e){e.fetchFn=()=>{var t,i,s,a,o,u;let l=null==(t=e.fetchOptions)?void 0:null==(i=t.meta)?void 0:i.refetchPage,c=null==(s=e.fetchOptions)?void 0:null==(a=s.meta)?void 0:a.fetchMore,h=null==c?void 0:c.pageParam,d=(null==c?void 0:c.direction)==="forward",f=(null==c?void 0:c.direction)==="backward",p=(null==(o=e.state.data)?void 0:o.pages)||[],g=(null==(u=e.state.data)?void 0:u.pageParams)||[],v=g,y=!1,m=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get(){var t,r;return null!=(t=e.signal)&&t.aborted?y=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{y=!0}),e.signal}})},b=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),E=(e,t,r,n)=>(v=n?[t,...v]:[...v,t],n?[r,...e]:[...e,r]),S=(t,r,n,i)=>{if(y)return Promise.reject("Cancelled");if(void 0===n&&!r&&t.length)return Promise.resolve(t);let s={queryKey:e.queryKey,pageParam:n,meta:e.meta};m(s);let a=b(s),o=Promise.resolve(a).then(e=>E(t,n,e,i));return o},T;if(p.length){if(d){let w=void 0!==h,A=w?h:r(e.options,p);T=S(p,w,A)}else if(f){let x=void 0!==h,_=x?h:n(e.options,p);T=S(p,x,_,!0)}else{v=[];let R=void 0===e.options.getNextPageParam,O=!l||!p[0]||l(p[0],0,p);T=O?S([],R,g[0]):Promise.resolve(E([],g[0],p[0]));for(let k=1;k<p.length;k++)T=T.then(t=>{let n=!l||!p[k]||l(p[k],k,p);if(n){let i=R?g[k]:r(e.options,t);return S(t,R,i)}return Promise.resolve(E(t,g[k],p[k]))})}}else T=S([]);let L=T.then(e=>({pages:e,pageParams:v}));return L}}}}},1856:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9735),i=r(3008);class s extends n.QueryObserver{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:i.infiniteQueryBehavior()},t)}getOptimisticResult(e){return e.behavior=i.infiniteQueryBehavior(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...t}={}
10){return this.fetch({...t,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,t){var r,n,s,a,o,u;let{state:l}=e,c=super.createResult(e,t);return{...c,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:i.hasNextPage(t,null==(r=l.data)?void 0:r.pages),hasPreviousPage:i.hasPreviousPage(t,null==(n=l.data)?void 0:n.pages),isFetchingNextPage:"fetching"===l.fetchStatus&&(null==(s=l.fetchMeta)?void 0:null==(a=s.fetchMore)?void 0:a.direction)==="forward",isFetchingPreviousPage:"fetching"===l.fetchStatus&&(null==(o=l.fetchMeta)?void 0:null==(u=o.fetchMore)?void 0:u.direction)==="backward"}}}t.InfiniteQueryObserver=s},637:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(819),i=r(305),s=r(4442),a=r(7007);class o extends s.Removable{constructor(e){super(),this.options={...e.defaultOptions,...e.options},this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||n.defaultLogger,this.observers=[],this.state=e.state||u(),this.meta=e.meta,this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){var e,t,r,n,i,s,o,u,l,c,h,d,f,p,g,v;let y="loading"===this.state.status;try{if(!y){this.dispatch({type:"loading",variables:this.options.variables}),null==(o=(u=this.mutationCache.config).onMutate)||o.call(u,this.state.variables,this);let m=await (null==(l=(c=this.options).onMutate)?void 0:l.call(c,this.state.variables));m!==this.state.context&&this.dispatch({type:"loading",context:m,variables:this.state.variables})}let b=await (()=>{var e;return this.retryer=a.createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return null==(e=(t=this.mutationCache.config).onSuccess)||e.call(t,b,this.state.variables,this.state.context,this),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,b,this.state.variables,this.state.context)),await (null==(i=(s=this.options).onSettled)?void 0:i.call(s,b,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:b}),b}catch(E){try{throw null==(h=(d=this.mutationCache.config).onError)||h.call(d,E,this.state.variables,this.state.context,this),await (null==(f=(p=this.options).onError)?void 0:f.call(p,E,this.state.variables,this.state.context)),await (null==(g=(v=this.options).onSettled)?void 0:g.call(v,void 0,E,this.state.variables,this.state.context)),E}finally{this.dispatch({type:"error",error:E})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:t.failureCount+1};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,error:null,isPaused:!a.canFetch(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),i.notifyManager.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function u(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}t.Mutation=o,t.getDefaultState=u},1348:function(e,t,r){"use strict";
10Object.defineProperty(t,"__esModule",{value:!0});var n=r(305),i=r(637),s=r(9095),a=r(8902);class o extends a.Subscribable{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let n=new i.Mutation({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0,meta:t.meta});return this.add(n),n}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){n.notifyManager.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>s.matchMutation(e,t))}findAll(e){return this.mutations.filter(t=>s.matchMutation(e,t))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.mutations.filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch(s.noop)),Promise.resolve()))}}t.MutationCache=o},8883:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(637),i=r(305),s=r(8902),a=r(9095);class o extends s.Subscribable{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.client.defaultMutationOptions(e),a.shallowEqualObjects(t,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:n.getDefaultState(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){i.notifyManager.batch(()=>{if(this.mutateOptions){var t,r,n,i,s,a,o,u;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(s=(a=this.mutateOptions).onError)||s.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(o=(u=this.mutateOptions).onSettled)||o.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(e=>{e(this.currentResult)})})}}t.MutationObserver=o},305:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095);function i(){let e=[],t=0,r=e=>{e()},i=e=>{e()},s=e=>{let r;t++;try{r=e()}finally{--t||u()}return r},a=i=>{t?e.push(i):n.scheduleMicrotask(()=>{r(i)})},o=e=>(...t)=>{a(()=>{e(...t)})},u=()=>{let t=e;e=[],t.length&&n.scheduleMicrotask(()=>{i(()=>{t.forEach(e=>{r(e)})})})},l=e=>{r=e},c=e=>{i=e};return{batch:s,batchCalls:o,schedule:a,setNotifyFunction:l,setBatchNotifyFunction:c}}let s=i();t.createNotifyManager=i,t.notifyManager=s},8378:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8902),i=r(9095);class s extends n.Subscribable{constructor(){super(),this.setup=e=>{if(!i.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("online",t,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){this.online=e,e&&this.onOnline()}
10onOnline(){this.listeners.forEach(e=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}}let a=new s;t.OnlineManager=s,t.onlineManager=a},1309:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095),i=r(305),s=r(9735),a=r(8902);class o extends a.Subscribable{constructor(e,t){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},t&&this.setQueries(t)}onSubscribe(){1===this.listeners.length&&this.observers.forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})})}onUnsubscribe(){this.listeners.length||this.destroy()}destroy(){this.listeners=[],this.observers.forEach(e=>{e.destroy()})}setQueries(e,t){this.queries=e,i.notifyManager.batch(()=>{let e=this.observers,r=this.findMatchingObservers(this.queries);r.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions,t));let i=r.map(e=>e.observer),s=Object.fromEntries(i.map(e=>[e.options.queryHash,e])),a=i.map(e=>e.getCurrentResult()),o=i.some((t,r)=>t!==e[r]);if(e.length!==i.length||o)this.observers=i,this.observersMap=s,this.result=a,this.hasListeners()&&(n.difference(e,i).forEach(e=>{e.destroy()}),n.difference(i,e).forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})}),this.notify())})}getCurrentResult(){return this.result}getQueries(){return this.observers.map(e=>e.getCurrentQuery())}getOptimisticResult(e){return this.findMatchingObservers(e).map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions))}
10findMatchingObservers(e){let t=this.observers,r=e.map(e=>this.client.defaultQueryOptions(e)),n=r.flatMap(e=>{let r=t.find(t=>t.options.queryHash===e.queryHash);return null!=r?[{defaultedQueryOptions:e,observer:r}]:[]}),i=n.map(e=>e.defaultedQueryOptions.queryHash),a=r.filter(e=>!i.includes(e.queryHash)),o=t.filter(e=>!n.some(t=>t.observer===e)),u=e=>{let t=this.client.defaultQueryOptions(e),r=this.observersMap[t.queryHash];return null!=r?r:new s.QueryObserver(this.client,t)},l=a.map((e,t)=>{if(e.keepPreviousData){let r=o[t];if(void 0!==r)return{defaultedQueryOptions:e,observer:r}}return{defaultedQueryOptions:e,observer:u(e)}}),c=(e,t)=>r.indexOf(e.defaultedQueryOptions)-r.indexOf(t.defaultedQueryOptions);return n.concat(l).sort(c)}onUpdate(e,t){let r=this.observers.indexOf(e);-1!==r&&(this.result=n.replaceAt(this.result,r,t),this.notify())}notify(){i.notifyManager.batch(()=>{this.listeners.forEach(e=>{e(this.result)})})}}t.QueriesObserver=o},123:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095),i=r(819),s=r(305),a=r(7007),o=r(4442);class u extends o.Removable{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||i.defaultLogger,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==e.initialData,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0,i=void 0!==t;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isInvalidated:!1,status:i?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.meta=e.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.meta=null==e?void 0:e.meta,this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){let r=n.replaceData(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then(n.noop).catch(n.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!n.timeUntilStale(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){-1===this.observers.indexOf(e)&&(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){-1!==this.observers.indexOf(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,i,s,o;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(s=this.retryer)||s.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let u=this.observers.find(e=>e.options.queryFn);u&&this.setOptions(u.options)}Array.isArray(this.options.queryKey);let l=n.getAbortController(),c={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},h=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>
10{if(l)return this.abortSignalConsumed=!0,l.signal}})};h(c);let d=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(c)):Promise.reject("Missing queryFn"),f={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:d,meta:this.meta};h(f),null==(r=this.options.behavior)||r.onFetch(f),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(i=f.fetchOptions)?void 0:i.meta))&&this.dispatch({type:"fetch",meta:null==(o=f.fetchOptions)?void 0:o.meta});let p=e=>{if(a.isCancelledError(e)&&e.silent||this.dispatch({type:"error",error:e}),!a.isCancelledError(e)){var t,r;null==(t=(r=this.cache.config).onError)||t.call(r,e,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=a.createRetryer({fn:f.fetchFn,abort:null==l?void 0:l.abort.bind(l),onSuccess:e=>{var t,r;if(void 0===e){p(Error("undefined"));return}this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:p,onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var r,n;switch(e.type){case"failed":return{...t,fetchFailureCount:t.fetchFailureCount+1};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:a.canFetch(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(n=e.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0}};case"error":let i=e.error;if(a.isCancelledError(i)&&i.revert&&this.revertState)return{...this.revertState};return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),s.notifyManager.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}t.Query=u},2642:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095),i=r(123),s=r(305),a=r(8902);class o extends a.Subscribable{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var s;let a=t.queryKey,o=null!=(s=t.queryHash)?s:n.hashQueryKeyByOptions(a,t),u=this.get(o);return u||(u=new i.Query({cache:this,logger:e.getLogger(),queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a),meta:t.meta}),this.add(u)),u}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){s.notifyManager.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=n.parseFilterArgs(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>n.matchQuery(r,e))}findAll(e,t){let[r]=n.parseFilterArgs(e,t);return Object.keys(r).length>0?this.queries.filter(e=>n.matchQuery(r,e)):this.queries}notify(e){s.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.notifyManager.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){s.notifyManager.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}t.QueryCache=o},9989:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095),i=r(2642),s=r(1348),a=r(4979),o=r(8378),u=r(305),l=r(3008),c=r(819);t.QueryClient=class{constructor(e={}){this.queryCache=e.queryCache||new i.QueryCache,this.mutationCache=e.mutationCache||new s.MutationCache,this.logger=e.logger||c.defaultLogger,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=a.focusManager.subscribe(()=>{a.focusManager.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=o.onlineManager.subscribe(()=>{o.onlineManager.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var e,t;null==(e=this.unsubscribeFocus)||e.call(this),null==(t=this.unsubscribeOnline)||t.call(this)}isFetching(e,t){let[r]=n.parseFilterArgs(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>{let r=t.data;return[e,r]})}setQueryData(e,t,r){let i=this.queryCache.find(e),s=null==i?void 0:i.state.data,a=n.functionalUpdate(t,s);if(void 0===a)return;let o=n.parseQueryArgs(e),u=this.defaultQueryOptions(o);return this.queryCache.build(this,u).setData(a,{...r,manual:!0})}
10setQueriesData(e,t,r){return u.notifyManager.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=n.parseFilterArgs(e,t),i=this.queryCache;u.notifyManager.batch(()=>{i.findAll(r).forEach(e=>{i.remove(e)})})}resetQueries(e,t,r){let[i,s]=n.parseFilterArgs(e,t,r),a=this.queryCache,o={type:"active",...i};return u.notifyManager.batch(()=>(a.findAll(i).forEach(e=>{e.reset()}),this.refetchQueries(o,s)))}cancelQueries(e,t,r){let[i,s={}]=n.parseFilterArgs(e,t,r);void 0===s.revert&&(s.revert=!0);let a=u.notifyManager.batch(()=>this.queryCache.findAll(i).map(e=>e.cancel(s)));return Promise.all(a).then(n.noop).catch(n.noop)}invalidateQueries(e,t,r){let[i,s]=n.parseFilterArgs(e,t,r);return u.notifyManager.batch(()=>{var e,t;if(this.queryCache.findAll(i).forEach(e=>{e.invalidate()}),"none"===i.refetchType)return Promise.resolve();let r={...i,type:null!=(e=null!=(t=i.refetchType)?t:i.type)?e:"active"};return this.refetchQueries(r,s)})}refetchQueries(e,t,r){let[i,s]=n.parseFilterArgs(e,t,r),a=u.notifyManager.batch(()=>this.queryCache.findAll(i).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...s,cancelRefetch:null==(t=null==s?void 0:s.cancelRefetch)||t,meta:{refetchPage:i.refetchPage}})})),o=Promise.all(a).then(n.noop);return null!=s&&s.throwOnError||(o=o.catch(n.noop)),o}fetchQuery(e,t,r){let i=n.parseQueryArgs(e,t,r),s=this.defaultQueryOptions(i);void 0===s.retry&&(s.retry=!1);let a=this.queryCache.build(this,s);return a.isStaleByTime(s.staleTime)?a.fetch(s):Promise.resolve(a.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(n.noop).catch(n.noop)}fetchInfiniteQuery(e,t,r){let i=n.parseQueryArgs(e,t,r);return i.behavior=l.infiniteQueryBehavior(),this.fetchQuery(i)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(n.noop).catch(n.noop)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>n.hashQueryKey(e)===n.hashQueryKey(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>n.partialMatchKey(e,t.queryKey));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>n.hashQueryKey(e)===n.hashQueryKey(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>n.partialMatchKey(e,t.mutationKey));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=n.hashQueryKeyByOptions(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}},9735:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095),i=r(305),s=r(4979),a=r(8902),o=r(7007);class u extends a.Subscribable{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.length&&(this.currentQuery.addObserver(this),l(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return c(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){let r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),n.shallowEqualObjects(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let s=this.hasListeners();s&&h(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(t),s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let a=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(e){let t=this.client.getQueryCache().build(this.client,e);return this.createResult(t,e)}getCurrentResult(){return this.currentResult}trackResult(e){let t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){let t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(n.noop)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),n.isServer||this.currentResult.isStale||!n.isValidTimeout(this.options.staleTime))return;let e=n.timeUntilStale(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},e+1)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!n.isServer&&!1!==this.options.enabled&&n.isValidTimeout(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>
10{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){let r=this.currentQuery,i=this.options,s=this.currentResult,a=this.currentResultState,u=this.currentResultOptions,c=e!==r,f=c?e.state:this.currentQueryInitialState,p=c?this.currentResult:this.previousQueryResult,{state:g}=e,{dataUpdatedAt:v,error:y,errorUpdatedAt:m,fetchStatus:b,status:E}=g,S=!1,T=!1,w;if(t._optimisticResults){let A=this.hasListeners(),x=!A&&l(e,t),_=A&&h(e,r,t,i);(x||_)&&(b=o.canFetch(e.options.networkMode)?"fetching":"paused",v||(E="loading")),"isRestoring"===t._optimisticResults&&(b="idle")}if(t.keepPreviousData&&!g.dataUpdateCount&&null!=p&&p.isSuccess&&"error"!==E)w=p.data,v=p.dataUpdatedAt,E=p.status,S=!0;else if(t.select&&void 0!==g.data){if(s&&g.data===(null==a?void 0:a.data)&&t.select===this.selectFn)w=this.selectResult;else try{this.selectFn=t.select,w=t.select(g.data),w=n.replaceData(null==s?void 0:s.data,w,t),this.selectResult=w,this.selectError=null}catch(R){this.selectError=R}}else w=g.data;if(void 0!==t.placeholderData&&void 0===w&&"loading"===E){let O;if(null!=s&&s.isPlaceholderData&&t.placeholderData===(null==u?void 0:u.placeholderData))O=s.data;else if(O="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==O)try{O=t.select(O),O=n.replaceData(null==s?void 0:s.data,O,t),this.selectError=null}catch(k){this.selectError=k}void 0!==O&&(E="success",w=O,T=!0)}this.selectError&&(y=this.selectError,w=this.selectResult,m=Date.now(),E="error");let L="fetching"===b,C="loading"===E,I="error"===E,D={status:E,fetchStatus:b,isLoading:C,isSuccess:"success"===E,isError:I,isInitialLoading:C&&L,data:w,dataUpdatedAt:v,error:y,errorUpdatedAt:m,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:L,isRefetching:L&&!C,isLoadingError:I&&0===g.dataUpdatedAt,isPaused:"paused"===b,isPlaceholderData:T,isPreviousData:S,isRefetchError:I&&0!==g.dataUpdatedAt,isStale:d(e,t),refetch:this.refetch,remove:this.remove};return D}updateResult(e){let t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,n.shallowEqualObjects(r,t))return;this.currentResult=r;let i={cache:!0};(null==e?void 0:e.listeners)!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options;if("all"===e||!e&&!this.trackedProps.size)return!0;let r=new Set(null!=e?e:this.trackedProps);return this.options.useErrorBoundary&&r.add("error"),Object.keys(this.currentResult).some(e=>{let n=this.currentResult[e]!==t[e];return n&&r.has(e)})})()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){let e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;let t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){let t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||o.isCancelledError(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){i.notifyManager.batch(()=>{var t,r,n,i,s,a,o,u;e.onSuccess?(null==(t=(r=this.options).onSuccess)||t.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):e.onError&&(null==(s=(a=this.options).onError)||s.call(a,this.currentResult.error),null==(o=(u=this.options).onSettled)||o.call(u,void 0,this.currentResult.error)),e.listeners&&this.listeners.forEac
10h(e=>{e(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function l(e,t){var r,n;return!1!==t.enabled&&!e.state.dataUpdatedAt&&!("error"===e.state.status&&!1===t.retryOnMount)||e.state.dataUpdatedAt>0&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==t.enabled){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&d(e,t)}return!1}function h(e,t,r,n){return!1!==r.enabled&&(e!==t||!1===n.enabled)&&(!r.suspense||"error"!==e.state.status)&&d(e,r)}function d(e,t){return e.isStaleByTime(t.staleTime)}t.QueryObserver=u},4442:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9095);t.Removable=class{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),n.isValidTimeout(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:n.isServer?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}},7007:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4979),i=r(8378),s=r(9095);function a(e){return Math.min(1e3*2**e,3e4)}function o(e){return(null!=e?e:"online")!=="online"||i.onlineManager.isOnline()}class u{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}t.CancelledError=u,t.canFetch=o,t.createRetryer=function(e){let t=!1,r=0,l=!1,c,h,d,f=new Promise((e,t)=>{h=e,d=t}),p=t=>{l||(b(new u(t)),null==e.abort||e.abort())},g=()=>{t=!0},v=()=>{t=!1},y=()=>!n.focusManager.isFocused()||"always"!==e.networkMode&&!i.onlineManager.isOnline(),m=t=>{l||(l=!0,null==e.onSuccess||e.onSuccess(t),null==c||c(),h(t))},b=t=>{l||(l=!0,null==e.onError||e.onError(t),null==c||c(),d(t))},E=()=>new Promise(t=>{c=e=>{if(l||!y())return t(e)},null==e.onPause||e.onPause()}).then(()=>{c=void 0,l||null==e.onContinue||e.onContinue()}),S=()=>{if(l)return;let n;try{n=e.fn()}catch(i){n=Promise.reject(i)}Promise.resolve(n).then(m).catch(n=>{var i,o;if(l)return;let u=null!=(i=e.retry)?i:3,c=null!=(o=e.retryDelay)?o:a,h="function"==typeof c?c(r,n):c,d=!0===u||"number"==typeof u&&r<u||"function"==typeof u&&u(r,n);if(t||!d){b(n);return}r++,null==e.onFail||e.onFail(r,n),s.sleep(h).then(()=>{if(y())return E()}).then(()=>{t?b(n):S()})})};return o(e.networkMode)?S():E().then(S),{promise:f,cancel:p,continue(){null==c||c()},cancelRetry:g,continueRetry:v}},t.isCancelledError=function(e){return e instanceof u}},8902:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Subscribable=class{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.push(e),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(t=>t!==e),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}},9095:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r="undefined"==typeof window;function n(e,t){let r=(null==t?void 0:t.queryKeyHashFn)||i;return r(e)}function i(e){return JSON.stringify(e,(e,t)=>l(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function s(e,t){return a(e,t)}function a(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!a(e[r],t[r]))}function o(e,t){if(e===t)return e;let r=u(e)&&u(t);if(r||l(e)&&l(t)){let n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),s=i.length,a=r?[]:{},c=0;for(let h=0;h<s;h++){let d=r?h:i[h];a[d]=o(e[d],t[d]),a[d]===e[d]&&c++}return n===s&&c===n?e:a}return t}function u(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function l(e){if(!c(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(c(r)&&r.hasOwnProperty("isPrototypeOf"))}function c(e){return"[object Object]"===Object.prototype.toString.call(e)}function h(e){return Array.isArray(e)}function d(e){return new Promise(t=>{setTimeout(t,e)})}t.difference=function(e,t){return e.filter(e=>-1===t.indexOf(e))},t.functionalUpdate=function(e,t){return"function"==typeof e?e(t):e},t.getAbortController=function(){if("function"==typeof AbortController)return new AbortController},t.hashQueryKey=i,t.hashQueryKeyByOptions=n,t.isError=function(e){return e instanceof Error},t.isPlainArray=u,t.isPlainObject=l,t.isQueryKey=h,t.isServer=r,t.isValidTimeout=function(e){return"number"==typeof e&&e>=0&&e!==1/0},t.matchMutation=function(e,t){let{exact:r,fetching:n,predicate:s,mutationKey:o}=e;if(h(o)){if(!t.options.mutationKey)return!1;if(r){if(i(t.options.mutationKey)!==i(o))return!1}else{var u,l;if(u=t.options.mutationKey,l=o,!a(u,l))return!1}}return("boolean"!=typeof n||"loading"===t.state.status===n)&&(!s||!!s(t))},t.matchQuery=function(e,t){let{type:r="all",exact:i,fetchStatus:s,predicate:o,queryKey:u,stale:l}=e;if(h(u)){if(i){if(t.queryHash!==n(u,t.options))return!1}else{var c,d;if(c=t.queryKey,d=u,!a(c,d))return!1}}if("all"!==r){let f=t.isActive();if("active"===r&&!f||"inactive"===r&&f)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(void 0===s||s===t.state.fetchStatus)&&(!o||!!o(t))},t.noop=function(){},t.parseFilterArgs=function(e,t,r){return h(e)?[{...t,queryKey:e},r]:[e||{},t]},t.parseMutationArgs=function(e,t,r){return h(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}},t.parseMutationFilterArgs=function(e,t,r){return h(e)?[{...t,mutationKey:e},r]:[e||{},t]},t.parseQueryArgs=function(e,t,r){return h(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e},t.partialDeepEqual=a,t.partialMatchKey=s,t.replaceAt=function(e,t,r){let n=e.slice(0);return n[t]=r,n},t.replaceData=function(e,t,r){return null!=r.isDataEqual&&r.isDataEqual(e,t)?e:"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?o(e,t):t},t.replaceEqualDeep=o,t.scheduleMicrotask=function(e){d(0).then(e)},t.shallowEqualObjects=function(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0},t.sleep=d,t.timeUntilStale=function(e,t){return Math.max(e+(t||0)-Date.now(),0)}},1052:function(e,t){var r;(r=function(e){"use strict";function t(){}e.createSyncStoragePersister=function({storage:e,key:r="REACT_QUERY_OFFLINE_CACHE",throttleTime:n=1e3,serialize:i=JSON.stringify,deserialize:s=JSON.parse,retry:a}){if(void 0!==e){let o=t=>{try{e.setItem(r,i(t))}catch(n){return n}};return{persistClient:function(e,t=100){let r,n=null;return function(...i){r=i,null===n&&(n=setTimeout(()=>{e(...r),n=null},t))}}(e=>{let t=e,r=o(t),n=0;for(;r&&t;)n++,(t=null==a?void 0:a({persistedClient:t,error:r,errorCount:n}))&&(r=o(t))},n),restoreClient(){let t=e.getItem(r);if(t)return s(t)},removeClient(){e.removeItem(r)}}}return{persistClient:t,restoreClient(){},removeClient:t}}
10,Object.defineProperty(e,"__esModule",{value:!0})})(t)},3156:function(e,t,r){var n;(n=function(e,t,r){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(t);/**
11   * query-core
12   *
13   * Copyright (c) TanStack
14   *
15   * This source code is licensed under the MIT license found in the
16   * LICENSE.md file in the root directory of this source tree.
17   *
18   * @license MIT
19   */ class i{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.push(e),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(t=>t!==e),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}let s="undefined"==typeof window;function a(e){return e.state.isPaused}function o(e){return"success"===e.state.status}async function u({queryClient:e,persister:t,maxAge:r=864e5,buster:n="",hydrateOptions:i}){try{let s=await t.restoreClient();if(s){if(s.timestamp){let a=Date.now()-s.timestamp>r,o=s.buster!==n;a||o?t.removeClient():function(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),s=t.mutations||[],a=t.queries||[];s.forEach(t=>{var i;n.build(e,{...null==r||null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),a.forEach(t=>{var n;let s=i.get(t.queryHash);s?s.state.dataUpdatedAt<t.state.dataUpdatedAt&&s.setState(t.state):i.build(e,{...null==r||null==(n=r.defaultOptions)?void 0:n.queries,queryKey:t.queryKey,queryHash:t.queryHash},t.state)})}(e,s.clientState,i)}else t.removeClient()}}catch(u){t.removeClient()}}async function l({queryClient:e,persister:t,buster:r="",dehydrateOptions:n}){let i={buster:r,timestamp:Date.now(),clientState:function(e,t={}){let r=[],n=[];if(!1!==t.dehydrateMutations){let i=t.shouldDehydrateMutation||a;e.getMutationCache().getAll().forEach(e=>{var t;i(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let s=t.shouldDehydrateQuery||o;e.getQueryCache().getAll().forEach(e=>{var t;s(e)&&n.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:n}}(e,n)};await t.persistClient(i)}function c(e){let t=e.queryClient.getQueryCache().subscribe(()=>{l(e)}),r=e.queryClient.getMutationCache().subscribe(()=>{l(e)});return()=>{t(),r()}}function h(e){let t,r=!1;return[()=>{r=!0,null==t||t()},u(e).then(()=>{r||(t=c(e))})]}function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}new class extends i{constructor(){super(),this.setup=e=>{if(!s&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.focused=e,e&&this.onFocus()}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},new class extends i{constructor(){super(),this.setup=e=>{if(!s&&window.addEventListener){let t=()=>e();return window.addEventListener("online",t,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){var e;this.hasListeners()||(null==(e=this.cleanup)||e.call(this),this.cleanup=void 0)}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){this.online=e,e&&this.onOnline()}
19onOnline(){this.listeners.forEach(e=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}},e.PersistQueryClientProvider=({client:e,children:t,persistOptions:i,onSuccess:s,...a})=>{let[o,u]=n.useState(!0),l=n.useRef({persistOptions:i,onSuccess:s});return n.useEffect(()=>{l.current={persistOptions:i,onSuccess:s}}),n.useEffect(()=>{let t=!1;u(!0);let[r,n]=h({...l.current.persistOptions,queryClient:e});return n.then(()=>{t||(null==l.current.onSuccess||l.current.onSuccess(),u(!1))}),()=>{t=!0,r()}},[e]),n.createElement(r.QueryClientProvider,d({client:e},a),n.createElement(r.IsRestoringProvider,{value:o},t))},e.persistQueryClient=h,e.persistQueryClientRestore=u,e.persistQueryClientSave=l,e.persistQueryClientSubscribe=c,e.removeOldestQuery=({persistedClient:e})=>{let t=[...e.clientState.mutations],r=[...e.clientState.queries],n={...e,clientState:{mutations:t,queries:r}},i=[...r].sort((e,t)=>e.state.dataUpdatedAt-t.state.dataUpdatedAt);if(i.length>0){let s=i.shift();return n.clientState.queries=r.filter(e=>e!==s),n}},Object.defineProperty(e,"__esModule",{value:!0})})(t,r(7294),r(1611))},911:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(3097),s=r(5538),a=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);function o(e,t={}){let r=s.useQueryClient({context:t.context}),n=a.useRef(t);n.current=t,a.useMemo(()=>{e&&i.hydrate(r,e,n.current)},[r,e])}let u=({children:e,options:t,state:r})=>(o(r,t),e);t.Hydrate=u,t.useHydrate=o},5538:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(r(7294));let s=i.createContext(void 0),a=i.createContext(!1);function o(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=s),window.ReactQueryClientContext):s)}let u=({context:e}={})=>{let t=i.useContext(o(e,i.useContext(a)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},l=({client:e,children:t,context:r,contextSharing:n=!1})=>{i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);let s=o(r,n);return i.createElement(a.Provider,{value:!r&&n},i.createElement(s.Provider,{value:e},t))};t.QueryClientProvider=l,t.defaultContext=s,t.useQueryClient=u},2980:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(r(7294));function s(){let e=!1;return{clearReset(){e=!1},reset(){e=!0},isReset:()=>e}}let a=i.createContext(s()),o=()=>i.useContext(a),u=({children:e})=>{let[t]=i.useState(()=>s());return i.createElement(a.Provider,{value:t},"function"==typeof e?e(t):e)};t.QueryErrorResetBoundary=u,t.useQueryErrorResetBoundary=o},3804:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(346),s=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);let a=(e,t)=>{(e.suspense||e.useErrorBoundary)&&!t.isReset()&&(e.retryOnMount=!1)},o=e=>{s.useEffect(()=>{e.clearReset()},[e])},u=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&i.shouldThrowError(r,[e.error,n]);t.ensurePreventErrorBoundaryRetry=a,t.getHasError=u,t.useClearResetErrorBoundary=o},1611:function(e,t,r){"use strict";
19Object.defineProperty(t,"__esModule",{value:!0}),r(5222);var n=r(3097),i=r(3313),s=r(7634),a=r(5538),o=r(911),u=r(2980),l=r(1364),c=r(5716),h=r(6739),d=r(5942),f=r(6416);t.useQueries=i.useQueries,t.useQuery=s.useQuery,t.QueryClientProvider=a.QueryClientProvider,t.defaultContext=a.defaultContext,t.useQueryClient=a.useQueryClient,t.Hydrate=o.Hydrate,t.useHydrate=o.useHydrate,t.QueryErrorResetBoundary=u.QueryErrorResetBoundary,t.useQueryErrorResetBoundary=u.useQueryErrorResetBoundary,t.useIsFetching=l.useIsFetching,t.useIsMutating=c.useIsMutating,t.useMutation=h.useMutation,t.useInfiniteQuery=d.useInfiniteQuery,t.IsRestoringProvider=f.IsRestoringProvider,t.useIsRestoring=f.useIsRestoring,Object.keys(n).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})})},6416:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(r(7294));let s=i.createContext(!1),a=()=>i.useContext(s),o=s.Provider;t.IsRestoringProvider=o,t.useIsRestoring=a},5222:function(e,t,r){"use strict";var n=r(3097),i=r(8070);n.notifyManager.setBatchNotifyFunction(i.unstable_batchedUpdates)},8677:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(464),s=r(3097),a=r(2980),o=r(5538),u=r(6416),l=r(3804),c=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);t.useBaseQuery=function(e,t){let r=o.useQueryClient({context:e.context}),n=u.useIsRestoring(),h=a.useQueryErrorResetBoundary(),d=r.defaultQueryOptions(e);d._optimisticResults=n?"isRestoring":"optimistic",d.onError&&(d.onError=s.notifyManager.batchCalls(d.onError)),d.onSuccess&&(d.onSuccess=s.notifyManager.batchCalls(d.onSuccess)),d.onSettled&&(d.onSettled=s.notifyManager.batchCalls(d.onSettled)),d.suspense&&"number"!=typeof d.staleTime&&(d.staleTime=1e3),l.ensurePreventErrorBoundaryRetry(d,h),l.useClearResetErrorBoundary(h);let[f]=c.useState(()=>new t(r,d)),p=f.getOptimisticResult(d);if(i.useSyncExternalStore(c.useCallback(e=>n?()=>void 0:f.subscribe(s.notifyManager.batchCalls(e)),[f,n]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),c.useEffect(()=>{f.setOptions(d,{listeners:!1})},[d,f]),d.suspense&&p.isLoading&&p.isFetching&&!n)throw f.fetchOptimistic(d).then(({data:e})=>{null==d.onSuccess||d.onSuccess(e),null==d.onSettled||d.onSettled(e,null)}
19).catch(e=>{h.clearReset(),null==d.onError||d.onError(e),null==d.onSettled||d.onSettled(void 0,e)});if(l.getHasError({result:p,errorResetBoundary:h,useErrorBoundary:d.useErrorBoundary,query:f.getCurrentQuery()}))throw p.error;return d.notifyOnChangeProps?p:f.trackResult(p)}},5942:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3097),i=r(8677);t.useInfiniteQuery=function(e,t,r){let s=n.parseQueryArgs(e,t,r);return i.useBaseQuery(s,n.InfiniteQueryObserver)}},1364:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(3097),s=r(464),a=r(5538),o=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);t.useIsFetching=function(e,t,r){let[n,u={}]=i.parseFilterArgs(e,t,r),l=a.useQueryClient({context:u.context}),c=l.getQueryCache();return s.useSyncExternalStore(o.useCallback(e=>c.subscribe(i.notifyManager.batchCalls(e)),[c]),()=>l.isFetching(n),()=>l.isFetching(n))}},5716:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(464),s=r(3097),a=r(5538),o=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);t.useIsMutating=function(e,t,r){let[n,u={}]=s.parseMutationFilterArgs(e,t,r),l=a.useQueryClient({context:u.context}),c=l.getMutationCache();return i.useSyncExternalStore(o.useCallback(e=>c.subscribe(s.notifyManager.batchCalls(e)),[c]),()=>l.isMutating(n),()=>l.isMutating(n))}},6739:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(464),s=r(3097),a=r(5538),o=r(346),u=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);function l(){}t.useMutation=function(e,t,r){let n=s.parseMutationArgs(e,t,r),c=a.useQueryClient({context:n.context}),[h]=u.useState(()=>new s.MutationObserver(c,n));u.useEffect(()=>{h.setOptions(n)},[h,n]);let d=i.useSyncExternalStore(u.useCallback(e=>h.subscribe(s.notifyManager.batchCalls(e)),[h]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),f=u.useCallback((e,t)=>{h.mutate(e,t).catch(l)},[h]);if(d.error&&o.shouldThrowError(h.options.useErrorBoundary,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}},3313:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7294),i=r(464),s=r(3097),a=r(5538),o=r(6416),u=r(2980),l=r(3804),c=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}(n);t.useQueries=function({queries:e,context:t}){let r=a.useQueryClient({context:t}),n=o.useIsRestoring(),h=c.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=n?"isRestoring":"optimistic",t}),[e,r,n]),[d]=c.useState(()=>new s.QueriesObserver(r,h)),f=d.getOptimisticResult(h);i.useSyncExternalStore(c.useCallback(e=>n?()=>void 0:d.subscribe(s.notifyManager.batchCalls(e)),[d,n]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),c.useEffect(()=>{d.setQueries(h,{listeners:!1})},[h,d]);let p=u.useQueryErrorResetBoundary();h.forEach(e=>{l.ensurePreventErrorBoundaryRetry(e,p)}),l.useClearResetErrorBoundary(p);let g=f.find((e,t)=>{var r,n;return l.getHasError({result:e,errorResetBoundary:p,useErrorBoundary:null!=(r=null==(n=h[t])?void 0:n.useErrorBoundary)&&r,query:d.getQueries()[t]})});if(null!=g&&g.error)throw g.error;return f}},7634:function(e,t,r){"use strict";
vendor: 11,796 bytes, line 19
19Object.defineProperty(t,"__esModule",{value:!0});var n=r(3097),i=r(8677);t.useQuery=function(e,t,r){let s=n.parseQueryArgs(e,t,r);return i.useBaseQuery(s,n.QueryObserver)}},346:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldThrowError=function(e,t){return"function"==typeof e?e(...t):!!e}},3026:function(e,t,r){e.exports=r(3278)},5112:function(e,t,r){"use strict";var n=r(4260),i=r(3507),s=r(1158),a=r(5004),o=r(6383),u=r(9468),l=r(9332),c=r(3546),h=r(2438),d=r(7630),f=r(294);e.exports=function(e){return new Promise(function(t,r){var p,g=e.data,v=e.headers,y=e.responseType;function m(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(g)&&n.isStandardBrowserEnv()&&delete v["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var E=e.auth.username||"",S=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(E+":"+S)}var T=o(e.baseURL,e.url);function w(){if(b){var n="getAllResponseHeaders"in b?u(b.getAllResponseHeaders()):null,s={data:y&&"text"!==y&&"json"!==y?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:n,config:e,request:b};i(function(e){t(e),m()},function(e){r(e),m()},s),b=null}}if(b.open(e.method.toUpperCase(),a(T,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(w)},b.onabort=function(){b&&(r(new h("Request aborted",h.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new h("Network Error",h.ERR_NETWORK,e,b,b)),b=null},b.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||c;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new h(t,n.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,e,b)),b=null},n.isStandardBrowserEnv()){var A=(e.withCredentials||l(T))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;A&&(v[e.xsrfHeaderName]=A)}"setRequestHeader"in b&&n.forEach(v,function(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete v[t]:b.setRequestHeader(t,e)}),n.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),y&&"json"!==y&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){b&&(r(!e||e&&e.type?new d:e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),g||(g=null);var x=f(T);if(x&&-1===["http","https","file"].indexOf(x)){r(new h("Unsupported protocol "+x+":",h.ERR_BAD_REQUEST,e));return}b.send(g)})}},3278:function(e,t,r){"use strict";var n,i=r(4260),s=r(8811),a=r(9975),o=r(2791),u=function e(t){var r=new a(t),n=s(a.prototype.request,r);return i.extend(n,a.prototype,r),i.extend(n,r),n.create=function(r){return e(o(t,r))},n}(r(7538));u.Axios=a,u.CanceledError=r(7630),u.CancelToken=r(3308),u.isCancel=r(6223),u.VERSION=r(3793).version,u.toFormData=r(8826),u.AxiosError=r(2438),u.Cancel=u.CanceledError,u.all=function(e){return Promise.all(e)},u.spread=r(5463),u.isAxiosError=r(2625),e.exports=u,e.exports.default=u},3308:function(e,t,r){"use strict";var n=r(7630);function i(e){if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});var t,r=this;this.promise.then(function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e){!r.reason&&(r.reason=new n(e),t(r.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i(function(t){e=t}),cancel:e}},e.exports=i},7630:function(e,t,r){"use strict";var n=r(2438),i=r(4260);function s(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}i.inherits(s,n,{__CANCEL__:!0}),e.exports=s},6223:function(e){"use strict";e.exports=function(e){return!!(e&&e.__CANCEL__)}},9975:function(e,t,r){"use strict";var n=r(4260),i=r(5004),s=r(7618),a=r(3669),o=r(2791),u=r(6383),l=r(6782),c=l.validators;function h(e){this.defaults=e,this.interceptors={request:new s,response:new s}}h.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=o(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r,n=t.transitional;void 0!==n&&l.assertOptions(n,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var i=[],s=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});var u=[];if(this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)}),!s){var h=[a,void 0];for(Array.prototype.unshift.apply(h,i),h=h.concat(u),r=Promise.resolve(t);h.length;)r=r.then(h.shift(),h.shift());return r}for(var d=t;i.length;){var f=i.shift(),p=i.shift();try{d=f(d)}catch(g){p(g);break}}try{r=a(d)}catch(v){return Promise.reject(v)}for(;u.length;)r=r.then(u.shift(),u.shift());return r},h.prototype.getUri=function(e){e=o(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],function(e){h.prototype[e]=function(t,r){return this.request(o(r||{},{method:e,url:t,data:(r||{}).data}))}}),n.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,i){return this.request(o(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}h.prototype[e]=t(),h.prototype[e+"Form"]=t(!0)}),e.exports=h},2438:function(e,t,r){"use strict";var n=r(4260);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var s=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){a[e]={value:e}}),Object.defineProperties(i,a),Object.defineProperty(s,"isAxiosError",{value:!0}),i.from=function(e,t,r,a,o,u){var l=Object.create(s);return n.toFlatObject(e,l,function(e){return e!==Error.prototype}),i.call(l,e.message,t,r,a,o),l.name=e.name,u&&Object.assign(l,u),l},e.exports=i},7618:function(e,t,r){"use strict";var n=r(4260);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},6383:function(e,t,r){"use strict";var n=r(3554),i=r(7827);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},3669:function(e,t,r){"use strict";var n=r(4260),i=r(9368),s=r(6223),a=r(7538),o=r(7630);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new o}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t},function(t){return!s(t)&&(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},2791:function(e,t,r){"use strict";var n=r(4260);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=l[e]||s,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)}),r}},3507:function(e,t,r){"use strict";var n=r(2438);e.exports=function(e,t,r){var i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}},9368:function(e,t,r){"use strict";var n=r(4260),i=r(7538);e.exports=function(e,t,r){var s=this||i;return n.forEach(r,function(r){e=r.call(s,e,t)}),e}},7538:function(e,t,r){"use strict";var n=r(3454),i=r(4260),s=r(842),a=r(2438),o=r(3546),u=r(8826),l={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var h,d={transitional:o,adapter:("undefined"!=typeof XMLHttpRequest?h=r(5112):void 0!==n&&"[object process]"===Object.prototype.toString.call(n)&&(h=r(5112)),h),transformRequest:[function(e,t){if(s(t,"Accept"),s(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e))return e;if(i.isArrayBufferView(e))return e.buffer;if(i.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,n=i.isObject(e),a=t&&t["Content-Type"];if((r=i.isFileList(e))||n&&"multipart/form-data"===a){var o=this.env&&this.env.FormData;return u(r?{"files[]":e}:e,o&&new o)}return n||"application/json"===a?(c(t,"application/json"),function(e,t,r){if(i.isString(e))try{return(0,JSON.parse)(e),i.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||d.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||n&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(s){if("SyntaxError"===o.name)throw a.from(o,a.ERR_BAD_RESPONSE,this,null,this.response);throw o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(3091)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};
19i.forEach(["delete","get","head"],function(e){d.headers[e]={}}),i.forEach(["post","put","patch"],function(e){d.headers[e]=i.merge(l)}),e.exports=d},3546:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},3793:function(e){e.exports={version:"0.27.2"}},8811:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5004:function(e,t,r){"use strict";var n=r(4260);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;if(r)s=r(t);else if(n.isURLSearchParams(t))s=t.toString();else{var s,a=[];n.forEach(t,function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))}))}),s=a.join("&")}if(s){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},7827:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},1158:function(e,t,r){"use strict";var n=r(4260);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,s,a){var o=[];o.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),n.isString(i)&&o.push("path="+i),n.isString(s)&&o.push("domain="+s),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},3554:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},2625:function(e,t,r){"use strict";var n=r(4260);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},9332:function(e,t,r){"use strict";var n=r(4260);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},842:function(e,t,r){"use strict";var n=r(4260);e.exports=function(e,t){n.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})}},3091:function(e){e.exports=null},9468:function(e,t,r){"use strict";var n=r(4260),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,s,a={};return e&&n.forEach(e.split("\n"),function(e){s=e.indexOf(":"),t=n.trim(e.substr(0,s)).toLowerCase(),r=n.trim(e.substr(s+1)),t&&!(a[t]&&i.indexOf(t)>=0)&&("set-cookie"===t?a[t]=(a[t]?a[t]:[]).concat([r]):a[t]=a[t]?a[t]+", "+r:r)}),a}},294:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},5463:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8826:function(e,t,r){"use strict";var n=r(8764).lW,i=r(4260);e.exports=function(e,t){t=t||new FormData;var r=[];function s(e){return null===e?"":i.isDate(e)?e.toISOString():i.isArrayBuffer(e)||i.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):n.from(e):e}return!function e(n,a){if(i.isPlainObject(n)||i.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+a);r.push(n),i.forEach(n,function(r,n){if(!i.isUndefined(r)){var o,u=a?a+"."+n:n;if(r&&!a&&"object"==typeof r){if(i.endsWith(n,"{}"))r=JSON.stringify(r);else if(i.endsWith(n,"[]")&&(o=i.toArray(r))){o.forEach(function(e){i.isUndefined(e)||t.append(u,s(e))});return}}e(r,u)}}),r.pop()}else t.append(a,s(n))}(e),t}},6782:function(e,t,r){"use strict";var n=r(3793).version,i=r(2438),s={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){s[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var a={};s.transitional=function(e,t,r){function s(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,o){if(!1===e)throw new i(s(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(s(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),s=n.length;s-- >0;){var a=n[s],o=t[a];if(o){var u=e[a],l=void 0===u||o(u,a,e);if(!0!==l)throw new i("option "+a+" must be "+l,i.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new i("Unknown option "+a,i.ERR_BAD_OPTION)}},validators:s}},4260:function(e,t,r){"use strict";var n,i=r(8811),s=Object.prototype.toString,a=(n=Object.create(null),function(e){var t=s.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function o(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function u(e){return Array.isArray(e)}function l(e){return void 0===e}var c=o("ArrayBuffer");function h(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var f=o("Date"),p=o("File"),g=o("Blob"),v=o("FileList");function y(e){return"[object Function]"===s.call(e)}var m=o("URLSearchParams");function b(e,t){if(null!=e){if("object"!=typeof e&&(e=[e]),u(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}}var E,S=(E="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return E&&e instanceof E});e.exports={isArray:u,isArrayBuffer:c,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){var t;return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&c(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:h,isPlainObject:d,isUndefined:l,isDate:f,isFile:p,isBlob:g,isFunction:y,isStream:function(e){return h(e)&&y(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:b,merge:function e(){var t={};function r(r,n){d(t[n])&&d(r)?t[n]=e(t[n],r):d(r)?t[n]=e({},r):u(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)b(arguments[n],r);return t},extend:function(e,t,r){return b(t,function(t,n){r&&"function"==typeof t?e[n]=i(t,r):e[n]=t}),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,i,s,a={};t=t||{};do{for(i=(n=Object.getOwnPropertyNames(e)).length;i-- >0;)a[s=n[i]]||(t[s]=e[s],a[s]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:o,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return -1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(l(t))return null;for(var r=Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:S,isFileList:v}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s,a,o=u(e),l=o[0],c=o[1],h=new i((l+c)*3/4-c),d=0,f=c>0?l-4:l;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],h[d++]=t>>16&255,h[d++]=t>>8&255,h[d++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,h[d++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,h[d++]=t>>8&255,h[d++]=255&t),h},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],a=0,o=n-i;a<o;a+=16383)s.push(c(e,a,a+16383>o?o:a+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 19,869 bytes, lines 19-24
19+/",a=0,o=s.length;a<o;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],s=t;s<r;s+=3)i.push(l(n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2])));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:function(e,t,r){"use strict";/*!
20 * The buffer module from node.js, for the browser.
21 *
22 * @author   Feross Aboukhadijeh <https://feross.org>
23 * @license  MIT
24 */ var n=r(9742),i=r(645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|p(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(N(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);var i=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),a(e<0?0:0|f(e))}function h(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function f(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),s=r=+r,s!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var s,a=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,o/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(s=r;s<o;s++)if(l(e,s)===l(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===u)return c*a}else -1!==c&&(s-=s-c),c=-1}else for(r+u>o&&(r=o-u),s=r;s>=0;s--){for(var h=!0,d=0;d<u;d++)if(l(e,s+d)!==l(t,d)){h=!1;break}if(h)return s}return -1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o,u=parseInt(t.substr(2*a,2),16);if(o=u,o!=o)break;e[r+a]=u}return a}function E(e,t,r,n){return B(U(t,e.length-r),e,r,n)}function S(e,t,r,n){return B(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return B(F(t),e,r,n)}function w(e,t,r,n){return B(function(e,t){for(var r,n,i,s=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,a,o,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:(192&(s=e[i+1]))==128&&(u=(31&l)<<6|63&s)>127&&(c=u);break;case 3:s=e[i+1],a=e[i+2],(192&s)==128&&(192&a)==128&&(u=(15&l)<<12|(63&s)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:s=e[i+1],a=e[i+2],o=e[i+3],(192&s)==128&&(192&a)==128&&(192&o)==128&&(u=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function _(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=q[e[s]];return i}function k(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function I(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function D(e,t,r,n,s){return t=+t,r>>>=0,s||I(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,s){return t=+t,r>>>=0,s||I(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.lW=o,t.h2=50,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(r){return!1}}(),o.TYPED_ARRAY_SUPPORT||"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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){var n,i,s;return(l(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(N(s,Uint8Array))i+s.length>n.length?o.from(s).copy(n,i):Uint8Array.prototype.set.call(n,s,i);else if(o.isBuffer(s))s.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=s.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,a=r-t,u=Math.min(s,a),l=this.slice(n,i),c=e.slice(t,r),h=0;h<u;++h)if(l[h]!==c[h]){s=l[h],a=c[h];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return(e>>>=0,t||L(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,!n&&C(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,!n&&C(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),u=a.length;
24if(0===u)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%u]}return this};var M=/[^+/0-9A-Za-z-_]/g;function U(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function F(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function j(e){return e!=e}var q=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},9662:function(e,t,r){var n=r(614),i=r(6330),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(i(e)+" is not a function")}},9483:function(e,t,r){var n=r(4411),i=r(6330),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(i(e)+" is not a constructor")}},6077:function(e,t,r){var n=r(614),i=String,s=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw s("Can't set "+i(e)+" as a prototype")}},1223:function(e,t,r){var n=r(6958),i=r(30),s=r(3070).f,a=n("unscopables"),o=Array.prototype;void 0==o[a]&&s(o,a,{configurable:!0,value:i(null)}),e.exports=function(e){o[a][e]=!0}},1530:function(e,t,r){"use strict";var n=r(8710).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},5787:function(e,t,r){var n=r(7976),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw i("Incorrect invocation")}},9670:function(e,t,r){var n=r(111),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw s(i(e)+" is not an object")}},7556:function(e,t,r){var n=r(7293);e.exports=n(function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})},8533:function(e,t,r){"use strict";var n=r(2092).forEach,i=r(9341)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},8457:function(e,t,r){"use strict";var n=r(9974),i=r(6916),s=r(7908),a=r(3411),o=r(7659),u=r(4411),l=r(6244),c=r(6135),h=r(4121),d=r(1246),f=Array;e.exports=function(e){var t,r,p,g,v,y,m=s(e),b=u(this),E=arguments.length,S=E>1?arguments[1]:void 0,T=void 0!==S;T&&(S=n(S,E>2?arguments[2]:void 0));var w=d(m),A=0;if(w&&!(this===f&&o(w)))for(v=(g=h(m,w)).next,r=b?new this:[];!(p=i(v,g)).done;A++)y=T?a(g,S,[p.value,A],!0):p.value,c(r,A,y);else for(t=l(m),r=b?new this(t):f(t);t>A;A++)y=T?S(m[A],A):m[A],c(r,A,y);return r.length=A,r}},1318:function(e,t,r){var n=r(5656),i=r(1400),s=r(6244),a=function(e){return function(t,r,a){var o,u=n(t),l=s(u),c=i(a,l);if(e&&r!=r){for(;l>c;)if((o=u[c++])!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:function(e,t,r){var n=r(9974),i=r(1702),s=r(8361),a=r(7908),o=r(6244),u=r(5417),l=i([].push),c=function(e){var t=1==e,r=2==e,i=3==e,c=4==e,h=6==e,d=7==e,f=5==e||h;return function(p,g,v,y){for(var m,b,E=a(p),S=s(E),T=n(g,v),w=o(S),A=0,x=y||u,_=t?x(p,w):r||d?x(p,0):void 0;w>A;A++)if((f||A in S)&&(b=T(m=S[A],A,E),e)){if(t)_[A]=b;else if(b)switch(e){case 3:return!0;case 5:return m;case 6:return A;case 2:l(_,m)}else switch(e){case 4:return!1;case 7:l(_,m)}}return h?-1:i||c?c:_}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},1194:function(e,t,r){var n=r(7293),i=r(6958),s=r(7392),a=i("species");e.exports=function(e){return s>=51||!n(function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}
vendor: 4,485 bytes, line 24
24},1!==t[e](Boolean).foo})}},9341:function(e,t,r){"use strict";var n=r(7293);e.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){return 1},1)})}},3671:function(e,t,r){var n=r(9662),i=r(7908),s=r(8361),a=r(6244),o=TypeError,u=function(e){return function(t,r,u,l){n(r);var c=i(t),h=s(c),d=a(c),f=e?d-1:0,p=e?-1:1;if(u<2)for(;;){if(f in h){l=h[f],f+=p;break}if(f+=p,e?f<0:d<=f)throw o("Reduce of empty array with no initial value")}for(;e?f>=0:d>f;f+=p)f in h&&(l=r(l,h[f],f,c));return l}};e.exports={left:u(!1),right:u(!0)}},3658:function(e,t,r){"use strict";var n=r(9781),i=r(3157),s=TypeError,a=Object.getOwnPropertyDescriptor,o=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=o?function(e,t){if(i(e)&&!a(e,"length").writable)throw s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},1589:function(e,t,r){var n=r(1400),i=r(6244),s=r(6135),a=Array,o=Math.max;e.exports=function(e,t,r){for(var u=i(e),l=n(t,u),c=n(void 0===r?u:r,u),h=a(o(c-l,0)),d=0;l<c;l++,d++)s(h,d,e[l]);return h.length=d,h}},206:function(e,t,r){var n=r(1702);e.exports=n([].slice)},4362:function(e,t,r){var n=r(1589),i=Math.floor,s=function(e,t){var r=e.length,u=i(r/2);return r<8?a(e,t):o(e,s(n(e,0,u),t),s(n(e,u),t),t)},a=function(e,t){for(var r,n,i=e.length,s=1;s<i;){for(n=s,r=e[s];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==s++&&(e[n]=r)}return e},o=function(e,t,r,n){for(var i=t.length,s=r.length,a=0,o=0;a<i||o<s;)e[a+o]=a<i&&o<s?0>=n(t[a],r[o])?t[a++]:r[o++]:a<i?t[a++]:r[o++];return e};e.exports=s},7475:function(e,t,r){var n=r(3157),i=r(4411),s=r(111),a=r(6958)("species"),o=Array;e.exports=function(e){var t;return n(e)&&(i(t=e.constructor)&&(t===o||n(t.prototype))?t=void 0:s(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?o:t}},5417:function(e,t,r){var n=r(7475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},3411:function(e,t,r){var n=r(9670),i=r(9212);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(a){i(e,"throw",a)}}},7072:function(e,t,r){var n=r(6958)("iterator"),i=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch(o){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},e(s)}catch(a){}return r}},4326:function(e,t,r){var n=r(84),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},648:function(e,t,r){var n=r(1694),i=r(614),s=r(4326),a=r(6958)("toStringTag"),o=Object,u="Arguments"==s(function(){return arguments}()),l=function(e,t){try{return e[t]}catch(r){}};e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=l(t=o(e),a))?r:u?s(t):"Object"==(n=s(t))&&i(t.callee)?"Arguments":n}},5631:function(e,t,r){"use strict";var n=r(3070).f,i=r(30),s=r(9190),a=r(9974),o=r(5787),u=r(8554),l=r(408),c=r(1656),h=r(6178),d=r(6340),f=r(9781),p=r(2423).fastKey,g=r(9909),v=g.set,y=g.getterFor;e.exports={getConstructor:function(e,t,r,c){var h=e(function(e,n){o(e,d),v(e,{type:t,index:i(null),first:void 0,last:void 0,size:0}),f||(e.size=0),u(n)||l(n,e[c],{that:e,AS_ENTRIES:r})}),d=h.prototype,g=y(t),m=function(e,t,r){var n,i,s=g(e),a=b(e,t);return a?a.value=r:(s.last=a={index:i=p(t,!0),key:t,value:r,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=a),n&&(n.next=a),f?s.size++:e.size++,"F"!==i&&(s.index[i]=a)),e},b=function(e,t){var r,n=g(e),i=p(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return s(d,{clear:function(){for(var e=this,t=g(e),r=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete r[n.index],n=n.next;t.first=t.last=void 0,f?t.size=0:e.size=0},delete:function(e){var t=g(this),r=b(this,e);if(r){var n=r.next,i=r.previous;delete t.index[r.index],r.removed=!0,i&&(i.next=n),n&&(n.previous=i),t.first==r&&(t.first=n),t.last==r&&(t.last=i),f?t.size--:this.size--}return!!r},forEach:function(e){for(var t,r=g(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!b(this,e)}}),s(d,r?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),f&&n(d,"size",{get:function(){return g(this).size}}
24),h},setStrong:function(e,t,r){var n=t+" Iterator",i=y(t),s=y(n);c(e,t,function(e,t){v(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?h(r.key,!1):"values"==t?h(r.value,!1):h([r.key,r.value],!1):(e.target=void 0,h(void 0,!0))},r?"entries":"values",!r,!0),d(t)}}},7710:function(e,t,r){"use strict";var n=r(2109),i=r(7854),s=r(1702),a=r(4705),o=r(8052),u=r(2423),l=r(408),c=r(5787),h=r(614),d=r(8554),f=r(111),p=r(7293),g=r(7072),v=r(8003),y=r(9587);e.exports=function(e,t,r){var m=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),E=m?"set":"add",S=i[e],T=S&&S.prototype,w=S,A={},x=function(e){var t=s(T[e]);o(T,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return(!b||!!f(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return b&&!f(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return(!b||!!f(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!h(S)||!(b||T.forEach&&!p(function(){new S().entries().next()}))))w=r.getConstructor(t,e,m,E),u.enable();else if(a(e,!0)){var _=new w,R=_[E](b?{}:-0,1)!=_,O=p(function(){_.has(1)}),k=g(function(e){new S(e)}),L=!b&&p(function(){for(var e=new S,t=5;t--;)e[E](t,t);return!e.has(-0)});k||((w=t(function(e,t){c(e,T);var r=y(new S,e,w);return d(t)||l(t,r[E],{that:r,AS_ENTRIES:m}),r})).prototype=T,T.constructor=w),(O||L)&&(x("delete"),x("has"),m&&x("get")),(L||R)&&x(E),b&&T.clear&&delete T.clear}return A[e]=w,n({global:!0,constructor:!0,forced:w!=S},A),v(w,e),b||r.setStrong(w,e,m),w}},9920:function(e,t,r){var n=r(2597),i=r(3887),s=r(1236),a=r(3070);e.exports=function(e,t,r){for(var o=i(t),u=a.f,l=s.f,c=0;c<o.length;c++){var h=o[c];n(e,h)||r&&n(r,h)||u(e,h,l(t,h))}}},4964:function(e,t,r){var n=r(6958)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[n]=!1,"/./"[e](t)}catch(r){}}return!1}},8544:function(e,t,r){var n=r(7293);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},6178:function(e){e.exports=function(e,t){return{value:e,done:t}}},8880:function(e,t,r){var n=r(9781),i=r(3070),s=r(9114);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},9114:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6135:function(e,t,r){"use strict";var n=r(4948),i=r(3070),s=r(9114);e.exports=function(e,t,r){var a=n(t);a in e?i.f(e,a,s(0,r)):e[a]=r}},7045:function(e,t,r){var n=r(6339),i=r(3070);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},8052:function(e,t,r){var n=r(614),i=r(3070),s=r(6339),a=r(3072);e.exports=function(e,t,r,o){o||(o={});var u=o.enumerable,l=void 0!==o.name?o.name:t;if(n(r)&&s(r,l,o),o.global)u?e[t]=r:a(t,r);else{try{o.unsafe?e[t]&&(u=!0):delete e[t]}catch(c){}u?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},9190:function(e,t,r){var n=r(8052);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},3072:function(e,t,r){var n=r(7854),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},5117:function(e,t,r){"use strict";var n=r(6330),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw i("Cannot delete property "+n(t)+" of "+n(e))}},9781:function(e,t,r){var n=r(7293);e.exports=!n(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},4154:function(e){var t="object"==typeof document&&document.all;e.exports={all:t,IS_HTMLDDA:void 0===t&&void 0!==t}},317:function(e,t,r){var n=r(7854),i=r(111),s=n.document,a=i(s)&&i(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},7207:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:function(e,t,r){var n=r(317)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},7871:function(e,t,r){var n=r(3823),i=r(5268);e.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},3823:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1528:function(e,t,r){var n=r(8113),i=r(7854);e.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==i.Pebble},6833:function(e,t,r){var n=r(8113);
vendor: 5,905 bytes, line 24
24e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:function(e,t,r){var n=r(4326),i=r(7854);e.exports="process"==n(i.process)},1036:function(e,t,r){var n=r(8113);e.exports=/web0s(?!.*chrome)/i.test(n)},8113:function(e,t,r){var n=r(5005);e.exports=n("navigator","userAgent")||""},7392:function(e,t,r){var n,i,s=r(7854),a=r(8113),o=s.process,u=s.Deno,l=o&&o.versions||u&&u.version,c=l&&l.v8;c&&(i=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(e,t,r){var n=r(7854),i=r(1236).f,s=r(8880),a=r(8052),o=r(3072),u=r(9920),l=r(4705);e.exports=function(e,t){var r,c,h,d,f,p,g=e.target,v=e.global,y=e.stat;if(c=v?n:y?n[g]||o(g,{}):(n[g]||{}).prototype)for(h in t){if(f=t[h],d=e.dontCallGetSet?(p=i(c,h))&&p.value:c[h],!l(v?h:g+(y?".":"#")+h,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;u(f,d)}(e.sham||d&&d.sham)&&s(f,"sham",!0),a(c,h,f,e)}}},7293:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},9063:function(e,t,r){"use strict";r(4916);var n=r(1702),i=r(8052),s=r(2261),a=r(7293),o=r(6958),u=r(8880),l=o("species"),c=RegExp.prototype;e.exports=function(e,t,r,h){var d=o(e),f=!a(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=f&&!a(function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[l]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return t=!0,null},r[d](""),!t});if(!f||!p||r){var g=n(/./[d]),v=t(d,""[e],function(e,t,r,i,a){var o=n(e),u=t.exec;return u===s||u===c.exec?f&&!a?{done:!0,value:g(t,r,i)}:{done:!0,value:o(r,t,i)}:{done:!1}});i(String.prototype,e,v[0]),i(c,d,v[1])}h&&u(c[d],"sham",!0)}},6677:function(e,t,r){var n=r(7293);e.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},2104:function(e,t,r){var n=r(4374),i=Function.prototype,s=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(s):function(){return a.apply(s,arguments)})},9974:function(e,t,r){var n=r(1702),i=r(9662),s=r(4374),a=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},4374:function(e,t,r){var n=r(7293);e.exports=!n(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},6916:function(e,t,r){var n=r(4374),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},6530:function(e,t,r){var n=r(9781),i=r(2597),s=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=i(s,"name"),u=o&&(!n||n&&a(s,"name").configurable);e.exports={EXISTS:o,PROPER:o&&"something"===(function(){}).name,CONFIGURABLE:u}},84:function(e,t,r){var n=r(4374),i=Function.prototype,s=i.call,a=n&&i.bind.bind(s,s);e.exports=function(e){return n?a(e):function(){return s.apply(e,arguments)}}},1702:function(e,t,r){var n=r(4326),i=r(84);e.exports=function(e){if("Function"===n(e))return i(e)}},5005:function(e,t,r){var n=r(7854),i=r(614);e.exports=function(e,t){var r;return arguments.length<2?i(r=n[e])?r:void 0:n[e]&&n[e][t]}},1246:function(e,t,r){var n=r(648),i=r(8173),s=r(8554),a=r(7497),o=r(6958)("iterator");e.exports=function(e){if(!s(e))return i(e,o)||i(e,"@@iterator")||a[n(e)]}},4121:function(e,t,r){var n=r(6916),i=r(9662),s=r(9670),a=r(6330),o=r(1246),u=TypeError;e.exports=function(e,t){var r=arguments.length<2?o(e):t;if(i(r))return s(n(r,e));throw u(a(e)+" is not iterable")}},8173:function(e,t,r){var n=r(9662),i=r(8554);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},647:function(e,t,r){var n=r(1702),i=r(7908),s=Math.floor,a=n("".charAt),o=n("".replace),u=n("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,h,d){var f=r+e.length,p=n.length,g=c;return void 0!==h&&(h=i(h),g=l),o(d,g,function(i,o){var l;switch(a(o,0)){case"$":return"$";case"&":return e;case"`":return u(t,0,r);case"'":return u(t,f);case"<":l=h[u(o,1,-1)];break;default:var c=+o;if(0===c)return i;if(c>p){var d=s(c/10);if(0===d)return i;if(d<=p)return void 0===n[d-1]?a(o,1):n[d-1]+a(o,1);return i}l=n[c-1]}return void 0===l?"":l})}},7854:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:function(e,t,r){var n=r(1702),i=r(7908),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(i(e),t)}},3501:function(e){e.exports={}},4413:function(e,t,r){var n=r(7854);e.exports=function(e,t){var r=n.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}},490:function(e,t,r){var n=r(5005);e.exports=n("document","documentElement")},4664:function(e,t,r){var n=r(9781),i=r(7293),s=r(317);e.exports=!n&&!i(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},8361:function(e,t,r){var n=r(1702),i=r(7293),s=r(4326),a=Object,o=n("".split);e.exports=i(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"==s(e)?o(e,""):a(e)}:a},9587:function(e,t,r){var n=r(614),i=r(111),s=r(7674);e.exports=function(e,t,r){var a,o;return s&&n(a=t.constructor)&&a!==r&&i(o=a.prototype)&&o!==r.prototype&&s(e,o),e}},2788:function(e,t,r){var n=r(1702),i=r(614),s=r(5465),a=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},2423:function(e,t,r){var n=r(2109),i=r(1702),s=r(3501),a=r(111),o=r(2597),u=r(3070).f,l=r(8006),c=r(1156),h=r(2050),d=r(9711),f=r(6677),p=!1,g=d("meta"),v=0,y=function(e){u(e,g,{value:{objectID:"O"+v++,weakData:{}}})},m=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;
vendor: 4,105 bytes, line 24
24if(!o(e,g)){if(!h(e))return"F";if(!t)return"E";y(e)}return e[g].objectID},b=function(e,t){if(!o(e,g)){if(!h(e))return!0;if(!t)return!1;y(e)}return e[g].weakData},E=function(e){return f&&p&&h(e)&&!o(e,g)&&y(e),e},S=function(){T.enable=function(){},p=!0;var e=l.f,t=i([].splice),r={};r[g]=1,e(r).length&&(l.f=function(r){for(var n=e(r),i=0,s=n.length;i<s;i++)if(n[i]===g){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:c.f}))},T=e.exports={enable:S,fastKey:m,getWeakData:b,onFreeze:E};s[g]=!0},9909:function(e,t,r){var n,i,s,a=r(4811),o=r(7854),u=r(111),l=r(8880),c=r(2597),h=r(5465),d=r(6200),f=r(3501),p="Object already initialized",g=o.TypeError,v=o.WeakMap,y=function(e){return s(e)?i(e):n(e,{})},m=function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return r}};if(a||h.state){var b=h.state||(h.state=new v);b.get=b.get,b.has=b.has,b.set=b.set,n=function(e,t){if(b.has(e))throw g(p);return t.facade=e,b.set(e,t),t},i=function(e){return b.get(e)||{}},s=function(e){return b.has(e)}}else{var E=d("state");f[E]=!0,n=function(e,t){if(c(e,E))throw g(p);return t.facade=e,l(e,E,t),t},i=function(e){return c(e,E)?e[E]:{}},s=function(e){return c(e,E)}}e.exports={set:n,get:i,has:s,enforce:y,getterFor:m}},7659:function(e,t,r){var n=r(6958),i=r(7497),s=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[s]===e)}},3157:function(e,t,r){var n=r(4326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},614:function(e,t,r){var n=r(4154),i=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},4411:function(e,t,r){var n=r(1702),i=r(7293),s=r(614),a=r(648),o=r(5005),u=r(2788),l=function(){},c=[],h=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,f=n(d.exec),p=!d.exec(l),g=function(e){if(!s(e))return!1;try{return h(l,c,e),!0}catch(t){return!1}},v=function(e){if(!s(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(d,u(e))}catch(t){return!0}};v.sham=!0,e.exports=!h||i(function(){var e;return g(g.call)||!g(Object)||!g(function(){e=!0})||e})?v:g},4705:function(e,t,r){var n=r(7293),i=r(614),s=/#|\.prototype\./,a=function(e,t){var r=u[o(e)];return r==c||r!=l&&(i(t)?n(t):!!t)},o=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},5988:function(e,t,r){var n=r(111),i=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&i(e)===e}},8554:function(e){e.exports=function(e){return null==e}},111:function(e,t,r){var n=r(614),i=r(4154),s=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===s}:function(e){return"object"==typeof e?null!==e:n(e)}},1913:function(e){e.exports=!1},6772:function(e,t,r){var n=r(111),i=r(4326),s=r(6958)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==i(e))}},2190:function(e,t,r){var n=r(5005),i=r(614),s=r(7976),a=r(3307),o=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,o(e))}},408:function(e,t,r){var n=r(9974),i=r(6916),s=r(9670),a=r(6330),o=r(7659),u=r(6244),l=r(7976),c=r(4121),h=r(1246),d=r(9212),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},g=p.prototype;e.exports=function(e,t,r){var v,y,m,b,E,S,T,w=r&&r.that,A=!!(r&&r.AS_ENTRIES),x=!!(r&&r.IS_RECORD),_=!!(r&&r.IS_ITERATOR),R=!!(r&&r.INTERRUPTED),O=n(t,w),k=function(e){return v&&d(v,"normal",e),new p(!0,e)},L=function(e){return A?(s(e),R?O(e[0],e[1],k):O(e[0],e[1])):R?O(e,k):O(e)};if(x)v=e.iterator;else if(_)v=e;else{if(!(y=h(e)))throw f(a(e)+" is not iterable");if(o(y)){for(m=0,b=u(e);b>m;m++)if((E=L(e[m]))&&l(g,E))return E;return new p(!1)}v=c(e,y)}for(S=x?e.next:v.next;!(T=i(S,v)).done;){try{E=L(T.value)}catch(C){d(v,"throw",C)}if("object"==typeof E&&E&&l(g,E))return E}return new p(!1)}},9212:function(e,t,r){var n=r(6916),i=r(9670),s=r(8173);e.exports=function(e,t,r){var a,o;i(e);
vendor: 4,236 bytes, line 24
24try{if(!(a=s(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(u){o=!0,a=u}if("throw"===t)throw r;if(o)throw a;return i(a),r}},7850:function(e,t,r){"use strict";var n=r(3383).IteratorPrototype,i=r(30),s=r(9114),a=r(8003),o=r(7497),u=function(){return this};e.exports=function(e,t,r,l){var c=t+" Iterator";return e.prototype=i(n,{next:s(+!l,r)}),a(e,c,!1,!0),o[c]=u,e}},1656:function(e,t,r){"use strict";var n=r(2109),i=r(6916),s=r(1913),a=r(6530),o=r(614),u=r(7850),l=r(9518),c=r(7674),h=r(8003),d=r(8880),f=r(8052),p=r(6958),g=r(7497),v=r(3383),y=a.PROPER,m=a.CONFIGURABLE,b=v.IteratorPrototype,E=v.BUGGY_SAFARI_ITERATORS,S=p("iterator"),T="keys",w="values",A="entries",x=function(){return this};e.exports=function(e,t,r,a,p,v,_){u(r,t,a);var R,O,k,L=function(e){if(e===p&&M)return M;if(!E&&e in D)return D[e];switch(e){case T:case w:case A:return function(){return new r(this,e)}}return function(){return new r(this)}},C=t+" Iterator",I=!1,D=e.prototype,P=D[S]||D["@@iterator"]||p&&D[p],M=!E&&P||L(p),U="Array"==t&&D.entries||P;if(U&&(R=l(U.call(new e)))!==Object.prototype&&R.next&&(s||l(R)===b||(c?c(R,b):o(R[S])||f(R,S,x)),h(R,C,!0,!0),s&&(g[C]=x)),y&&p==w&&P&&P.name!==w&&(!s&&m?d(D,"name",w):(I=!0,M=function(){return i(P,this)})),p){if(O={values:L(w),keys:v?M:L(T),entries:L(A)},_)for(k in O)!E&&!I&&k in D||f(D,k,O[k]);else n({target:t,proto:!0,forced:E||I},O)}return(!s||_)&&D[S]!==M&&f(D,S,M,{name:p}),g[t]=M,O}},3383:function(e,t,r){"use strict";var n,i,s,a=r(7293),o=r(614),u=r(111),l=r(30),c=r(9518),h=r(8052),d=r(6958),f=r(1913),p=d("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(i=c(c(s)))!==Object.prototype&&(n=i):g=!0),!u(n)||a(function(){var e={};return n[p].call(e)!==e})?n={}:f&&(n=l(n)),o(n[p])||h(n,p,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},7497:function(e){e.exports={}},6244:function(e,t,r){var n=r(7466);e.exports=function(e){return n(e.length)}},6339:function(e,t,r){var n=r(7293),i=r(614),s=r(2597),a=r(9781),o=r(6530).CONFIGURABLE,u=r(2788),l=r(9909),c=l.enforce,h=l.get,d=Object.defineProperty,f=a&&!n(function(){return 8!==d(function(){},"length",{value:8}).length}),p=String(String).split("String"),g=e.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||o&&e.name!==t)&&(a?d(e,"name",{value:t,configurable:!0}):e.name=t),f&&r&&s(r,"arity")&&e.length!==r.arity&&d(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?a&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(n){}var i=c(e);return s(i,"source")||(i.source=p.join("string"==typeof t?t:"")),e};Function.prototype.toString=g(function(){return i(this)&&h(this).source||u(this)},"toString")},4758:function(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},5948:function(e,t,r){var n,i,s,a,o,u,l,c,h=r(7854),d=r(9974),f=r(1236).f,p=r(261).set,g=r(6833),v=r(1528),y=r(1036),m=r(5268),b=h.MutationObserver||h.WebKitMutationObserver,E=h.document,S=h.process,T=h.Promise,w=f(h,"queueMicrotask"),A=w&&w.value;A||(n=function(){var e,t;for(m&&(e=S.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(r){throw i?a():s=void 0,r}}s=void 0,e&&e.enter()},g||m||y||!b||!E?!v&&T&&T.resolve?((l=T.resolve(void 0)).constructor=T,c=d(l.then,l),a=function(){c(n)}):m?a=function(){S.nextTick(n)}:(p=d(p,h),a=function(){p(n)}):(o=!0,u=E.createTextNode(""),new b(n).observe(u,{characterData:!0}),a=function(){u.data=o=!o})),e.exports=A||function(e){var t={fn:e,next:void 0};s&&(s.next=t),i||(i=t,a()),s=t}},8523:function(e,t,r){"use strict";var n=r(9662),i=TypeError,s=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw i("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new s(e)}},7927:function(e,t,r){var n=r(6772),i=TypeError;e.exports=function(e){if(n(e))throw i("The method doesn't accept regular expressions");return e}},1574:function(e,t,r){"use strict";var n=r(9781),i=r(1702),s=r(6916),a=r(7293),o=r(1956),u=r(7545),l=r(5296),c=r(7908),h=r(8361),d=Object.assign,f=Object.defineProperty,p=i([].concat);
24e.exports=!d||a(function(){if(n&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach(function(e){t[e]=e}),7!=d({},e)[r]||o(d({},t)).join("")!=i})?function(e,t){for(var r=c(e),i=arguments.length,a=1,d=u.f,f=l.f;i>a;)for(var g,v=h(arguments[a++]),y=d?p(o(v),d(v)):o(v),m=y.length,b=0;m>b;)g=y[b++],(!n||s(f,v,g))&&(r[g]=v[g]);return r}:d},30:function(e,t,r){var n,i=r(9670),s=r(6048),a=r(748),o=r(3501),u=r(490),l=r(317),c=r(6200),h="prototype",d="script",f=c("IE_PROTO"),p=function(){},g=function(e){return"<"+d+">"+e+"</"+d+">"},v=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=l("iframe");return t.style.display="none",u.appendChild(t),t.src=String("java"+d+":"),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F},m=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}m="undefined"!=typeof document?document.domain&&n?v(n):y():v(n);for(var t=a.length;t--;)delete m[h][a[t]];return m()};o[f]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p[h]=i(e),r=new p,p[h]=null,r[f]=e):r=m(),void 0===t?r:s.f(r,t)}},6048:function(e,t,r){var n=r(9781),i=r(3353),s=r(3070),a=r(9670),o=r(5656),u=r(1956);t.f=n&&!i?Object.defineProperties:function(e,t){a(e);for(var r,n=o(t),i=u(t),l=i.length,c=0;l>c;)s.f(e,r=i[c++],n[r]);return e}},3070:function(e,t,r){var n=r(9781),i=r(4664),s=r(3353),a=r(9670),o=r(4948),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",f="writable";t.f=n?s?function(e,t,r){if(a(e),t=o(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&f in r&&!r[f]){var n=c(e,t);n&&n[f]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:h in r?r[h]:n[h],writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(a(e),t=o(t),a(r),i)try{return l(e,t,r)}catch(n){}if("get"in r||"set"in r)throw u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1236:function(e,t,r){var n=r(9781),i=r(6916),s=r(5296),a=r(9114),o=r(5656),u=r(4948),l=r(2597),c=r(4664),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=o(e),t=u(t),c)try{return h(e,t)}catch(r){}if(l(e,t))return a(!i(s.f,e,t),e[t])}},1156:function(e,t,r){var n=r(4326),i=r(5656),s=r(8006).f,a=r(1589),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(e){try{return s(e)}catch(t){return a(o)}};e.exports.f=function(e){return o&&"Window"==n(e)?u(e):s(i(e))}},8006:function(e,t,r){var n=r(6324),i=r(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},7545:function(e,t){t.f=Object.getOwnPropertySymbols},9518:function(e,t,r){var n=r(2597),i=r(614),s=r(7908),a=r(6200),o=r(8544),u=a("IE_PROTO"),l=Object,c=l.prototype;e.exports=o?l.getPrototypeOf:function(e){var t=s(e);if(n(t,u))return t[u];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof l?c:null}},2050:function(e,t,r){var n=r(7293),i=r(111),s=r(4326),a=r(7556),o=Object.isExtensible,u=n(function(){o(1)});e.exports=u||a?function(e){return!!i(e)&&(!a||"ArrayBuffer"!=s(e))&&(!o||o(e))}:o},7976:function(e,t,r){var n=r(1702);e.exports=n({}.isPrototypeOf)},6324:function(e,t,r){var n=r(1702),i=r(2597),s=r(5656),a=r(1318).indexOf,o=r(3501),u=n([].push);e.exports=function(e,t){var r,n=s(e),l=0,c=[];for(r in n)!i(o,r)&&i(n,r)&&u(c,r);for(;t.length>l;)i(n,r=t[l++])&&(~a(c,r)||u(c,r));return c}},1956:function(e,t,r){var n=r(6324),i=r(748);e.exports=Object.keys||function(e){return n(e,i)}},5296:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},7674:function(e,t,r){var n=r(1702),i=r(9670),s=r(6077);
vendor: 13,228 bytes, line 24
24e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(a){}return function(r,n){return i(r),s(n),t?e(r,n):r.__proto__=n,r}}():void 0)},4699:function(e,t,r){var n=r(9781),i=r(1702),s=r(1956),a=r(5656),o=r(5296).f,u=i(o),l=i([].push),c=function(e){return function(t){for(var r,i=a(t),o=s(i),c=o.length,h=0,d=[];c>h;)r=o[h++],(!n||u(i,r))&&l(d,e?[r,i[r]]:i[r]);return d}};e.exports={entries:c(!0),values:c(!1)}},288:function(e,t,r){"use strict";var n=r(1694),i=r(648);e.exports=n?({}).toString:function(){return"[object "+i(this)+"]"}},2140:function(e,t,r){var n=r(6916),i=r(614),s=r(111),a=TypeError;e.exports=function(e,t){var r,o;if("string"===t&&i(r=e.toString)&&!s(o=n(r,e))||i(r=e.valueOf)&&!s(o=n(r,e))||"string"!==t&&i(r=e.toString)&&!s(o=n(r,e)))return o;throw a("Can't convert object to primitive value")}},3887:function(e,t,r){var n=r(5005),i=r(1702),s=r(8006),a=r(7545),o=r(9670),u=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=s.f(o(e)),r=a.f;return r?u(t,r(e)):t}},2534:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},3702:function(e,t,r){var n=r(7854),i=r(2492),s=r(614),a=r(4705),o=r(2788),u=r(6958),l=r(7871),c=r(3823),h=r(1913),d=r(7392),f=i&&i.prototype,p=u("species"),g=!1,v=s(n.PromiseRejectionEvent),y=a("Promise",function(){var e=o(i),t=e!==String(i);if(!t&&66===d||h&&!(f.catch&&f.finally))return!0;if(!d||d<51||!/native code/.test(e)){var r=new i(function(e){e(1)}),n=function(e){e(function(){},function(){})};if((r.constructor={})[p]=n,!(g=r.then(function(){}) instanceof n))return!0}return!t&&(l||c)&&!v});e.exports={CONSTRUCTOR:y,REJECTION_EVENT:v,SUBCLASSING:g}},2492:function(e,t,r){var n=r(7854);e.exports=n.Promise},9478:function(e,t,r){var n=r(9670),i=r(111),s=r(8523);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=s.f(e);return(0,r.resolve)(t),r.promise}},612:function(e,t,r){var n=r(2492),i=r(7072),s=r(3702).CONSTRUCTOR;e.exports=s||!i(function(e){n.all(e).then(void 0,function(){})})},8572:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=t},7651:function(e,t,r){var n=r(6916),i=r(9670),s=r(614),a=r(4326),o=r(2261),u=TypeError;e.exports=function(e,t){var r=e.exec;if(s(r)){var l=n(r,e,t);return null!==l&&i(l),l}if("RegExp"===a(e))return n(o,e,t);throw u("RegExp#exec called on incompatible receiver")}},2261:function(e,t,r){"use strict";var n,i,s=r(6916),a=r(1702),o=r(1340),u=r(7066),l=r(2999),c=r(2309),h=r(30),d=r(9909).get,f=r(9441),p=r(7168),g=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,y=v,m=a("".charAt),b=a("".indexOf),E=a("".replace),S=a("".slice),T=(i=/b*/g,s(v,n=/a/,"a"),s(v,i,"a"),0!==n.lastIndex||0!==i.lastIndex),w=l.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(T||A||w||f||p)&&(y=function(e){var t,r,n,i,a,l,c,f=this,p=d(f),x=o(e),_=p.raw;if(_)return _.lastIndex=f.lastIndex,t=s(y,_,x),f.lastIndex=_.lastIndex,t;var R=p.groups,O=w&&f.sticky,k=s(u,f),L=f.source,C=0,I=x;if(O&&(k=E(k,"y",""),-1===b(k,"g")&&(k+="g"),I=S(x,f.lastIndex),f.lastIndex>0&&(!f.multiline||f.multiline&&"\n"!==m(x,f.lastIndex-1))&&(L="(?: "+L+")",I=" "+I,C++),r=RegExp("^(?:"+L+")",k)),A&&(r=RegExp("^"+L+"$(?!\\s)",k)),T&&(n=f.lastIndex),i=s(v,O?r:f,I),O?i?(i.input=S(i.input,C),i[0]=S(i[0],C),i.index=f.lastIndex,f.lastIndex+=i[0].length):f.lastIndex=0:T&&i&&(f.lastIndex=f.global?i.index+i[0].length:n),A&&i&&i.length>1&&s(g,i[0],r,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)}),i&&R)for(a=0,i.groups=l=h(null);a<R.length;a++)l[(c=R[a])[0]]=i[c[1]];return i}),e.exports=y},7066:function(e,t,r){"use strict";var n=r(9670);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},4706:function(e,t,r){var n=r(6916),i=r(2597),s=r(7976),a=r(7066),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return!(void 0===t&&!("flags"in o)&&!i(e,"flags")&&s(o,e))?t:n(a,e)}},2999:function(e,t,r){var n=r(7293),i=r(7854).RegExp,s=n(function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),a=s||n(function(){return!i("a","y").sticky}),o=s||n(function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")});e.exports={BROKEN_CARET:o,MISSED_STICKY:a,UNSUPPORTED_Y:s}},9441:function(e,t,r){var n=r(7293),i=r(7854).RegExp;e.exports=n(function(){var e=i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})},7168:function(e,t,r){var n=r(7293),i=r(7854).RegExp;e.exports=n(function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})},4488:function(e,t,r){var n=r(8554),i=TypeError;e.exports=function(e){if(n(e))throw i("Can't call method on "+e);return e}},6340:function(e,t,r){"use strict";var n=r(5005),i=r(3070),s=r(6958),a=r(9781),o=s("species");e.exports=function(e){var t=n(e),r=i.f;a&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}},8003:function(e,t,r){var n=r(3070).f,i=r(2597),s=r(6958)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,s)&&n(e,s,{configurable:!0,value:t})}},6200:function(e,t,r){var n=r(2309),i=r(9711),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},5465:function(e,t,r){var n=r(7854),i=r(3072),s="__core-js_shared__",a=n[s]||i(s,{});e.exports=a},2309:function(e,t,r){var n=r(1913),i=r(5465);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.5",mode:n?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:function(e,t,r){var n=r(9670),i=r(9483),s=r(8554),a=r(6958)("species");e.exports=function(e,t){var r,o=n(e).constructor;return void 0===o||s(r=n(o)[a])?t:i(r)}},8710:function(e,t,r){var n=r(1702),i=r(9303),s=r(1340),a=r(4488),o=n("".charAt),u=n("".charCodeAt),l=n("".slice),c=function(e){return function(t,r){var n,c,h=s(a(t)),d=i(r),f=h.length;return d<0||d>=f?e?"":void 0:(n=u(h,d))<55296||n>56319||d+1===f||(c=u(h,d+1))<56320||c>57343?e?o(h,d):n:e?l(h,d,d+2):(n-55296<<10)+(c-56320)+65536}};e.exports={codeAt:c(!1),charAt:c(!0)}},4986:function(e,t,r){var n=r(8113);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},6650:function(e,t,r){var n=r(1702),i=r(7466),s=r(1340),a=r(8415),o=r(4488),u=n(a),l=n("".slice),c=Math.ceil,h=function(e){return function(t,r,n){var a,h,d=s(o(t)),f=i(r),p=d.length,g=void 0===n?" ":s(n);return f<=p||""==g?d:((h=u(g,c((a=f-p)/g.length))).length>a&&(h=l(h,0,a)),e?d+h:h+d)}};e.exports={start:h(!1),end:h(!0)}},3197:function(e,t,r){"use strict";var n=r(1702),i=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=RangeError,u=n(s.exec),l=Math.floor,c=String.fromCharCode,h=n("".charCodeAt),d=n([].join),f=n([].push),p=n("".replace),g=n("".split),v=n("".toLowerCase),y=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=h(e,r++);if(i>=55296&&i<=56319&&r<n){var s=h(e,r++);(64512&s)==56320?f(t,((1023&i)<<10)+(1023&s)+65536):(f(t,i),r--)}else f(t,i)}return t},m=function(e){return e+22+75*(e<26)},b=function(e,t,r){var n=0;for(e=r?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),n+=36;return l(n+36*e/(e+38))},E=function(e){var t,r,n=[],i=(e=y(e)).length,s=128,u=0,h=72;for(t=0;t<e.length;t++)(r=e[t])<128&&f(n,c(r));var p=n.length,g=p;for(p&&f(n,"-");g<i;){var v=2147483647;for(t=0;t<e.length;t++)(r=e[t])>=s&&r<v&&(v=r);var E=g+1;if(v-s>l((2147483647-u)/E))throw o(a);for(u+=(v-s)*E,s=v,t=0;t<e.length;t++){if((r=e[t])<s&&++u>2147483647)throw o(a);if(r==s){for(var S=u,T=36;;){var w=T<=h?1:T>=h+26?26:T-h;if(S<w)break;var A=S-w,x=36-w;f(n,c(m(w+A%x))),S=l(A/x),T+=36}f(n,c(m(S))),h=b(u,E,g==p),u=0,g++}}u++,s++}return d(n,"")};e.exports=function(e){var t,r,n=[],a=g(p(v(e),s,"."),".");for(t=0;t<a.length;t++)f(n,u(i,r=a[t])?"xn--"+E(r):r);return d(n,".")}},8415:function(e,t,r){"use strict";var n=r(9303),i=r(1340),s=r(4488),a=RangeError;e.exports=function(e){var t=i(s(this)),r="",o=n(e);if(o<0||o==1/0)throw a("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(r+=t);return r}},3111:function(e,t,r){var n=r(1702),i=r(4488),s=r(1340),a=r(1361),o=n("".replace),u="["+a+"]",l=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),h=function(e){return function(t){var r=s(i(t));return 1&e&&(r=o(r,l,"")),2&e&&(r=o(r,c,"")),r}};e.exports={start:h(1),end:h(2),trim:h(3)}},6293:function(e,t,r){var n=r(7392),i=r(7293);e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol();return!String(e)||!(Object(e) instanceof Symbol)||!Symbol.sham&&n&&n<41})},261:function(e,t,r){var n,i,s,a,o=r(7854),u=r(2104),l=r(9974),c=r(614),h=r(2597),d=r(7293),f=r(490),p=r(206),g=r(317),v=r(8053),y=r(6833),m=r(5268),b=o.setImmediate,E=o.clearImmediate,S=o.process,T=o.Dispatch,w=o.Function,A=o.MessageChannel,x=o.String,_=0,R={},O="onreadystatechange";try{n=o.location}catch(k){}var L=function(e){if(h(R,e)){var t=R[e];delete R[e],t()}},C=function(e){return function(){L(e)}},I=function(e){L(e.data)},D=function(e){o.postMessage(x(e),n.protocol+"//"+n.host)};b&&E||(b=function(e){v(arguments.length,1);var t=c(e)?e:w(e),r=p(arguments,1);return R[++_]=function(){u(t,void 0,r)},i(_),_},E=function(e){delete R[e]},m?i=function(e){S.nextTick(C(e))}:T&&T.now?i=function(e){T.now(C(e))}:A&&!y?(a=(s=new A).port2,s.port1.onmessage=I,i=l(a.postMessage,a)):o.addEventListener&&c(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(D)?(i=D,o.addEventListener("message",I,!1)):i=O in g("script")?function(e){f.appendChild(g("script"))[O]=function(){f.removeChild(this),L(e)}}:function(e){setTimeout(C(e),0)}),e.exports={set:b,clear:E}},863:function(e,t,r){var n=r(1702);e.exports=n(1..valueOf)},1400:function(e,t,r){var n=r(9303),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},5656:function(e,t,r){var n=r(8361),i=r(4488);e.exports=function(e){return n(i(e))}},9303:function(e,t,r){var n=r(4758);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},7466:function(e,t,r){var n=r(9303),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},7908:function(e,t,r){var n=r(4488),i=Object;e.exports=function(e){return i(n(e))}},7593:function(e,t,r){var n=r(6916),i=r(111),s=r(2190),a=r(8173),o=r(2140),u=r(6958),l=TypeError,c=u("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,u=a(e,c);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!i(r)||s(r))return r;throw l("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},4948:function(e,t,r){var n=r(7593),i=r(2190);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},1694:function(e,t,r){var n=r(6958)("toStringTag"),i={};i[n]="z",e.exports="[object z]"===String(i)},1340:function(e,t,r){var n=r(648),i=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},6330:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(r){return"Object"}}},9711:function(e,t,r){var n=r(1702),i=0,s=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+s,36)}},5143:function(e,t,r){var n=r(7293),i=r(6958),s=r(1913),a=i("iterator");e.exports=!n(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach(function(e,n){t.delete("b"),r+=n+e}),s&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})},3307:function(e,t,r){var n=r(6293);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(e,t,r){var n=r(9781),i=r(7293);e.exports=n&&i(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8053:function(e){var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},4811:function(e,t,r){var n=r(7854),i=r(614),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},6958:function(e,t,r){var n=r(7854),i=r(2309),s=r(2597),a=r(9711),o=r(6293),u=r(3307),l=i("wks"),c=n.Symbol,h=c&&c.for,d=u?c:c&&c.withoutSetter||a;e.exports=function(e){if(!s(l,e)||!(o||"string"==typeof l[e])){var t="Symbol."+e;o&&s(c,e)?l[e]=c[e]:u&&h?l[e]=h(t):l[e]=d(t)}return l[e]}},1361:function(e){e.exports="	\n\v\f\r \xa0               \u2028\u2029\uFEFF"},2222:function(e,t,r){"use strict";var n=r(2109),i=r(7293),s=r(3157),a=r(111),o=r(7908),u=r(6244),l=r(7207),c=r(6135),h=r(5417),d=r(1194),f=r(6958),p=r(7392),g=f("isConcatSpreadable"),v=p>
24=51||!i(function(){var e=[];return e[g]=!1,e.concat()[0]!==e}),y=d("concat"),m=function(e){if(!a(e))return!1;var t=e[g];return void 0!==t?!!t:s(e)};n({target:"Array",proto:!0,arity:1,forced:!v||!y},{concat:function(e){var t,r,n,i,s,a=o(this),d=h(a,0),f=0;for(t=-1,n=arguments.length;t<n;t++)if(s=-1===t?a:arguments[t],m(s))for(i=u(s),l(f+i),r=0;r<i;r++,f++)r in s&&c(d,f,s[r]);else l(f+1),c(d,f++,s);return d.length=f,d}})},7327:function(e,t,r){"use strict";var n=r(2109),i=r(2092).filter,s=r(1194)("filter");n({target:"Array",proto:!0,forced:!s},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},1038:function(e,t,r){var n=r(2109),i=r(8457),s=!r(7072)(function(e){Array.from(e)});n({target:"Array",stat:!0,forced:s},{from:i})},6699:function(e,t,r){"use strict";var n=r(2109),i=r(1318).includes,s=r(7293),a=r(1223),o=s(function(){return![,].includes()});n({target:"Array",proto:!0,forced:o},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},2772:function(e,t,r){"use strict";var n=r(2109),i=r(1702),s=r(1318).indexOf,a=r(9341),o=i([].indexOf),u=!!o&&1/o([1],1,-0)<0,l=a("indexOf");n({target:"Array",proto:!0,forced:u||!l},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return u?o(this,e,t)||0:s(this,e,t)}})},6992:function(e,t,r){"use strict";var n=r(5656),i=r(1223),s=r(7497),a=r(9909),o=r(3070).f,u=r(1656),l=r(6178),c=r(1913),h=r(9781),d="Array Iterator",f=a.set,p=a.getterFor(d);e.exports=u(Array,"Array",function(e,t){f(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=p(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,l(void 0,!0)):"keys"==r?l(n,!1):"values"==r?l(t[n],!1):l([n,t[n]],!1)},"values");var g=s.Arguments=s.Array;if(i("keys"),i("values"),i("entries"),!c&&h&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(v){}},1249:function(e,t,r){"use strict";var n=r(2109),i=r(2092).map,s=r(1194)("map");n({target:"Array",proto:!0,forced:!s},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5827:function(e,t,r){"use strict";var n=r(2109),i=r(3671).left,s=r(9341),a=r(7392),o=r(5268),u=s("reduce");n({target:"Array",proto:!0,forced:!u||!o&&a>79&&a<83},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},7042:function(e,t,r){"use strict";var n=r(2109),i=r(3157),s=r(4411),a=r(111),o=r(1400),u=r(6244),l=r(5656),c=r(6135),h=r(6958),d=r(1194),f=r(206),p=d("slice"),g=h("species"),v=Array,y=Math.max;n({target:"Array",proto:!0,forced:!p},{slice:function(e,t){var r,n,h,d=l(this),p=u(d),m=o(e,p),b=o(void 0===t?p:t,p);if(i(d)&&(s(r=d.constructor)&&(r===v||i(r.prototype))?r=void 0:a(r)&&null===(r=r[g])&&(r=void 0),r===v||void 0===r))return f(d,m,b);for(h=0,n=new(void 0===r?v:r)(y(b-m,0));m<b;m++,h++)m in d&&c(n,h,d[m]);return n.length=h,n}})},561:function(e,t,r){"use strict";var n=r(2109),i=r(7908),s=r(1400),a=r(9303),o=r(6244),u=r(3658),l=r(7207),c=r(5417),h=r(6135),d=r(5117),f=r(1194)("splice"),p=Math.max,g=Math.min;n({target:"Array",proto:!0,forced:!f},{splice:function(e,t){var r,n,f,v,y,m,b=i(this),E=o(b),S=s(e,E),T=arguments.length;for(0===T?r=n=0:1===T?(r=0,n=E-S):(r=T-2,n=g(p(a(t),0),E-S)),l(E+r-n),f=c(b,n),v=0;v<n;v++)(y=S+v)in b&&h(f,v,b[y]);if(f.length=n,r<n){for(v=S;v<E-n;v++)y=v+n,m=v+r,y in b?b[m]=b[y]:d(b,m);for(v=E;v>E-n+r;v--)d(b,v-1)}else if(r>n)for(v=E-n;v>S;v--)y=v+n-1,m=v+r-1,y in b?b[m]=b[y]:d(b,m);for(v=0;v<r;v++)b[v+S]=arguments[v+2];return u(b,E-n+r),f}})},9653:function(e,t,r){"use strict";var n=r(9781),i=r(7854),s=r(1702),a=r(4705),o=r(8052),u=r(2597),l=r(9587),c=r(7976),h=r(2190),d=r(7593),f=r(7293),p=r(8006).f,g=r(1236).f,v=r(3070).f,y=r(863),m=r(3111).trim,b="Number",E=i[b],S=E.prototype,T=i.TypeError,w=s("".slice),A=s("".charCodeAt),x=function(e){var t=d(e,"number");return"bigint"==typeof t?t:_(t)},_=function(e){var t,r,n,i,s,a,o,u,l=d(e,"number");if(h(l))throw T("Cannot convert a Symbol value to a number");if("string"==typeof l&&l.length>2){if(l=m(l),43===(t=A(l,0))||45===t){if(88===(r=A(l,2))||120===r)return NaN}else if(48===t){switch(A(l,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+l}for(o=0,a=(s=w(l,2)).length;o<a;o++)if((u=A(s,o))<48||u>i)return NaN;return parseInt(s,n)}}return+l};if(a(b,!E(" 0o1")||!E("0b1")||E("+0x1"))){for(var R,O=function(e){var t=arguments.length<1?0:E(x(e)),r=this;return c(S,r)&&f(function(){y(r)})?l(Object(t),r,O):t},k=n?p(E):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),L=0;k.length>L;L++)u(E,R=k[L])&&!u(O,R)&&v(O,R,g(E,R));O.prototype=S,S.constructor=O,o(i,b,O,{constructor:!0})}},3161:function(e,t,r){var n=r(2109),i=r(5988);n({target:"Number",stat:!0},{isInteger:i})},9601:function(e,t,r){var n=r(2109),i=r(1574);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},9720:function(e,t,r){var n=r(2109),i=r(4699).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},8559:function(e,t,r){var n=r(2109),i=r(408),s=r(6135);n({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,function(e,r){s(t,e,r)},{AS_ENTRIES:!0}),t}})},5375:function(e,t,r){var n=r(2109),i=r(7293),s=r(7908),a=r(9518),o=r(8544),u=i(function(){a(1)});n({target:"Object",stat:!0,forced:u,sham:!o},{getPrototypeOf:function(e){return a(s(e))}})},7941:function(e,t,r){var n=r(2109),i=r(7908),s=r(1956),a=r(7293)(function(){s(1)});n({target:"Object",stat:!0,forced:a},{keys:function(e){return s(i(e))}})},1539:function(e,t,r){var n=r(1694),i=r(8052),s=r(288);n||i(Object.prototype,"toString",s,{unsafe:!0})},821:function(e,t,r){"use strict";
vendor: 4,622 bytes, line 24
24var n=r(2109),i=r(6916),s=r(9662),a=r(8523),o=r(2534),u=r(408),l=r(612);n({target:"Promise",stat:!0,forced:l},{all:function(e){var t=this,r=a.f(t),n=r.resolve,l=r.reject,c=o(function(){var r=s(t.resolve),a=[],o=0,c=1;u(e,function(e){var s=o++,u=!1;c++,i(r,t,e).then(function(e){!u&&(u=!0,a[s]=e,--c||n(a))},l)}),--c||n(a)});return c.error&&l(c.value),r.promise}})},4164:function(e,t,r){"use strict";var n=r(2109),i=r(1913),s=r(3702).CONSTRUCTOR,a=r(2492),o=r(5005),u=r(614),l=r(8052),c=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(a)){var h=o("Promise").prototype.catch;c.catch!==h&&l(c,"catch",h,{unsafe:!0})}},3401:function(e,t,r){"use strict";var n,i,s,a,o=r(2109),u=r(1913),l=r(5268),c=r(7854),h=r(6916),d=r(8052),f=r(7674),p=r(8003),g=r(6340),v=r(9662),y=r(614),m=r(111),b=r(5787),E=r(6707),S=r(261).set,T=r(5948),w=r(4413),A=r(2534),x=r(8572),_=r(9909),R=r(2492),O=r(3702),k=r(8523),L="Promise",C=O.CONSTRUCTOR,I=O.REJECTION_EVENT,D=O.SUBCLASSING,P=_.getterFor(L),M=_.set,U=R&&R.prototype,F=R,B=U,N=c.TypeError,j=c.document,q=c.process,H=k.f,z=H,G=!!(j&&j.createEvent&&c.dispatchEvent),K="unhandledrejection",W=function(e){var t;return!!(m(e)&&y(t=e.then))&&t},V=function(e,t){var r,n,i,s=t.value,a=1==t.state,o=a?e.ok:e.fail,u=e.resolve,l=e.reject,c=e.domain;try{o?(a||(2===t.rejection&&J(t),t.rejection=1),!0===o?r=s:(c&&c.enter(),r=o(s),c&&(c.exit(),i=!0)),r===e.promise?l(N("Promise-chain cycle")):(n=W(r))?h(n,r,u,l):u(r)):l(s)}catch(d){c&&!i&&c.exit(),l(d)}},$=function(e,t){e.notified||(e.notified=!0,T(function(){for(var r,n=e.reactions;r=n.get();)V(r,e);e.notified=!1,t&&!e.rejection&&Y(e)}))},Q=function(e,t,r){var n,i;G?((n=j.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!I&&(i=c["on"+e])?i(n):e===K&&w("Unhandled promise rejection",r)},Y=function(e){h(S,c,function(){var t,r=e.facade,n=e.value;if(X(e)&&(t=A(function(){l?q.emit("unhandledRejection",n,r):Q(K,r,n)}),e.rejection=l||X(e)?2:1,t.error))throw t.value})},X=function(e){return 1!==e.rejection&&!e.parent},J=function(e){h(S,c,function(){var t=e.facade;l?q.emit("rejectionHandled",t):Q("rejectionhandled",t,e.value)})},Z=function(e,t,r){return function(n){e(t,n,r)}},ee=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,$(e,!0))},et=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw N("Promise can't be resolved itself");var n=W(t);n?T(function(){var r={done:!1};try{h(n,t,Z(et,r,e),Z(ee,r,e))}catch(i){ee(r,i,e)}}):(e.value=t,e.state=1,$(e,!1))}catch(i){ee({done:!1},i,e)}}};if(C&&(B=(F=function(e){b(this,B),v(e),h(n,this);var t=P(this);try{e(Z(et,t),Z(ee,t))}catch(r){ee(t,r)}}).prototype,(n=function(e){M(this,{type:L,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:void 0})}).prototype=d(B,"then",function(e,t){var r=P(this),n=H(E(this,F));return r.parent=!0,n.ok=!y(e)||e,n.fail=y(t)&&t,n.domain=l?q.domain:void 0,0==r.state?r.reactions.add(n):T(function(){V(n,r)}),n.promise}),i=function(){var e=new n,t=P(e);this.promise=e,this.resolve=Z(et,t),this.reject=Z(ee,t)},k.f=H=function(e){return e===F||e===s?new i(e):z(e)},!u&&y(R)&&U!==Object.prototype)){a=U.then,D||d(U,"then",function(e,t){var r=this;return new F(function(e,t){h(a,r,e,t)}).then(e,t)},{unsafe:!0});try{delete U.constructor}catch(er){}f&&f(U,B)}o({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:F}),p(F,L,!1,!0),g(L)},8674:function(e,t,r){r(3401),r(821),r(4164),r(6027),r(683),r(6294)},6027:function(e,t,r){"use strict";var n=r(2109),i=r(6916),s=r(9662),a=r(8523),o=r(2534),u=r(408),l=r(612);n({target:"Promise",stat:!0,forced:l},{race:function(e){var t=this,r=a.f(t),n=r.reject,l=o(function(){var a=s(t.resolve);u(e,function(e){i(a,t,e).then(r.resolve,n)})});return l.error&&n(l.value),r.promise}})},683:function(e,t,r){"use strict";var n=r(2109),i=r(6916),s=r(8523),a=r(3702).CONSTRUCTOR;n({target:"Promise",stat:!0,forced:a},{reject:function(e){var t=s.f(this);return i(t.reject,void 0,e),t.promise}})},6294:function(e,t,r){"use strict";var n=r(2109),i=r(5005),s=r(1913),a=r(2492),o=r(3702).CONSTRUCTOR,u=r(9478),l=i("Promise"),c=s&&!o;n({target:"Promise",stat:!0,forced:s||o},{resolve:function(e){return u(c&&this===l?a:this,e)}})},4916:function(e,t,r){"use strict";var n=r(2109),i=r(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9714:function(e,t,r){"use strict";var n=r(6530).PROPER,i=r(8052),s=r(9670),a=r(1340),o=r(7293),u=r(4706),l="toString",c=RegExp.prototype[l],h=o(function(){return"/a/b"!=c.call({source:"a",flags:"b"})}),d=n&&c.name!=l;
24(h||d)&&i(RegExp.prototype,l,function(){var e=s(this),t=a(e.source),r=a(u(e));return"/"+t+"/"+r},{unsafe:!0})},7227:function(e,t,r){"use strict";var n=r(7710),i=r(5631);n("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},i)},189:function(e,t,r){r(7227)},2023:function(e,t,r){"use strict";var n=r(2109),i=r(1702),s=r(7927),a=r(4488),o=r(1340),u=r(4964),l=i("".indexOf);n({target:"String",proto:!0,forced:!u("includes")},{includes:function(e){return!!~l(o(a(this)),o(s(e)),arguments.length>1?arguments[1]:void 0)}})},8783:function(e,t,r){"use strict";var n=r(8710).charAt,i=r(1340),s=r(9909),a=r(1656),o=r(6178),u="String Iterator",l=s.set,c=s.getterFor(u);a(String,"String",function(e){l(this,{type:u,string:i(e),index:0})},function(){var e,t=c(this),r=t.string,i=t.index;return i>=r.length?o(void 0,!0):(e=n(r,i),t.index+=e.length,o(e,!1))})},3112:function(e,t,r){"use strict";var n=r(2109),i=r(6650).start,s=r(4986);n({target:"String",proto:!0,forced:s},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5306:function(e,t,r){"use strict";var n=r(2104),i=r(6916),s=r(1702),a=r(9063),o=r(7293),u=r(9670),l=r(614),c=r(8554),h=r(9303),d=r(7466),f=r(1340),p=r(4488),g=r(1530),v=r(8173),y=r(647),m=r(7651),b=r(6958)("replace"),E=Math.max,S=Math.min,T=s([].concat),w=s([].push),A=s("".indexOf),x=s("".slice),_="$0"==="a".replace(/./,"$0"),R=!!/./[b]&&""===/./[b]("a","$0"),O=!o(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")});a("replace",function(e,t,r){var s=R?"$":"$0";return[function(e,r){var n=p(this),s=c(e)?void 0:v(e,b);return s?i(s,e,n,r):i(t,f(n),e,r)},function(e,i){var a=u(this),o=f(e);if("string"==typeof i&&-1===A(i,s)&&-1===A(i,"$<")){var c=r(t,a,o,i);if(c.done)return c.value}var p=l(i);p||(i=f(i));var v=a.global;if(v){var b=a.unicode;a.lastIndex=0}for(var _=[];;){var R=m(a,o);if(null===R||(w(_,R),!v))break;""===f(R[0])&&(a.lastIndex=g(o,d(a.lastIndex),b))}for(var O="",k=0,L=0;L<_.length;L++){for(var C,I=f((R=_[L])[0]),D=E(S(h(R.index),o.length),0),P=[],M=1;M<R.length;M++)w(P,void 0===(C=R[M])?C:String(C));var U=R.groups;if(p){var F=T([I],P,D,o);void 0!==U&&w(F,U);var B=f(n(i,void 0,F))}else B=y(I,o,D,P,U,i);D>=k&&(O+=x(o,k,D)+B,k=D+I.length)}return O+x(o,k)}]},!O||!_||R)},3123:function(e,t,r){"use strict";var n=r(2104),i=r(6916),s=r(1702),a=r(9063),o=r(9670),u=r(8554),l=r(6772),c=r(4488),h=r(6707),d=r(1530),f=r(7466),p=r(1340),g=r(8173),v=r(1589),y=r(7651),m=r(2261),b=r(2999),E=r(7293),S=b.UNSUPPORTED_Y,T=Math.min,w=[].push,A=s(/./.exec),x=s(w),_=s("".slice),R=!E(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]});a("split",function(e,t,r){var s;return s="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var s,a,o,u=p(c(this)),h=void 0===r?4294967295:r>>>0;if(0===h)return[];if(void 0===e)return[u];if(!l(e))return i(t,u,e,h);for(var d=[],f=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),g=0,y=RegExp(e.source,f+"g");(s=i(m,y,u))&&(!((a=y.lastIndex)>g)||(x(d,_(u,g,s.index)),s.length>1&&s.index<u.length&&n(w,d,v(s,1)),o=s[0].length,g=a,!(d.length>=h)));)y.lastIndex===s.index&&y.lastIndex++;return g===u.length?(o||!A(y,""))&&x(d,""):x(d,_(u,g)),d.length>h?v(d,0,h):d}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:i(t,this,e,r)}:t,[function(t,r){var n=c(this),a=u(t)?void 0:g(t,e);return a?i(a,t,n,r):i(s,p(n),t,r)},function(e,n){var i=o(this),a=p(e),u=r(s,i,a,n,s!==t);if(u.done)return u.value;var l=h(i,RegExp),c=i.unicode,g=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(S?"g":"y"),v=new l(S?"^(?:"+i.source+")":i,g),m=void 0===n?4294967295:n>>>0;if(0===m)return[];if(0===a.length)return null===y(v,a)?[a]:[];for(var b=0,E=0,w=[];E<a.length;){v.lastIndex=S?0:E;var A,R=y(v,S?_(a,E):a);if(null===R||(A=T(f(v.lastIndex+(S?E:0)),a.length))===b)E=d(a,E,c);else{if(x(w,_(a,b,E)),w.length===m)return w;for(var O=1;O<=R.length-1;O++)if(x(w,R[O]),w.length===m)return w;E=b=A}}return x(w,_(a,b)),w}]},!R,S)},4747:function(e,t,r){var n=r(7854),i=r(8324),s=r(8509),a=r(8533),o=r(8880),u=function(e){if(e&&e.forEach!==a)try{o(e,"forEach",a)}catch(t){e.forEach=a}};for(var l in i)i[l]&&u(n[l]&&n[l].prototype);u(s)},3948:function(e,t,r){var n=r(7854),i=r(8324),s=r(8509),a=r(6992),o=r(8880),u=r(6958),l=u("iterator"),c=u("toStringTag"),h=a.values,d=function(e,t){if(e){if(e[l]!==h)try{o(e,l,h)}catch(r){e[l]=h}if(e[c]||o(e,c,t),i[t]){for(var n in a)if(e[n]!==a[n])try{o(e,n,a[n])}catch(s){e[n]=a[n]}}}};for(var f in i)d(n[f]&&n[f].prototype,f);d(s,"DOMTokenList")},5556:function(e,t,r){"use strict";r(6992);var n=r(2109),i=r(7854),s=r(6916),a=r(1702),o=r(9781),u=r(5143),l=r(8052),c=r(9190),h=r(8003),d=r(7850),f=r(9909),p=r(5787),g=r(614),v=r(2597),y=r(9974),m=r(648),b=r(9670),E=r(111),S=r(1340),T=r(30),w=r(9114),A=r(4121),x=r(1246),_=r(8053),R=r(6958),O=r(4362),k=R("iterator"),L="URLSearchParams",C=L+"Iterator",I=f.set,D=f.getterFor(L),P=f.getterFor(C),M=Object.getOwnPropertyDescriptor,U=function(e){if(!o)return i[e];var t=M(i,e);return t&&t.value},F=U("fetch"),B=U("Request"),N=U("Headers"),j=B&&B.prototype,q=N&&N.prototype,H=i.RegExp,z=i.TypeError,G=i.decodeURIComponent,K=i.encodeURIComponent,W=a("".charAt),V=a([].join),$=a([].push),Q=a("".replace),Y=a([].shift),X=a([].splice),J=a("".split),Z=a("".slice),ee=/\+/g,et=[,,,,],er=function(e){try{return G(e)}catch(t){return e}},en=function(e){var t,r=Q(e,ee," "),n=4;try{return G(r)}catch(i){for(;n;)r=Q(r,et[(t=n--)-1]||(et[t-1]=H("((?:%[\\da-f]{2}){"+t+"})","gi")),er);return r}}
vendor: 7,904 bytes, line 24
24,ei=/[!'()~]|%20/g,es={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ea=function(e){return es[e]},eo=function(e){return Q(K(e),ei,ea)},eu=d(function(e,t){I(this,{type:C,iterator:A(D(e).entries),kind:t})},"Iterator",function(){var e=P(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r},!0),el=function(e){this.entries=[],this.url=null,void 0!==e&&(E(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===W(e,0)?Z(e,1):e:S(e)))};el.prototype={type:L,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,a,o,u,l=x(e);if(l)for(r=(t=A(e,l)).next;!(n=s(r,t)).done;){if(a=(i=A(b(n.value))).next,(o=s(a,i)).done||(u=s(a,i)).done||!s(a,i).done)throw z("Expected sequence with length 2");$(this.entries,{key:S(o.value),value:S(u.value)})}else for(var c in e)v(e,c)&&$(this.entries,{key:c,value:S(e[c])})},parseQuery:function(e){if(e)for(var t,r,n=J(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=J(t,"="),$(this.entries,{key:en(Y(r)),value:en(V(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)$(r,eo((e=t[n++]).key)+"="+eo(e.value));return V(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ec=function(){p(this,eh);var e=arguments.length>0?arguments[0]:void 0;I(this,new el(e))},eh=ec.prototype;if(c(eh,{append:function(e,t){_(arguments.length,2);var r=D(this);$(r.entries,{key:S(e),value:S(t)}),r.updateURL()},delete:function(e){_(arguments.length,1);for(var t=D(this),r=t.entries,n=S(e),i=0;i<r.length;)r[i].key===n?X(r,i,1):i++;t.updateURL()},get:function(e){_(arguments.length,1);for(var t=D(this).entries,r=S(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){_(arguments.length,1);for(var t=D(this).entries,r=S(e),n=[],i=0;i<t.length;i++)t[i].key===r&&$(n,t[i].value);return n},has:function(e){_(arguments.length,1);for(var t=D(this).entries,r=S(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){_(arguments.length,1);for(var r,n=D(this),i=n.entries,s=!1,a=S(e),o=S(t),u=0;u<i.length;u++)(r=i[u]).key===a&&(s?X(i,u--,1):(s=!0,r.value=o));s||$(i,{key:a,value:o}),n.updateURL()},sort:function(){var e=D(this);O(e.entries,function(e,t){return e.key>t.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,r=D(this).entries,n=y(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new eu(this,"keys")},values:function(){return new eu(this,"values")},entries:function(){return new eu(this,"entries")}},{enumerable:!0}),l(eh,k,eh.entries,{name:"entries"}),l(eh,"toString",function(){return D(this).serialize()},{enumerable:!0}),h(ec,L),n({global:!0,constructor:!0,forced:!u},{URLSearchParams:ec}),!u&&g(N)){var ed=a(q.has),ef=a(q.set),ep=function(e){if(E(e)){var t,r=e.body;if(m(r)===L)return t=e.headers?new N(e.headers):new N,ed(t,"content-type")||ef(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),T(e,{body:w(0,S(r)),headers:w(0,t)})}return e};if(g(F)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return F(e,arguments.length>1?ep(arguments[1]):{})}}),g(B)){var eg=function(e){return p(this,j),new B(e,arguments.length>1?ep(arguments[1]):{})};j.constructor=eg,eg.prototype=j,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:eg})}}e.exports={URLSearchParams:ec,getState:D}},1637:function(e,t,r){r(5556)},8789:function(e,t,r){"use strict";r(8783);var n,i=r(2109),s=r(9781),a=r(5143),o=r(7854),u=r(9974),l=r(1702),c=r(8052),h=r(7045),d=r(5787),f=r(2597),p=r(1574),g=r(8457),v=r(1589),y=r(8710).codeAt,m=r(3197),b=r(1340),E=r(8003),S=r(8053),T=r(5556),w=r(9909),A=w.set,x=w.getterFor("URL"),_=T.URLSearchParams,R=T.getState,O=o.URL,k=o.TypeError,L=o.parseInt,C=Math.floor,I=Math.pow,D=l("".charAt),P=l(/./.exec),M=l([].join),U=l(1..toString),F=l([].pop),B=l([].push),N=l("".replace),j=l([].shift),q=l("".split),H=l("".slice),z=l("".toLowerCase),G=l([].unshift),K="Invalid scheme",W="Invalid host",V="Invalid port",$=/[a-z]/i,Q=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,J=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,er=/[\0\t\n\r #/:<>?@[\\\]^|]/,en=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ei=/[\t\n\r]/g,es=function(e){var t,r,n,i,s,a,o,u=q(e,".");if(u.length&&""==u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(n=0,r=[];n<t;n++){if(""==(i=u[n]))return e;if(s=10,i.length>1&&"0"==D(i,0)&&(s=P(X,i)?16:8,i=H(i,8==s?1:2)),""===i)a=0;else{if(!P(10==s?Z:8==s?J:ee,i))return e;a=L(i,s)}B(r,a)}for(n=0;n<t;n++)if(a=r[n],n==t-1){if(a>=I(256,5-t))return null}else if(a>255)return null;for(n=0,o=F(r);n<r.length;n++)o+=r[n]*I(256,3-n);return o},ea=function(e){var t,r,n,i,s,a,o,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,d=function(){return D(e,h)};if(":"==d()){if(":"!=D(e,1))return;h+=2,c=++l}for(;d();){if(8==l)return;if(":"==d()){if(null!==c)return;h++,c=++l;continue}for(t=r=0;r<4&&P(ee,d());)t=16*t+L(d(),16),h++,r++;if("."==d()){if(0==r||(h-=r,l>6))return;for(n=0;d();){if(i=null,n>0){if("."!=d()||!(n<4))return;h++}if(!P(Y,d()))return;for(;P(Y,d());){if(s=L(d(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(i>255)return;h++}u[l]=256*u[l]+i,(2==++n||4==n)&&l++}if(4!=n)return;break}if(":"==d()){if(h++,!d())return}else if(d())return;u[l++]=t}if(null!==c)for(a=l-c,l=7;0!=l&&a>0;)o=u[l],u[l--]=u[c+a-1],u[c+--a]=o;else if(8!=l)return;return u},eo=function(e){for(var t=null,r=1,n=null,i=0,s=0;s<8;s++)0!==e[s]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=s),++i);return i>r&&(t=n,r=i),t},eu=function(e){var t,r,n,i;if("number"==typeof e){for(r=0,t=[];r<4;r++)G(t,e%256),e=C(e/256);return M(t,".")}if("object"==typeof e){for(r=0,t="",n=eo(e);r<8;r++)(!i||0!==e[r])&&(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=U(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},el={},ec=p({},el,{" ":1,'"':1,"<":1,">":1,"`":1}),eh=p({},ec,{"#":1,"?":1,"{":1,"}":1}),ed=p({},eh,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ef=function(e,t){var r=y(e,0);return r>32&&r<127&&!f(t,e)?e:encodeURIComponent(e)},ep={ftp:21,file:null,http:80,https:443,ws:80,wss:443},eg=function(e,t){var r;return 2==e.length&&P($,D(e,0))&&(":"==(r=D(e,1))||!t&&"|"==r)},ev=function(e){var t;return e.length>1&&eg(H(e,0,2))&&(2==e.length||"/"===(t=D(e,2))||"\\"===t||"?"===t||"#"===t)},ey={},em={},eb={},eE={},eS={},eT={},ew={},eA={},ex={},e_={},eR={},eO={},ek={},eL={},eC={},eI={},eD={},eP={},eM={},eU={},eF={},eB=function(e,t,r){var n,i,s,a=b(e);if(t){if(i=this.parse(a))throw k(i);this.searchParams=null}else{if(void 0!==r&&(n=new eB(r,!0)),i=this.parse(a,null,n))throw k(i);(s=R(new _)).bindURL(this),this.searchParams=s}};eB.prototype={type:"URL",parse:function(e,t,r){var i,s,a,o,u=this,l=t||ey,c=0,h="",d=!1,p=!1,y=!1;for(e=b(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=N(e,en,"")),e=N(e,ei,""),i=g(e);c<=i.length;){switch(s=i[c],l){case ey:if(s&&P($,s))h+=z(s),l=em;else{if(t)return K;l=eb;continue}break;case em:if(s&&(P(Q,s)||"+"==s||"-"==s||"."==s))h+=z(s);else if(":"==s){if(t&&(u.isSpecial()!=f(ep,h)||"file"==h&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=h,t){u.isSpecial()&&ep[u.scheme]==u.port&&(u.port=null);return}h="","file"==u.scheme?l=eL:u.isSpecial()&&r&&r.scheme==u.scheme?l=eE:u.isSpecial()?l=eA:"/"==i[c+1]?(l=eS,c++):(u.cannotBeABaseURL=!0,B(u.path,""),l=eM)}else{if(t)return K;h="",l=eb,c=0;continue}break;case eb:if(!r||r.cannotBeABaseURL&&"#"!=s)return K;if(r.cannotBeABaseURL&&"#"==s){u.scheme=r.scheme,u.path=v(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=eF;break}l="file"==r.scheme?eL:eT;continue;case eE:if("/"==s&&"/"==i[c+1])l=ex,c++;else{l=eT;continue}break;case eS:if("/"==s){l=e_;break}l=eP;continue;
24case eT:if(u.scheme=r.scheme,s==n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query;else if("/"==s||"\\"==s&&u.isSpecial())l=ew;else if("?"==s)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query="",l=eU;else if("#"==s)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query,u.fragment="",l=eF;else{u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.path.length--,l=eP;continue}break;case ew:if(u.isSpecial()&&("/"==s||"\\"==s))l=ex;else if("/"==s)l=e_;else{u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=eP;continue}break;case eA:if(l=ex,"/"!=s||"/"!=D(h,c+1))continue;c++;break;case ex:if("/"!=s&&"\\"!=s){l=e_;continue}break;case e_:if("@"==s){d&&(h="%40"+h),d=!0,a=g(h);for(var m,E,S=0;S<a.length;S++){var T=a[S];if(":"==T&&!y){y=!0;continue}var w=ef(T,ed);y?u.password+=w:u.username+=w}h=""}else if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&u.isSpecial()){if(d&&""==h)return"Invalid authority";c-=g(h).length+1,h="",l=eR}else h+=s;break;case eR:case eO:if(t&&"file"==u.scheme){l=eI;continue}if(":"!=s||p){if(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&u.isSpecial()){if(u.isSpecial()&&""==h)return W;if(t&&""==h&&(u.includesCredentials()||null!==u.port))return;if(o=u.parseHost(h))return o;if(h="",l=eD,t)return;continue}"["==s?p=!0:"]"==s&&(p=!1),h+=s}else{if(""==h)return W;if(o=u.parseHost(h))return o;if(h="",l=ek,t==eO)return}break;case ek:if(P(Y,s))h+=s;else{if(!(s==n||"/"==s||"?"==s||"#"==s||"\\"==s&&u.isSpecial())&&!t)return V;if(""!=h){var A=L(h,10);if(A>65535)return V;u.port=u.isSpecial()&&A===ep[u.scheme]?null:A,h=""}if(t)return;l=eD;continue}break;case eL:if(u.scheme="file","/"==s||"\\"==s)l=eC;else if(r&&"file"==r.scheme){if(s==n)u.host=r.host,u.path=v(r.path),u.query=r.query;else if("?"==s)u.host=r.host,u.path=v(r.path),u.query="",l=eU;else if("#"==s)u.host=r.host,u.path=v(r.path),u.query=r.query,u.fragment="",l=eF;else{ev(M(v(i,c),""))||(u.host=r.host,u.path=v(r.path),u.shortenPath()),l=eP;continue}}else{l=eP;continue}break;case eC:if("/"==s||"\\"==s){l=eI;break}r&&"file"==r.scheme&&!ev(M(v(i,c),""))&&(eg(r.path[0],!0)?B(u.path,r.path[0]):u.host=r.host),l=eP;continue;case eI:if(s==n||"/"==s||"\\"==s||"?"==s||"#"==s){if(!t&&eg(h))l=eP;else if(""==h){if(u.host="",t)return;l=eD}else{if(o=u.parseHost(h))return o;if("localhost"==u.host&&(u.host=""),t)return;h="",l=eD}continue}h+=s;break;case eD:if(u.isSpecial()){if(l=eP,"/"!=s&&"\\"!=s)continue}else if(t||"?"!=s){if(t||"#"!=s){if(s!=n&&(l=eP,"/"!=s))continue}else u.fragment="",l=eF}else u.query="",l=eU;break;case eP:if(s==n||"/"==s||"\\"==s&&u.isSpecial()||!t&&("?"==s||"#"==s)){if((m=h,".."===(m=z(m))||"%2e."===m||".%2e"===m||"%2e%2e"===m)?(u.shortenPath(),"/"==s||"\\"==s&&u.isSpecial()||B(u.path,"")):"."===(E=h)||"%2e"===z(E)?"/"==s||"\\"==s&&u.isSpecial()||B(u.path,""):("file"==u.scheme&&!u.path.length&&eg(h)&&(u.host&&(u.host=""),h=D(h,0)+":"),B(u.path,h)),h="","file"==u.scheme&&(s==n||"?"==s||"#"==s))for(;u.path.length>1&&""===u.path[0];)j(u.path);"?"==s?(u.query="",l=eU):"#"==s&&(u.fragment="",l=eF)}else h+=ef(s,eh);break;case eM:"?"==s?(u.query="",l=eU):"#"==s?(u.fragment="",l=eF):s!=n&&(u.path[0]+=ef(s,el));break;case eU:t||"#"!=s?s!=n&&("'"==s&&u.isSpecial()?u.query+="%27":"#"==s?u.query+="%23":u.query+=ef(s,el)):(u.fragment="",l=eF);break;case eF:s!=n&&(u.fragment+=ef(s,ec))}c++}},parseHost:function(e){var t,r,n;if("["==D(e,0)){if("]"!=D(e,e.length-1)||!(t=ea(H(e,1,-1))))return W;this.host=t}else if(this.isSpecial()){if(e=m(e),P(et,e)||null===(t=es(e)))return W;this.host=t}else{if(P(er,e))return W;for(n=0,t="",r=g(e);n<r.length;n++)t+=ef(r[n],el);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return f(ep,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&("file"!=this.scheme||1!=t||!eg(e[0],!0))&&e.length--},serialize:function(){var e=this.scheme,t=this.username,r=this.password,n=this.host,i=this.port,s=this.path,a=this.query,o=this.fragment,u=e+":";return null!==n?(u+="//",this.includesCredentials()&&(u+=t+(r?":"+r:"")+"@"),u+=eu(n),null!==i&&(u+=":"+i)):"file"==e&&(u+="//"),u+=this.cannotBeABaseURL?s[0]:s.length?"/"+M(s,"/"):"",null!==a&&(u+="?"+a),null!==o&&(u+="#"+o),u},setHref:function(e){var t=this.parse(e);if(t)throw k(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new eN(e.path[0]).origin}catch(r){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+eu(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(b(e)+":",ey)},getUsername:function(){return this.username},setUsername:function(e){var t=g(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=ef(t[r],ed)}},getPassword:function(){return this.password},setPassword:function(e){var t=g(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=ef(t[r],ed)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?eu(e):eu(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,eR)},getHostname:function(){var e=this.host;return null===e?"":eu(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,eO)},getPort:function(){var e=this.port;
24return null===e?"":b(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=b(e))?this.port=null:this.parse(e,ek))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+M(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,eD))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=b(e))?this.query=null:("?"==D(e,0)&&(e=H(e,1)),this.query="",this.parse(e,eU)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(""==(e=b(e))){this.fragment=null;return}"#"==D(e,0)&&(e=H(e,1)),this.fragment="",this.parse(e,eF)},update:function(){this.query=this.searchParams.serialize()||null}};var eN=function(e){var t=d(this,ej),r=S(arguments.length,1)>1?arguments[1]:void 0,n=A(t,new eB(e,!1,r));s||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ej=eN.prototype,eq=function(e,t){return{get:function(){return x(this)[e]()},set:t&&function(e){return x(this)[t](e)},configurable:!0,enumerable:!0}};if(s&&(h(ej,"href",eq("serialize","setHref")),h(ej,"origin",eq("getOrigin")),h(ej,"protocol",eq("getProtocol","setProtocol")),h(ej,"username",eq("getUsername","setUsername")),h(ej,"password",eq("getPassword","setPassword")),h(ej,"host",eq("getHost","setHost")),h(ej,"hostname",eq("getHostname","setHostname")),h(ej,"port",eq("getPort","setPort")),h(ej,"pathname",eq("getPathname","setPathname")),h(ej,"search",eq("getSearch","setSearch")),h(ej,"searchParams",eq("getSearchParams")),h(ej,"hash",eq("getHash","setHash"))),c(ej,"toJSON",function(){return x(this).serialize()},{enumerable:!0}),c(ej,"toString",function(){return x(this).serialize()},{enumerable:!0}),O){var eH=O.createObjectURL,ez=O.revokeObjectURL;eH&&c(eN,"createObjectURL",u(eH,O)),ez&&c(eN,"revokeObjectURL",u(ez,O))}E(eN,"URL"),i({global:!0,constructor:!0,forced:!a,sham:!s},{URL:eN})},285:function(e,t,r){r(8789)},4098:function(e,t){var r,n="undefined"!=typeof self?self:this,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();r=i,function(e){var t={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=a(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=a(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),o(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),o(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);
vendor: 4,134 bytes, line 24
24var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,n,i=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function y(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];y.redirect=function(e,t){if(-1===m.indexOf(t))throw RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(b){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(r,n){return new Promise(function(i,s){var a=new g(r,n);if(a.signal&&a.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function l(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;i(new y(n,r))},o.onerror=function(){s(TypeError("Network request failed"))},o.ontimeout=function(){s(TypeError("Network request failed"))},o.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},o.open(a.method,a.url,!0),"include"===a.credentials?o.withCredentials=!0:"omit"===a.credentials&&(o.withCredentials=!1),"responseType"in o&&t.blob&&(o.responseType="blob"),a.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),a.signal&&(a.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&a.signal.removeEventListener("abort",l)}),o.send(void 0===a._bodyInit?null:a._bodyInit)})}E.polyfill=!0,r.fetch||(r.fetch=E,r.Headers=u,r.Request=g,r.Response=y),e.Headers=u,e.Request=g,e.Response=y,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill,(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},6230:function(e){e.exports="object"==typeof self?self.FormData:window.FormData},7631:function(e){var t;"undefined"!=typeof window&&(t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
24),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./src/hls.ts")}({
vendor: 2,778 bytes, line 24
24"./node_modules/eventemitter3/index.js":function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function s(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,r,n,s){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new a(r,n||e,s),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],o]:e._events[u].push(o):(e._events[u]=o,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1)),l.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,a=Array(s);n<s;n++)a[n]=r[n].fn;return a},l.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,n,s,a){var o=i?i+e:e;if(!this._events[o])return!1;var u,l,c=this._events[o],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,n),!0;case 5:return c.fn.call(c.context,t,r,n,s),!0;case 6:return c.fn.call(c.context,t,r,n,s,a),!0}for(l=1,u=Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,r);break;case 4:c[l].fn.call(c[l].context,t,r,n);break;default:if(!u)for(d=1,u=Array(h-1);d<h;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},l.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},l.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},l.prototype.removeListener=function(e,t,r,n){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return u(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||n&&!a.once||r&&a.context!==r||u(this,s);else{for(var o=0,l=[],c=a.length;o<c;o++)(a[o].fn!==t||n&&!a[o].once||r&&a[o].context!==r)&&l.push(a[o]);l.length?this._events[s]=1===l.length?l[0]:l:u(this,s)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&u(this,t)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=i,l.EventEmitter=l,e.exports=l},
vendor: 1,739 bytes, line 24
24"./node_modules/url-toolkit/src/url-toolkit.js":function(e,t,r){var n,i,s,a,o;n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var n=o.parseURL(e);if(!n)throw Error("Error trying to parse base URL.");return n.path=o.normalizePath(n.path),o.buildURLFromParts(n)}var s=o.parseURL(t);if(!s)throw Error("Error trying to parse relative URL.");if(s.scheme)return r.alwaysNormalize?(s.path=o.normalizePath(s.path),o.buildURLFromParts(s)):t;var a=o.parseURL(e);if(!a)throw Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var u=i.exec(a.path);a.netLoc=u[1],a.path=u[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=a.netLoc,"/"!==s.path[0])){if(s.path){var c=a.path,h=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=o.normalizePath(h)}else l.path=a.path,s.params||(l.params=a.params,s.query||(l.query=a.query))}return null===l.path&&(l.path=r.alwaysNormalize?o.normalizePath(s.path):s.path),o.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(s,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=o},
vendor: 2,667 bytes, line 24
24"./node_modules/webworkify-webpack/index.js":function(e,t,r){function n(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var n=r(r.s=ENTRY_MODULE);return n.default||n}var i="[\\.|\\-|\\+|\\w|/|@]+",s="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+i+").*?\\)";function a(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function o(e){return!isNaN(1*e)}function u(e,t,n){var u,l={};l[n]=[];var c=t.toString(),h=c.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!h)return l;for(var d=h[1],f=RegExp("(\\\\n|\\W)"+a(d)+s,"g");u=f.exec(c);)"dll-reference"!==u[3]&&l[n].push(u[3]);for(f=RegExp("\\("+a(d)+'\\("(dll-reference\\s('+i+'))"\\)\\)'+s,"g");u=f.exec(c);)e[u[2]]||(l[n].push(u[1]),e[u[2]]=r(u[1]).m),l[u[2]]=l[u[2]]||[],l[u[2]].push(u[4]);for(var p=Object.keys(l),g=0;g<p.length;g++)for(var v=0;v<l[p[g]].length;v++)o(l[p[g]][v])&&(l[p[g]][v]=1*l[p[g]][v]);return l}function l(e){return Object.keys(e).reduce(function(t,r){return t||e[r].length>0},!1)}e.exports=function(e,t){t=t||{};var i={main:r.m},s=t.all?{main:Object.keys(i.main)}:function(e,t){for(var r={main:[t]},n={main:[]},i={main:{}};l(r);)for(var s=Object.keys(r),a=0;a<s.length;a++){var o=s[a],c=r[o].pop();if(i[o]=i[o]||{},!i[o][c]&&e[o][c]){i[o][c]=!0,n[o]=n[o]||[],n[o].push(c);for(var h=u(e,e[o][c],o),d=Object.keys(h),f=0;f<d.length;f++)r[d[f]]=r[d[f]]||[],r[d[f]]=r[d[f]].concat(h[d[f]])}}return n}(i,e),a="";Object.keys(s).filter(function(e){return"main"!==e}).forEach(function(e){for(var t=0;s[e][t];)t++;s[e].push(t),i[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+e+" = ("+n.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+s[e].map(function(t){return""+JSON.stringify(t)+": "+i[e][t].toString()}).join(",")+"});\n"}),a=a+"new (("+n.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+s.main.map(function(e){return""+JSON.stringify(e)+": "+i.main[e].toString()}).join(",")+"}))(self);";var o=new window.Blob([a],{type:"text/javascript"});if(t.bare)return o;var c=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(o),h=new window.Worker(c);return h.objectURL=c,h}},
vendor: 5,802 bytes, line 24
24"./src/config.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"hlsDefaultConfig",function(){return w}),r.d(t,"mergeConfig",function(){return A}),r.d(t,"enableStreamingMode",function(){return x});var n=r(/*! ./controller/abr-controller */ "./src/controller/abr-controller.ts"),i=r(/*! ./controller/audio-stream-controller */ "./src/controller/audio-stream-controller.ts"),s=r(/*! ./controller/audio-track-controller */ "./src/controller/audio-track-controller.ts"),a=r(/*! ./controller/subtitle-stream-controller */ "./src/controller/subtitle-stream-controller.ts"),o=r(/*! ./controller/subtitle-track-controller */ "./src/controller/subtitle-track-controller.ts"),u=r(/*! ./controller/buffer-controller */ "./src/controller/buffer-controller.ts"),l=r(/*! ./controller/timeline-controller */ "./src/controller/timeline-controller.ts"),c=r(/*! ./controller/cap-level-controller */ "./src/controller/cap-level-controller.ts"),h=r(/*! ./controller/fps-controller */ "./src/controller/fps-controller.ts"),d=r(/*! ./controller/eme-controller */ "./src/controller/eme-controller.ts"),f=r(/*! ./controller/cmcd-controller */ "./src/controller/cmcd-controller.ts"),p=r(/*! ./utils/xhr-loader */ "./src/utils/xhr-loader.ts"),g=r(/*! ./utils/fetch-loader */ "./src/utils/fetch-loader.ts"),v=r(/*! ./utils/cues */ "./src/utils/cues.ts"),y=r(/*! ./utils/mediakeys-helper */ "./src/utils/mediakeys-helper.ts"),m=r(/*! ./utils/logger */ "./src/utils/logger.ts");function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach(function(t){T(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:n.default,bufferController:u.default,capLevelController:c.default,fpsController:h.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:y.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},{cueHandler:v.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:a.SubtitleStreamController,subtitleTrackController:o.default,timelineController:l.TimelineController,audioStreamController:i.default,audioTrackController:s.default,emeController:d.default,cmcdController:f.default});function A(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return b({},e,t)}function x(e){var t=e.loader;t!==g.default&&t!==p.default?(m.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):Object(g.fetchSupported)()&&(e.loader=g.default,e.progressive=!0,e
vendor: 137 bytes, line 24
24.enableSoftwareAES=!0,m.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":
24function(e,t,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../utils/ewma-bandwidth-estimator */ "./src/utils/ewma-bandwidth-estimator.ts"),s=r(/*! ../events */ "./src/events.ts"),a=r(/*! ../errors */ "./src/errors.ts"),o=r(/*! ../types/loader */ "./src/types/loader.ts"),u=r(/*! ../utils/logger */ "./src/utils/logger.ts");function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var c=function(){function e(e){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;var t=e.config;this.bwEstimator=new i.default(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var t,r,c,h=e.prototype;return h.registerListeners=function(){var e=this.hls;e.on(s.Events.FRAG_LOADING,this.onFragLoading,this),e.on(s.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(s.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var e=this.hls;e.off(s.Events.FRAG_LOADING,this.onFragLoading,this),e.off(s.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(s.Events.ERROR,this.onError,this)},h.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},h.onFragLoading=function(e,t){var r,n=t.frag;n.type!==o.PlaylistLevelType.MAIN||this.timer||(this.fragCurrent=n,this.partCurrent=null!=(r=t.part)?r:null,this.timer=self.setInterval(this.onCheck,100))},h.onLevelLoaded=function(e,t){var r=this.hls.config;t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},h._abandonRulesCheck=function(){var e,t=this.fragCurrent,r=this.partCurrent,i=this.hls,a=i.autoLevelEnabled,o=(i.config,i.media);if(t&&o){var l=r?r.stats:t.stats,c=r?r.duration:t.duration;if(l.aborted||l.loaded&&l.loaded===l.total||0===t.level){this.clearTimer(),this._nextAutoLevel=-1;return}if(a&&!o.paused&&o.playbackRate&&o.readyState){var h=i.mainForwardBufferInfo;if(null!==h){var d=performance.now()-l.loading.start,f=Math.abs(o.playbackRate);if(!(d<=500*c/f)){var p=l.loaded&&l.loading.first,g=this.bwEstimator.getEstimate(),v=i.levels,y=i.minAutoLevel,m=v[t.level],b=l.total||Math.max(l.loaded,Math.round(c*m.maxBitrate/8)),E=p?1e3*l.loaded/d:0,S=E?(b-l.loaded)/E:8*b/g,T=h.len/f;if(!(S<=T)){var w=Number.POSITIVE_INFINITY;for(e=t.level-1;e>y;e--){var A=v[e].maxBitrate;if((w=E?c*A/(6.4*E):c*A/g)<T)break}!(w>=S)&&(u.logger.warn("Fragment "+t.sn+(r?" part "+r.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+e+"\n      Current BW estimate: "+(Object(n.isFiniteNumber)(g)?(g/1024).toFixed(3):"Unknown")+" Kb/s\n      Estimated load time for current fragment: "+S.toFixed(3)+" s\n      Estimated load time for the next fragment: "+w.toFixed(3)+" s\n      Time to underbuffer: "+T.toFixed(3)+" s"),i.nextLoadLevel=e,p&&this.bwEstimator.sample(d,l.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),i.trigger(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:r,stats:l}))}}}}}},h.onFragLoaded=function(e,t){var r=t.frag,i=t.part;if(r.type===o.PlaylistLevelType.MAIN&&Object(n.isFiniteNumber)(r.sn)){var a=i?i.stats:r.stats,u=i?i.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[r.level],c=(l.loaded?l.loaded.bytes:0)+a.loaded,h=(l.loaded?l.loaded.duration:0)+u;l.loaded={bytes:c,duration:h},l.realBitrate=Math.round(8*c/h)}if(r.bitrateTest){var d={stats:a,frag:r,part:i,id:r.type};this.onFragBuffered(s.Events.FRAG_BUFFERED,d)}}},h.onFragBuffered=function(e,t){var r=t.frag,n=t.part,i=n?n.stats:r.stats;if(!i.aborted&&r.type===o.PlaylistLevelType.MAIN&&"initSegment"!==r.sn){var s=i.parsing.end-i.loading.start;this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}},h.onError=function(e,t){switch(t.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},h.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},h.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,r=this.hls,n=r.maxAutoLevel,i=r.config,s=r.minAutoLevel,a=r.media,o=t?t.duration:e?e.duration:0;a&&a.currentTime;var l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,h=r.mainForwardBufferInfo,d=(h?h.len:0)/l,f=this.findBestLevel(c,s,n,d,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(f>=0)return f;u.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var p=o?Math.min(o,i.maxStarvationDelay):i.maxStarvationDelay,g=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(!d){var y=this.bitrateTestDelay;y&&(p=(o?Math.min(o,i.maxLoadingDelay):i.maxLoadingDelay)-y,u.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*p)+" ms"),g=v=1)}return Math.max(f=this.findBestLevel(c,s,n,d+p,g,v),0)},h.findBestLevel=function(e,t,r,i,s,a){for(var o,l=this.fragCurrent,c=this.partCurrent,h=this.lastLoadedFragLevel,d=this.hls.levels,f=d[h],p=!!(null!=f&&null!==(o=f.details)&&void 0!==o&&o.live),g=null==f?void 0:f.codecSet,v=c?c.duration:l?l.duration:0,y=r;y>=t;y--){var m=d[y];if(m&&(!g||m.codecSet===g)){var b=m.details,E=(c?null==b?void 0:b.partTarget:null==b?void 0:b.averagetargetduration)||v,S=void 0;
24S=y<=h?s*e:a*e;var T=d[y].maxBitrate,w=T*E/S;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(S)+"/"+T+"/"+E+"/"+i+"/"+w),S>T&&(0===w||!Object(n.isFiniteNumber)(w)||p&&!this.bitrateTestDelay||w<i))return y}}return -1},r=[{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;var r=this.getNextABRAutoLevel();return -1!==e&&this.hls.levels[r].loadError?e:(-1!==e&&(r=Math.min(e,r)),r)},set:function(e){this._nextAutoLevel=e}}],l(e.prototype,r),c&&l(e,c),Object.defineProperty(e,"prototype",{writable:!1}),e}();t.default=c},
24"./src/controller/audio-stream-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ./base-stream-controller */ "./src/controller/base-stream-controller.ts"),s=r(/*! ../events */ "./src/events.ts"),a=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),o=r(/*! ./fragment-tracker */ "./src/controller/fragment-tracker.ts"),u=r(/*! ../types/level */ "./src/types/level.ts"),l=r(/*! ../types/loader */ "./src/types/loader.ts"),c=r(/*! ../loader/fragment */ "./src/loader/fragment.ts"),h=r(/*! ../demux/chunk-cache */ "./src/demux/chunk-cache.ts"),d=r(/*! ../demux/transmuxer-interface */ "./src/demux/transmuxer-interface.ts"),f=r(/*! ../types/transmuxer */ "./src/types/transmuxer.ts"),p=r(/*! ./fragment-finders */ "./src/controller/fragment-finders.ts"),g=r(/*! ../utils/discontinuities */ "./src/utils/discontinuities.ts"),v=r(/*! ../errors */ "./src/errors.ts");function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var b=function(e){function t(t,r){var n;return(n=e.call(this,t,r,"[audio-stream-controller]")||this).videoBuffer=null,n.videoTrackCC=-1,n.waitingVideoCC=-1,n.audioSwitch=!1,n.trackId=-1,n.waitingData=null,n.mainDetails=null,n.bufferFlushed=!1,n.cachedTrackLoadedData=null,n._registerListeners(),n}r=t,b=e,r.prototype=Object.create(b.prototype),r.prototype.constructor=r,m(r,b);var r,b,E=t.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var e=this.hls;e.on(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(s.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(s.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(s.Events.ERROR,this.onError,this),e.on(s.Events.BUFFER_RESET,this.onBufferReset,this),e.on(s.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(s.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var e=this.hls;e.off(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(s.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(s.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(s.Events.ERROR,this.onError,this),e.off(s.Events.BUFFER_RESET,this.onBufferReset,this),e.off(s.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(s.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onInitPtsFound=function(e,t){var r=t.frag,n=t.id,s=t.initPTS;if("main"===n){var a=r.cc;this.initPTS[r.cc]=s,this.log("InitPTS for cc: "+a+" found from main: "+s),this.videoTrackCC=a,this.state===i.State.WAITING_INIT_PTS&&this.tick()}},E.startLoad=function(e){if(!this.levels){this.startPosition=e,this.state=i.State.STOPPED;return}var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=i.State.IDLE):(this.loadedmetadata=!1,this.state=i.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},E.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_TRACK:var t,r=this.levels,n=this.trackId,s=null==r?void 0:null===(t=r[n])||void 0===t?void 0:t.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=i.State.WAITING_INIT_PTS}break;case i.State.FRAG_LOADING_WAITING_RETRY:var o,u=performance.now(),l=this.retryDate;(!l||u>=l||null!==(o=this.media)&&void 0!==o&&o.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=i.State.IDLE);break;case i.State.WAITING_INIT_PTS:var c=this.waitingData;if(c){var h=c.frag,d=c.part,f=c.cache,g=c.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.FRAG_LOADING;var v={frag:h,part:d,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(v),g&&e.prototype._handleFragmentLoadComplete.call(this,v)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var y=this.getLoadPosition(),m=a.BufferHelper.bufferInfo(this.mediaBuffer,y,this.config.maxBufferHole);0>Object(p.fragmentWithinToleranceTest)(m.end,this.config.maxFragLookUpTolerance,h)&&(this.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+m.end+" is needed"),this.clearWaitingFragment())}}else this.state=i.State.IDLE}this.onTickEnd()},E.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.IDLE)},E.resetLoadingState=function(){this.clearWaitingFragment(),e.prototype.resetLoadingState.call(this)},E.onTickEnd=function(){var e=this.media;if(e&&e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length&&(this.loadedmetadata=!0),this.lastCurrentTime=e.currentTime}},E.doTickIdle=function(){var e,t,r=this.hls,n=this.levels,a=this.media,o=this.trackId,u=r.config;if(n&&n[o]&&(a||!this.startFragRequested&&u.startFragPrefetch)){var h=n[o].details;if(!h||h.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(h)){this.state=i.State.WAITING_TRACK;return}var d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,c.ElementaryStreamTypes.AUDIO,l.PlaylistLevelType.AUDIO));var f=this.getFwdBufferInfo(d,l.PlaylistLevelType.AUDIO);if(null!==f){var p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,l.PlaylistLevelType.MAIN),g=f.len,v=this.getMaxBufferLength(null==p?void 0:p.len),y=this.audioSwitch;if(!(g>=v)||y){if(!y&&this._streamEnded(f,h)){r.trigger(s.Events.BUFFER_EOS,{type:"audio"}),this.state=i.State.ENDED;return}var m=h.fragments[0].start,b=f.end;if(y&&a){var E=this.getLoadPosition();b=E,h.PTSKnown&&E<m&&(f.end>m||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),a.currentTime=m+.05)}if((!p||!(b>p.end+h.targetduration))&&(p&&p.len||!f.len)){var S=this.getNextFragment(b,h);if(!S){this.bufferFlushed=!0;return}(null===(e=S.decryptdata)||void 0===e?void 0:e.keyFormat)!=="identity"||null!==(t=S.decryptdata)&&void 0!==t&&t.key?this.loadFragment(S,h,b):this.loadKey(S,h)}}}}},E.getMaxBufferLength=function(t){var r=e.prototype.getMaxBufferLength.call(this);return t?Math.max(r,t):r},E.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},E.onAudioTracksUpdated=function(e,t){var r=t.audioTracks;this.resetTransmuxer(),this.levels=r.map(function(e){return new u.Level(e)}
vendor: 7,125 bytes, line 24
24)},E.onAudioTrackSwitching=function(e,t){var r=!!t.url;this.trackId=t.id;var n=this.fragCurrent;null!=n&&n.loader&&n.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=i.State.IDLE):this.state=i.State.STOPPED,this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},E.onLevelLoaded=function(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(s.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},E.onAudioTrackLoaded=function(e,t){if(null==this.mainDetails){this.cachedTrackLoadedData=t;return}var r,n=this.levels,s=t.details,a=t.id;if(!n){this.warn("Audio tracks were reset while loading level "+a);return}this.log("Track "+a+" loaded ["+s.startSN+","+s.endSN+"],duration:"+s.totalduration);var o=n[a],u=0;if(s.live||null!==(r=o.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed||!l)return;!o.details&&s.hasProgramDateTime&&l.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(s,l),u=s.fragments[0].start):u=this.alignPlaylists(s,o.details)}o.details=s,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(o.details,u),this.state!==i.State.WAITING_TRACK||this.waitForCdnTuneIn(s)||(this.state=i.State.IDLE),this.tick()},E._handleFragmentLoadProgress=function(e){var t,r=e.frag,n=e.part,s=e.payload,a=this.config,o=this.trackId,u=this.levels;if(!u){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered");return}var c=u[o];console.assert(c,"Audio track is defined on fragment load progress");var p=c.details;console.assert(p,"Audio track details are defined on fragment load progress");var g=a.defaultAudioCodec||c.audioCodec||"mp4a.40.2",v=this.transmuxer;v||(v=this.transmuxer=new d.default(this.hls,l.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[r.cc],m=null===(t=r.initSegment)||void 0===t?void 0:t.data;if(void 0!==y){var b=n?n.index:-1,E=new f.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,s.byteLength,b,-1!==b);v.push(s,m,g,"",r,n,p.totalduration,!1,E,y)}else this.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+p.startSN+" ,"+p.endSN+"],track "+o),(this.waitingData=this.waitingData||{frag:r,part:n,cache:new h.default,complete:!1}).cache.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=i.State.WAITING_INIT_PTS},E._handleFragmentLoadComplete=function(t){if(this.waitingData){this.waitingData.complete=!0;return}e.prototype._handleFragmentLoadComplete.call(this,t)},E.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},E.onBufferCreated=function(e,t){var r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)},E.onFragBuffered=function(e,t){var r=t.frag,n=t.part;if(r.type===l.PlaylistLevelType.AUDIO){if(this.fragContextChanged(r)){this.warn("Fragment "+r.sn+(n?" p: "+n.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}"initSegment"!==r.sn&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,n)}},E.onError=function(t,r){switch(r.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(l.PlaylistLevelType.AUDIO,r);break;case v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==i.State.ERROR&&this.state!==i.State.STOPPED&&(this.state=r.fatal?i.State.ERROR:i.State.IDLE,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var n=!0,s=this.getFwdBufferInfo(this.mediaBuffer,l.PlaylistLevelType.AUDIO);s&&s.len>.5&&(n=!this.reduceMaxBufferLength(s.len)),n&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},E.onBufferFlushed=function(e,t){t.type===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},E._handleTransmuxComplete=function(e){var t,r="audio",n=this.hls,a=e.remuxResult,o=e.chunkMeta,u=this.getCurrentContext(o);if(!u){this.warn("The loading context changed while buffering fragment "+o.sn+" of level "+o.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(o.level);return}var l=u.frag,h=u.part,d=u.level.details,f=a.audio,p=a.text,g=a.id3,v=a.initSegment;if(!this.fragContextChanged(l)&&d){if(this.state=i.State.PARSING,this.audioSwitch&&f&&this.completeAudioSwitch(),null!=v&&v.tracks&&(this._bufferInitSegment(v.tracks,l,o),n.trigger(s.Events.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:r,tracks:v.tracks})),f){var m=f.startPTS,b=f.endPTS,E=f.startDTS,S=f.endDTS;h&&(h.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:m,endPTS:b,startDTS:E,endDTS:S}),l.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,m,b,E,S),this.bufferFragmentData(f,l,h,o)}if(null!=g&&null!==(t=g.samples)&&void 0!==t&&t.length){var T=y({id:r,frag:l,details:d},g);n.trigger(s.Events.FRAG_PARSING_METADATA,T)}if(p){var w=y({id:r,frag:l,details:d},p);n.trigger(s.Events.FRAG_PARSING_USERDATA,w)}}},E._bufferInitSegment=function(e,t,r){if(this.state===i.State.PARSING){e.video&&delete e.video;var n=e.audio;if(n){n.levelCodec=n.codec,n.id="audio",this.log("Init audio buffer, container:"+n.container+", codecs[parsed]=["+n.codec+"]"),this.hls.trigger(s.Events.BUFFER_CODECS,e);var a=n.initSegment;if(null!=a&&a.byteLength){var o={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:a};this.hls.trigger(s.Events.BUFFER_APPENDING,o)}this.tick()}}},E.loadFragment=function(t,r,s){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||a===o.FragmentState.NOT_LOADED||a===o.FragmentState.PARTIAL)&&("initSegment"===t.sn?this._loadInitSegment(t):r.live&&!Object(n.isFiniteNumber)(this.initPTS[t.cc])?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=i.State.WAITING_INIT_PTS):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,r,s)))},E.completeAudioSwitch=function(){var t=this.hls,r=this.media,n=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:n})},t}(i.default);t.default=b},
24"./src/controller/audio-track-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../errors */ "./src/errors.ts"),s=r(/*! ./base-playlist-controller */ "./src/controller/base-playlist-controller.ts"),a=r(/*! ../types/loader */ "./src/types/loader.ts");function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){function t(t){var r;return(r=e.call(this,t,"[audio-track-controller]")||this).tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}r=t,s=e,r.prototype=Object.create(s.prototype),r.prototype.constructor=r,u(r,s);var r,s,l,c,h,d=t.prototype;return d.registerListeners=function(){var e=this.hls;e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(n.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(n.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(n.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(n.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,e.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(e,t){this.tracks=t.audioTracks||[]},d.onAudioTrackLoaded=function(e,t){var r=t.id,n=t.details,i=this.tracksInGroup[r];if(!i){this.warn("Invalid audio track id "+r);return}var s=i.details;i.details=t.details,this.log("audioTrack "+r+" loaded ["+n.startSN+"-"+n.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,t,s))},d.onLevelLoading=function(e,t){this.switchLevel(t.level)},d.onLevelSwitching=function(e,t){this.switchLevel(t.level)},d.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.audioGroupIds){var r=t.audioGroupIds[t.urlId];if(this.groupId!==r){this.groupId=r;var i=this.tracks.filter(function(e){return!r||e.groupId===r});this.selectDefaultTrack&&!i.some(function(e){return e.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i,this.log("Updating audio tracks, "+i.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(n.Events.AUDIO_TRACKS_UPDATED,{audioTracks:i}),this.selectInitialTrack()}}},d.onError=function(t,r){e.prototype.onError.call(this,t,r),!r.fatal&&r.context&&r.context.type===a.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},d.setAudioTrack=function(e){var t=this.tracksInGroup;if(e<0||e>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=t[this.trackId];this.log("Now switching to audio-track index "+e);var i=t[e],s=i.id,a=i.groupId,o=i.name,u=i.type,l=i.url;if(this.trackId=e,this.trackName=o,this.selectDefaultTrack=!1,this.hls.trigger(n.Events.AUDIO_TRACK_SWITCHING,{id:s,groupId:void 0===a?"":a,name:o,type:u,url:l}),!i.details||i.details.live){var c=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(c)}},d.selectInitialTrack=function(){var e=this.tracksInGroup;console.assert(e.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,r=this.findTrackId(t)||this.findTrackId();-1!==r?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r<t.length;r++){var n=t[r];
24if((!this.selectDefaultTrack||n.default)&&(!e||e===n.name))return n.id}return -1},d.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var r=t.id,i=t.groupId,s=t.url;if(e)try{s=e.addDirectives(s)}catch(a){this.warn("Could not construct new URL with HLS Delivery Directives: "+a)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(n.Events.AUDIO_TRACK_LOADING,{url:s,id:r,groupId:i,deliveryDirectives:e||null})}},c=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}}],o(t.prototype,c),h&&o(t,h),Object.defineProperty(t,"prototype",{writable:!1}),t}(s.default);t.default=l},
vendor: 3,889 bytes, line 24
24"./src/controller/base-playlist-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return u});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../types/level */ "./src/types/level.ts"),s=r(/*! ./level-helper */ "./src/controller/level-helper.ts"),a=r(/*! ../utils/logger */ "./src/utils/logger.ts"),o=r(/*! ../errors */ "./src/errors.ts"),u=function(){function e(e,t){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=a.logger.log.bind(a.logger,t+":"),this.warn=a.logger.warn.bind(a.logger,t+":"),this.hls=e}var t=e.prototype;return t.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},t.onError=function(e,t){t.fatal&&t.type===o.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},t.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},t.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},t.stopLoad=function(){this.canLoad=!1,this.clearTimer()},t.switchParams=function(e,t){var r=null==t?void 0:t.renditionReports;if(r)for(var s=0;s<r.length;s++){var a=r[s],o=""+a.URI;if(o===e.slice(-o.length)){var u=parseInt(a["LAST-MSN"]),l=parseInt(a["LAST-PART"]);if(t&&this.hls.config.lowLatencyMode){var c=Math.min(t.age-t.partTarget,t.targetduration);void 0!==l&&c>t.partTarget&&(l+=1)}if(Object(n.isFiniteNumber)(u))return new i.HlsUrlParameters(u,Object(n.isFiniteNumber)(l)?l:void 0,i.HlsSkip.No)}}},t.loadPlaylist=function(e){},t.shouldLoadTrack=function(e){return this.canLoad&&e&&!!e.url&&(!e.details||e.details.live)},t.playlistLoaded=function(e,t,r){var n=this,i=t.details,a=t.stats,o=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(i.advancedDateTime=Date.now()-o,i.live||null!=r&&r.live){if(i.reloaded(r),r&&this.log("live playlist "+e+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),r&&i.fragments.length>0&&Object(s.mergeDetails)(r,i),!this.canLoad||!i.live)return;var u,l=void 0,c=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var h=this.hls.config.lowLatencyMode,d=i.lastPartSn,f=i.endSN,p=i.lastPartIndex,g=d===f;-1!==p?(l=g?f+1:d,c=g?h?0:p:p+1):l=f+1;var v=i.age,y=Math.min(v+i.ageHeader-i.partTarget,1.5*i.targetduration);if(y>0){if(r&&y>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var m=Math.floor(y/i.targetduration);l+=m,void 0!==c&&(c+=Math.round(y%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+y+" skip sn "+m+" to part "+c)}i.tuneInGoal=y}if(u=this.getDeliveryDirectives(i,t.deliveryDirectives,l,c),h||!g){this.loadPlaylist(u);return}}else u=this.getDeliveryDirectives(i,t.deliveryDirectives,l,c);var b=Object(s.computeReloadInterval)(i,a);void 0!==l&&i.canBlockReload&&(b-=i.partTarget||1),this.log("reload live playlist "+e+" in "+Math.round(b)+" ms"),this.timer=self.setTimeout(function(){return n.loadPlaylist(u)},b)}else this.clearTimer()},t.getDeliveryDirectives=function(e,t,r,n){var s=Object(i.getSkipValue)(e,r);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,s=i.HlsSkip.No),new i.HlsUrlParameters(r,n,s)},t.retryLoadingOrFail=function(e){var t,r=this,n=this.hls.config,i=this.retryCount<n.levelLoadingMaxRetry;if(i){if(this.retryCount++,e.details.indexOf("LoadTimeOut")>-1&&null!==(t=e.context)&&void 0!==t&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+e.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return r.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+e.details+'"')}}else this.warn('cannot recover from error "'+e.details+'"'),this.clearTimer(),e.fatal=!0;return i},e}()},
24"./src/controller/base-stream-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"State",function(){return T}),r.d(t,"default",function(){return w});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../task-loop */ "./src/task-loop.ts"),s=r(/*! ./fragment-tracker */ "./src/controller/fragment-tracker.ts"),a=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),o=r(/*! ../utils/logger */ "./src/utils/logger.ts"),u=r(/*! ../events */ "./src/events.ts"),l=r(/*! ../errors */ "./src/errors.ts"),c=r(/*! ../types/transmuxer */ "./src/types/transmuxer.ts"),h=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),d=r(/*! ../utils/discontinuities */ "./src/utils/discontinuities.ts"),f=r(/*! ./fragment-finders */ "./src/controller/fragment-finders.ts"),p=r(/*! ./level-helper */ "./src/controller/level-helper.ts"),g=r(/*! ../loader/fragment-loader */ "./src/loader/fragment-loader.ts"),v=r(/*! ../crypt/decrypter */ "./src/crypt/decrypter.ts"),y=r(/*! ../utils/time-ranges */ "./src/utils/time-ranges.ts"),m=r(/*! ../types/loader */ "./src/types/loader.ts");function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function E(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e,t){return(S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var T={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},w=function(e){function t(t,r,n){var i;return(i=e.call(this)||this).hls=void 0,i.fragPrevious=null,i.fragCurrent=null,i.fragmentTracker=void 0,i.transmuxer=null,i._state=T.STOPPED,i.media=null,i.mediaBuffer=null,i.config=void 0,i.bitrateTest=!1,i.lastCurrentTime=0,i.nextLoadPosition=0,i.startPosition=0,i.loadedmetadata=!1,i.fragLoadError=0,i.retryDate=0,i.levels=null,i.fragmentLoader=void 0,i.levelLastLoaded=null,i.startFragRequested=!1,i.decrypter=void 0,i.initPTS=[],i.onvseeking=null,i.onvended=null,i.logPrefix="",i.log=void 0,i.warn=void 0,i.logPrefix=n,i.log=o.logger.log.bind(o.logger,n+":"),i.warn=o.logger.warn.bind(o.logger,n+":"),i.hls=t,i.fragmentLoader=new g.default(t.config),i.fragmentTracker=r,i.config=t.config,i.decrypter=new v.default(t,t.config),t.on(u.Events.KEY_LOADED,i.onKeyLoaded,E(i)),t.on(u.Events.LEVEL_SWITCHING,i.onLevelSwitching,E(i)),i}r=t,i=e,r.prototype=Object.create(i.prototype),r.prototype.constructor=r,S(r,i);var r,i,w,A,x,_=t.prototype;return _.doTick=function(){this.onTickEnd()},_.onTickEnd=function(){},_.startLoad=function(e){},_.stopLoad=function(){this.fragmentLoader.abort();var e=this.fragCurrent;e&&this.fragmentTracker.removeFragment(e),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=T.STOPPED},_._streamEnded=function(e,t){var r=this.fragCurrent,n=this.fragmentTracker;if(!t.live&&r&&this.media&&r.sn>=t.endSN&&!e.nextStart){var i=t.partList;if(null!=i&&i.length){var o=i[i.length-1];return a.BufferHelper.isBuffered(this.media,o.start+o.duration/2)}var u=n.getState(r);return u===s.FragmentState.PARTIAL||u===s.FragmentState.OK}return!1},_.onMediaAttached=function(e,t){var r=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);var n=this.config;this.levels&&n.autoStartLoad&&this.state===T.STOPPED&&this.startLoad(n.startPosition)},_.onMediaDetaching=function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},_.onMediaSeeking=function(){var e=this.config,t=this.fragCurrent,r=this.media,i=this.mediaBuffer,s=this.state,o=r?r.currentTime:0,u=a.BufferHelper.bufferInfo(i||r,o,e.maxBufferHole);if(this.log("media seeking to "+(Object(n.isFiniteNumber)(o)?o.toFixed(3):o)+", state: "+s),s===T.ENDED)this.resetLoadingState();else if(t&&!u.len){var l=e.maxFragLookUpTolerance,c=t.start-l,h=o>t.start+t.duration+l;(o<c||h)&&(h&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.loader.abort()),this.resetLoadingState())}r&&(this.lastCurrentTime=o),this.loadedmetadata||u.len||(this.nextLoadPosition=this.startPosition=o),this.tickImmediate()},_.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},_.onKeyLoaded=function(e,t){if(this.state===T.KEY_LOADING&&t.frag===this.fragCurrent&&this.levels){this.state=T.IDLE;var r=this.levels[t.frag.level].details;r&&this.loadFragment(t.frag,r,t.frag.start)}},_.onLevelSwitching=function(e,t){this.fragLoadError=0},_.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},_.onHandlerDestroyed=function(){this.state=T.STOPPED,this.hls.off(u.Events.KEY_LOADED,this.onKeyLoaded,this),this.hls.off(u.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,e.prototype.onHandlerDestroyed.call(this)},_.loadKey=function(e,t){this.log("Loading key for "+e.sn+" of ["+t.startSN+"-"+t.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level),this.state=T.KEY_LOADING,this.fragCurrent=e,this.hls.trigger(u.Events.KEY_LOADING,{frag:e})},_.loadFragment=function(e,t,r){this._loadFragForPlayback(e,t,r)},_._loadFragForPlayback=function(e,t,r){var n=this,i=function(t){if(n.fragContextChanged(e)){n.warn("Fragment "+e.sn+(t.part?" p: "+t.part.index:"")+" of level "+e.level+" was dropped during download."),n.fragmentTracker.removeFragment(e);return}e.stats.chunkCount++,n._handleFragmentLoadProgress(t)};this._doFragLoad(e,t,r,i).then(function(t){if(t){n.fragLoadError=0;var r=n.state;if(n.fragContextChanged(e)){r!==T.FRAG_LOADING&&(n.fragCurrent||r!==T.PARSING)||(n.fragmentTracker.removeFragment(e),n.state=T.IDLE);return}"payload"in t&&(n.log("Loaded fragment "+e.sn+" of level "+e.level),n.hls.trigger(u.Events.FRAG_LOADED,t)),n._handleFragmentLoadComplete(t)}}).catch(function(t){n.state!==T.STOPPED&&n.state!==T.ERROR&&(n.warn(t),n.resetFragmentLoading(e))})},_.flushMainBuffer=function(e,t,r){if(void 0===r&&(r=null),e-t){var n={startOffset:e,endOffset:t,type:r};this.fragLoadError=0,this.hls.trigger(u.Events.BUFFER_FLUSHING,n)}},_._loadInitSegment=function(e){var t=this;this._doFragLoad(e).then(function(r){if(!r||t.fragContextChanged(e)||!t.levels)throw Error("init load aborted");return r}).then(function(r){var n=t.hls,i=r.payload,s=e.decryptdata;if(i&&i.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){var a=self.performance.now();
24return t.decrypter.webCryptoDecrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer).then(function(t){var i=self.performance.now();return n.trigger(u.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:a,tdecrypt:i}}),r.payload=t,r})}return r}).then(function(r){var n=t.fragCurrent,i=t.hls,s=t.levels;if(!s)throw Error("init load aborted, missing levels");var a=s[e.level].details;console.assert(a,"Level details are defined when init segment is loaded");var o=e.stats;t.state=T.IDLE,t.fragLoadError=0,e.data=new Uint8Array(r.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),r.frag===n&&i.trigger(u.Events.FRAG_BUFFERED,{stats:o,frag:n,part:null,id:e.type}),t.tick()}).catch(function(r){t.state!==T.STOPPED&&t.state!==T.ERROR&&(t.warn(r),t.resetFragmentLoading(e))})},_.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},_.fragBufferedComplete=function(e,t){var r=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level+" "+(r?y.default.toString(a.BufferHelper.getBuffered(r)):"(detached)")),this.state=T.IDLE,r&&(!this.loadedmetadata&&r.buffered.length&&this.fragCurrent===this.fragPrevious&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},_.seekToStartPos=function(){},_._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var r=e.frag,n=e.part,i=e.partsLoaded,s=!i||0===i.length||i.some(function(e){return!e}),a=new c.ChunkMetadata(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(a)}},_._handleFragmentLoadProgress=function(e){},_._doFragLoad=function(e,t,r,i){var s=this;if(void 0===r&&(r=null),!this.levels)throw Error("frag load aborted, missing levels");if(r=Math.max(e.start,r||0),this.config.lowLatencyMode&&t){var a=t.partList;if(a&&i){r>e.end&&t.fragmentHint&&(e=t.fragmentHint);var o=this.getNextPart(a,e,r);if(o>-1){var l=a[o];return this.log("Loading part sn: "+e.sn+" p: "+l.index+" cc: "+e.cc+" of playlist ["+t.startSN+"-"+t.endSN+"] parts [0-"+o+"-"+(a.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=l.start+l.duration,this.state=T.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:e,part:a[o],targetBufferTime:r}),this.doFragPartsLoad(e,a,o,i).catch(function(e){return s.handleFragLoadError(e)})}if(!e.url||this.loadedEndOfParts(a,r))return Promise.resolve(null)}}return this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(t?"of ["+t.startSN+"-"+t.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),Object(n.isFiniteNumber)(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=T.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragmentLoader.load(e,i).catch(function(e){return s.handleFragLoadError(e)})},_.doFragPartsLoad=function(e,t,r,n){var i=this;return new Promise(function(s,a){var o=[];!function r(l){var c=t[l];i.fragmentLoader.loadPart(e,c,n).then(function(n){o[c.index]=n;var a=n.part;i.hls.trigger(u.Events.FRAG_LOADED,n);var h=t[l+1];if(!h||h.fragment!==e)return s({frag:e,part:a,partsLoaded:o});r(l+1)}).catch(a)}(r)})},_.handleFragLoadError=function(e){var t=e.data;return t&&t.details===l.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(u.Events.ERROR,t),null},_._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(!t||this.state!==T.PARSING){this.fragCurrent||(this.state=T.IDLE);return}var r=t.frag,n=t.part,i=t.level,s=self.performance.now();r.stats.parsing.end=s,n&&(n.stats.parsing.end=s),this.updateLevelTiming(r,n,i,e.partial)},_.getCurrentContext=function(e){var t=this.levels,r=e.level,n=e.sn,i=e.part;if(!t||!t[r])return this.warn("Levels object was unset while buffering fragment "+n+" of level "+r+". The current chunk will not be buffered."),null;var s=t[r],a=i>-1?Object(p.getPartWith)(s,n,i):null,o=a?a.fragment:Object(p.getFragmentWithSN)(s,n,this.fragCurrent);return o?{frag:o,part:a,level:s}:null},_.bufferFragmentData=function(e,t,r,n){if(e&&this.state===T.PARSING){var i=e.data1,s=e.data2,a=i;if(i&&s&&(a=Object(h.appendUint8Array)(i,s)),a&&a.length){var o={type:e.type,frag:t,part:r,chunkMeta:n,parent:t.type,data:a};this.hls.trigger(u.Events.BUFFER_APPENDING,o),e.dropped&&e.independent&&!r&&this.flushBufferGap(t)}}},_.flushBufferGap=function(e){var t=this.media;if(t){if(!a.BufferHelper.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}var r=t.currentTime,n=a.BufferHelper.bufferInfo(t,r,0),i=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),o=Math.max(Math.min(e.start-s,n.end-s),r+s);e.start-o>s&&this.flushMainBuffer(o,e.start)}},_.getFwdBufferInfo=function(e,t){var r=this.config,i=this.getLoadPosition();if(!Object(n.isFiniteNumber)(i))return null;var s=a.BufferHelper.bufferInfo(e,i,r.maxBufferHole);if(0===s.len&&void 0!==s.nextStart){var o=this.fragmentTracker.getBufferedFrag(i,t);if(o&&s.nextStart<o.end)return a.BufferHelper.bufferInfo(e,i,Math.max(s.nextStart,r.max
vendor: 5,273 bytes, line 24
24BufferHole))}return s},_.getMaxBufferLength=function(e){var t,r=this.config;return Math.min(e?Math.max(8*r.maxBufferSize/e,r.maxBufferLength):r.maxBufferLength,r.maxMaxBufferLength)},_.reduceMaxBufferLength=function(e){var t=this.config,r=e||t.maxBufferLength;return t.maxMaxBufferLength>=r&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},_.getNextFragment=function(e,t){var r,n=t.fragments,i=n.length;if(!i)return null;var s=this.config,a=n[0].start;if(t.live){var o=s.initialLiveManifestSize;if(i<o)return this.warn("Not enough fragments to start playback (have: "+i+", need: "+o+")"),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(r=this.getInitialLiveFragment(t,n),this.startPosition=r?this.hls.liveSyncPosition||r.start:e)}else e<=a&&(r=n[0]);if(!r){var u=s.lowLatencyMode?t.partEnd:t.fragmentEnd;r=this.getFragmentAtPosition(e,u,t)}return this.mapToInitFragWhenRequired(r)},_.mapToInitFragWhenRequired=function(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment},_.getNextPart=function(e,t,r){for(var n=-1,i=!1,s=!0,a=0,o=e.length;a<o;a++){var u=e[a];if(s=s&&!u.independent,n>-1&&r<u.start)break;var l=u.loaded;!l&&(i||u.independent||s)&&u.fragment===t&&(n=a),i=l}return n},_.loadedEndOfParts=function(e,t){var r=e[e.length-1];return r&&t>r.start&&r.loaded},_.getInitialLiveFragment=function(e,t){var r=this.fragPrevious,n=null;if(r){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),n=Object(f.findFragmentByPDT)(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){var i=r.sn+1;if(i>=e.startSN&&i<=e.endSN){var s=t[i-e.startSN];r.cc===s.cc&&(n=s,this.log("Live playlist, switching playlist, load frag with next SN: "+n.sn))}!n&&(n=Object(f.findFragWithCC)(t,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+n.sn)}}else{var a=this.hls.liveSyncPosition;null!==a&&(n=this.getFragmentAtPosition(a,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n},_.getFragmentAtPosition=function(e,t,r){var n,i=this.config,a=this.fragPrevious,o=r.fragments,u=r.endSN,l=r.fragmentHint,c=i.maxFragLookUpTolerance,h=!!(i.lowLatencyMode&&r.partList&&l);if(h&&l&&!this.bitrateTest&&(o=o.concat(l),u=l.sn),n=e<t?Object(f.findFragmentByPTS)(a,o,e,e>t-c?0:c):o[o.length-1]){var d=n.sn-r.startSN;if(a&&n.sn===a.sn&&!h&&a&&n.level===a.level){var p=o[d+1];n.sn<u&&this.fragmentTracker.getState(p)!==s.FragmentState.OK?(this.log("SN "+n.sn+" just loaded, load next one: "+p.sn),n=p):n=null}}return n},_.synchronizeToLiveEdge=function(e){var t=this.config,r=this.media;if(r){var n=this.hls.liveSyncPosition,i=r.currentTime,s=e.fragments[0].start,a=e.edge,o=i>=s-t.maxFragLookUpTolerance&&i<=a;if(null!==n&&r.duration>n&&(i<n||!o)){var u=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!o&&r.readyState<4||i<a-u)&&(this.loadedmetadata||(this.nextLoadPosition=n),r.readyState&&(this.warn("Playback: "+i.toFixed(3)+" is located too far from the end of live sliding playlist: "+a+", reset currentTime to : "+n.toFixed(3)),r.currentTime=n))}}},_.alignPlaylists=function(e,t){var r=this.levels,i=this.levelLastLoaded,s=this.fragPrevious,a=null!==i?r[i]:null,o=e.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;var u=e.fragments[0].start,l=e.alignedSliding&&Object(n.isFiniteNumber)(u);if(!t||!l&&!u){Object(d.alignStream)(s,a,e);var c=e.fragments[0].start;return this.log("Live playlist sliding: "+c.toFixed(2)+" start-sn: "+(t?t.startSN:"na")+"->"+e.startSN+" prev-sn: "+(s?s.sn:"na")+" fragments: "+o),c}return u},_.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},_.setStartPosition=function(e,t){var r=this.startPosition;if(r<t&&(r=-1),-1===r||-1===this.lastCurrentTime){var i=e.startTimeOffset;Object(n.isFiniteNumber)(i)?(r=t+i,i<0&&(r+=e.totalduration),r=Math.min(Math.max(t,r),t+e.totalduration),this.log("Start time offset "+i+" found in playlist, adjust startPosition to "+r),this.startPosition=r):e.live?r=this.hls.liveSyncPosition||t:this.startPosition=r=0,this.lastCurrentTime=r}this.nextLoadPosition=r},_.getLoadPosition=function(){var e=this.media,t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t},_.handleFragLoadAborted=function(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn("Fragment "+e.sn+(t?" part"+t.index:"")+" of level "+e.level+" was aborted"),this.resetFragmentLoading(e))},_.resetFragmentLoading=function(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===T.FRAG_LOADING_WAITING_RETRY)||(this.state=T.IDLE)},_.onFragmentOrKeyLoadError=function(e,t){if(!t.fatal){var r=t.frag;if(r&&r.type===e){var n=this.fragCurrent;console.assert(n&&r.sn===n.sn&&r.level===n.level&&r.urlId===n.urlId,"Frag load error must match current frag to retry");var i=this.config;if(this.fragLoadError+1<=i.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var s=Math.min(Math.pow(2,this.fragLoadError)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);
24this.warn("Fragment "+r.sn+" of "+e+" "+r.level+" failed to load, retrying in "+s+"ms"),this.retryDate=self.performance.now()+s,this.fragLoadError++,this.state=T.FRAG_LOADING_WAITING_RETRY}else t.levelRetry?(e===m.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=T.IDLE):(o.logger.error(t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.hls.stopLoad(),this.state=T.ERROR)}}},_.afterBufferFlushed=function(e,t,r){if(e){var n=a.BufferHelper.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===T.ENDED&&this.resetLoadingState()}},_.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=T.IDLE},_.resetStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},_.updateLevelTiming=function(e,t,r,n){var i=this,s=r.details;console.assert(!!s,"level.details must be defined"),Object.keys(e.elementaryStreams).reduce(function(t,a){var o=e.elementaryStreams[a];if(o){var l=o.endPTS-o.startPTS;if(l<=0)return i.warn("Could not parse fragment "+e.sn+" "+a+" duration reliably ("+l+")"),t||!1;var c=n?0:Object(p.updateFragPTSDTS)(s,e,o.startPTS,o.endPTS,o.startDTS,o.endDTS);return i.hls.trigger(u.Events.LEVEL_PTS_UPDATED,{details:s,level:r,drift:c,type:a,frag:e,start:o.startPTS,end:o.endPTS}),!0}return t},!1)||(this.warn("Found no media in fragment "+e.sn+" of level "+r.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=T.PARSED,this.hls.trigger(u.Events.FRAG_PARSED,{frag:e,part:t})},_.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A=[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}],b(t.prototype,A),x&&b(t,x),Object.defineProperty(t,"prototype",{writable:!1}),t}(i.default)},
vendor: 4,683 bytes, line 24
24"./src/controller/buffer-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return f});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a=r(/*! ../errors */ "./src/errors.ts"),o=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),u=r(/*! ../utils/mediasource-helper */ "./src/utils/mediasource-helper.ts"),l=r(/*! ../loader/fragment */ "./src/loader/fragment.ts"),c=r(/*! ./buffer-operation-queue */ "./src/controller/buffer-operation-queue.ts"),h=Object(u.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function e(e){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var e=t.hls,r=t.media,n=t.mediaSource;s.logger.log("[buffer-controller]: Media source opened"),r&&(t.updateMediaElementDuration(),e.trigger(i.Events.MEDIA_ATTACHED,{media:r})),n&&n.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){s.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){s.logger.log("[buffer-controller]: Media source ended")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null},t.registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(i.Events.BUFFER_RESET,this.onBufferReset,this),e.on(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(i.Events.BUFFER_EOS,this.onBufferEos,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(i.Events.FRAG_PARSED,this.onFragParsed,this),e.on(i.Events.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(i.Events.BUFFER_RESET,this.onBufferReset,this),e.off(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(i.Events.BUFFER_EOS,this.onBufferEos,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(i.Events.FRAG_PARSED,this.onFragParsed,this),e.off(i.Events.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},t.onManifestParsed=function(e,t){var r=2;(!t.audio||t.video)&&t.altAudio||(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,s.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var r=this.media=t.media;if(r&&h){var n=this.mediaSource=new h;n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(n),this._objectUrl=r.src}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,r=this._objectUrl;if(t){if(s.logger.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(n){s.logger.warn("[buffer-controller]: onMediaDetaching: "+n.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):s.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(i.Events.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;
24this.getSourceBufferTypes().forEach(function(t){var r=e.sourceBuffer[t];try{r&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(r),e.sourceBuffer[t]=void 0)}catch(n){s.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",n)}}),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var r=this,n=this.getSourceBufferTypes().length;Object.keys(t).forEach(function(e){if(n){var i=r.tracks[e];if(i&&"function"==typeof i.buffer.changeType){var a=t[e],o=a.id,u=a.codec,l=a.levelCodec,c=a.container,h=a.metadata,f=(i.levelCodec||i.codec).replace(d,"$1"),p=(l||u).replace(d,"$1");f!==p&&(r.appendChangeType(e,c+";codecs="+(l||u)),s.logger.log("[buffer-controller]: switching codec "+f+" to "+p),r.tracks[e]={buffer:i.buffer,codec:u,container:c,levelCodec:l,metadata:h,id:o})}}else r.pendingTracks[e]=t[e]}),!n&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var r=this,n=this.operationQueue;n.append({execute:function(){var i=r.sourceBuffer[e];i&&(s.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),i.changeType(t)),n.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){s.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}},e)},t.onBufferAppending=function(e,t){var r=this,n=this.hls,u=this.operationQueue,l=this.tracks,c=t.data,h=t.type,d=t.frag,f=t.part,p=t.chunkMeta,g=p.buffering[h],v=self.performance.now();g.start=v;var y=d.stats.buffering,m=f?f.stats.buffering:null;0===y.start&&(y.start=v),m&&0===m.start&&(m.start=v);var b=l.audio,E="audio"===h&&1===p.id&&(null==b?void 0:b.container)==="audio/mpeg";u.append({execute:function(){if(g.executeStart=self.performance.now(),E){var e=r.sourceBuffer[h];if(e){var t=d.start-e.timestampOffset;Math.abs(t)>=.1&&(s.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+t+") sn: "+d.sn+")"),e.timestampOffset=d.start)}}r.appendExecutor(c,h)},onStart:function(){},onComplete:function(){var e=self.performance.now();g.executeEnd=g.end=e,0===y.first&&(y.first=e),m&&0===m.first&&(m.first=e);var t=r.sourceBuffer,n={};for(var s in t)n[s]=o.BufferHelper.getBuffered(t[s]);r.appendError=0,r.hls.trigger(i.Events.BUFFER_APPENDED,{type:h,frag:d,part:f,chunkMeta:p,parent:d.type,timeRanges:n})},onError:function(e){s.logger.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",e);var t={type:a.ErrorTypes.MEDIA_ERROR,parent:d.type,details:a.ErrorDetails.BUFFER_APPEND_ERROR,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=a.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,t.details=a.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>n.config.appendErrorMaxRetry&&(s.logger.error("[buffer-controller]: Failed "+n.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0,n.stopLoad())),n.trigger(i.Events.ERROR,t)}},h)},t.onBufferFlushing=function(e,t){var r=this,n=this.operationQueue,a=function(e){return{execute:r.removeExecutor.bind(r,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(i.Events.BUFFER_FLUSHED,{type:e})},onError:function(t){s.logger.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?n.append(a(t.type),t.type):this.getSourceBufferTypes().forEach(function(e){n.append(a(e),e)})},t.onFragParsed=function(e,t){var r=this,n=t.frag,a=t.part,o=[],u=a?a.elementaryStreams:n.elementaryStreams;u[l.ElementaryStreamTypes.AUDIOVIDEO]?o.push("audiovideo"):(u[l.ElementaryStreamTypes.AUDIO]&&o.push("audio"),u[l.ElementaryStreamTypes.VIDEO]&&o.push("video"));var c=function(){var e=self.performance.now();n.stats.buffering.end=e,a&&(a.stats.buffering.end=e);var t=a?a.stats:n.stats;r.hls.trigger(i.Events.FRAG_BUFFERED,{frag:n,part:a,stats:t,id:n.type})};0===o.length&&s.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+n.type+" level: "+n.level+" sn: "+n.sn),this.blockBuffers(c,o)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var r=this;
vendor: 4,111 bytes, line 24
24this.getSourceBufferTypes().reduce(function(e,n){var i=r.sourceBuffer[n];return t.type&&t.type!==n||!i||i.ended||(i.ended=!0,s.logger.log("[buffer-controller]: "+n+" sourceBuffer now EOS")),e&&!!(!i||i.ended)},!0)&&this.blockBuffers(function(){var e=r.mediaSource;e&&"open"===e.readyState&&e.endOfStream()})},t.onLevelUpdated=function(e,t){var r=t.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,r=this.media,s=this.sourceBuffer;if(r&&null!==t){var a=this.getSourceBufferTypes();if(a.length){var u=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(Object(n.isFiniteNumber)(u)&&!(u<0)){var l=r.currentTime,c=t.levelTargetDuration,h=Math.floor(l/c)*c-Math.max(u,c);a.forEach(function(r){var n=s[r];if(n){var a=o.BufferHelper.getBuffered(n);a.length>0&&h>a.start(0)&&(e.trigger(i.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),t.live&&e.trigger(i.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),e.trigger(i.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:h,type:r}))}})}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,r=this.media,i=this.mediaSource,a=e.fragments[0].start+e.totalduration,o=r.duration,u=Object(n.isFiniteNumber)(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(s.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(e)):(a>u&&a>o||!Object(n.isFiniteNumber)(o))&&(s.logger.log("[buffer-controller]: Updating Media Source duration to "+a.toFixed(3)),i.duration=a)}},t.updateSeekableRange=function(e){var t=this.mediaSource,r=e.fragments;if(r.length&&e.live&&null!=t&&t.setLiveSeekableRange){var n=Math.max(0,r[0].start),i=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,i)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,r=this.pendingTracks,n=Object.keys(r).length;if(n&&!e||2===n){this.createSourceBuffers(r),this.pendingTracks={};var s=this.getSourceBufferTypes();if(0===s.length){this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}s.forEach(function(e){t.executeNext(e)})}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var n=0;for(var o in e)if(!t[o]){var u=e[o];if(!u)throw Error("source buffer exists for track "+o+", however track does not");var l=u.levelCodec||u.codec,c=u.container+";codecs="+l;s.logger.log("[buffer-controller]: creating sourceBuffer("+c+")");try{var h=t[o]=r.addSourceBuffer(c),d=o;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[o]={buffer:h,codec:l,container:u.container,levelCodec:u.levelCodec,metadata:u.metadata,id:u.id},n++}catch(f){s.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:c})}}n&&this.hls.trigger(i.Events.BUFFER_CREATED,{tracks:this.tracks})},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){s.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(e);r&&r.onError(t)},t.removeExecutor=function(e,t,r){var i=this.media,a=this.mediaSource,o=this.operationQueue,u=this.sourceBuffer[e];
24if(!i||!a||!u){s.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(e);return}var l=Object(n.isFiniteNumber)(i.duration)?i.duration:1/0,c=Object(n.isFiniteNumber)(a.duration)?a.duration:1/0,h=Math.max(0,t),d=Math.min(r,l,c);d>h?(s.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+e+" SourceBuffer"),console.assert(!u.updating,e+" sourceBuffer must not be updating"),u.remove(h,d)):o.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var r=this.operationQueue,n=this.sourceBuffer[t];if(!n){s.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),r.shiftAndExecuteNext(t);return}n.ended=!1,console.assert(!n.updating,t+" sourceBuffer must not be updating"),n.appendBuffer(e)},t.blockBuffers=function(e,t){var r=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length){s.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);return}var n=this.operationQueue;Promise.all(t.map(function(e){return n.appendBlocker(e)})).then(function(){e(),t.forEach(function(e){var t=r.sourceBuffer[e];t&&t.updating||n.shiftAndExecuteNext(e)})})},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,r){var n=this.sourceBuffer[e];if(n){var i=r.bind(this,e);this.listeners[e].push({event:t,listener:i}),n.addEventListener(t,i)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach(function(e){t.removeEventListener(e.event,e.listener)})},e}()},
24"./src/controller/buffer-operation-queue.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return i});var n=r(/*! ../utils/logger */ "./src/utils/logger.ts"),i=function(){function e(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}var t=e.prototype;return t.append=function(e,t){var r=this.queues[t];r.push(e),1===r.length&&this.buffers[t]&&this.executeNext(t)},t.insertAbort=function(e,t){this.queues[t].unshift(e),this.executeNext(t)},t.appendBlocker=function(e){var t,r=new Promise(function(e){t=e}),n={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(n,e),r},t.executeNext=function(e){var t=this.buffers,r=this.queues,i=t[e],s=r[e];if(s.length){var a=s[0];try{a.execute()}catch(o){n.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(o),i&&i.updating||(s.shift(),this.executeNext(e))}}},t.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},t.current=function(e){return this.queues[e][0]},e}()},
vendor: 3,446 bytes, line 24
24"./src/controller/cap-level-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */ "./src/events.ts");function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){function e(e){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var t,r,s,a=e.prototype;return a.setStreamController=function(e){this.streamController=e},a.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},a.registerListeners=function(){var e=this.hls;e.on(n.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.unregisterListener=function(){var e=this.hls;e.off(n.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.onFpsDropLevelCapping=function(t,r){e.isLevelAllowed(r.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(r.droppedLevel)},a.onMediaAttaching=function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null},a.onManifestParsed=function(e,t){var r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()},a.onBufferCodecs=function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()},a.onMediaDetaching=function(){this.stopCapping()},a.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},a.getMaxLevel=function(t){var r=this,n=this.hls.levels;if(!n.length)return -1;var i=n.filter(function(n,i){return e.isLevelAllowed(i,r.restrictedLevels)&&i<=t});return this.clientRect=null,e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},a.startCapping=function(){!this.timer&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},a.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},a.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.
24width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t},e.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},e.getMaxLevelByMediaSize=function(e,t,r){if(!e||!e.length)return -1;for(var n=e.length-1,i=0;i<e.length;i+=1){var s,a,o=e[i];if((o.width>=t||o.height>=r)&&(!(a=e[i+1])||o.width!==a.width||o.height!==a.height)){n=i;break}}return n},r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}}],i(e.prototype,r),s&&i(e,s),Object.defineProperty(e,"prototype",{writable:!1}),e}();t.default=s},
24"./src/controller/cmcd-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return d});var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../types/cmcd */ "./src/types/cmcd.ts"),s=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),a=r(/*! ../utils/logger */ "./src/utils/logger.ts");function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var d=function(){function e(t){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(e){try{r.apply(e,{ot:i.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(t){a.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(e){try{var t=e.frag,n=r.hls.levels[t.level],s=r.getObjectType(t),o={d:1e3*t.duration,ot:s};(s===i.CMCDObjectType.VIDEO||s===i.CMCDObjectType.AUDIO||s==i.CMCDObjectType.MUXED)&&(o.br=n.bitrate/1e3,o.tb=r.getTopBandwidth(s)/1e3,o.bl=r.getBufferLength(s)),r.apply(e,o)}catch(u){a.logger.warn("Could not generate segment CMCD data.",u)}},this.hls=t;var n=this.config=t.config,s=n.cmcd;null!=s&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||e.uuid(),this.cid=s.contentId,this.useHeaders=!0===s.useHeaders,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(n.Events.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(n.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},t.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var r,n;this.audioBuffer=null===(r=t.tracks.audio)||void 0===r?void 0:r.buffer,this.videoBuffer=null===(n=t.tracks.video)||void 0===n?void 0:n.buffer},t.createData=function(){var e;return{v:i.CMCDVersion,sf:i.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(e=this.media)||void 0===e?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(t,r){void 0===r&&(r={}),h(r,this.createData());var n=r.ot===i.CMCDObjectType.INIT||r.ot===i.CMCDObjectType.VIDEO||r.ot===i.CMCDObjectType.MUXED;if(this.starved&&n&&(r.bs=!0,r.su=!0,this.starved=!1),null==r.su&&(r.su=this.buffering),this.useHeaders){var s=e.toHeaders(r);if(!Object.keys(s).length)return;t.headers||(t.headers={}),h(t.headers,s)}else{var a=e.toQuery(r);if(!a)return;t.url=e.appendQueryToUri(t.url,a)}},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?i.CMCDObjectType.TIMED_TEXT:"initSegment"===e.sn?i.CMCDObjectType.INIT:"audio"===t?i.CMCDObjectType.AUDIO:"main"===t?this.hls.audioTracks.length?i.CMCDObjectType.VIDEO:i.CMCDObjectType.MUXED:void 0},t.getTopBandwidth=function(e){var t=0,r=this.hls;if(e===i.CMCDObjectType.AUDIO)a=r.audioTracks;else{var n=r.maxAutoLevel,s=n>-1?n+1:r.levels.length;a=r.levels.slice(0,s)}for(var a,o,u=l(a);!(o=u()).done;){var c=o.value;c.bitrate>t&&(t=c.bitrate)}return t>0?t:NaN},t.getBufferLength=function(e){var t=this.hls.media,r=e===i.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return r&&t?1e3*s.BufferHelper.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var n=e.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(e,r,n){t(e),this.loader.load(e,r,n)},u(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()}
24,t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var n=e.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(e,r,n){t(e),this.loader.load(e,r,n)},u(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,r=[],n=function(e){return Math.round(e)},i=function(e){return 100*n(e/100)},s={br:n,d:n,bl:i,dl:i,mtp:i,nor:function(e){return encodeURIComponent(e)},rtp:i,tb:n},a=Object.keys(e||{}).sort(),o=l(a);!(t=o()).done;){var u,c=t.value,h=e[c];if(!Number.isNaN(u=h)&&null!=u&&""!==u&&!1!==u&&("v"!==c||1!==h)&&("pr"!=c||1!==h)){var d=s[c];d&&(h=d(h));var f=typeof h,p=void 0;p="ot"===c||"sf"===c||"st"===c?c+"="+h:"boolean"===f?c:"number"===f?c+"="+h:c+"="+JSON.stringify(h),r.push(p)}}return r.join(",")},e.toHeaders=function(t){for(var r=Object.keys(t),n={},i=["Object","Request","Session","Status"],s=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=0;o<r.length;o++){var u=r[o];s[null!=a[u]?a[u]:1][u]=t[u]}for(var l=0;l<s.length;l++){var c=e.serialize(s[l]);c&&(n["CMCD-"+i[l]]=c)}return n},e.toQuery=function(t){return"CMCD="+encodeURIComponent(e.serialize(t))},e.appendQueryToUri=function(e,t){if(!t)return e;var r=e.includes("?")?"&":"?";return""+e+r+t},e}()},
24"./src/controller/eme-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../errors */ "./src/errors.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a=r(/*! ../utils/mediakeys-helper */ "./src/utils/mediakeys-helper.ts");function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var u=function(e,t,r){var n={audioCapabilities:[],videoCapabilities:[]};return e.forEach(function(e){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+e+'"',robustness:r.audioRobustness||""})}),t.forEach(function(e){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+e+'"',robustness:r.videoRobustness||""})}),[n]},l=function(e,t,r,n){if(e===a.KeySystems.WIDEVINE)return u(t,r,n);throw Error("Unknown key-system: "+e)},c=function(){function e(e){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=e,this._config=e.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var t,r,u,c=e.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(n.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(e){switch(e){case a.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw Error('no license server URL configured for key-system "'+e+'"')},c._attemptKeySystemAccess=function(e,t,r){var n=this,i=l(e,t,r,this._drmSystemOptions);s.logger.log("Requesting encrypted media key-system access");var a=this.requestMediaKeySystemAccess(e,i);this.mediaKeysPromise=a.then(function(t){return n._onMediaKeySystemAccessObtained(e,t)}),a.catch(function(t){s.logger.error('Failed to obtain key-system "'+e+'" access:',t)})},c._onMediaKeySystemAccessObtained=function(e,t){var r=this;
24s.logger.log('Access for key-system "'+e+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};this._mediaKeysList.push(n);var i=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(t){return n.mediaKeys=t,s.logger.log('Media-keys created for key-system "'+e+'"'),r._onMediaKeysCreated(),t});return i.catch(function(e){s.logger.error("Failed to create media-keys:",e)}),i},c._onMediaKeysCreated=function(){var e=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),e._onNewMediaKeySession(t.mediaKeysSession))})},c._onNewMediaKeySession=function(e){var t=this;s.logger.log("New key-system session "+e.sessionId),e.addEventListener("message",function(r){t._onKeySessionMessage(e,r.message)},!1)},c._onKeySessionMessage=function(e,t){s.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(t){s.logger.log("Received license data (length: "+(t?t.byteLength:t)+"), updating key-session"),e.update(t).catch(function(e){s.logger.warn("Updating key-session failed: "+e)})})},c.onMediaEncrypted=function(e){var t=this;if(s.logger.log('Media is encrypted using "'+e.initDataType+'" init data type'),!this.mediaKeysPromise){s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(r){t._media&&(t._attemptSetMediaKeys(r),t._generateRequestWithPreferredKeySession(e.initDataType,e.initData))};this.mediaKeysPromise.then(r).catch(r)},c._attemptSetMediaKeys=function(e){if(!this._media)throw Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}s.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(e,t){var r=this,a=this._mediaKeysList[0];if(!a){s.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(a.mediaKeysSessionInitialized){s.logger.warn("Key-Session already initialized but requested again");return}var o=a.mediaKeysSession;if(!o){s.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){s.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}s.logger.log('Generating key-session request for "'+e+'" init data type'),a.mediaKeysSessionInitialized=!0,o.generateRequest(e,t).then(function(){s.logger.debug("Key-session generation succeeded")}).catch(function(e){s.logger.error("Error generating key-session request:",e),r.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},c._createLicenseXhr=function(e,t,r){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,e,t,r);var i=this._licenseXhrSetup;if(i)try{i.call(this.hls,n,e),i=void 0}catch(a){s.logger.error(a)}try{n.readyState||n.open("POST",e,!0),i&&i.call(this.hls,n,e)}catch(o){throw Error("issue setting up KeySystem license XHR "+o)}return n},c._onLicenseRequestReadyStageChange=function(e,t,r,a){if(4===e.readyState){if(200===e.status){this._requestLicenseFailureCount=0,s.logger.log("License request succeeded");var o=e.response,u=this._licenseResponseCallback;if(u)try{o=u.call(this.hls,e,t)}catch(l){s.logger.error(l)}a(o)}else{if(s.logger.error("License Request XHR failed ("+t+"). Status: "+e.status+" ("+e.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3){this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var c=3-this._requestLicenseFailureCount+1;s.logger.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(r,a)}}},c._generateLicenseRequestChallenge=function(e,t){if(e.mediaKeySystemDomain===a.KeySystems.WIDEVINE)return t;throw Error("unsupported key-system: "+e.mediaKeySystemDomain)},c._requestLicense=function(e,t){s.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){s.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var a=this.getLicenseServerUrl(r.mediaKeySystemDomain),o=this._createLicenseXhr(a,e,t);s.logger.log("Sending license request to URL: "+a);var u=this._generateLicenseRequestChallenge(r,e);o.send(u)}catch(l){s.logger.error("Failure requesting DRM license: "+l),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(e,t){if(this._emeEnabled){var r=t.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},c.onMediaDetached=function(){var e=this._media,t=this._mediaKeysList;e&&(e.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(e){if(e.mediaKeysSession)return e.mediaKeysSession.close().catch(function(){})})).then(function(){return e.setMediaKeys(null)}
24).catch(function(){}))},c.onManifestParsed=function(e,t){if(this._emeEnabled){var r=t.levels.map(function(e){return e.audioCodec}).filter(function(e){return!!e}),n=t.levels.map(function(e){return e.videoCodec}).filter(function(e){return!!e});this._attemptKeySystemAccess(a.KeySystems.WIDEVINE,r,n)}},r=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}],o(e.prototype,r),u&&o(e,u),Object.defineProperty(e,"prototype",{writable:!1}),e}();t.default=c},
vendor: 2,171 bytes, line 24
24"./src/controller/fps-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../utils/logger */ "./src/utils/logger.ts"),s=function(){function e(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var r=this.hls.config;if(r.capLevelOnFPSDrop){var n=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=n,n&&"function"==typeof n.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,r){var s=performance.now();if(t){if(this.lastTime){var a=s-this.lastTime,o=r-this.lastDroppedFrames,u=t-this.lastDecodedFrames,l=this.hls;if(l.trigger(n.Events.FPS_DROP,{currentDropped:o,currentDecoded:u,totalDroppedFrames:r}),1e3*o/a>0&&o>l.config.fpsDroppedMonitoringThreshold*u){var c=l.currentLevel;i.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(-1===l.autoLevelCapping||l.autoLevelCapping>=c)&&(c-=1,l.trigger(n.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:l.currentLevel}),l.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=r,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e){if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},e}();t.default=s},
24"./src/controller/fragment-finders.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"findFragmentByPDT",function(){return s}),r.d(t,"findFragmentByPTS",function(){return a}),r.d(t,"fragmentWithinToleranceTest",function(){return o}),r.d(t,"pdtWithinToleranceTest",function(){return u}),r.d(t,"findFragWithCC",function(){return l});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../utils/binary-search */ "./src/utils/binary-search.ts");function s(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!Object(n.isFiniteNumber)(t)||t<(e[0].programDateTime||0)||t>=(e[e.length-1].endProgramDateTime||0))return null;r=r||0;for(var i=0;i<e.length;++i){var s=e[i];if(u(t,r,s))return s}return null}function a(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var s=null;if(e?s=t[e.sn-t[0].sn+1]||null:0===r&&0===t[0].start&&(s=t[0]),s&&0===o(r,n,s))return s;var a=i.default.search(t,o.bind(null,r,n));return a||s}function o(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0);var n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function u(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-n>e}function l(e,t){return i.default.search(e,function(e){return e.cc<t?1:e.cc>t?-1:0})}},
24"./src/controller/fragment-tracker.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"FragmentState",function(){return n}),r.d(t,"FragmentTracker",function(){return o});var n,i,s=r(/*! ../events */ "./src/events.ts"),a=r(/*! ../types/loader */ "./src/types/loader.ts");(i=n||(n={})).NOT_LOADED="NOT_LOADED",i.APPENDING="APPENDING",i.PARTIAL="PARTIAL",i.OK="OK";var o=function(){function e(e){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(s.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(s.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(s.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(s.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){if(t===a.PlaylistLevelType.MAIN){var r=this.activeFragment,n=this.activeParts;if(!r)return null;if(n)for(var i=n.length;i--;){var s=n[i],o=s?s.end:r.appendedPTS;if(s.start<=e&&void 0!==o&&e<=o)return i>9&&(this.activeParts=n.slice(i-9)),s}else if(r.start<=e&&void 0!==r.appendedPTS&&e<=r.appendedPTS)return r}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var r=this.fragments,n=Object.keys(r),i=n.length;i--;){var s=r[n[i]];if((null==s?void 0:s.body.type)===t&&s.buffered){var a=s.body;if(a.start<=e&&e<=a.end)return a}}return null},t.detectEvictedFragments=function(e,t,r){var n=this;Object.keys(this.fragments).forEach(function(i){var s=n.fragments[i];if(s){if(!s.buffered){s.body.type===r&&n.removeFragment(s.body);return}var a=s.range[e];a&&a.time.some(function(e){var r=!n.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&n.removeFragment(s.body),r})}})},t.detectPartialFragments=function(e){var t=this,r=this.timeRanges,n=e.frag,i=e.part;if(r&&"initSegment"!==n.sn){var s=l(n),a=this.fragments[s];a&&(Object.keys(r).forEach(function(e){var s=n.elementaryStreams[e];if(s){var o=r[e],u=null!==i||!0===s.partial;a.range[e]=t.getBufferedTimes(n,i,u,o)}}),a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body))}},t.fragBuffered=function(e){var t=l(e),r=this.fragments[t];r&&(r.loaded=null,r.buffered=!0)},t.getBufferedTimes=function(e,t,r,n){for(var i={time:[],partial:r},s=t?t.start:e.start,a=t?t.end:e.end,o=e.minEndPTS||a,u=e.maxStartPTS||s,l=0;l<n.length;l++){var c=n.start(l)-this.bufferPadding,h=n.end(l)+this.bufferPadding;if(u>=c&&o<=h){i.time.push({startPTS:Math.max(s,n.start(l)),endPTS:Math.min(a,n.end(l))});break}if(s<h&&a>c)i.partial=!0,i.time.push({startPTS:Math.max(s,n.start(l)),endPTS:Math.min(a,n.end(l))});else if(a<=c)break}return i},t.getPartialFragment=function(e){var t,r,n,i=null,s=0,a=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(l){var c=o[l];c&&u(c)&&(r=c.body.start-a,n=c.body.end+a,e>=r&&e<=n&&s<=(t=Math.min(e-r,n-e))&&(i=c.body,s=t))}),i},t.getState=function(e){var t=l(e),r=this.fragments[t];return r?r.buffered?u(r)?n.PARTIAL:n.OK:n.APPENDING:(0,n.NOT_LOADED)},t.isTimeBuffered=function(e,t,r){for(var n,i,s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)break}return!1},t.onFragLoaded=function(e,t){var r=t.frag,n=t.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!n){var i=l(r);this.fragments[i]={body:r,loaded:t,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var r=this,n=t.frag,i=t.part,s=t.timeRanges;if(n.type===a.PlaylistLevelType.MAIN){if(this.activeFragment=n,i){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(i)}else this.activeParts=null}this.timeRanges=s,Object.keys(s).forEach(function(e){var t=s[e];if(r.detectEvictedFragments(e,t),!i)for(var a=0;a<t.length;a++)n.appendedPTS=Math.max(t.end(a),n.appendedPTS||0)})},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t=l(e);return!!this.fragments[t]},t.removeFragmentsInRange=function(e,t,r){var n=this;
vendor: 608 bytes, line 24
24Object.keys(this.fragments).forEach(function(i){var s=n.fragments[i];if(s&&s.buffered){var a=s.body;a.type===r&&a.start<t&&a.end>e&&n.removeFragment(a)}})},t.removeFragment=function(e){var t=l(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),delete this.fragments[t]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},e}();function u(e){var t,r;return e.buffered&&((null===(t=e.range.video)||void 0===t?void 0:t.partial)||(null===(r=e.range.audio)||void 0===r?void 0:r.partial))}function l(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}},
24"./src/controller/gap-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"STALL_MINIMUM_DURATION_MS",function(){return o}),r.d(t,"MAX_START_GAP_JUMP",function(){return u}),r.d(t,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return l}),r.d(t,"SKIP_BUFFER_RANGE_START",function(){return c}),r.d(t,"default",function(){return h});var n=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),i=r(/*! ../errors */ "./src/errors.ts"),s=r(/*! ../events */ "./src/events.ts"),a=r(/*! ../utils/logger */ "./src/utils/logger.ts"),o=250,u=2,l=.1,c=.05,h=function(){function e(e,t,r,n){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=r,this.hls=n}var t=e.prototype;return t.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},t.poll=function(e,t){var r=this.config,i=this.media,s=this.stalled;if(null!==i){var l=i.currentTime,c=i.seeking,h=this.seeking&&!c,d=!this.seeking&&c;if(this.seeking=c,l!==e){if(this.moved=!0,null!==s){if(this.stallReported){var f=self.performance.now()-s;a.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(f)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((d||h)&&(this.stalled=null),(!i.paused||c)&&!i.ended&&0!==i.playbackRate&&n.BufferHelper.getBuffered(i).length){var p=n.BufferHelper.bufferInfo(i,l,0),g=p.len>0,v=p.nextStart||0;if(g||v){if(c){var y=p.len>u,m=!v||t&&t.start<=l||v-l>u&&!this.fragmentTracker.getPartialFragment(l);if(y||m)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var b,E=Math.max(v,p.start||0)-l,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,T=(null==S?void 0:null===(b=S.details)||void 0===b?void 0:b.live)?2*S.details.targetduration:u;if(E>0&&E<=T){this._trySkipBufferHole(null);return}}var w=self.performance.now();if(null===s){this.stalled=w;return}var A=w-s;if(c||!(A>=o)||(this._reportStall(p),this.media)){var x=n.BufferHelper.bufferInfo(i,l,r.maxBufferHole);this._tryFixBufferStall(x,A)}}}}},t._tryFixBufferStall=function(e,t){var r=this.config,n=this.fragmentTracker,i=this.media;if(null!==i){var s=i.currentTime,o=n.getPartialFragment(s);if(o&&(this._trySkipBufferHole(o)||!this.media))return;e.len>r.maxBufferHole&&t>1e3*r.highBufferWatchdogPeriod&&(a.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},t._reportStall=function(e){var t=this.hls,r=this.media;!this.stallReported&&r&&(this.stallReported=!0,a.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer ("+JSON.stringify(e)+")"),t.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e.len}))},t._trySkipBufferHole=function(e){var t=this.config,r=this.hls,o=this.media;if(null===o)return 0;for(var u=o.currentTime,h=0,d=n.BufferHelper.getBuffered(o),f=0;f<d.length;f++){var p=d.start(f);if(u+t.maxBufferHole>=h&&u<p){var g=Math.max(p+c,o.currentTime+l);return a.logger.warn("skipping hole, adjusting currentTime from "+u+" to "+g),this.moved=!0,this.stalled=null,o.currentTime=g,e&&r.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+u+" to "+g,frag:e}),g}h=d.end(f)}return 0},t._tryNudgeBuffer=function(){var e=this.config,t=this.hls,r=this.media,n=this.nudgeRetry;if(null!==r){var o=r.currentTime;if(this.nudgeRetry++,n<e.nudgeMaxRetry){var u=o+(n+1)*e.nudgeOffset;a.logger.warn("Nudging 'currentTime' from "+o+" to "+u),r.currentTime=u,t.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else a.logger.error("Playhead still not moving while enough data buffered @"+o+" after "+e.nudgeMaxRetry+" nudges"),t.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}},e}()},
24"./src/controller/id3-track-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../utils/texttrack-utils */ "./src/utils/texttrack-utils.ts"),a=r(/*! ../demux/id3 */ "./src/demux/id3.ts"),o=r(/*! ../loader/date-range */ "./src/loader/date-range.ts"),u=r(/*! ../types/demuxer */ "./src/types/demuxer.ts");function l(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}function c(e,t){return e.getTime()/1e3-t}function h(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var d=function(){function e(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}var t=e.prototype;return t.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},t._registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},t._unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},t.onMediaAttached=function(e,t){this.media=t.media},t.onMediaDetaching=function(){this.id3Track&&(Object(s.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},t.onManifestLoading=function(){this.dateRangeCuesAppended={}},t.createTrack=function(e){var t=this.getID3Track(e.textTracks);return t.mode="hidden",t},t.getID3Track=function(e){if(this.media){for(var t=0;t<e.length;t++){var r=e[t];if("metadata"===r.kind&&"id3"===r.label)return Object(s.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")}},t.onFragParsingMetadata=function(e,t){if(this.media){var r=this.hls.config,n=r.enableEmsgMetadataCues,i=r.enableID3MetadataCues;if(n||i){var s=t.frag,o=t.samples,c=t.details;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var h=c.edge||s.end,d=l(),f=!1,p={},g=0;g<o.length;g++){var v=o[g].type;if((v!==u.MetadataSchema.emsg||n)&&i){var y=a.getID3Frames(o[g].data);if(y){var m=o[g].pts,b=h;b-m<=0&&(b=m+.25);for(var E=0;E<y.length;E++){var S=y[E];if(!a.isTimeStampFrame(S)){var T=new d(m,b,"");T.value=S,v&&(T.type=v),this.id3Track.addCue(T),p[S.key]=null,f=!0}}}}}f&&this.updateId3CueEnds(p)}}},t.updateId3CueEnds=function(e){var t=null===(n=this.id3Track)||void 0===n?void 0:n.cues;if(t)for(var r=t.length;r--;){var n,i,s=t[r],a=null===(i=s.value)||void 0===i?void 0:i.key;if(a&&a in e){var o=e[a];o&&s.endTime!==o&&(s.endTime=o),e[a]=s.startTime}}},t.onBufferFlushing=function(e,t){var r,n=t.startOffset,i=t.endOffset,a=t.type,o=this.id3Track,l=this.hls;if(l){var c=l.config,h=c.enableEmsgMetadataCues,d=c.enableID3MetadataCues;o&&(h||d)&&(r="audio"===a?function(e){return e.type===u.MetadataSchema.audioId3&&d}:"video"===a?function(e){return e.type===u.MetadataSchema.emsg&&h}:function(e){return e.type===u.MetadataSchema.audioId3&&d||e.type===u.MetadataSchema.emsg&&h},Object(s.removeCuesInRange)(o,n,i,r))}},t.onLevelUpdated=function(e,t){var r=this,i=t.details;if(this.media&&i.hasProgramDateTime&&this.hls.config.enableDateRangeMetadataCues){var s=this.dateRangeCuesAppended,a=this.id3Track,d=i.dateRanges,f=Object.keys(d);if(a)for(var p=Object.keys(s).filter(function(e){return!f.includes(e)}),g=p.length;g--;)!function(e){var t=p[e];Object.keys(s[t].cues).forEach(function(e){a.removeCue(s[t].cues[e])}),delete s[t]}(g);var v=i.fragments[i.fragments.length-1];if(0!==f.length&&Object(n.isFiniteNumber)(null==v?void 0:v.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var y=v.programDateTime/1e3-v.start,m=i.edge||v.end,b=l(),E=0;E<f.length;E++)!function(e){var t=f[e],n=d[t],i=s[t],a=(null==i?void 0:i.cues)||{}
24,l=(null==i?void 0:i.durationKnown)||!1,p=c(n.startDate,y),g=m,v=n.endDate;if(v)g=c(v,y),l=!0;else if(n.endOnNext&&!l){var E=f.reduce(function(e,t){var r=d[t];return r.class===n.class&&r.id!==t&&r.startDate>n.startDate&&e.push(r),e},[]).sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()})[0];E&&(g=c(E.startDate,y),l=!0)}for(var S=Object.keys(n.attr),T=0;T<S.length;T++){var w=S[T];if(w!==o.DateRangeAttribute.ID&&w!==o.DateRangeAttribute.CLASS&&w!==o.DateRangeAttribute.START_DATE&&w!==o.DateRangeAttribute.DURATION&&w!==o.DateRangeAttribute.END_DATE&&w!==o.DateRangeAttribute.END_ON_NEXT){var A=a[w];if(A)l&&!i.durationKnown&&(A.endTime=g);else{var x=n.attr[w];A=new b(p,g,""),(w===o.DateRangeAttribute.SCTE35_OUT||w===o.DateRangeAttribute.SCTE35_IN)&&(x=h(x)),A.value={key:w,data:x},A.type=u.MetadataSchema.dateRange,r.id3Track.addCue(A),a[w]=A}}}s[t]={cues:a,dateRange:n,durationKnown:l}}(E)}}},e}();t.default=d},
24"./src/controller/latency-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return o});var n=r(/*! ../errors */ "./src/errors.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts");function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function e(e){var t=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return t.timeupdate()},this.hls=e,this.config=e.config,this.registerListeners()}var t,r,o,u=e.prototype;return u.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},u.registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(i.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(i.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(i.Events.ERROR,this.onError)},u.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},u.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},u.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},u.onLevelUpdated=function(e,t){var r=t.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},u.onError=function(e,t){t.details===n.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,s.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},u.timeupdate=function(){var e=this.media,t=this.levelDetails;if(e&&t){this.currentTime=e.currentTime;var r=this.computeLatency();if(null!==r){this._latency=r;var n=this.config,i=n.lowLatencyMode,s=n.maxLiveSyncPlaybackRate;if(i&&1!==s){var a=this.targetLatency;if(null!==a){var o=r-a,u=Math.min(this.maxLatency,a+t.targetduration);if(t.live&&o<u&&o>.05&&this.forwardBufferLength>1){var l=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(Math.min(2,Math.max(1,s)),Math.max(1,l))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},u.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},u.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,r=e.partHoldBack,n=e.targetduration,i=this.config,s=i.liveSyncDuration,a=i.liveSyncDurationCount,o=i.lowLatencyMode,u=this.hls.userConfig,l=o&&r||t;return(u.liveSyncDuration||u.liveSyncDurationCount||0===l)&&(l=void 0!==s?s:a*n),l+Math.min(1*this.stallCount,n)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;var n,i=r.edge,s=e-t-this.edgeStalled;return Math.min(Math.max(i-r.totalduration,s),i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration))}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}}],a(e.prototype,r),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}()},
24"./src/controller/level-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return p});var n=r(/*! ../types/level */ "./src/types/level.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../errors */ "./src/errors.ts"),a=r(/*! ../utils/codecs */ "./src/utils/codecs.ts"),o=r(/*! ./level-helper */ "./src/controller/level-helper.ts"),u=r(/*! ./base-playlist-controller */ "./src/controller/base-playlist-controller.ts"),l=r(/*! ../types/loader */ "./src/types/loader.ts");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(e){function t(t){var r;return(r=e.call(this,t,"[level-controller]")||this)._levels=[],r._firstLevel=-1,r._startLevel=void 0,r.currentLevelIndex=-1,r.manualLevelIndex=-1,r.onParsedComplete=void 0,r._registerListeners(),r}r=t,u=e,r.prototype=Object.create(u.prototype),r.prototype.constructor=r,d(r,u);var r,u,p,g,v,y=t.prototype;return y._registerListeners=function(){var e=this.hls;e.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(i.Events.ERROR,this.onError,this)},y._unregisterListeners=function(){var e=this.hls;e.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(i.Events.ERROR,this.onError,this)},y.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},y.startLoad=function(){this._levels.forEach(function(e){e.loadError=0}),e.prototype.startLoad.call(this)},y.onManifestLoaded=function(e,t){var r,u,l=[],c=[],h=[],d={},p=!1,g=!1,v=!1;if(t.levels.forEach(function(e){var t=e.attrs;p=p||!!(e.width&&e.height),g=g||!!e.videoCodec,v=v||!!e.audioCodec,f&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0);var r=e.bitrate+"-"+e.attrs.RESOLUTION+"-"+e.attrs.CODECS;(u=d[r])?u.url.push(e.url):(u=new n.Level(e),d[r]=u,l.push(u)),t&&(t.AUDIO&&Object(o.addGroupId)(u,"audio",t.AUDIO),t.SUBTITLES&&Object(o.addGroupId)(u,"text",t.SUBTITLES))}),(p||g)&&v&&(l=l.filter(function(e){var t=e.videoCodec,r=e.width,n=e.height;return!!t||!!(r&&n)})),l=l.filter(function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||Object(a.isCodecSupportedInMp4)(t,"audio"))&&(!r||Object(a.isCodecSupportedInMp4)(r,"video"))}),t.audioTracks&&(c=t.audioTracks.filter(function(e){return!e.audioCodec||Object(a.isCodecSupportedInMp4)(e.audioCodec,"audio")}),Object(o.assignTrackIdsByGroup)(c)),t.subtitles&&(h=t.subtitles,Object(o.assignTrackIdsByGroup)(h)),l.length>0){r=l[0].bitrate,l.sort(function(e,t){return e.bitrate-t.bitrate}),this._levels=l;for(var y=0;y<l.length;y++)if(l[y].bitrate===r){this._firstLevel=y,this.log("manifest loaded, "+l.length+" level(s) found, first bitrate: "+r);break}var m=v&&!g,b={levels:l,audioTracks:c,subtitleTracks:h,firstLevel:this._firstLevel,stats:t.stats,audio:v,video:g,altAudio:!m&&c.some(function(e){return!!e.url})};this.hls.trigger(i.Events.MANIFEST_PARSED,b),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,reason:"no level with compatible codecs found in manifest"})},y.onError=function(t,r){if(e.prototype.onError.call(this,t,r),!r.fatal){var n,i,a=r.context,o=this._levels[this.currentLevelIndex];if(a&&(a.type===l.PlaylistContextType.AUDIO_TRACK&&o.audioGroupIds&&a.groupId===o.audioGroupIds[o.urlId]||a.type===l.PlaylistContextType.SUBTITLE_TRACK&&o.textGroupIds&&a.groupId===o.textGroupIds[o.urlId])){this.redundantFailover(this.currentLevelIndex);return}var u=!1,c=!0;switch(r.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:if(r.frag){var h=r.frag.type===l.PlaylistLevelType.MAIN?r.frag.level:this.currentLevelIndex,d=this._levels[h];d?(d.fragmentError++,d.fragmentError>
vendor: 4,479 bytes, line 24
24this.hls.config.fragLoadingMaxRetry&&(i=h)):i=h}break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:a&&(a.deliveryDirectives&&(c=!1),i=a.level),u=!0;break;case s.ErrorDetails.REMUX_ALLOC_ERROR:i=null!=(n=r.level)?n:this.currentLevelIndex,u=!0}void 0!==i&&this.recoverLevel(r,i,u,c)}},y.recoverLevel=function(e,t,r,n){var i=e.details,s=this._levels[t];if(s.loadError++,r){if(this.retryLoadingOrFail(e))e.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(n){var a=s.url.length;if(a>1&&s.loadError<a)e.levelRetry=!0,this.redundantFailover(t);else if(-1===this.manualLevelIndex){for(var o=-1,u=this._levels,l=u.length;l--;){var c=(l+this.currentLevelIndex)%u.length;if(c!==this.currentLevelIndex&&0===u[c].loadError){o=c;break}}o>-1&&this.currentLevelIndex!==o&&(this.warn(i+": switch to "+o),e.levelRetry=!0,this.hls.nextAutoLevel=o)}}},y.redundantFailover=function(e){var t=this._levels[e],r=t.url.length;if(r>1){var n=(t.urlId+1)%r;this.warn("Switching to redundant URL-id "+n),this._levels.forEach(function(e){e.urlId=n}),this.level=e}},y.onFragLoaded=function(e,t){var r=t.frag;if(void 0!==r&&r.type===l.PlaylistLevelType.MAIN){var n=this._levels[r.level];void 0!==n&&(n.fragmentError=0,n.loadError=0)}},y.onLevelLoaded=function(e,t){var r,n,i=t.level,s=t.details,a=this._levels[i];if(!a){this.warn("Invalid level index "+i),null!==(n=t.deliveryDirectives)&&void 0!==n&&n.skip&&(s.deltaUpdateFailed=!0);return}i===this.currentLevelIndex?(0===a.fragmentError&&(a.loadError=0,this.retryCount=0),this.playlistLoaded(i,t,a.details)):null!==(r=t.deliveryDirectives)&&void 0!==r&&r.skip&&(s.deltaUpdateFailed=!0)},y.onAudioTrackSwitched=function(e,t){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var n=-1,i=this.hls.audioTracks[t.id].groupId,s=0;s<r.audioGroupIds.length;s++)if(r.audioGroupIds[s]===i){n=s;break}n!==r.urlId&&(r.urlId=n,this.startLoad())}},y.loadPlaylist=function(e){var t=this.currentLevelIndex,r=this._levels[t];if(this.canLoad&&r&&r.url.length>0){var n=r.urlId,s=r.url[n];if(e)try{s=e.addDirectives(s)}catch(a){this.warn("Could not construct new URL with HLS Delivery Directives: "+a)}this.log("Attempt loading level index "+t+(e?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+n+" "+s),this.clearTimer(),this.hls.trigger(i.Events.LEVEL_LOADING,{url:s,level:t,id:n,deliveryDirectives:e||null})}},y.removeLevel=function(e,t){var r=function(e,r){return r!==t},n=this._levels.filter(function(n,i){return i!==e||n.url.length>1&&void 0!==t&&(n.url=n.url.filter(r),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(r)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(r)),n.urlId=0,!0)}).map(function(e,t){var r=e.details;return null!=r&&r.fragments&&r.fragments.forEach(function(e){e.level=t}),e});this._levels=n,this.hls.trigger(i.Events.LEVELS_UPDATED,{levels:n})},g=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==e||null===(t=r[e])||void 0===t||!t.details)){if(e<0||e>=r.length){var n=e<0;if(this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:n,reason:"invalid level idx"}),n)return;e=Math.min(e,r.length-1)}this.clearTimer();var a=this.currentLevelIndex,o=r[a],u=r[e];this.log("switching to level "+e+" from "+a),this.currentLevelIndex=e;var l=c({},u,{level:e,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete l._urlId,this.hls.trigger(i.Events.LEVEL_SWITCHING,l);var h=u.details;if(!h||h.live){var d=this.switchParams(u.uri,null==o?void 0:o.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0!==this._startLevel)return this._startLevel;var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return -1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}],h(t.prototype,g),v&&h(t,v),Object.defineProperty(t,"prototype",{writable:!1}),t}(u.default)},
24"./src/controller/level-helper.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"addGroupId",function(){return o}),r.d(t,"assignTrackIdsByGroup",function(){return u}),r.d(t,"updatePTS",function(){return l}),r.d(t,"updateFragPTSDTS",function(){return h}),r.d(t,"mergeDetails",function(){return d}),r.d(t,"mapPartIntersection",function(){return f}),r.d(t,"mapFragmentIntersection",function(){return p}),r.d(t,"adjustSliding",function(){return g}),r.d(t,"addSliding",function(){return v}),r.d(t,"computeReloadInterval",function(){return y}),r.d(t,"getFragmentWithSN",function(){return m}),r.d(t,"getPartWith",function(){return b});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../utils/logger */ "./src/utils/logger.ts"),s=r(/*! ../loader/date-range */ "./src/loader/date-range.ts");function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r)}}function u(e){var t={};e.forEach(function(e){var r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++})}function l(e,t,r){var n;c(e[t],e[r])}function c(e,t){var r=t.startPTS;if(Object(n.isFiniteNumber)(r)){var i,s=0;t.sn>e.sn?(s=r-e.start,i=e):(s=e.start-r,i=t),i.duration!==s&&(i.duration=s)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function h(e,t,r,s,a,o){s-r<=0&&(i.logger.warn("Fragment should have a positive duration",t),s=r+t.duration,o=a+t.duration);var u,l=r,h=s,d=t.startPTS,f=t.endPTS;if(Object(n.isFiniteNumber)(d)){var p=Math.abs(d-r);Object(n.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(p,t.deltaPTS):t.deltaPTS=p,l=Math.max(r,d),r=Math.min(r,d),a=Math.min(a,t.startDTS),h=Math.min(s,f),s=Math.max(s,f),o=Math.max(o,t.endDTS)}t.duration=s-r;var g=r-t.start;t.appendedPTS=s,t.start=t.startPTS=r,t.maxStartPTS=l,t.startDTS=a,t.endPTS=s,t.minEndPTS=h,t.endDTS=o;var v=t.sn;if(!e||v<e.startSN||v>e.endSN)return 0;var y=v-e.startSN,m=e.fragments;for(m[y]=t,u=y;u>0;u--)c(m[u],m[u-1]);for(u=y;u<m.length-1;u++)c(m[u],m[u+1]);return e.fragmentHint&&c(m[m.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,g}function d(e,t){for(var r,o=null,u=e.fragments,l=u.length-1;l>=0;l--){var c=u[l].initSegment;if(c){o=c;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var d=0;if(p(e,t,function(e,i){e.relurl&&(d=e.cc-i.cc),Object(n.isFiniteNumber)(e.startPTS)&&Object(n.isFiniteNumber)(e.endPTS)&&(i.start=i.startPTS=e.startPTS,i.startDTS=e.startDTS,i.appendedPTS=e.appendedPTS,i.maxStartPTS=e.maxStartPTS,i.endPTS=e.endPTS,i.endDTS=e.endDTS,i.minEndPTS=e.minEndPTS,i.duration=e.endPTS-e.startPTS,i.duration&&(r=i),t.PTSKnown=t.alignedSliding=!0),i.elementaryStreams=e.elementaryStreams,i.loader=e.loader,i.stats=e.stats,i.urlId=e.urlId,e.initSegment&&(i.initSegment=e.initSegment,o=e.initSegment)}),o&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach(function(e){var t;e.initSegment&&e.initSegment.relurl!==(null===(t=o)||void 0===t?void 0:t.relurl)||(e.initSegment=o)}),t.skippedSegments){if(t.deltaUpdateFailed=t.fragments.some(function(e){return!e}),t.deltaUpdateFailed){i.logger.warn("[level-helper] Previous playlist missing segments ski
24pped in delta playlist");for(var v,y,m,b,E=t.skippedSegments;E--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else{t.canSkipDateRanges&&(t.dateRanges=(v=e.dateRanges,y=t.dateRanges,m=t.recentlyRemovedDateranges,b=a({},v),m&&m.forEach(function(e){delete b[e]}),Object.keys(y).forEach(function(e){var t=new s.DateRange(y[e].attr,b[e]);t.isValid?b[e]=t:i.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(y[e].attr)+'"')}),b))}}var S=t.fragments;if(d){i.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<S.length;T++)S[T].cc+=d}t.skippedSegments&&(t.startCC=t.fragments[0].cc),f(e.partList,t.partList,function(e,t){t.elementaryStreams=e.elementaryStreams,t.stats=e.stats}),r?h(t,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):g(e,t),S.length&&(t.totalduration=t.edge-S[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;var w=t.advancedDateTime;if(t.advanced&&w){var A=t.edge;t.driftStart||(t.driftStartTime=w,t.driftStart=A),t.driftEndTime=w,t.driftEnd=A}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function f(e,t,r){if(e&&t)for(var n=0,i=0,s=e.length;i<=s;i++){var a=e[i],o=t[i+n];a&&o&&a.index===o.index&&a.fragment.sn===o.fragment.sn?r(a,o):n--}}function p(e,t,r){for(var n=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(n?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=i;l<=s;l++){var c=u[a+l],h=o[l];n&&!h&&l<n&&(h=t.fragments[l]=c),c&&h&&r(c,h)}}function g(e,t){var r=t.startSN+t.skippedSegments-e.startSN,n=e.fragments;!(r<0)&&!(r>=n.length)&&v(t,n[r].start)}function v(e,t){if(t){for(var r=e.fragments,n=e.skippedSegments;n<r.length;n++)r[n].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function y(e,t){var r,n=1e3*e.levelTargetDuration,i=n/2,s=e.age,a=s>0&&s<3*n,o=t.loading.end-t.loading.start,u=e.availabilityDelay;return!1===e.updated?a?(r=Math.max(Math.min(i,2*o),333*e.misses),e.availabilityDelay=(e.availabilityDelay||0)+r):r=i:a?(u=Math.min(u||n/2,s),e.availabilityDelay=u,r=u+n-s):r=n-o,Math.round(r)}function m(e,t,r){if(!e||!e.details)return null;var n=e.details,i=n.fragments[t-n.startSN];return i||(i=n.fragmentHint)&&i.sn===t?i:t<n.startSN&&r&&r.sn===t?r:null}function b(e,t,r){if(!e||!e.details)return null;var n=e.details.partList;if(n)for(var i=n.length;i--;){var s=n[i];if(s.index===r&&s.fragment.sn===t)return s}return null}},
vendor: 19,037 bytes, line 24
24"./src/controller/stream-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return y});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ./base-stream-controller */ "./src/controller/base-stream-controller.ts"),s=r(/*! ../is-supported */ "./src/is-supported.ts"),a=r(/*! ../events */ "./src/events.ts"),o=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),u=r(/*! ./fragment-tracker */ "./src/controller/fragment-tracker.ts"),l=r(/*! ../types/loader */ "./src/types/loader.ts"),c=r(/*! ../loader/fragment */ "./src/loader/fragment.ts"),h=r(/*! ../demux/transmuxer-interface */ "./src/demux/transmuxer-interface.ts"),d=r(/*! ../types/transmuxer */ "./src/types/transmuxer.ts"),f=r(/*! ./gap-controller */ "./src/controller/gap-controller.ts"),p=r(/*! ../errors */ "./src/errors.ts");function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v(e,t){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e){function t(t,r){var n;return(n=e.call(this,t,r,"[stream-controller]")||this).audioCodecSwap=!1,n.gapController=null,n.level=-1,n._forceStartLoad=!1,n.altAudio=!1,n.audioOnly=!1,n.fragPlaying=null,n.onvplaying=null,n.onvseeked=null,n.fragLastKbps=0,n.couldBacktrack=!1,n.backtrackFragment=null,n.audioCodecSwitch=!1,n.videoBuffer=null,n._registerListeners(),n}r=t,y=e,r.prototype=Object.create(y.prototype),r.prototype.constructor=r,v(r,y);var r,y,m,b,E,S=t.prototype;return S._registerListeners=function(){var e=this.hls;e.on(a.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(a.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(a.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(a.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(a.Events.ERROR,this.onError,this),e.on(a.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(a.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(a.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(a.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(a.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(a.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var e=this.hls;e.off(a.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(a.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(a.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(a.Events.ERROR,this.onError,this),e.off(a.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(a.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(a.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(a.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(a.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(a.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(r.config.testBandwidth&&this.levels.length>1?(n=0,this.bitrateTest=!0):n=r.nextAutoLevel),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=i.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=i.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_LEVEL:var e,t=this.levels,r=this.level,n=null==t?void 0:null===(e=t[r])||void 0===e?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=i.State.IDLE}break;case i.State.FRAG_LOADING_WAITING_RETRY:var s,a=self.performance.now(),o=this.retryDate;(!o||a>=o||null!==(s=this.media)&&void 0!==s&&s.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=i.State.IDLE)}this.onTickEnd()},S.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var e=this.hls,t=this.levelLastLoaded,r=this.levels,n=this.media,s=e.config,o=e.nextLoadLevel;if(null!==t&&(n||!this.startFragRequested&&s.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&r&&r[o]){var h=r[o];this.level=e.nextLoadLevel=o;var d=h.details;if(!d||this.state===i.State.WAITING_LEVEL||d.live&&this.levelLastLoaded!==o){this.state=i.State.WAITING_LEVEL;return}var f=this.getMainFwdBufferInfo();if(null!==f){if(!(f.len>=this.getMaxBufferLength(h.maxBitrate))){if(this._streamEnded(f,d)){var p={};this.altAudio&&(p.type="video"),this.hls.trigger(a.Events.BUFFER_EOS,p),this.state=i.State.ENDED;return}this.backtrackFragment&&this.backtrackFragment.start>f.end&&(this.backtrackFragment=null);var g=this.backtrackFragment?this.backtrackFragment.start:f.end,v=this.getNextFragment(g,d);if(this.couldBacktrack&&!this.fragPrevious&&v&&"initSegment"!==v.sn&&this.fragmentTracker.getState(v)!==u.FragmentState.OK){var y,m,b,E,S=(null!=(E=this.backtrackFragment)?E:v).sn-d.startSN,T=d.fragments[S-1];T&&v.cc===T.cc&&(v=T,this.fragmentTracker.removeFragment(T))}else this.backtrackFragment&&f.len&&(this.backtrackFragment=null);if(v&&this.fragmentTracker.getState(v)===u.FragmentState.OK&&this.nextLoadPosition>g){var w=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;n&&this.afterBufferFlushed(n,w,l.PlaylistLevelType.MAIN),v=this.getNextFragment(this.nextLoadPosition,d)}v&&(!v.initSegment||v.initSegment.data||this.bitrateTest||(v=v.initSegment),(null===(m=v.decryptdata)||void 0===m?void 0:m.keyFormat)!=="identity"||null!==(b=v.decryptdata)&&void 0!==b&&b.key?this.loadFragment(v,d,g):this.loadKey(v,d))}}}},S.loadFragment=function(t,r,n){var i,s=this.fragmentTracker.getState(t);this.fragCurrent=t,s===u.FragmentState.NOT_LOADED?"initSegment"===t.sn?this._loadInitSegment(t):this.bitrateTest?(this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,r,n)):s===u.FragmentState.APPENDING?this.reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t):(null===(i=this.media)||void 0===i?void 0:i.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(e){var t=this.fragmentTracker.getAppendedFrag(e,l.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},S.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,l.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var r,n=this.getAppendedFrag(t.currentTime);if(n&&n.start>1&&this.flushMainBuffer(0,n.start-1),!t.paused&&e){var i=e[this.hls.nextLoadLevel],s=this.fragLastKbps;r=s&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*s)+1:0}else r=0;var a=this.getBufferedFrag(t.currentTime+r);if(a){var o=this.followingBufferedFrag(a);if(o){this.abortCurrentFrag();var u=o.maxStartPTS?o.maxStartPTS:o.start,l=o.duration,c=Math.max(a.end,u+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,.5*l),.75*l));this.flushMainBuffer(c,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,null!=e&&e.loader&&e.loader.abort(),this.state){case i.State.KEY_LOADING:case i.State.FRAG_LOADING:case i.State.FRAG_LOADING_WAITING_RETRY:case i.State.PARSING:case i.State.PARSED:this.state=i.State.IDLE}this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(t,r){e.prototype.flushMainBuffer.call(this,t,r,this.altAudio?"video":null)},S.onMediaAttached=function(t,r){e.prototype.onMediaAttached.call(this,t,r);var n=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,n,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var t=this.media;t&&this.onvplaying&&this.onvseeked&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;Object(n.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(a.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},S.onManifestParsed=function(e,t){var r,n=!1,i=!1;t.levels.forEach(function(e){(r=e.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(n=!0),-1!==r.indexOf("mp4a.40.5")&&(i=!0))}),this.audioCodecSwitch=n&&i&&!Object(s.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},S.onLevelLoading=function(e,t){var r=this.levels;if(r&&this.state===i.State.IDLE){var n=r[t.level];(!n.details||n.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(n.details))&&(this.state=i.State.WAITING_LEVEL)}},S.onLevelLoaded=function(e,t){var r,n=this.levels,s=t.level,o=t.details,u=o.totalduration;if(!n){this.warn("Levels were reset while loading level "+s);return}this.log("Level "+s+" loaded ["+o.startSN+","+o.endSN+"], cc ["+o.startCC+", "+o.endCC+"] duration:"+u);var l=this.fragCurrent;l&&(this.state===i.State.FRAG_LOADING||this.state===i.State.FRAG_LOADING_WAITING_RETRY)&&l.level!==t.level&&l.loader&&(this.state=i.State.IDLE,this.backtrackFragment=null,l.loader.abort());var c=n[s],h=0;if(o.live||null!==(r=c.details)&&void 0!==r&&r.live){if(o.fragments[0]||(o.deltaUpdateFailed=!0),o.deltaUpdateFailed)return;h=this.alignPlaylists(o,c.details)}if(c.details=o,this.levelLastLoaded=s,this.hls.trigger(a.Events.LEVEL_UPDATED,{details:o,level:s}),this.state===i.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=i.State.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,h),this.tick()},S._handleFragmentLoadProgress=function(e){var t,r=e.frag,n=e.part,i=e.payload,s=this.levels;if(!s){this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered");return}var a=s[r.level],o=a.details;if(!o){this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset");return}var u=a.videoCodec,c=o.PTSKnown||!o.live,f=null===(t=r.initSegment)||void 0===t?void 0:t.data,p=this._getAudioCodec(a),g=this.transmuxer=this.transmuxer||new h.default(this.hls,l.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),v=n?n.index:-1,y=new d.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,i.byteLength,v,-1!==v),m=this.initPTS[r.cc];g.push(i,f,p,u,r,n,o.totalduration,c,y,m)},S.onAudioTrackSwitching=function(e,t){var r=this.altAudio,n=!!t.url,i=t.id;if(!n){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;r&&o.trigger(a.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),o.trigger(a.Events.AUDIO_TRACK_SWITCHED,{id:i})}},S.onAudioTrackSwitched=function(e,t){var r=t.id,n=!!this.hls.audioTracks[r].url;if(n){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=n,this.tick()},S.onBufferCreated=function(e,t){var r,n,i=t.tracks,s=!1;for(var a in i){var o=i[a];if("main"===o.id){if(n=a,r=o,"video"===a){var u=i[a];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&r?(this.log("Alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(e,t){var r=t.frag,n=t.part;if(!r||r.type===l.PlaylistLevelType.MAIN){if(this.fragContextChanged(r)){this.warn("Fragment "+r.sn+(n?" p: "+n.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),this.state===i.State.PARSED&&(this.state=i.State.IDLE);return}var s=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}},S.onError=function(e,t){switch(t.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(l.PlaylistLevelType.MAIN,t);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state===i.State.ERROR||(t.fatal?(this.warn(""+t.details),this.state=i.State.ERROR):t.levelRetry||this.state!==i.State.WAITING_LEVEL||(this.state=i.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===t.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var r=!0,n=this.getFwdBufferInfo(this.media,l.PlaylistLevelType.MAIN);n&&n.len>.5&&(r=!this.reduceMaxBufferLength(n.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},S.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){if(this.loadedmetadata||!o.BufferHelper.getBuffered(e).length){var r=this.state!==i.State.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,r)}this.lastCurrentTime=e.currentTime}},S.onFragLoadEmergencyAborted=function(){this.state=i.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(e,t){var r=t.type;if(r!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var n=(r===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,r,l.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(e,t){this.levels=t.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var e=this.media;if(e){var t=e.currentTime,r=this.startPosition;if(r>=0&&t<r){if(e.seeking){this.log("could not seek to "+r+", already seeking at "+t);return}var n=o.BufferHelper.getBuffered(e),i=(n.length?n.start(0):0)-r;i>0&&(i<this.config.maxBufferHole||i<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+i+" to match buffer start"),r+=i,this.startPosition=r),this.log("seek to target start position "+r+" from current time "+t),e.currentTime=r}}},S._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t},S._loadBitrateTestFrag=function(e){var t=this;e.bitrateTest=!0,this._doFragLoad(e).then(function(r){var n=t.hls;if(!(!r||n.nextLoadLevel||t.fragContextChanged(e))){t.fragLoadError=0,t.state=i.State.IDLE,t.startFragRequested=!1,t.bitrateTest=!1;var s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),n.trigger(a.Events.FRAG_LOADED,r),e.bitrateTest=!1}})},S._handleTransmuxComplete=function(e){var t,r="main",s=this.hls,o=e.remuxResult,u=e.chunkMeta,l=this.getCurrentContext(u);if(!l){this.warn("The loading context changed while buffering fragment "+u.sn+" of level "+u.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(u.level);return}var h=l.frag,d=l.part,f=l.level,p=o.video,g=o.text,v=o.id3,y=o.initSegment,m=f.details,b=this.altAudio?void 0:o.audio;if(!this.fragContextChanged(h)){if(this.state=i.State.PARSING,y){y.tracks&&(this._bufferInitSegment(f,y.tracks,h,u),s.trigger(a.Events.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:r,tracks:y.tracks}));var E=y.initPTS,S=y.timescale;Object(n.isFiniteNumber)(E)&&(this.initPTS[h.cc]=E,s.trigger(a.Events.INIT_PTS_FOUND,{frag:h,id:r,initPTS:E,timescale:S}))}if(p&&!1!==o.independent){if(m){var T=p.startPTS,w=p.endPTS,A=p.startDTS,x=p.endDTS;if(d)d.elementaryStreams[p.type]={startPTS:T,endPTS:w,startDTS:A,endDTS:x};else if(p.firstKeyFrame&&p.independent&&(this.couldBacktrack=!0),p.dropped&&p.independent){var _,R=this.getMainFwdBufferInfo();if((R?R.end:this.getLoadPosition())+this.config.maxBufferHole<(p.firstKeyFramePTS?p.firstKeyFramePTS:T)-this.config.maxBufferHole){this.backtrack(h);return}h.setElementaryStreamInfo(p.type,h.start,w,h.start,x,!0)}h.setElementaryStreamInfo(p.type,T,w,A,x),this.backtrackFragment&&(this.backtrackFragment=h),this.bufferFragmentData(p,h,d,u)}}else if(!1===o.independent){this.backtrack(h);return}if(b){var O=b.startPTS,k=b.endPTS,L=b.startDTS,C=b.endDTS;d&&(d.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:O,endPTS:k,startDTS:L,endDTS:C}),h.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,O,k,L,C),this.bufferFragmentData(b,h,d,u)}if(m&&null!=v&&null!==(t=v.samples)&&void 0!==t&&t.length){var I={id:r,frag:h,details:m,samples:v.samples};s.trigger(a.Events.FRAG_PARSING_METADATA,I)}if(m&&g){var D={id:r,frag:h,details:m,samples:g.samples};s.trigger(a.Events.FRAG_PARSING_USERDATA,D)}}},S._bufferInitSegment=function(e,t,r,n){var s=this;if(this.state===i.State.PARSING){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var o=t.audio,u=t.video,l=t.audiovideo;if(o){var c=e.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(c&&(c=-1!==c.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),
241!==o.metadata.channelCount&&-1===h.indexOf("firefox")&&(c="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==o.container&&(c="mp4a.40.2",this.log("Android: force audio codec to "+c)),e.audioCodec&&e.audioCodec!==c&&this.log('Swapping manifest audio codec "'+e.audioCodec+'" for "'+c+'"'),o.levelCodec=c,o.id="main",this.log("Init audio buffer, container:"+o.container+", codecs[selected/level/parsed]=["+(c||"")+"/"+(e.audioCodec||"")+"/"+o.codec+"]")}u&&(u.levelCodec=e.videoCodec,u.id="main",this.log("Init video buffer, container:"+u.container+", codecs[level/parsed]=["+(e.videoCodec||"")+"/"+u.codec+"]")),l&&this.log("Init audiovideo buffer, container:"+l.container+", codecs[level/parsed]=["+(e.attrs.CODECS||"")+"/"+l.codec+"]"),this.hls.trigger(a.Events.BUFFER_CODECS,t),Object.keys(t).forEach(function(e){var i=t[e].initSegment;null!=i&&i.byteLength&&s.hls.trigger(a.Events.BUFFER_APPENDING,{type:e,data:i,frag:r,part:null,chunkMeta:n,parent:r.type})}),this.tick()}},S.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,l.PlaylistLevelType.MAIN)},S.backtrack=function(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=i.State.IDLE},S.checkFragmentChanged=function(){var e=this.media,t=null;if(e&&e.readyState>1&&!1===e.seeking){var r=e.currentTime;if(o.BufferHelper.isBuffered(e,r)?t=this.getAppendedFrag(r):o.BufferHelper.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;var n=this.fragPlaying,i=t.level;n&&t.sn===n.sn&&n.level===i&&t.urlId===n.urlId||(this.hls.trigger(a.Events.FRAG_CHANGED,{frag:t}),n&&n.level===i||this.hls.trigger(a.Events.LEVEL_SWITCHED,{level:i}),this.fragPlaying=t)}}},b=[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){var e=this.media;if(e){var t=e.currentTime,r=this.currentFrag;if(r&&Object(n.isFiniteNumber)(t)&&Object(n.isFiniteNumber)(r.programDateTime)){var i=r.programDateTime+(t-r.start)*1e3;return new Date(i)}}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}],g(t.prototype,b),E&&g(t,E),Object.defineProperty(t,"prototype",{writable:!1}),t}(i.default)},
24"./src/controller/subtitle-stream-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"SubtitleStreamController",function(){return p});var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../utils/buffer-helper */ "./src/utils/buffer-helper.ts"),s=r(/*! ./fragment-finders */ "./src/controller/fragment-finders.ts"),a=r(/*! ../utils/discontinuities */ "./src/utils/discontinuities.ts"),o=r(/*! ./level-helper */ "./src/controller/level-helper.ts"),u=r(/*! ./fragment-tracker */ "./src/controller/fragment-tracker.ts"),l=r(/*! ./base-stream-controller */ "./src/controller/base-stream-controller.ts"),c=r(/*! ../types/loader */ "./src/types/loader.ts"),h=r(/*! ../types/level */ "./src/types/level.ts");function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var p=function(e){function t(t,r){var n;return(n=e.call(this,t,r,"[subtitle-stream-controller]")||this).levels=[],n.currentTrackId=-1,n.tracksBuffered=[],n.mainDetails=null,n._registerListeners(),n}r=t,p=e,r.prototype=Object.create(p.prototype),r.prototype.constructor=r,f(r,p);var r,p,v,y,m,b=t.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var e=this.hls;e.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(n.Events.ERROR,this.onError,this),e.on(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(n.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(n.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(n.Events.ERROR,this.onError,this),e.off(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(n.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(n.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b.startLoad=function(){this.stopLoad(),this.state=l.State.IDLE,this.setInterval(500),this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},b.onLevelLoaded=function(e,t){this.mainDetails=t.details},b.onSubtitleFragProcessed=function(e,t){var r,n=t.frag,i=t.success;if(this.fragPrevious=n,this.state=l.State.IDLE,i){var s=this.tracksBuffered[this.currentTrackId];if(s){for(var a=n.start,o=0;o<s.length;o++)if(a>=s[o].start&&a<=s[o].end){r=s[o];break}var u=n.start+n.duration;r?r.end=u:(r={start:a,end:u},s.push(r)),this.fragmentTracker.fragBuffered(n)}}},b.onBufferFlushing=function(e,t){var r=t.startOffset,n=t.endOffset;if(0===r&&n!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,s=this.levels;if(!s.length||!s[i]||!s[i].details)return;var a=n-s[i].details.targetduration;if(a<=0)return;t.endOffsetSubtitles=Math.max(0,a),this.tracksBuffered.forEach(function(e){for(var t=0;t<e.length;){if(e[t].end<=a){e.shift();continue}if(e[t].start<a)e[t].start=a;else break;t++}}),this.fragmentTracker.removeFragmentsInRange(r,a,c.PlaylistLevelType.SUBTITLE)}},b.onError=function(e,t){var r,n=t.frag;n&&n.type===c.PlaylistLevelType.SUBTITLE&&(null!==(r=this.fragCurrent)&&void 0!==r&&r.loader&&this.fragCurrent.loader.abort(),this.state=l.State.IDLE)},b.onSubtitleTracksUpdated=function(e,t){var r=this,n=t.subtitleTracks;this.tracksBuffered=[],this.levels=n.map(function(e){return new h.Level(e)}
24),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(e){r.tracksBuffered[e.id]=[]}),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(e,t){if(this.currentTrackId=t.id,!this.levels.length||-1===this.currentTrackId){this.clearInterval();return}var r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)},b.onSubtitleTrackLoaded=function(e,t){var r,n=t.details,i=t.id,u=this.currentTrackId,c=this.levels;if(c.length){var h=c[u];if(!(i>=c.length)&&i===u&&h){if(this.mediaBuffer=this.mediaBufferTimeRanges,n.live||null!==(r=h.details)&&void 0!==r&&r.live){var d=this.mainDetails;if(n.deltaUpdateFailed||!d)return;var f=d.fragments[0];h.details?0===this.alignPlaylists(n,h.details)&&f&&Object(o.addSliding)(n,f.start):n.hasProgramDateTime&&d.hasProgramDateTime?Object(a.alignMediaPlaylistByPDT)(n,d):f&&Object(o.addSliding)(n,f.start)}h.details=n,this.levelLastLoaded=i,this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===l.State.IDLE&&(Object(s.findFragmentByPTS)(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0))}}},b._handleFragmentLoadComplete=function(e){var t=e.frag,r=e.payload,i=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).then(function(e){var r=performance.now();s.trigger(n.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:a,tdecrypt:r}})})}},b.doTick=function(){if(!this.media){this.state=l.State.IDLE;return}if(this.state===l.State.IDLE){var e,t=this.currentTrackId,r=this.levels;if(!r.length||!r[t]||!r[t].details)return;var n,a=r[t].details,o=a.targetduration,c=this.config,h=this.media,d=i.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],h.currentTime-o,c.maxBufferHole),f=d.end;if(d.len>this.getMaxBufferLength()+o)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var p=a.fragments,g=p.length,v=a.edge,y=this.fragPrevious;if(f<v){var m=c.maxFragLookUpTolerance;(e=Object(s.findFragmentByPTS)(y,p,Math.max(p[0].start,f),m))||!y||!(y.start<p[0].start)||(e=p[0])}else e=p[g-1];if(!(e=this.mapToInitFragWhenRequired(e))||this.fragmentTracker.getState(e)!==u.FragmentState.NOT_LOADED)return;e.encrypted?this.loadKey(e,a):this.loadFragment(e,a,f)}},b.loadFragment=function(t,r,n){this.fragCurrent=t,"initSegment"===t.sn?this._loadInitSegment(t):e.prototype.loadFragment.call(this,t,r,n)},y=[{key:"mediaBufferTimeRanges",get:function(){return new g(this.tracksBuffered[this.currentTrackId]||[])}}],d(t.prototype,y),m&&d(t,m),Object.defineProperty(t,"prototype",{writable:!1}),t}(l.default),g=function(e){this.buffered=void 0;var t=function(t,r,n){if((r>>>=0)>n-1)throw new DOMException("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+r+") is greater than the maximum bound ("+n+")");return e[r][t]};this.buffered={get length(){return e.length},end:function(r){return t("end",r,e.length)},start:function(r){return t("start",r,e.length)}}}},
vendor: 3,190 bytes, line 24
24"./src/controller/subtitle-track-controller.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../utils/texttrack-utils */ "./src/utils/texttrack-utils.ts"),s=r(/*! ./base-playlist-controller */ "./src/controller/base-playlist-controller.ts"),a=r(/*! ../types/loader */ "./src/types/loader.ts");function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){function t(t){var r;return(r=e.call(this,t,"[subtitle-track-controller]")||this).media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r._subtitleDisplay=!0,r.registerListeners(),r}r=t,s=e,r.prototype=Object.create(s.prototype),r.prototype.constructor=r,u(r,s);var r,s,l,h,d,f=t.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},f.registerListeners=function(){var e=this.hls;e.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(n.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(n.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(n.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(n.Events.ERROR,this.onError,this)},f.onMediaAttached=function(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},f.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},f.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),c(this.media.textTracks).forEac
24h(function(e){Object(i.clearCurrentCues)(e)}),this.subtitleTrack=-1,this.media=null)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},f.onSubtitleTrackLoaded=function(e,t){var r=t.id,n=t.details,i=this.trackId,s=this.tracksInGroup[i];if(!s){this.warn("Invalid subtitle track id "+r);return}var a=s.details;s.details=t.details,this.log("subtitle track "+r+" loaded ["+n.startSN+"-"+n.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,t,a))},f.onLevelLoading=function(e,t){this.switchLevel(t.level)},f.onLevelSwitching=function(e,t){this.switchLevel(t.level)},f.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var r=t.textGroupIds[t.urlId];if(this.groupId!==r){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,s=this.tracks.filter(function(e){return!r||e.groupId===r});this.tracksInGroup=s;var a=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r,this.log("Updating subtitle tracks, "+s.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(n.Events.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:s}),-1!==a&&this.setSubtitleTrack(a,i)}}},f.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r<t.length;r++){var n=t[r];if((!this.selectDefaultTrack||n.default)&&(!e||e===n.name))return n.id}return -1},f.onError=function(t,r){e.prototype.onError.call(this,t,r),!r.fatal&&r.context&&r.context.type===a.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},f.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var r=t.id,i=t.groupId,s=t.url;if(e)try{s=e.addDirectives(s)}catch(a){this.warn("Could not construct new URL with HLS Delivery Directives: "+a)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADING,{url:s,id:r,groupId:i,deliveryDirectives:e||null})}},f.toggleTrackModes=function(e){var t=this,r=this.media,n=this.trackId;if(r){var i=c(r.textTracks),s=i.filter(function(e){return e.groupId===t.groupId});if(-1===e)[].slice.call(i).forEach(function(e){e.mode="disabled"});else{var a=s[n];a&&(a.mode="disabled")}var o=s[e];o&&(o.mode=this.subtitleDisplay?"showing":"hidden")}},f.setSubtitleTrack=function(e,t){var r,i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(this.trackId!==e&&this.toggleTrackModes(e),(this.trackId!==e||-1!==e&&(null===(r=i[e])||void 0===r||!r.details))&&!(e<-1)&&!(e>=i.length)){this.clearTimer();var s=i[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,s){var a=s.id,o=s.groupId,u=s.name,l=s.type,c=s.url;this.hls.trigger(n.Events.SUBTITLE_TRACK_SWITCH,{id:a,groupId:void 0===o?"":o,name:u,type:l,url:c});var h=this.switchParams(s.url,null==t?void 0:t.details);this.loadPlaylist(h)}else this.hls.trigger(n.Events.SUBTITLE_TRACK_SWITCH,{id:e})}},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=c(this.media.textTracks),r=0;r<t.length;r++)if("hidden"===t[r].mode)e=r;else if("showing"===t[r].mode){e=r;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},h=[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}],o(t.prototype,h),d&&o(t,d),Object.defineProperty(t,"prototype",{writable:!1}),t}(s.default);function c(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];"subtitles"===n.kind&&n.label&&t.push(e[r])}return t}t.default=l},
vendor: 4,640 bytes, line 24
24"./src/controller/timeline-controller.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"TimelineController",function(){return f});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../utils/cea-608-parser */ "./src/utils/cea-608-parser.ts"),a=r(/*! ../utils/output-filter */ "./src/utils/output-filter.ts"),o=r(/*! ../utils/webvtt-parser */ "./src/utils/webvtt-parser.ts"),u=r(/*! ../utils/texttrack-utils */ "./src/utils/texttrack-utils.ts"),l=r(/*! ../utils/imsc1-ttml-parser */ "./src/utils/imsc1-ttml-parser.ts"),c=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),h=r(/*! ../types/loader */ "./src/types/loader.ts"),d=r(/*! ../utils/logger */ "./src/utils/logger.ts"),f=function(){function e(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=v(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new a.default(this,"textTrack1"),r=new a.default(this,"textTrack2"),n=new a.default(this,"textTrack3"),o=new a.default(this,"textTrack4");this.cea608Parser1=new s.default(1,t,r),this.cea608Parser2=new s.default(3,n,o)}e.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(i.Events.FRAG_LOADING,this.onFragLoading,this),e.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(i.Events.FRAG_LOADING,this.onFragLoading,this),e.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(e,t,r,n,s){for(var a=!1,o=s.length;o--;){var u=s[o],l=g(u[0],u[1],t,r);if(l>=0&&(u[0]=Math.min(u[0],t),u[1]=Math.max(u[1],r),a=!0,l/(r-t)>.5))return}if(a||s.push([t,r]),this.config.renderTextTracksNatively){var c=this.captionsTracks[e];this.Cues.newCue(c,t,r,n)}else{var h=this.Cues.newCue(null,t,r,n);this.hls.trigger(i.Events.CUES_PARSED,{type:"captions",cues:h,track:e})}},t.onInitPtsFound=function(e,t){var r=this,n=t.frag,s=t.id,a=t.initPTS,o=t.timescale,u=this.unparsedVttFrags;"main"===s&&(this.initPTS[n.cc]=a,this.timescale[n.cc]=o),u.length&&(this.unparsedVttFrags=[],u.forEach(function(e){r.onFragLoaded(i.Events.FRAG_LOADED,e)}))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var r=0;r<t.textTracks.length;r++){var n=t.textTracks[r];if(n[e])return n}return null},t.createCaptionsTrack=function(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)},t.createNativeTrack=function(e){if(!this.captionsTracks[e]){var t=this.captionsProperties,r=this.captionsTracks,n=this.media,i=t[e],s=i.label,a=i.languageCode,o=this.getExistingTrack(e);
24if(o)r[e]=o,Object(u.clearCurrentCues)(r[e]),Object(u.sendAddTrackEvent)(r[e],n);else{var l=this.createTextTrack("captions",s,a);l&&(l[e]=!0,r[e]=l)}}},t.createNonNativeTrack=function(e){if(!this.nonNativeCaptionsTracks[e]){var t=this.captionsProperties[e];if(t){var r={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}}},t.createTextTrack=function(e,t,r){var n=this.media;if(n)return n.addTextTrack(e,t,r)},t.onMediaAttaching=function(e,t){this.media=t.media,this._cleanTracks()},t.onMediaDetaching=function(){var e=this.captionsTracks;Object.keys(e).forEach(function(t){Object(u.clearCurrentCues)(e[t]),delete e[t]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=v(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var r=0;r<t.length;r++)Object(u.clearCurrentCues)(t[r])}},t.onSubtitleTracksUpdated=function(e,t){var r=this;this.textTracks=[];var n=t.subtitleTracks||[],s=n.some(function(e){return e.textCodec===l.IMSC1_CODEC});if(this.config.enableWebVTT||s&&this.config.enableIMSC1){var a=this.tracks&&n&&this.tracks.length===n.length;if(this.tracks=n||[],this.config.renderTextTracksNatively){var o=this.media?this.media.textTracks:[];this.tracks.forEach(function(e,t){var n;if(t<o.length){for(var i=null,s=0;s<o.length;s++)if(p(o[s],e)){i=o[s];break}i&&(n=i)}if(n)Object(u.clearCurrentCues)(n);else{var a=r._captionsOrSubtitlesFromCharacteristics(e);(n=r.createTextTrack(a,e.name,e.lang))&&(n.mode="disabled")}n&&(n.groupId=e.groupId,r.textTracks.push(n))})}else if(!a&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(e){return{label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}});this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},t._captionsOrSubtitlesFromCharacteristics=function(e){var t;if(null!==(t=e.attrs)&&void 0!==t&&t.CHARACTERISTICS){var r=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),n=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(r&&n)return"captions"}return"subtitles"},t.onManifestLoaded=function(e,t){var r=this;this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(function(e){var t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(t){var n="textTrack"+t[1],i=r.captionsProperties[n];i&&(i.label=e.name,e.lang&&(i.languageCode=e.lang),i.media=e)}})},t.closedCaptionsForLevel=function(e){var t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]},t.onFragLoading=function(e,t){var r=this.cea608Parser1,n=this.cea608Parser2,i=this.lastSn,s=this.lastPartIndex;if(this.enabled&&r&&n&&t.frag.type===h.PlaylistLevelType.MAIN){var a,o,u=t.frag.sn,l=null!=(a=null==t?void 0:null===(o=t.part)||void 0===o?void 0:o.index)?a:-1;u===i+1||u===i&&l===s+1||(r.reset(),n.reset()),this.lastSn=u,this.lastPartIndex=l}},t.onFragLoaded=function(e,t){var r=t.frag,s=t.payload,a=this.initPTS,o=this.unparsedVttFrags;if(r.type===h.PlaylistLevelType.SUBTITLE){if(s.byteLength){if(!Object(n.isFiniteNumber)(a[r.cc])){o.push(t),a.length&&this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:Error("Missing initial subtitle PTS")});return}var u=r.decryptdata;if(null==u||null==u.key||"AES-128"!==u.method||"stats"in t){var c=this.tracks[r.level],d=this.vttCCs;d[r.cc]||(d[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),c&&c.textCodec===l.IMSC1_CODEC?this._parseIMSC1(r,s):this._parseVTTs(r,s,d)}}else this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:Error("Empty subtitle payload")})}},t._parseIMSC1=function(e,t){var r=this,n=this.hls;Object(l.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],function(t){r._appendCues(t,e.level),n.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},function(t){d.logger.log("Failed to parse IMSC1: "+t),n.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})},t._parseVTTs=function(e,t,r){var n,s=this,a=this.hls,u=null!==(n=e.initSegment)&&void 0!==n&&n.data?Object(c.appendUint8Array)(e.initSegment.data,new Uint8Array(t)):t;Object(o.parseWebVTT)(u,this.initPTS[e.cc],this.timescale[e.cc],r,e.cc,e.start,function(t){s._appendCues(t,e.level),a.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},function(r){s._fallbackToIMSC1(e,t),d.logger.log("Failed to parse VTT cue: "+r),a.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:r})})},t._fallbackToIMSC1=function(e,t){var r=this,n=this.tracks[e.level];n.textCodec||Object(l.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],function(){n.textCodec=l.IMSC1_CODEC,r._parseIMSC1(e,t)},function(){n.textCodec="wvtt"})},t._appendCues=function(e,t){var r=this.hls;if(this.config.renderTextTracksNatively){var n=this.textTracks[t];if(!n||"disabled"===n.mode)return;e.forEach(function(e){return Object(u.addCueToTrack)(n,e)})}else{var s=this.tracks[t];if(!s)return;var a=s.default?"default":"subtitles"+t;r.trigger(i.Events.CUES_PARSED,{type:"subtitles",cues:e,track:a})}},t.onFragDecrypted=function(e,t){var r=t.frag;if(r.type===h.PlaylistLevelType.SUBTITLE){if(!Object(n.isFiniteNumber)(this.initPTS[r.cc])){this.unparsedVttFrags.push(t);return}this.onFragLoaded(i.Events.FRAG_LOADED,t)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){var r=this.cea608Parser1,n=this.cea608Parser2;if(this.enabled&&r&&n){var i=t.frag,s=t.samples;if(i.type!==h.PlaylistLevelType.MAIN||"NONE"!==this.closedCaptionsForLevel(i))for(var a=0;a<s.length;a++){var o=s[a].bytes;if(o){var u=this.extractCea608Data(o);r.addData(s[a].pts,u[0]),n.addData(s[a].pts,u[1])}}}},t.onBufferFlushing=function(e,t){var r=t.startOffset,n=t.endOffset,i=t.endOffsetSubtitles,s=t.type,a=this.media;
24if(a&&!(a.currentTime<n)){if(!s||"video"===s){var o=this.captionsTracks;Object.keys(o).forEach(function(e){return Object(u.removeCuesInRange)(o[e],r,n)})}if(this.config.renderTextTracksNatively&&0===r&&void 0!==i){var l=this.textTracks;Object.keys(l).forEach(function(e){return Object(u.removeCuesInRange)(l[e],r,i)})}}},t.extractCea608Data=function(e){for(var t=[[],[]],r=31&e[0],n=2,i=0;i<r;i++){var s=e[n++],a=127&e[n++],o=127&e[n++];if((0!==a||0!==o)&&(4&s)!=0){var u=3&s;(0===u||1===u)&&(t[u].push(a),t[u].push(o))}}return t},e}();function p(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}function g(e,t,r,n){return Math.min(t,n)-Math.max(e,r)}function v(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}},
24"./src/crypt/aes-crypto.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return n});var n=function(){function e(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}()},
24"./src/crypt/aes-decryptor.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"removePadding",function(){return i}),r.d(t,"default",function(){return s});var n=r(/*! ../utils/typed-array */ "./src/utils/typed-array.ts");function i(e){var t=e.byteLength,r=t&&new DataView(e.buffer).getUint8(t-1);return r?Object(n.sliceUint8)(e,0,t-r):e}var s=function(){function e(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var t=e.prototype;return t.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r},t.initTable=function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],s=r[2],a=r[3],o=this.invSubMix,u=o[0],l=o[1],c=o[2],h=o[3],d=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)g<128?d[g]=g<<1:d[g]=g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,e[f]=v,t[v]=f;var y=d[f],m=d[y],b=d[m],E=257*d[v]^16843008*v;n[f]=E<<24|E>>>8,i[f]=E<<16|E>>>16,s[f]=E<<8|E>>>24,a[f]=E,E=16843009*b^65537*m^257*y^16843008*f,u[v]=E<<24|E>>>8,l[v]=E<<16|E>>>16,c[v]=E<<8|E>>>24,h[v]=E,f?(f=y^d[d[d[b^y]]],p^=d[d[p]]):f=p=1}},t.expandKey=function(e){for(var t,r,n,i,s=this.uint8ArrayToUint32Array_(e),a=!0,o=0;o<s.length&&a;)a=s[o]===this.key[o],o++;if(!a){this.key=s;var u=this.keySize=s.length;if(4!==u&&6!==u&&8!==u)throw Error("Invalid aes key size="+u);var l=this.ksRows=(u+6+1)*4,c=this.keySchedule=new Uint32Array(l),h=this.invKeySchedule=new Uint32Array(l),d=this.sBox,f=this.rcon,p=this.invSubMix,g=p[0],v=p[1],y=p[2],m=p[3];for(t=0;t<l;t++){if(t<u){n=c[t]=s[t];continue}i=n,t%u==0?(i=d[(i=i<<8|i>>>24)>>>24]<<24|d[i>>>16&255]<<16|d[i>>>8&255]<<8|d[255&i],i^=f[t/u|0]<<24):u>6&&t%u==4&&(i=d[i>>>24]<<24|d[i>>>16&255]<<16|d[i>>>8&255]<<8|d[255&i]),c[t]=n=(c[t-u]^i)>>>0}for(r=0;r<l;r++)t=l-r,i=3&r?c[t]:c[t-4],r<4||t<=4?h[r]=i:h[r]=g[d[i>>>24]]^v[d[i>>>16&255]]^y[d[i>>>8&255]]^m[d[255&i]],h[r]=h[r]>>>0}},t.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},t.decrypt=function(e,t,r){for(var n,i,s,a,o,u,l,c,h,d,f,p,g,v,y=this.keySize+6,m=this.invKeySchedule,b=this.invSBox,E=this.invSubMix,S=E[0],T=E[1],w=E[2],A=E[3],x=this.uint8ArrayToUint32Array_(r),_=x[0],R=x[1],O=x[2],k=x[3],L=new Int32Array(e),C=new Int32Array(L.length),I=this.networkToHostOrderSwap;t<L.length;){for(v=1,h=I(L[t]),d=I(L[t+1]),f=I(L[t+2]),p=I(L[t+3]),o=h^m[0],u=p^m[1],l=f^m[2],c=d^m[3],g=4;v<y;v++)n=S[o>>>24]^T[u>>16&255]^w[l>>8&255]^A[255&c]^m[g],i=S[u>>>24]^T[l>>16&255]^w[c>>8&255]^A[255&o]^m[g+1],s=S[l>>>24]^T[c>>16&255]^w[o>>8&255]^A[255&u]^m[g+2],a=S[c>>>24]^T[o>>16&255]^w[u>>8&255]^A[255&l]^m[g+3],o=n,u=i,l=s,c=a,g+=4;n=b[o>>>24]<<24^b[u>>16&255]<<16^b[l>>8&255]<<8^b[255&c]^m[g],i=b[u>>>24]<<24^b[l>>16&255]<<16^b[c>>8&255]<<8^b[255&o]^m[g+1],s=b[l>>>24]<<24^b[c>>16&255]<<16^b[o>>8&255]<<8^b[255&u]^m[g+2],a=b[c>>>24]<<24^b[o>>16&255]<<16^b[u>>8&255]<<8^b[255&l]^m[g+3],C[t]=I(n^_),C[t+1]=I(a^R),C[t+2]=I(s^O),C[t+3]=I(i^k),_=h,R=d,O=f,k=p,t+=4}return C.buffer},e}()},
24"./src/crypt/decrypter.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return l});var n=r(/*! ./aes-crypto */ "./src/crypt/aes-crypto.ts"),i=r(/*! ./fast-aes-key */ "./src/crypt/fast-aes-key.ts"),s=r(/*! ./aes-decryptor */ "./src/crypt/aes-decryptor.ts"),a=r(/*! ../utils/logger */ "./src/utils/logger.ts"),o=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),u=r(/*! ../utils/typed-array */ "./src/utils/typed-array.ts"),l=function(){function e(e,t,r){var n=(void 0===r?{}:r).removePKCS7Padding,i=void 0===n||n;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=e,this.config=t,this.removePKCS7Padding=i,i)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(a){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var t=e.prototype;return t.destroy=function(){this.observer=null},t.isSync=function(){return this.config.enableSoftwareAES},t.flush=function(){var e=this.currentResult;if(!e){this.reset();return}var t=new Uint8Array(e);return(this.reset(),this.removePKCS7Padding)?Object(s.removePadding)(t):t},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(e,t,r,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(e),t,r);var i=this.flush();i&&n(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(e),t,r).then(n)},t.softwareDecrypt=function(e,t,r){var n=this.currentIV,i=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(e=Object(o.appendUint8Array)(a,e),this.remainderData=null);var l=this.getValidChunk(e);if(!l.length)return null;n&&(r=n);var c=this.softwareDecrypter;return(c||(c=this.softwareDecrypter=new s.default),c.expandKey(t),this.currentResult=c.decrypt(l.buffer,0,r),this.currentIV=Object(u.sliceUint8)(l,-16).buffer,i)?i:null},t.webCryptoDecrypt=function(e,t,r){var s=this,a=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new i.default(a,t)),this.fastAesKey.expandKey().then(function(t){return a?new n.default(a,r).decrypt(e.buffer,t):Promise.reject(Error("web crypto not initialized"))}).catch(function(n){return s.onWebCryptoError(n,e,t,r)})},t.onWebCryptoError=function(e,t,r,n){return a.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",e),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(t,r,n)},t.getValidChunk=function(e){var t=e,r=e.length-e.length%16;return r!==e.length&&(t=Object(u.sliceUint8)(e,0,r),this.remainderData=Object(u.sliceUint8)(e,r)),t},t.logOnce=function(e){this.logEnabled&&(a.logger.log("[decrypter.ts]: "+e),this.logEnabled=!1)},e}()},
24"./src/crypt/fast-aes-key.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return n});var n=function(){function e(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}()},
vendor: 1,305 bytes, line 24
24"./src/demux/aacdemuxer.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./base-audio-demuxer */ "./src/demux/base-audio-demuxer.ts"),i=r(/*! ./adts */ "./src/demux/adts.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a=r(/*! ../demux/id3 */ "./src/demux/id3.ts");function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var u=function(e){function t(t,r){var n;return(n=e.call(this)||this).observer=void 0,n.config=void 0,n.observer=t,n.config=r,n}r=t,n=e,r.prototype=Object.create(n.prototype),r.prototype.constructor=r,o(r,n);var r,n,u=t.prototype;return u.resetInitSegment=function(t,r,n,i){e.prototype.resetInitSegment.call(this,t,r,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(!e)return!1;for(var t=(a.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(i.probe(e,t))return s.logger.log("ADTS sync word found !"),!0;return!1},u.canParse=function(e,t){return i.canParse(e,t)},u.appendFrame=function(e,t,r){i.initTrackConfig(e,this.observer,t,r,e.manifestCodec);var n=i.appendFrame(e,t,r,this.basePTS,this.frameIndex);if(n&&0===n.missing)return n},t}(n.default);t.default=u},
24"./src/demux/adts.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"getAudioConfig",function(){return a}),r.d(t,"isHeaderPattern",function(){return o}),r.d(t,"getHeaderLength",function(){return u}),r.d(t,"getFullFrameLength",function(){return l}),r.d(t,"canGetFrameLength",function(){return c}),r.d(t,"isHeader",function(){return h}),r.d(t,"canParse",function(){return d}),r.d(t,"probe",function(){return f}),r.d(t,"initTrackConfig",function(){return p}),r.d(t,"getFrameDuration",function(){return g}),r.d(t,"parseFrameHeader",function(){return v}),r.d(t,"appendFrame",function(){return y});var n=r(/*! ../utils/logger */ "./src/utils/logger.ts"),i=r(/*! ../errors */ "./src/errors.ts"),s=r(/*! ../events */ "./src/events.ts");function a(e,t,r,a){var o,u,l,c,h=navigator.userAgent.toLowerCase(),d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];o=((192&t[r+2])>>>6)+1;var f=(60&t[r+2])>>>2;if(f>d.length-1){e.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+f});return}return l=(1&t[r+2])<<2,l|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+a+", ADTS type:"+o+", samplingIndex:"+f),/firefox/i.test(h)?f>=6?(o=5,c=[,,,,],u=f-3):(o=2,c=[,,],u=f):-1!==h.indexOf("android")?(o=2,c=[,,],u=f):(o=5,c=[,,,,],a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&f>=6?u=f-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(f>=6&&1===l||/vivaldi/i.test(h))||!a&&1===l)&&(o=2,c=[,,]),u=f)),c[0]=o<<3,c[0]|=(14&f)>>1,c[1]|=(1&f)<<7,c[1]|=l<<3,5===o&&(c[1]|=(14&u)>>1,c[2]=(1&u)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:d[f],channelCount:l,codec:"mp4a.40."+o,manifestCodec:a}}function o(e,t){return 255===e[t]&&(246&e[t+1])==240}function u(e,t){return 1&e[t+1]?7:9}function l(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function c(e,t){return t+5<e.length}function h(e,t){return t+1<e.length&&o(e,t)}function d(e,t){return c(e,t)&&o(e,t)&&l(e,t)<=e.length-t}function f(e,t){if(h(e,t)){var r=u(e,t);if(t+r>=e.length)return!1;var n=l(e,t);if(n<=r)return!1;var i=t+n;return i===e.length||h(e,i)}return!1}function p(e,t,r,i,s){if(!e.samplerate){var o=a(t,r,i,s);o&&(e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,n.logger.log("parsed codec:"+e.codec+", rate:"+o.samplerate+", channels:"+o.channelCount))}}function g(e){return 9216e4/e}function v(e,t){var r=u(e,t);if(t+r<=e.length){var n=l(e,t)-r;if(n>0)return{headerLength:r,frameLength:n}}}function y(e,t,r,n,i){var s,a=n+i*g(e.samplerate),o=v(t,r);if(o){var u=o.frameLength,l=o.headerLength,c=l+u,h=Math.max(0,r+c-t.length);h?(s=new Uint8Array(c-l)).set(t.subarray(r+l,t.length),0):s=t.subarray(r+l,r+c);var d={unit:s,pts:a};return h||e.samples.push(d),{sample:d,length:c,missing:h}}var f=t.length-r;return(s=new Uint8Array(f)).set(t.subarray(r,t.length),0),{sample:{unit:s,pts:a},length:f,missing:-1}}},
24"./src/demux/base-audio-demuxer.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"initPTSFn",function(){return c});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../demux/id3 */ "./src/demux/id3.ts"),s=r(/*! ../types/demuxer */ "./src/types/demuxer.ts"),a=r(/*! ./dummy-demuxed-track */ "./src/demux/dummy-demuxed-track.ts"),o=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),u=r(/*! ../utils/typed-array */ "./src/utils/typed-array.ts"),l=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(e){this.initPTS=e,this.resetContiguity()},t.resetContiguity=function(){this.basePTS=null,this.frameIndex=0},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,r){},t.demux=function(e,t){this.cachedData&&(e=Object(o.appendUint8Array)(this.cachedData,e),this.cachedData=null);var r,l,h=i.getID3Data(e,0),d=h?h.length:0,f=this._audioTrack,p=this._id3Track,g=h?i.getTimeStamp(h):void 0,v=e.length;for((null===this.basePTS||0===this.frameIndex&&Object(n.isFiniteNumber)(g))&&(this.basePTS=c(g,t,this.initPTS)),h&&h.length>0&&p.samples.push({pts:this.basePTS,dts:this.basePTS,data:h,type:s.MetadataSchema.audioId3}),l=this.basePTS;d<v;){if(this.canParse(e,d)){var y=this.appendFrame(f,e,d);y?(this.frameIndex++,l=y.sample.pts,d+=y.length,r=d):d=v}else i.canParse(e,d)?(h=i.getID3Data(e,d),p.samples.push({pts:l,dts:l,data:h,type:s.MetadataSchema.audioId3}),d+=h.length,r=d):d++;if(d===v&&r!==v){var m=Object(u.sliceUint8)(e,r);this.cachedData?this.cachedData=Object(o.appendUint8Array)(this.cachedData,m):this.cachedData=m}}return{audioTrack:f,videoTrack:Object(a.dummyTrack)(),id3Track:p,textTrack:Object(a.dummyTrack)()}},t.demuxSampleAes=function(e,t,r){return Promise.reject(Error("["+this+"] This demuxer does not support Sample-AES decryption"))},t.flush=function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Object(a.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(a.dummyTrack)()}},t.destroy=function(){},e}(),c=function(e,t,r){return Object(n.isFiniteNumber)(e)?90*e:9e4*t+(r||0)};t.default=l},
24"./src/demux/chunk-cache.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return n});var n=function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,r=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var r=new Uint8Array(t),n=0,i=0;i<e.length;i++){var s=e[i];r.set(s,n),n+=s.length}return r}(t,r),this.reset(),e):new Uint8Array(0)},t.reset=function(){this.chunks.length=0,this.dataLength=0},e}()},
24"./src/demux/dummy-demuxed-track.ts":function(e,t,r){"use strict";function n(e,t){return void 0===e&&(e=""),void 0===t&&(t=9e4),{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}r.r(t),r.d(t,"dummyTrack",function(){return n})},
24"./src/demux/exp-golomb.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../utils/logger */ "./src/utils/logger.ts"),i=function(){function e(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}var t=e.prototype;return t.loadWord=function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},t.skipBits=function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return(e>32&&n.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable)?r<<t|this.readBits(t):r},t.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!=0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t,r=8,n=8,i=0;i<e;i++)0!==n&&(n=(r+this.readEG()+256)%256),r=0===n?r:n},t.readSPS=function(){var e,t,r,n=0,i=0,s=0,a=0,o=this.readUByte.bind(this),u=this.readBits.bind(this),l=this.readUEG.bind(this),c=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);o();var g=o();if(u(5),h(3),o(),f(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){var v=l();if(3===v&&h(1),f(),f(),h(1),c())for(r=0,t=3!==v?8:12;r<t;r++)c()&&p(r<6?16:64)}f();var y=l();if(0===y)l();else if(1===y)for(h(1),d(),d(),e=l(),r=0;r<e;r++)d();f(),h(1);var m=l(),b=l(),E=u(1);0===E&&h(1),h(1),c()&&(n=l(),i=l(),s=l(),a=l());var S=[1,1];if(c()&&c()){var T=o();switch(T){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[o()<<8|o(),o()<<8|o()]}}return{width:Math.ceil((m+1)*16-2*n-2*i),height:(2-E)*(b+1)*16-(E?2:4)*(s+a),pixelRatio:S}},t.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();t.default=i},
24"./src/demux/id3.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"isHeader",function(){return i}),r.d(t,"isFooter",function(){return s}),r.d(t,"getID3Data",function(){return a}),r.d(t,"canParse",function(){return u}),r.d(t,"getTimeStamp",function(){return l}),r.d(t,"isTimeStampFrame",function(){return c}),r.d(t,"getID3Frames",function(){return d}),r.d(t,"decodeFrame",function(){return f}),r.d(t,"utf8ArrayToStr",function(){return m}),r.d(t,"testables",function(){return b});var n,i=function(e,t){return!!(t+10<=e.length)&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&!!(e[t+3]<255)&&!!(e[t+4]<255)&&!!(e[t+6]<128)&&!!(e[t+7]<128)&&!!(e[t+8]<128)&&!!(e[t+9]<128)},s=function(e,t){return!!(t+10<=e.length)&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&!!(e[t+3]<255)&&!!(e[t+4]<255)&&!!(e[t+6]<128)&&!!(e[t+7]<128)&&!!(e[t+8]<128)&&!!(e[t+9]<128)},a=function(e,t){for(var r=0;i(e,t);){r+=10;var n=o(e,t+6);r+=n,s(e,t+10)&&(r+=10),t+=r}if(r>0)return e.subarray(t,t+r)},o=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},u=function(e,t){return i(e,t)&&o(e,t+6)+10<=e.length-t},l=function(e){for(var t=d(e),r=0;r<t.length;r++){var n=t[r];if(c(n))return y(n)}},c=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},h=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=o(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}},d=function(e){for(var t=0,r=[];i(e,t);){for(var n=o(e,t+6),a=(t+=10)+n;t+8<a;){var u=h(e.subarray(t)),l=f(u);l&&r.push(l),t+=u.size+10}s(e,t)&&(t+=10)}return r},f=function(e){return"PRIV"===e.type?p(e):"W"===e.type[0]?v(e):g(e)},p=function(e){if(!(e.size<2)){var t=m(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}}},g=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,r=m(e.data.subarray(t),!0);t+=r.length+1;var n=m(e.data.subarray(t));return{key:e.type,info:r,data:n}}var i=m(e.data.subarray(1));return{key:e.type,data:i}}},v=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,r=m(e.data.subarray(t),!0);t+=r.length+1;var n=m(e.data.subarray(t));return{key:e.type,info:r,data:n}}var i=m(e.data);return{key:e.type,data:i}},y=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}},m=function(e,t){void 0===t&&(t=!1);var r,i,s,a=(n||void 0===self.TextDecoder||(n=new self.TextDecoder("utf-8")),n);if(a){var o=a.decode(e);if(t){var u=o.indexOf("\0");return -1!==u?o.substring(0,u):o}return o.replace(/\0/g,"")}for(var l=e.length,c="",h=0;h<l&&(0!==(r=e[h++])||!t);)if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(r);break;case 12:case 13:c+=String.fromCharCode((31&r)<<6|63&(i=e[h++]));break;case 14:c+=String.fromCharCode((15&r)<<12|(63&(i=e[h++]))<<6|(63&e[h++])<<0)}return c},b={decodeTextFrame:g}},
vendor: 1,202 bytes, line 24
24"./src/demux/mp3demuxer.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./base-audio-demuxer */ "./src/demux/base-audio-demuxer.ts"),i=r(/*! ../demux/id3 */ "./src/demux/id3.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a=r(/*! ./mpegaudio */ "./src/demux/mpegaudio.ts");function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var u=function(e){function t(){return e.apply(this,arguments)||this}r=t,n=e,r.prototype=Object.create(n.prototype),r.prototype.constructor=r,o(r,n);var r,n,u=t.prototype;return u.resetInitSegment=function(t,r,n,i){e.prototype.resetInitSegment.call(this,t,r,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:r,duration:i,inputTimeScale:9e4,dropped:0}},t.probe=function(e){if(!e)return!1;for(var t=(i.getID3Data(e,0)||[]).length,r=e.length;t<r;t++)if(a.probe(e,t))return s.logger.log("MPEG Audio sync word found !"),!0;return!1},u.canParse=function(e,t){return a.canParse(e,t)},u.appendFrame=function(e,t,r){if(null!==this.basePTS)return a.appendFrame(e,t,r,this.basePTS,this.frameIndex)},t}(n.default);t.default=u},
24"./src/demux/mp4demuxer.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../types/demuxer */ "./src/types/demuxer.ts"),s=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),a=r(/*! ./dummy-demuxed-track */ "./src/demux/dummy-demuxed-track.ts"),o=/\/emsg[-/]ID3/i,u=function(){function e(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}var t=e.prototype;return t.resetTimeStamp=function(){},t.resetInitSegment=function(e,t,r,n){var i=Object(s.parseInitSegment)(e),o=this.videoTrack=Object(a.dummyTrack)("video",1),u=this.audioTrack=Object(a.dummyTrack)("audio",1),l=this.txtTrack=Object(a.dummyTrack)("text",1);if(this.id3Track=Object(a.dummyTrack)("id3",1),this.timeOffset=0,i.video){var c=i.video,h=c.id,d=c.timescale,f=c.codec;o.id=h,o.timescale=l.timescale=d,o.codec=f}if(i.audio){var p=i.audio,g=p.id,v=p.timescale,y=p.codec;u.id=g,u.timescale=v,u.codec=y}l.id=s.RemuxerTrackIdConfig.text,o.sampleDuration=0,o.duration=u.duration=n},t.resetContiguity=function(){},e.probe=function(e){return e=e.length>16384?e.subarray(0,16384):e,Object(s.findBox)(e,["moof"]).length>0},t.demux=function(e,t){this.timeOffset=t;var r=e,n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Object(s.appendUint8Array)(this.remainderData,e));var a=Object(s.segmentValidRange)(r);this.remainderData=a.remainder,n.samples=a.valid||new Uint8Array}else n.samples=r;var o=this.extractID3Track(n,t);return i.samples=Object(s.parseSamples)(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}},t.flush=function(){var e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var n=this.extractID3Track(t,this.timeOffset);
24return r.samples=Object(s.parseSamples)(e,t),{videoTrack:t,audioTrack:Object(a.dummyTrack)(),id3Track:n,textTrack:Object(a.dummyTrack)()}},t.extractID3Track=function(e,t){var r=this.id3Track;if(e.samples.length){var a=Object(s.findBox)(e.samples,["emsg"]);a&&a.forEach(function(e){var a=Object(s.parseEmsg)(e);if(o.test(a.schemeIdUri)){var u=Object(n.isFiniteNumber)(a.presentationTime)?a.presentationTime/a.timeScale:t+a.presentationTimeDelta/a.timeScale,l=a.payload;r.samples.push({data:l,len:l.byteLength,dts:u,pts:u,type:i.MetadataSchema.emsg})}})}return r},t.demuxSampleAes=function(e,t,r){return Promise.reject(Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}();t.default=u},
24"./src/demux/mpegaudio.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"appendFrame",function(){return u}),r.d(t,"parseHeader",function(){return l}),r.d(t,"isHeaderPattern",function(){return c}),r.d(t,"isHeader",function(){return h}),r.d(t,"canParse",function(){return d}),r.d(t,"probe",function(){return f});var n=null,i=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],a=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],o=[0,1,1,4];function u(e,t,r,n,i){if(!(r+24>t.length)){var s=l(t,r);if(s&&r+s.frameLength<=t.length){var a=n+i*(9e4*s.samplesPerFrame/s.sampleRate),o={unit:t.subarray(r,r+s.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(o),{sample:o,length:s.frameLength,missing:0}}}}function l(e,t){var r=e[t+1]>>3&3,u=e[t+1]>>1&3,l=e[t+2]>>4&15,c=e[t+2]>>2&3;if(1!==r&&0!==l&&15!==l&&3!==c){var h=e[t+2]>>1&1,d=e[t+3]>>6,f=1e3*i[14*(3===r?3-u:3===u?3:4)+l-1],p=s[3*(3===r?0:2===r?1:2)+c],g=a[r][u],v=o[u];if(null===n){var y=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);n=y?parseInt(y[1]):0}return n&&n<=87&&2===u&&f>=224e3&&0===d&&(e[t+3]=128|e[t+3]),{sampleRate:p,channelCount:3===d?1:2,frameLength:Math.floor(g*f/p+h)*v,samplesPerFrame:8*g*v}}}function c(e,t){return 255===e[t]&&(224&e[t+1])==224&&(6&e[t+1])!=0}function h(e,t){return t+1<e.length&&c(e,t)}function d(e,t){return c(e,t)&&4<=e.length-t}function f(e,t){if(t+1<e.length&&c(e,t)){var r=l(e,t),n=4;null!=r&&r.frameLength&&(n=r.frameLength);var i=t+n;return i===e.length||h(e,i)}return!1}},
24"./src/demux/sample-aes.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../crypt/decrypter */ "./src/crypt/decrypter.ts"),i=r(/*! ./tsdemuxer */ "./src/demux/tsdemuxer.ts"),s=function(){function e(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new n.default(e,t,{removePKCS7Padding:!1})}var t=e.prototype;return t.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,t)},t.decryptAacSample=function(e,t,r,n){var i=e[t].unit;if(!(i.length<=16)){var s=i.subarray(16,i.length-i.length%16),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),o=this;this.decryptBuffer(a,function(s){var a=new Uint8Array(s);i.set(a,16),n||o.decryptAacSamples(e,t+1,r)})}},t.decryptAacSamples=function(e,t,r){for(;;t++){if(t>=e.length){r();return}if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r},t.getAvcDecryptedUnit=function(e,t){for(var r=new Uint8Array(t),n=0,i=32;i<e.length-16;i+=160,n+=16)e.set(r.subarray(n,n+16),i);return e},t.decryptAvcSample=function(e,t,r,n,s,a){var o=Object(i.discardEPB)(s.data),u=this.getAvcEncryptedData(o),l=this;this.decryptBuffer(u.buffer,function(i){s.data=l.getAvcDecryptedUnit(o,i),a||l.decryptAvcSamples(e,t,r+1,n)})},t.decryptAvcSamples=function(e,t,r,n){if(e instanceof Uint8Array)throw Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length){n();return}for(var i=e[t].units;!(r>=i.length);r++){var s=i[r];if(!(s.data.length<=48)&&(1===s.type||5===s.type)){var a=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,s,a),!a)return}}}},e}();t.default=s},
vendor: 4,809 bytes, line 24
24"./src/demux/transmuxer-interface.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return h});var n=r(/*! webworkify-webpack */ "./node_modules/webworkify-webpack/index.js"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../demux/transmuxer */ "./src/demux/transmuxer.ts"),a=r(/*! ../utils/logger */ "./src/utils/logger.ts"),o=r(/*! ../errors */ "./src/errors.ts"),u=r(/*! ../utils/mediasource-helper */ "./src/utils/mediasource-helper.ts"),l=r(/*! eventemitter3 */ "./node_modules/eventemitter3/index.js"),c=Object(u.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function e(e,t,r,u){var h,d=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=e,this.id=t,this.onTransmuxComplete=r,this.onFlush=u;var f=e.config,p=function(t,r){(r=r||{}).frag=d.frag,r.id=d.id,e.trigger(t,r)};this.observer=new l.EventEmitter,this.observer.on(i.Events.FRAG_DECRYPTED,p),this.observer.on(i.Events.ERROR,p);var g={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(f.enableWorker&&"undefined"!=typeof Worker){a.logger.log("demuxing in webworker");try{h=this.worker=n(/*! ../demux/transmuxer-worker.ts */ "./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),h.addEventListener("message",this.onwmsg),h.onerror=function(t){e.trigger(i.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:Error(t.message+"  ("+t.filename+":"+t.lineno+")")})},h.postMessage({cmd:"init",typeSupported:g,vendor:v,id:t,config:JSON.stringify(f)})}catch(y){a.logger.warn("Error in worker:",y),a.logger.error("Error while initializing DemuxerWorker, fallback to inline"),h&&self.URL.revokeObjectURL(h.objectURL),this.transmuxer=new s.default(this.observer,g,f,v,t),this.worker=null}}else this.transmuxer=new s.default(this.observer,g,f,v,t)}var t=e.prototype;return t.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null,this.onwmsg=void 0;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},t.push=function(e,t,r,n,i,o,u,l,c,h){var d,f,p=this;c.transmuxing.start=self.performance.now();var g=this.transmuxer,v=this.worker,y=o?o.start:i.start,m=i.decryptdata,b=this.frag,E=!(b&&i.cc===b.cc),S=!(b&&c.level===b.level),T=b?c.sn-b.sn:-1,w=this.part?c.part-this.part.index:-1,A=0===T&&c.id>1&&c.id===(null==b?void 0:b.stats.chunkCount),x=!S&&(1===T||0===T&&(1===w||A&&w<=0)),_=self.performance.now();(S||T||0===i.stats.parsing.start)&&(i.stats.parsing.start=_),o&&(w||!x)&&(o.stats.parsing.start=_);var R=!(b&&(null===(d=i.initSegment)||void 0===d?void 0:d.url)===(null===(f=b.initSegment)||void 0===f?void 0:f.url)),O=new s.TransmuxState(E,x,l,S,y,R);if(!x||E||R){a.logger.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+"\n        discontinuity: "+E+"\n        trackSwitch: "+S+"\n        contiguous: "+x+"\n        accurateTimeOffset: "+l+"\n        timeOffset: "+y+"\n        initSegmentChange: "+R);var k=new s.TransmuxConfig(r,n,t,u,h);this.configureTransmuxer(k)}if(this.frag=i,this.part=o,v)v.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:O},e instanceof ArrayBuffer?[e]:[]);else if(g){var L=g.push(e,m,c,O);Object(s.isPromise)(L)?L.then(function(e){p.handleTransmuxComplete(e)}):this.handleTransmuxComplete(L)}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var r=this.transmuxer,n=this.worker;if(n)n.postMessage({cmd:"flush",chunkMeta:e});else if(r){var i=r.flush(e);Object(s.isPromise)(i)?i.then(function(r){t.handleFlushResult(r,e)}):this.handleFlushResult(i,e)}},t.handleFlushResult=function(e,t){var r=this;e.forEach(function(e){r.handleTransmuxComplete(e)}),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,r=this.hls;switch(t.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":a.logger[t.data.logType]&&a.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.worker,r=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):r&&r.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e}()},
24"./src/demux/transmuxer-worker.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return o});var n=r(/*! ../demux/transmuxer */ "./src/demux/transmuxer.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a=r(/*! eventemitter3 */ "./node_modules/eventemitter3/index.js");function o(e){var t=new a.EventEmitter,r=function(t,r){e.postMessage({event:t,data:r})};t.on(i.Events.FRAG_DECRYPTED,r),t.on(i.Events.ERROR,r);var o=function(){var e=function(e){var t=function(t){r("workerLog",{logType:e,message:t})};s.logger[e]=t};for(var t in s.logger)e(t)};e.addEventListener("message",function(i){var a=i.data;switch(a.cmd){case"init":var l=JSON.parse(a.config);e.transmuxer=new n.default(t,a.typeSupported,l,a.vendor,a.id),Object(s.enableLogs)(l.debug),o(),r("init",null);break;case"configure":e.transmuxer.configure(a.config);break;case"demux":var h=e.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(n.isPromise)(h)?h.then(function(t){u(e,t)}):u(e,h);break;case"flush":var d=a.chunkMeta,f=e.transmuxer.flush(d);Object(n.isPromise)(f)?f.then(function(t){c(e,t,d)}):c(e,f,d)}})}function u(e,t){if(r=t.remuxResult,!r.audio&&!r.video&&!r.text&&!r.id3&&!r.initSegment)return!1;var r,n=[],i=t.remuxResult,s=i.audio,a=i.video;return s&&l(n,s),a&&l(n,a),e.postMessage({event:"transmuxComplete",data:t},n),!0}function l(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function c(e,t,r){t.reduce(function(t,r){return u(e,r)||t},!1)||e.postMessage({event:"transmuxComplete",data:t[0]}),e.postMessage({event:"flush",data:r})}},
24"./src/demux/transmuxer.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return v}),r.d(t,"isPromise",function(){return m}),r.d(t,"TransmuxConfig",function(){return b}),r.d(t,"TransmuxState",function(){return E});var n,i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../errors */ "./src/errors.ts"),a=r(/*! ../crypt/decrypter */ "./src/crypt/decrypter.ts"),o=r(/*! ../demux/aacdemuxer */ "./src/demux/aacdemuxer.ts"),u=r(/*! ../demux/mp4demuxer */ "./src/demux/mp4demuxer.ts"),l=r(/*! ../demux/tsdemuxer */ "./src/demux/tsdemuxer.ts"),c=r(/*! ../demux/mp3demuxer */ "./src/demux/mp3demuxer.ts"),h=r(/*! ../remux/mp4-remuxer */ "./src/remux/mp4-remuxer.ts"),d=r(/*! ../remux/passthrough-remuxer */ "./src/remux/passthrough-remuxer.ts"),f=r(/*! ../utils/logger */ "./src/utils/logger.ts");try{n=self.performance.now.bind(self.performance)}catch(p){f.logger.debug("Unable to use Performance API on this environment"),n=self.Date.now}var g=[{demux:l.default,remux:h.default},{demux:u.default,remux:d.default},{demux:o.default,remux:h.default},{demux:c.default,remux:h.default}],v=function(){function e(e,t,r,n,i){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n,this.id=i}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,r,i){var s=this,a=r.transmuxing;a.executeStart=n();var o=new Uint8Array(e),u=this.config,l=this.currentTransmuxState,c=this.transmuxConfig;i&&(this.currentTransmuxState=i);var h,d,f,p=i||l,g=p.contiguous,v=p.discontinuity,m=p.trackSwitch,b=p.accurateTimeOffset,E=p.timeOffset,S=p.initSegmentChange,T=c.audioCodec,w=c.videoCodec,A=c.defaultInitPts,x=c.duration,_=c.initSegmentData;(v||m||S)&&this.resetInitSegment(_,T,w,x),(v||S)&&this.resetInitialTimestamp(A),g||this.resetContiguity();var R=(h=o,d=t,f=null,h.byteLength>0&&null!=d&&null!=d.key&&null!==d.iv&&null!=d.method&&(f=d),f);if(R&&"AES-128"===R.method){var O=this.getDecrypter();if(!u.enableSoftwareAES)return this.decryptionPromise=O.webCryptoDecrypt(o,R.key.buffer,R.iv.buffer).then(function(e){var t=s.push(e,null,r);return s.decryptionPromise=null,t}),this.decryptionPromise;var k=O.softwareDecrypt(o,R.key.buffer,R.iv.buffer);if(!k)return a.executeEnd=n(),y(r);o=new Uint8Array(k)}this.needsProbing(o,v,m)&&this.configureTransmuxer(o,c);var L=this.transmux(o,R,E,b,r),C=this.currentTransmuxState;return C.contiguous=!0,C.discontinuity=!1,C.trackSwitch=!1,a.executeEnd=n(),L},t.flush=function(e){var t=this,r=e.transmuxing;r.executeStart=n();var a=this.decrypter,o=this.currentTransmuxState,u=this.decryptionPromise;if(u)return u.then(function(){return t.flush(e)});var l=[],c=o.timeOffset;if(a){var h=a.flush();h&&l.push(this.push(h,null,e))}var d=this.demuxer,f=this.remuxer;if(!d||!f)return this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=n(),[y(e)];var p=d.flush(c);return m(p)?p.then(function(r){return t.flushRemux(l,r,e),l}):(this.flushRemux(l,p,e),l)},t.flushRemux=function(e,t,r){var i=t.audioTrack,s=t.videoTrack,a=t.id3Track,o=t.textTrack,u=this.currentTransmuxState,l=u.accurateTimeOffset,c=u.timeOffset;f.logger.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var h=this.remuxer.remux(i,s,a,o,c,l,!0,this.id);e.push({remuxResult:h,chunkMeta:r}),r.transmuxing.executeEnd=n()},t.resetInitialTimestamp=function(e){var t=this.demuxer,r=this.remuxer;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,r,n){var i=this.demuxer,s=this.remuxer;i&&s&&(i.resetInitSegment(e,t,r,n),s.resetInitSegment(e,t,r))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,r,n,i){var s;return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,n,i):this.transmuxUnencrypted(e,r,n,i)},t.transmuxUnencrypted=function(e,t,r,n){var i=this.demuxer.demux(e,t,!1,!this.config.progressive),s=i.audioTrack,a=i.videoTrack,o=i.id3Track,u=i.textTrack;return{remuxResult:this.remuxer.remux(s,a,o,u,t,r,!1,this.id),chunkMeta:n}},t.transmuxSampleAes=function(e,t,r,n,i){var s=this;return this.demuxer.demuxSampleAes(e,t,r).then(function(e){return{remuxResult:s.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,r,n,!1,s.id),chunkMeta:i}})},t.configureTransmuxer=function(e,t){for(var r,n=this.config,i=this.observer,s=this.typeSupp
vendor: 1,382 bytes, line 24
24orted,a=this.vendor,o=t.audioCodec,l=t.defaultInitPts,c=t.duration,h=t.initSegmentData,p=t.videoCodec,v=0,y=g.length;v<y;v++)if(g[v].demux.probe(e)){r=g[v];break}r||(f.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),r={demux:u.default,remux:d.default});var m=this.demuxer,b=this.remuxer,E=r.remux,S=r.demux;b&&b instanceof E||(this.remuxer=new E(i,n,s,a)),m&&m instanceof S||(this.demuxer=new S(i,n,s),this.probe=S.probe),this.resetInitSegment(h,o,p,c),this.resetInitialTimestamp(l)},t.needsProbing=function(e,t,r){return!this.demuxer||!this.remuxer||t||r},t.getDecrypter=function(){var e=this.decrypter;return e||(e=this.decrypter=new a.default(this.observer,this.config)),e},e}(),y=function(e){return{remuxResult:{},chunkMeta:e}};function m(e){return"then"in e&&e.then instanceof Function}var b=function(e,t,r,n,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=n,this.defaultInitPts=i},E=function(e,t,r,n,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=n,this.timeOffset=i,this.initSegmentChange=s}},
24"./src/demux/tsdemuxer.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"discardEPB",function(){return b});var n=r(/*! ./adts */ "./src/demux/adts.ts"),i=r(/*! ./mpegaudio */ "./src/demux/mpegaudio.ts"),s=r(/*! ./exp-golomb */ "./src/demux/exp-golomb.ts"),a=r(/*! ./sample-aes */ "./src/demux/sample-aes.ts"),o=r(/*! ../events */ "./src/events.ts"),u=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),l=r(/*! ../utils/logger */ "./src/utils/logger.ts"),c=r(/*! ../errors */ "./src/errors.ts"),h=r(/*! ../types/demuxer */ "./src/types/demuxer.ts");function d(){return(d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var f=function(){function e(e,t,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=r}e.probe=function(e){return 71===e[0]&&71===e[188]},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:u.RemuxerTrackIdConfig[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,r,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video"),this._audioTrack=e.createTrack("audio",i),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=r,this.videoCodec=n,this._duration=i},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._avcTrack,r=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null},t.demux=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1),r||(this.sampleAes=null);var i,s=this._avcTrack,a=this._audioTrack,h=this._id3Track,d=this._txtTrack,f=s.pid,p=s.pesData,m=a.pid,b=h.pid,E=a.pesData,S=h.pesData,T=null,w=this.pmtParsed,A=this._pmtId,x=e.length;if(this.remainderData&&(x=(e=Object(u.appendUint8Array)(this.remainderData,e)).length,this.remainderData=null),x<188&&!n)return this.remainderData=e,{audioTrack:a,videoTrack:s,id3Track:h,textTrack:d};(x-=x%188)<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,x,e.buffer.byteLength-x));for(var _=0,R=0;R<x;R+=188)if(71===e[R]){var O=!!(64&e[R+1]),k=((31&e[R+1])<<8)+e[R+2],L=(48&e[R+3])>>4,C=void 0;if(L>1){if((C=R+5+e[R+4])===R+188)continue}else C=R+4;switch(k){case f:O&&(p&&(i=y(p))&&this.parseAVCPES(s,d,i,!1),p={data:[],size:0}),p&&(p.data.push(e.subarray(C,R+188)),p.size+=R+188-C);break;case m:if(O){if(E&&(i=y(E)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,i);break;case"mp3":this.parseMPEGPES(a,i)}E={data:[],size:0}}E&&(E.data.push(e.subarray(C,R+188)),E.size+=R+188-C);break;case b:O&&(S&&(i=y(S))&&this.parseID3PES(h,i),S={data:[],size:0}),S&&(S.data.push(e.subarray(C,R+188)),S.size+=R+188-C);break;case 0:O&&(C+=e[C]+1),A=this._pmtId=g(e,C);break;case A:O&&(C+=e[C]+1);var I=v(e,C,this.typeSupported,r);(f=I.avc)>0&&(s.pid=f),(m=I.audio)>0&&(a.pid=m,a.segmentCodec=I.segmentCodec),(b=I.id3)>0&&(h.pid=b),null===T||w||(l.logger.log("unknown PID '"+T+"' in TS found"),T=null),w=this.pmtParsed=!0;break;case 17:case 8191:break;default:T=k}}else _++;_>0&&this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+_+" TS packet/s that do not start with 0x47"}),s.pesData=p,a.pesData=E,h.pesData=S;var D={audioTrack:a,videoTrack:s,id3Track:h,textTrack:d};return n&&this.extractRemainingSamples(D),D},t.flush=function(){var e,t=this.remainderData;return(this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes)?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,r=e.audioTrack,n=e.videoTrack,i=e.id3Track,s=e.textTrack,a=n.pesData,o=r.pesData,u=i.pesData;
24if(a&&(t=y(a))?(this.parseAVCPES(n,s,t,!0),n.pesData=null):n.pesData=a,o&&(t=y(o))){switch(r.segmentCodec){case"aac":this.parseAACPES(r,t);break;case"mp3":this.parseMPEGPES(r,t)}r.pesData=null}else null!=o&&o.size&&l.logger.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=o;u&&(t=y(u))?(this.parseID3PES(i,t),i.pesData=null):i.pesData=u},t.demuxSampleAes=function(e,t,r){var n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new a.default(this.observer,this.config,t);return this.decrypt(n,i)},t.decrypt=function(e,t){return new Promise(function(r){var n=e.audioTrack,i=e.videoTrack;n.samples&&"aac"===n.segmentCodec?t.decryptAacSamples(n.samples,0,function(){i.samples?t.decryptAvcSamples(i.samples,0,0,function(){r(e)}):r(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,function(){r(e)})})},t.destroy=function(){this._duration=0},t.parseAVCPES=function(e,t,r,n){var i,a=this,o=this.parseAVCNALu(e,r.data),l=this.avcSample,c=!1;r.data=null,l&&o.length&&!e.audFound&&(m(l,e),l=this.avcSample=p(!1,r.pts,r.dts,"")),o.forEach(function(n){switch(n.type){case 1:i=!0,l||(l=a.avcSample=p(!0,r.pts,r.dts,"")),l.frame=!0;var o=n.data;if(c&&o.length>4){var h=new s.default(o).readSliceType();(2===h||4===h||7===h||9===h)&&(l.key=!0)}break;case 5:i=!0,l||(l=a.avcSample=p(!0,r.pts,r.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0,Object(u.parseSEIMessageFromNALu)(b(n.data),r.pts,t.samples);break;case 7:if(i=!0,c=!0,!e.sps){var d=new s.default(n.data).readSPS();e.width=d.width,e.height=d.height,e.pixelRatio=d.pixelRatio,e.sps=[n.data],e.duration=a._duration;for(var f=n.data.subarray(1,4),g="avc1.",v=0;v<3;v++){var y=f[v].toString(16);y.length<2&&(y="0"+y),g+=y}e.codec=g}break;case 8:i=!0,e.pps||(e.pps=[n.data]);break;case 9:i=!1,e.audFound=!0,l&&m(l,e),l=a.avcSample=p(!1,r.pts,r.dts,"");break;case 12:i=!0;break;default:i=!1,l&&(l.debug+="unknown NAL "+n.type+" ")}l&&i&&l.units.push(n)}),n&&l&&(m(l,e),this.avcSample=null)},t.getLastNalUnit=function(e){var t,r,n=this.avcSample;if(n&&0!==n.units.length||(n=e[e.length-1]),null!==(t=n)&&void 0!==t&&t.units){var i=n.units;r=i[i.length-1]}return r},t.parseAVCNALu=function(e,t){var r,n,i,s=t.byteLength,a=e.naluState||0,o=a,u=[],l=0,c=-1,h=0;for(-1===a&&(c=0,h=31&t[0],a=0,l=1);l<s;){if(r=t[l++],!a){a=r?0:1;continue}if(1===a){a=r?0:2;continue}if(r){if(1===r){if(c>=0){var d={data:t.subarray(c,l-a-1),type:h};u.push(d)}else{var f=this.getLastNalUnit(e.samples);if(f&&(o&&l<=4-o&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-o)),(n=l-a-1)>0)){var p=new Uint8Array(f.data.byteLength+n);p.set(f.data,0),p.set(t.subarray(0,n),f.data.byteLength),f.data=p,f.state=0}}l<s?(i=31&t[l],c=l,h=i,a=0):a=-1}else a=0}else a=3}if(c>=0&&a>=0){var g={data:t.subarray(c,s),type:h,state:a};u.push(g)}if(0===u.length){var v=this.getLastNalUnit(e.samples);if(v){var y=new Uint8Array(v.data.byteLength+t.byteLength);y.set(v.data,0),y.set(t,v.data.byteLength),v.data=y}}return e.naluState=a,u},t.parseAACPES=function(e,t){var r,i,s,a,u,h,d=0,f=this.aacOverFlow,p=t.data;if(f){this.aacOverFlow=null;var g=f.missing,v=f.sample.unit.byteLength;if(-1===g){var y=new Uint8Array(v+p.byteLength);y.set(f.sample.unit,0),y.set(p,v),p=y}else f.sample.unit.set(p.subarray(0,g),v-g),e.samples.push(f.sample),d=f.missing}for(r=d,i=p.length;r<i-1&&!n.isHeader(p,r);r++);if(r===d||(r<i-1?(s="AAC PES did not start with ADTS header,offset:"+r,a=!1):(s="no ADTS header found in AAC PES",a=!0),l.logger.warn("parsing error:"+s),this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:a,reason:s}),!a)){if(n.initTrackConfig(e,this.observer,p,r,this.audioCodec),void 0!==t.pts)u=t.pts;else if(f){var m=n.getFrameDuration(e.samplerate);u=f.sample.pts+m}else{l.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var b=0;r<i;){if(h=n.appendFrame(e,p,r,u,b),r+=h.length,h.missing){this.aacOverFlow=h;break}for(b++;r<i-1&&!n.isHeader(p,r);r++);}}},t.parseMPEGPES=function(e,t){var r=t.data,n=r.length,s=0,a=0,o=t.pts;if(void 0===o){l.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;a<n;)if(i.isHeader(r,a)){var u=i.appendFrame(e,r,a,o,s);if(u)a+=u.length,s++;else break}else a++},t.parseID3PES=function(e,t){if(void 0===t.pts){l.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var r=d({},t,{type:this._avcTrack?h.MetadataSchema.emsg:h.MetadataSchema.audioId3});e.samples.push(r)},e}();function p(e,t,r,n){return{key:e,frame:!1,pts:t,dts:r,units:[],debug:n,length:0}}function g(e,t){return(31&e[t+10])<<8|e[t+11]}function v(e,t,r,n){var i={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},s=(15&e[t+1])<<8|e[t+2],a=t+3+s-4,o=(15&e[t+10])<<8|e[t+11];for(t+=12+o;t<a;){var u=(31&e[t+1])<<8|e[t+2];switch(e[t]){case 207:if(!n){l.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===i.audio&&(i.audio=u);break;case 21:-1===i.id3&&(i.id3=u);break;case 219:if(!n){l.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===i.avc&&(i.avc=u);break;case 3:case 4:!0!==r.mpeg&&!0!==r.mp3?l.logger.log("MPEG audio found, not supported in this browser"):-1===i.audio&&(i.audio=u,i.segmentCodec="mp3");break;case 36:l.logger.warn("Unsupported HEVC stream type found")}t+=((15&e[t+3])<<8|e[t+4])+5}return i}function y(e){var t,r,n,i,s,a=0,o=e.data;if(!e||0===e.size)return null;for(;o[0].length<19&&o.length>1;){var u=new Uint8Array(o[0].length+o[1].length);u.set(o[0]),u.set(o[1],o[0].length),o[0]=u,o.splice(1,1)}if(1===((t=o[0])[0]<<16)+(t[1]<<8)+t[2]){if((r=(t[4]<<8)+t[5])&&r>e.size-6)return null;var c=t[7];192&c&&(i=(14&t[9])*536870912+(255&t[10])*4194304+(254&t[11])*16384+(255&t[12])*128+(254&t[13])/2,64&c?i-(s=(14&t[14])*536870912+(255&t[15])*4194304+(254&t[16])*16384+(255&t[17])*128+(254&t[18])/2)>54e5&&(l.logger.warn(Math.round((i-s)/9e4)+"s delta between PTS and DTS, align them"),i=s):s=i);var h=(n=t[8])+9;if(e.size<=h)return null;e.size-=h;for(var d=new Uint8Array(e.size),f=0,p=o.length;f<p;f++){var g=(t=o[f]).byteLength;if(h){if(h>g){h-=g;continue}t=t.subarray(h),g-=h,h=0}d.set(t,a),a+=g}return r&&(r-=n+3),{data:d,pts:i,dts:s,len:r}}return null}function m(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var r=t.samples,n=r.length;if(n){var i=r[n-1];e.pts=i.pts,e.dts=i.dts}else{t.dropped++;return}}t.samples.push(e)}e.debug.length&&l.logger.log(e.pts+"/"+e.dts+":"+e.debug)}function b(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(0===r.length)return e;var i=t-r.length,s=new Uint8Array(i),a=0;for(n=0;n<i;a++,n++)a===r[0]&&(a++,r.shift()),s[n]=e[a];return s}t.default=f},
24"./src/errors.ts":function(e,t,r){"use strict";var n,i,s,a;r.r(t),r.d(t,"ErrorTypes",function(){return n}),r.d(t,"ErrorDetails",function(){return i}),(s=n||(n={})).NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",(a=i||(i={})).KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.UNKNOWN="unknown"},
24"./src/events.ts":function(e,t,r){"use strict";var n,i;r.r(t),r.d(t,"Events",function(){return n}),(i=n||(n={})).MEDIA_ATTACHING="hlsMediaAttaching",i.MEDIA_ATTACHED="hlsMediaAttached",i.MEDIA_DETACHING="hlsMediaDetaching",i.MEDIA_DETACHED="hlsMediaDetached",i.BUFFER_RESET="hlsBufferReset",i.BUFFER_CODECS="hlsBufferCodecs",i.BUFFER_CREATED="hlsBufferCreated",i.BUFFER_APPENDING="hlsBufferAppending",i.BUFFER_APPENDED="hlsBufferAppended",i.BUFFER_EOS="hlsBufferEos",i.BUFFER_FLUSHING="hlsBufferFlushing",i.BUFFER_FLUSHED="hlsBufferFlushed",i.MANIFEST_LOADING="hlsManifestLoading",i.MANIFEST_LOADED="hlsManifestLoaded",i.MANIFEST_PARSED="hlsManifestParsed",i.LEVEL_SWITCHING="hlsLevelSwitching",i.LEVEL_SWITCHED="hlsLevelSwitched",i.LEVEL_LOADING="hlsLevelLoading",i.LEVEL_LOADED="hlsLevelLoaded",i.LEVEL_UPDATED="hlsLevelUpdated",i.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",i.LEVELS_UPDATED="hlsLevelsUpdated",i.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",i.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",i.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",i.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",i.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",i.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",i.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",i.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",i.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",i.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",i.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",i.CUES_PARSED="hlsCuesParsed",i.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",i.INIT_PTS_FOUND="hlsInitPtsFound",i.FRAG_LOADING="hlsFragLoading",i.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",i.FRAG_LOADED="hlsFragLoaded",i.FRAG_DECRYPTED="hlsFragDecrypted",i.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",i.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",i.FRAG_PARSING_METADATA="hlsFragParsingMetadata",i.FRAG_PARSED="hlsFragParsed",i.FRAG_BUFFERED="hlsFragBuffered",i.FRAG_CHANGED="hlsFragChanged",i.FPS_DROP="hlsFpsDrop",i.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",i.ERROR="hlsError",i.DESTROYING="hlsDestroying",i.KEY_LOADING="hlsKeyLoading",i.KEY_LOADED="hlsKeyLoaded",i.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",i.BACK_BUFFER_REACHED="hlsBackBufferReached"},
vendor: 8,766 bytes, line 24
24"./src/hls.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return m});var n=r(/*! url-toolkit */ "./node_modules/url-toolkit/src/url-toolkit.js"),i=r(/*! ./loader/playlist-loader */ "./src/loader/playlist-loader.ts"),s=r(/*! ./loader/key-loader */ "./src/loader/key-loader.ts"),a=r(/*! ./controller/id3-track-controller */ "./src/controller/id3-track-controller.ts"),o=r(/*! ./controller/latency-controller */ "./src/controller/latency-controller.ts"),u=r(/*! ./controller/level-controller */ "./src/controller/level-controller.ts"),l=r(/*! ./controller/fragment-tracker */ "./src/controller/fragment-tracker.ts"),c=r(/*! ./controller/stream-controller */ "./src/controller/stream-controller.ts"),h=r(/*! ./is-supported */ "./src/is-supported.ts"),d=r(/*! ./utils/logger */ "./src/utils/logger.ts"),f=r(/*! ./config */ "./src/config.ts"),p=r(/*! eventemitter3 */ "./node_modules/eventemitter3/index.js"),g=r(/*! ./events */ "./src/events.ts"),v=r(/*! ./errors */ "./src/errors.ts");function y(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var m=function(){function e(t){void 0===t&&(t={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var r=this.config=Object(f.mergeConfig)(e.DefaultConfig,t);this.userConfig=t,Object(d.enableLogs)(r.debug),this._autoLevelCapping=-1,r.progressive&&Object(f.enableStreamingMode)(r);var n=r.abrController,h=r.bufferController,g=r.capLevelController,v=r.fpsController,y=this.abrController=new n(this),m=this.bufferController=new h(this),b=this.capLevelController=new g(this),E=new v(this),S=new i.default(this),T=new s.default(this),w=new a.default(this),A=this.levelController=new u.default(this),x=new l.FragmentTracker(this),_=this.streamController=new c.default(this,x);b.setStreamController(_),E.setStreamController(_);var R=[S,T,A,_];this.networkControllers=R;var O=[y,m,b,E,w,x];this.audioTrackController=this.createController(r.audioTrackController,null,R),this.createController(r.audioStreamController,x,R),this.subtitleTrackController=this.createController(r.subtitleTrackController,null,R),this.createController(r.subtitleStreamController,x,R),this.createController(r.timelineController,null,O),this.emeController=this.createController(r.emeController,null,O),this.cmcdController=this.createController(r.cmcdController,null,O),this.latencyController=this.createController(o.default,null,O),this.coreComponents=O}e.isSupported=function(){return Object(h.isSupported)()};var t,r,m,b=e.prototype;return b.createController=function(e,t,r){if(e){var n=t?new e(this,t):new e(this);return r&&r.push(n),n}return null},b.on=function(e,t,r){void 0===r&&(r=this),this._emitter.on(e,t,r)},b.once=function(e,t,r){void 0===r&&(r=this),this._emitter.once(e,t,r)},b.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},b.off=function(e,t,r,n){void 0===r&&(r=this),this._emitter.off(e,t,r,n)},b.listeners=function(e){return this._emitter.listeners(e)},b.emit=function(e,t,r){return this._emitter.emit(e,t,r)},b.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){d.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),this.trigger(g.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,error:r})}return!1},b.listenerCount=function(e){return this._emitter.listenerCount(e)},b.destroy=function(){d.logger.log("destroy"),this.trigger(g.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(e){return e.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(e){return e.destroy()}),this.coreComponents.length=0},b.attachMedia=function(e){d.logger.log("attachMedia"),this._media=e,this.trigger(g.Events.MEDIA_ATTACHING,{media:e})},b.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(g.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(e){this.stopLoad();var t=this.media,r=this.url,i=this.url=n.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});d.logger.log("loadSource:"+i),t&&r&&r!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(g.Events.MANIFEST_LOADING,{url:e})},b.startLoad=function(e){void 0===e&&(e=-1),d.logger.log("startLoad("+e+")"),this.networkControllers.forEach(function(t){t.startLoad(e)})},b.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach(function(e){e.stopLoad()})},b.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){d.logger.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},b.removeLevel=function(e,t){void 0===t&&(t=0),this.levelController.removeLevel(e,t)},r=[{key:"levels",get:function(){var e;return this.levelController.levels||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){d.logger.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){d.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){d.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){d.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){d.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(d.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return -1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var r=e.length,n=0;n<r;n++)if(e[n].maxBitrate>=t)return n;return 0}},{key:"maxAutoLevel",get:function(){var e,t=this.levels,r=this.autoLevelCapping;return -1===r&&t&&t.length?t.length-1:r}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}
24,set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],m=[{key:"version",get:function(){return"1.2.4"}},{key:"Events",get:function(){return g.Events}},{key:"ErrorTypes",get:function(){return v.ErrorTypes}},{key:"ErrorDetails",get:function(){return v.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:f.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}],r&&y(e.prototype,r),m&&y(e,m),Object.defineProperty(e,"prototype",{writable:!1}),e}();m.defaultConfig=void 0},
24"./src/is-supported.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"isSupported",function(){return s}),r.d(t,"changeTypeSupported",function(){return a});var n=r(/*! ./utils/mediasource-helper */ "./src/utils/mediasource-helper.ts");function i(){return self.SourceBuffer||self.WebKitSourceBuffer}function s(){var e=Object(n.getMediaSource)();if(!e)return!1;var t=i(),r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!s}function a(){var e,t=i();return"function"==typeof(null==t?void 0:null===(e=t.prototype)||void 0===e?void 0:e.changeType)}},
24"./src/loader/date-range.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"DateRangeAttribute",function(){return i}),r.d(t,"DateRange",function(){return c});var n,i,s=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),a=r(/*! ../utils/attr-list */ "./src/utils/attr-list.ts"),o=r(/*! ../utils/logger */ "./src/utils/logger.ts");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(n=i||(i={})).ID="ID",n.CLASS="CLASS",n.START_DATE="START-DATE",n.DURATION="DURATION",n.END_DATE="END-DATE",n.END_ON_NEXT="END-ON-NEXT",n.PLANNED_DURATION="PLANNED-DURATION",n.SCTE35_OUT="SCTE35-OUT",n.SCTE35_IN="SCTE35-IN";var c=function(){var e,t,r;function n(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){var r=t.attr;for(var n in r)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==r[n]){o.logger.warn('DATERANGE tag attribute: "'+n+'" does not match for tags with ID: "'+e.ID+'"'),this._badValueForSameId=n;break}e=u(new a.AttrList({}),r,e)}if(this.attr=e,this._startDate=new Date(e[i.START_DATE]),i.END_DATE in this.attr){var l=new Date(this.attr[i.END_DATE]);Object(s.isFiniteNumber)(l.getTime())&&(this._endDate=l)}}return t=[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}},{key:"duration",get:function(){if(i.DURATION in this.attr){var e=this.attr.decimalFloatingPoint(i.DURATION);if(Object(s.isFiniteNumber)(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return i.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(i.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(i.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Object(s.isFiniteNumber)(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}],l(n.prototype,t),r&&l(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}()},
24"./src/loader/fragment-loader.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return l}),r.d(t,"LoadError",function(){return h});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../errors */ "./src/errors.ts");function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){var r;if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,e)})(e)}function a(e,t,r){return(a=!function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&o(i,r.prototype),i}:Reflect.construct.bind()).apply(null,arguments)}function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var r=this,n=e.url;if(!n)return Promise.reject(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,networkDetails:null},"Fragment does not have a "+(n?"part list":"url")));this.abort();var s=this.config,a=s.fLoader,o=s.loader;return new Promise(function(n,u){r.loader&&r.loader.destroy();var l=r.loader=e.loader=a?new a(s):new o(s),d=c(e),f={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:"initSegment"===e.sn?1/0:131072};e.stats=l.stats,l.load(d,f,{onSuccess:function(t,i,s,a){r.resetLoader(e,l),n({frag:e,part:null,payload:t.data,networkDetails:a})},onError:function(t,n,s){r.resetLoader(e,l),u(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:t,networkDetails:s}))},onAbort:function(t,n,s){r.resetLoader(e,l),u(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,networkDetails:s}))},onTimeout:function(t,n,s){r.resetLoader(e,l),u(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,networkDetails:s}))},onProgress:function(r,n,i,s){t&&t({frag:e,part:null,payload:i,networkDetails:s})}})})},t.loadPart=function(e,t,r){var n=this;this.abort();var s=this.config,a=s.fLoader,o=s.loader;return new Promise(function(u,l){n.loader&&n.loader.destroy();var d=n.loader=e.loader=a?new a(s):new o(s),f=c(e,t),p={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:131072};t.stats=d.stats,d.load(f,p,{onSuccess:function(i,s,a,o){n.resetLoader(e,d),n.updateStatsFromPart(e,t);var l={frag:e,part:t,payload:i.data,networkDetails:o};r(l),u(l)},onError:function(r,s,a){n.resetLoader(e,d),l(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:r,networkDetails:a}))},onAbort:function(r,s,a){e.stats.aborted=t.stats.aborted,n.resetLoader(e,d),l(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,networkDetails:a}))},onTimeout:function(r,s,a){n.resetLoader(e,d),l(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,networkDetails:a}))}})})},t.updateStatsFromPart=function(e,t){var r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){var s=Math.round(e.duration/t.duration),a=Math.min(Math.round(r.loaded/i),s),o=(s-a)*Math.round(r.loaded/a);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);var u=r.loading,l=n.loading;u.start?u.first+=l.first-l.start:(u.start=l.start,u.first=l.first),u.end=l.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}();function c(e,t){void 0===t&&(t=null);var r=t||e,i={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},s=r.byteRangeStartOffset,a=r.byteRangeEndOffset;return Object(n.isFiniteNumber)(s)&&Object(n.isFiniteNumber)(a)&&(i.rangeStart=s,i.rangeEnd=a),i}var h=function(e){var t,r;function n(t){for(var r,n=arguments.length,i=Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return(r=e.call.apply(e,[this].concat(i))||this).data=void 0,r.data=t,r}return(t=n).prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e),n}(s(Error))},
24"./src/loader/fragment.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"ElementaryStreamTypes",function(){return i}),r.d(t,"BaseSegment",function(){return p}),r.d(t,"Fragment",function(){return g}),r.d(t,"Part",function(){return v});var n,i,s=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),a=r(/*! url-toolkit */ "./node_modules/url-toolkit/src/url-toolkit.js"),o=r(/*! ../utils/logger */ "./src/utils/logger.ts"),u=r(/*! ./level-key */ "./src/loader/level-key.ts"),l=r(/*! ./load-stats */ "./src/loader/load-stats.ts");function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,h(e,t)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(n=i||(i={})).AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo";var p=function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[i.AUDIO]=null,t[i.VIDEO]=null,t[i.AUDIOVIDEO]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){var r=e.split("@",2),n=[];1===r.length?n[0]=t?t.byteRangeEndOffset:0:n[0]=parseInt(r[1]),n[1]=parseInt(r[0])+n[0],this._byteRange=n},f(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(a.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e}(),g=function(e){function t(t,r){var n;return(n=e.call(this,r)||this)._decryptdata=null,n.rawProgramDateTime=null,n.programDateTime=null,n.tagList=[],n.duration=0,n.sn=0,n.levelkey=void 0,n.type=void 0,n.loader=null,n.level=-1,n.cc=0,n.startPTS=void 0,n.endPTS=void 0,n.appendedPTS=void 0,n.startDTS=void 0,n.endDTS=void 0,n.start=0,n.deltaPTS=void 0,n.maxStartPTS=void 0,n.minEndPTS=void 0,n.stats=new l.LoadStats,n.urlId=0,n.data=void 0,n.bitrateTest=!1,n.title=null,n.initSegment=null,n.type=t,n}c(t,e);var r=t.prototype;return r.createInitializationVector=function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t},r.setDecryptDataFromLevelKey=function(e,t){var r=e;return(null==e?void 0:e.method)==="AES-128"&&e.uri&&!e.iv&&((r=u.LevelKey.fromURI(e.uri)).method=e.method,r.iv=this.createInitializationVector(t),r.keyFormat="identity"),r},r.setElementaryStreamInfo=function(e,t,r,n,i,s){void 0===s&&(s=!1);var a=this.elementaryStreams,o=a[e];if(!o){a[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:s};return}o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,n),o.endDTS=Math.max(o.endDTS,i)},r.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[i.AUDIO]=null,e[i.VIDEO]=null,e[i.AUDIOVIDEO]=null},f(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var e=this.sn;"number"!=typeof e&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),e=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,e)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime||!Object(s.isFiniteNumber)(this.programDateTime))return null;var e=Object(s.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;return null!==(e=this.decryptdata)&&void 0!==e&&!!e.keyFormat&&!!this.decryptdata.uri}}]),t}(p),v=function(e){function t(t,r,n,i,s){(a=e.call(this,n)||this).fragOffset=0,a.duration=0,a.gap=!1,a.independent=!1,a.relurl=void 0,a.fragment=void 0,a.index=void 0,a.stats=new l.LoadStats,a.duration=t.decimalFloatingPoint("DURATION"),a.gap=t.bool("GAP"),a.independent=t.bool("INDEPENDENT"),a.relurl=t.enumeratedString("URI"),a.fragment=r,a.index=i;var a,o=t.enumeratedString("BYTERANGE");return o&&a.setByteRange(o,s),s&&(a.fragOffset=s.fragOffset+s.duration),a}return c(t,e),f(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t}(p)},
24"./src/loader/key-loader.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return a});var n=r(/*! ../events */ "./src/events.ts"),i=r(/*! ../errors */ "./src/errors.ts"),s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a=function(){function e(e){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){this.hls.on(n.Events.KEY_LOADING,this.onKeyLoading,this)},t.unregisterListeners=function(){this.hls.off(n.Events.KEY_LOADING,this.onKeyLoading)},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onKeyLoading=function(e,t){var r=t.frag,i=r.type,a=this.loaders[i];if(!r.decryptdata){s.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=r.decryptdata.uri;if(o!==this.decrypturl||null===this.decryptkey){var u=this.hls.config;if(a&&(s.logger.warn("abort previous key loader for type:"+i),a.abort()),!o){s.logger.warn("key uri is falsy");return}var l=u.loader,c=r.loader=this.loaders[i]=new l(u);this.decrypturl=o,this.decryptkey=null;var h={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load({url:o,frag:r,responseType:"arraybuffer"},h,d)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(n.Events.KEY_LOADED,{frag:r}))},t.loadsuccess=function(e,t,r){var i=r.frag;if(!i.decryptdata){s.logger.error("after key load, decryptdata unset");return}this.decryptkey=i.decryptdata.key=new Uint8Array(e.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(n.Events.KEY_LOADED,{frag:i})},t.loaderror=function(e,t){var r=t.frag,s=r.loader;s&&s.abort(),delete this.loaders[r.type],this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},t.loadtimeout=function(e,t){var r=t.frag,s=r.loader;s&&s.abort(),delete this.loaders[r.type],this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e}()},
24"./src/loader/level-details.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"LevelDetails",function(){return s});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts");function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){var e,t,r;function s(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.dateRanges={},this.url=e}return s.prototype.reloaded=function(e){if(!e){this.advanced=!0,this.updated=!0;return}var t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},t=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(n.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}}
vendor: 981 bytes, line 24
24,{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!==(e=this.fragments)&&void 0!==e&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}],i(s.prototype,t),r&&i(s,r),Object.defineProperty(s,"prototype",{writable:!1}),s}()},
24"./src/loader/level-key.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"LevelKey",function(){return s});var n=r(/*! url-toolkit */ "./node_modules/url-toolkit/src/url-toolkit.js");function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=function(){var e,t,r;function s(e,t){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,t?this._uri=Object(n.buildAbsoluteURL)(e,t,{alwaysNormalize:!0}):this._uri=e}return s.fromURL=function(e,t){return new s(e,t)},s.fromURI=function(e){return new s(e)},t=[{key:"uri",get:function(){return this._uri}}],i(s.prototype,t),r&&i(s,r),Object.defineProperty(s,"prototype",{writable:!1}),s}()},
24"./src/loader/load-stats.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"LoadStats",function(){return n});var n=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},
vendor: 4,960 bytes, line 24
24"./src/loader/m3u8-parser.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return y});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! url-toolkit */ "./node_modules/url-toolkit/src/url-toolkit.js"),s=r(/*! ./date-range */ "./src/loader/date-range.ts"),a=r(/*! ./fragment */ "./src/loader/fragment.ts"),o=r(/*! ./level-details */ "./src/loader/level-details.ts"),u=r(/*! ./level-key */ "./src/loader/level-key.ts"),l=r(/*! ../utils/attr-list */ "./src/utils/attr-list.ts"),c=r(/*! ../utils/logger */ "./src/utils/logger.ts"),h=r(/*! ../utils/codecs */ "./src/utils/codecs.ts"),d=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,f=/#EXT-X-MEDIA:(.*)/g,p=RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),g=RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),v=/\.(mp4|m4s|m4v|m4a)$/i,y=function(){function e(){}return e.findGroup=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.id===t)return n}},e.convertAVC1ToAVCOTI=function(e){var t=e.split(".");if(t.length>2){var r=t.shift()+".";return r+=parseInt(t.shift()).toString(16),r+=("000"+parseInt(t.shift()).toString(16)).slice(-4)}return e},e.resolve=function(e,t){return i.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,r){var n=[],i=[],s={},a=!1;for(d.lastIndex=0;null!=(o=d.exec(t));)if(o[1]){var o,u,c=new l.AttrList(o[1]),h={attrs:c,bitrate:c.decimalInteger("AVERAGE-BANDWIDTH")||c.decimalInteger("BANDWIDTH"),name:c.NAME,url:e.resolve(o[2],r)},f=c.decimalResolution("RESOLUTION");f&&(h.width=f.width,h.height=f.height),m((c.CODECS||"").split(/[ ,]+/).filter(function(e){return e}),h),h.videoCodec&&-1!==h.videoCodec.indexOf("avc1")&&(h.videoCodec=e.convertAVC1ToAVCOTI(h.videoCodec)),null!==(u=h.unknownCodecs)&&void 0!==u&&u.length||i.push(h),n.push(h)}else if(o[3]){var p=new l.AttrList(o[3]);p["DATA-ID"]&&(a=!0,s[p["DATA-ID"]]=p)}return{levels:i.length>0&&i.length<n.length?i:n,sessionData:a?s:null}},e.parseMasterPlaylistMedia=function(t,r,n,i){void 0===i&&(i=[]);var s,a=[],o=0;for(f.lastIndex=0;null!==(s=f.exec(t));){var u=new l.AttrList(s[1]);if(u.TYPE===n){var c={attrs:u,bitrate:0,id:o++,groupId:u["GROUP-ID"],instreamId:u["INSTREAM-ID"],name:u.NAME||u.LANGUAGE||"",type:n,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:u.LANGUAGE,url:u.URI?e.resolve(u.URI,r):""};if(i.length){var h=e.findGroup(i,c.groupId)||i[0];b(c,h,"audioCodec"),b(c,h,"textCodec")}a.push(c)}}return a},e.parseLevelPlaylist=function(e,t,r,h,d){var f=new o.LevelDetails(t),y=f.fragments,m=null,b=0,T=0,w=0,A=0,x=null,_=new a.Fragment(h,t),R=-1,O=!1;for(p.lastIndex=0,f.m3u8=e;null!==(q=p.exec(e));){O&&(O=!1,(_=new a.Fragment(h,t)).start=w,_.sn=b,_.cc=A,_.level=r,m&&(_.initSegment=m,_.rawProgramDateTime=m.rawProgramDateTime,m.rawProgramDateTime=null));var k=q[1];if(k){_.duration=parseFloat(k);var L=(" "+q[2]).slice(1);_.title=L||null,_.tagList.push(L?["INF",k,L]:["INF",k])}else if(q[3])Object(n.isFiniteNumber)(_.duration)&&(_.start=w,z&&(_.levelkey=z),_.sn=b,_.level=r,_.cc=A,_.urlId=d,y.push(_),_.relurl=(" "+q[3]).slice(1),E(_,x),x=_,w+=_.duration,b++,T=0,O=!0);else if(q[4]){var C=(" "+q[4]).slice(1);x?_.setByteRange(C,x):_.setByteRange(C)}else if(q[5])_.rawProgramDateTime=(" "+q[5]).slice(1),_.tagList.push(["PROGRAM-DATE-TIME",_.rawProgramDateTime]),-1===R&&(R=y.length);else{if(!(q=q[0].match(g))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(H=1;H<q.length&&void 0===q[H];H++);var I=(" "+q[H]).slice(1),D=(" "+q[H+1]).slice(1),P=q[H+2]?(" "+q[H+2]).slice(1):"";switch(I){case"PLAYLIST-TYPE":f.type=D.toUpperCase();break;case"MEDIA-SEQUENCE":b=f.startSN=parseInt(D);break;case"SKIP":var M=new l.AttrList(D),U=M.decimalInteger("SKIPPED-SEGMENTS");if(Object(n.isFiniteNumber)(U)){f.skippedSegments=U;for(var F=U;F--;)y.unshift(null);b+=U}var B=M.enumeratedString("RECENTLY-REMOVED-DATERANGES");B&&(f.recentlyRemovedDateranges=B.split("	"));break;case"TARGETDURATION":f.targetduration=parseFloat(D);break;case"VERSION":f.version=parseInt(D);break;case"EXTM3U":break;case"ENDLIST":f.live=!1;break;case"#":(D||P)&&_.tagList.push(P?[D,P]:[D]);break;case"DISCONTINUITY":A++,_.tagList.push(["DIS"]);break;case"GAP":_.tagList.push([I]);break;case"BITRATE":_.tagList.push([I,D]);break;case"DATERANGE":var N=new l.AttrList(D),j=new s.DateRange(N,f.dateRanges[N.ID]);j.isValid||f.skippedSegments?f.dateRanges[j.id]=j:c.logger.warn('Ignoring invalid DATERANGE tag: "'+
vendor: 3,659 bytes, line 24
24D+'"'),_.tagList.push(["EXT-X-DATERANGE",D]);break;case"DISCONTINUITY-SEQUENCE":A=parseInt(D);break;case"KEY":var q,H,z,G,K=new l.AttrList(D),W=K.enumeratedString("METHOD"),V=K.URI,$=K.hexadecimalInteger("IV"),Q=K.enumeratedString("KEYFORMATVERSIONS"),Y=K.enumeratedString("KEYID"),X=null!=(G=K.enumeratedString("KEYFORMAT"))?G:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(X)>-1){c.logger.warn("Keyformat "+X+" is not supported from the manifest");continue}if("identity"!==X)continue;W&&(z=u.LevelKey.fromURL(t,V),V&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(W)>=0&&(z.method=W,z.keyFormat=X,Y&&(z.keyID=Y),Q&&(z.keyFormatVersions=Q),z.iv=$));break;case"START":var J=new l.AttrList(D).decimalFloatingPoint("TIME-OFFSET");Object(n.isFiniteNumber)(J)&&(f.startTimeOffset=J);break;case"MAP":var Z=new l.AttrList(D);if(_.duration){var ee=new a.Fragment(h,t);S(ee,Z,r,z),m=ee,_.initSegment=m,m.rawProgramDateTime&&!_.rawProgramDateTime&&(_.rawProgramDateTime=m.rawProgramDateTime)}else S(_,Z,r,z),m=_,O=!0;break;case"SERVER-CONTROL":var et=new l.AttrList(D);f.canBlockReload=et.bool("CAN-BLOCK-RELOAD"),f.canSkipUntil=et.optionalFloat("CAN-SKIP-UNTIL",0),f.canSkipDateRanges=f.canSkipUntil>0&&et.bool("CAN-SKIP-DATERANGES"),f.partHoldBack=et.optionalFloat("PART-HOLD-BACK",0),f.holdBack=et.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var er=new l.AttrList(D);f.partTarget=er.decimalFloatingPoint("PART-TARGET");break;case"PART":var en=f.partList;en||(en=f.partList=[]);var ei=T>0?en[en.length-1]:void 0,es=T++,ea=new a.Part(new l.AttrList(D),_,t,es,ei);en.push(ea),_.duration+=ea.duration;break;case"PRELOAD-HINT":var eo=new l.AttrList(D);f.preloadHint=eo;break;case"RENDITION-REPORT":var eu=new l.AttrList(D);f.renditionReports=f.renditionReports||[],f.renditionReports.push(eu);break;default:c.logger.warn("line parsed but not handled: "+q)}}}x&&!x.relurl?(y.pop(),w-=x.duration,f.partList&&(f.fragmentHint=x)):f.partList&&(E(_,x),_.cc=A,f.fragmentHint=_);var el=y.length,ec=y[0],eh=y[el-1];if((w+=f.skippedSegments*f.targetduration)>0&&el&&eh){f.averagetargetduration=w/el;var ed=eh.sn;f.endSN="initSegment"!==ed?ed:0,ec&&(f.startCC=ec.cc,!ec.initSegment&&f.fragments.every(function(e){var t,r,n;return e.relurl&&(t=e.relurl,v.test(null!=(r=null===(n=i.parseURL(t))||void 0===n?void 0:n.path)?r:""))})&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(_=new a.Fragment(h,t)).relurl=eh.relurl,_.level=r,_.sn="initSegment",ec.initSegment=_,f.needSidxRanges=!0))}else f.endSN=0,f.startCC=0;return f.fragmentHint&&(w+=f.fragmentHint.duration),f.totalduration=w,f.endCC=A,R>0&&function(e,t){for(var r=e[t],n=t;n--;){var i=e[n];if(!i)return;i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(y,R),f},e}();function m(e,t){["video","audio","text"].forEach(function(r){var n=e.filter(function(e){return Object(h.isCodecType)(e,r)});if(n.length){var i=n.filter(function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)});t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter(function(e){return -1===n.indexOf(e)})}}),t.unknownCodecs=e}function b(e,t,r){var n=t[r];n&&(e[r]=n)}function E(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(n.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function S(e,t,r,n){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",n&&(e.levelkey=n),e.initSegment=null}},
24"./src/loader/playlist-loader.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../events */ "./src/events.ts"),s=r(/*! ../errors */ "./src/errors.ts"),a=r(/*! ../utils/logger */ "./src/utils/logger.ts"),o=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),u=r(/*! ./m3u8-parser */ "./src/loader/m3u8-parser.ts"),l=r(/*! ../types/loader */ "./src/types/loader.ts"),c=r(/*! ../utils/attr-list */ "./src/utils/attr-list.ts");function h(e,t){var r=e.url;return(void 0===r||0===r.indexOf("data:"))&&(r=t.url),r}var d=function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){var e=this.hls;e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return e.loader=i,this.loaders[e.type]=i,i},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var r=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:l.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var r=t.id,n=t.level,i=t.url,s=t.deliveryDirectives;this.load({id:r,groupId:null,level:n,responseType:"text",type:l.PlaylistContextType.LEVEL,url:i,deliveryDirectives:s})},t.onAudioTrackLoading=function(e,t){var r=t.id,n=t.groupId,i=t.url,s=t.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:l.PlaylistContextType.AUDIO_TRACK,url:i,deliveryDirectives:s})},t.onSubtitleTrackLoading=function(e,t){var r=t.id,n=t.groupId,i=t.url,s=t.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:l.PlaylistContextType.SUBTITLE_TRACK,url:i,deliveryDirectives:s})},t.load=function(e){var t,r,n,i,s,o,u=this.hls.config,c=this.getInternalLoader(e);if(c){var h=c.context;if(h&&h.url===e.url){a.logger.trace("[playlist-loader]: playlist request ongoing");return}a.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),c.abort()}switch(e.type){case l.PlaylistContextType.MANIFEST:r=u.manifestLoadingMaxRetry,n=u.manifestLoadingTimeOut,i=u.manifestLoadingRetryDelay,s=u.manifestLoadingMaxRetryTimeout;break;case l.PlaylistContextType.LEVEL:case l.PlaylistContextType.AUDIO_TRACK:case l.PlaylistContextType.SUBTITLE_TRACK:r=0,n=u.levelLoadingTimeOut;break;default:r=u.levelLoadingMaxRetry,n=u.levelLoadingTimeOut,i=u.levelLoadingRetryDelay,s=u.levelLoadingMaxRetryTimeout}if(c=this.createInternalLoader(e),null!==(t=e.deliveryDirectives)&&void 0!==t&&t.part&&(e.type===l.PlaylistContextType.LEVEL&&null!==e.level?o=this.hls.levels[e.level].details:e.type===l.PlaylistContextType.AUDIO_TRACK&&null!==e.id?o=this.hls.audioTracks[e.id].details:e.type===l.PlaylistContextType.SUBTITLE_TRACK&&null!==e.id&&(o=this.hls.subtitleTracks[e.id].details),o)){var d=o.partTarget,f=o.targetduration;d&&f&&(n=Math.min(1e3*Math.max(3*d,.8*f),n))}var p={timeout:n,maxRetry:r,retryDelay:i,maxRetryDelay:s,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(e,p,g)},t.loadsuccess=function(e,t,r,n){if(void 0===n&&(n=null),r.isSidxRequest){this.handleSidxRequest(e,r),this.handlePlaylistLoaded(e,t,r,n);return}this.resetInternalLoader(r.type);var i=e.data;if(0!==i.indexOf("#EXTM3U")){this.handleManifestParsingError(e,r,"no EXTM3U delimiter",n);return}t.parsing.start=performance.now(),i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,r,n):this.handleMasterPlaylist(e,t,r,n)},t.loaderror=function(e,t,r){void 0===r&&(r=null),this.handleNetworkError(t,r,!1,e)},t.loadtimeout=function(e,t,r){void 0===r&&(r=null),this.handleNetworkError(t,r,!0)},t.handleMasterPlaylist=function(e,t,r,n){var s=this.hls,o=e.data,l=h(e,r),d=u.default.parseMasterPlaylist(o,l),f=d.levels,p=d.sessionData;if(!f.length){this.handleManifestParsingError(e,r,"no level found in manifest",n);return}var g=f.map(function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}}),v=f.map(function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}}),y=u.default.parseMasterPlaylistMedia(o,l,"AUDIO",g),m=u.default.parseMasterPlaylistMedia(o,l,"SUBTITLES",v),b=u.default.parseMasterPlaylistMedia(o,l,"CLOSED-CAPTIONS");y.length&&(y.some(function(e){return!e.url})||!f[0].audioCodec||f[0].attrs.AUDIO||(a.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))),s.trigger(i.Events.MANIFEST_LOADED,{levels:f,audioTracks:y,subtitles:m,captions:b,url:l,stats:t,networkDetails:n,sessionData:p})},t.handleTrackOrLevelPlaylist=function(e,t,r,a){var o=this.hls,d=r.id,f=r.level,p=r.type,g=h(e,r),v=Object(n.isFiniteNumber)(d)?d:0,y=Object(n.isFiniteNumber)(f)?f:v,m=function(e){var t=e.type;switch(t){case l.PlaylistContextType.AUDIO_TRACK:return l.PlaylistLevelType.AUDIO;case l.PlaylistContextType.SUBTITLE_TRACK:return l.PlaylistLevelType.SUBTITLE;default:return l.PlaylistLevelType.MAIN}}(r),b=u.default.parseLevelPlaylist(e.data,g,y,m,v);if(!b.fragments.length){o.trigger(i.Events.ERROR,{type:s.ErrorTypes.NETWORK_E
24RROR,details:s.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0});return}if(p===l.PlaylistContextType.MANIFEST){var E={attrs:new c.AttrList({}),bitrate:0,details:b,name:"",url:g};o.trigger(i.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:g,stats:t,networkDetails:a,sessionData:null})}if(t.parsing.end=performance.now(),b.needSidxRanges){var S,T=null===(S=b.fragments[0].initSegment)||void 0===S?void 0:S.url;this.load({url:T,isSidxRequest:!0,type:p,level:f,levelDetails:b,id:d,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}r.levelDetails=b,this.handlePlaylistLoaded(e,t,r,a)},t.handleSidxRequest=function(e,t){var r=new Uint8Array(e.data),n=Object(o.findBox)(r,["sidx"])[0];if(n){var i=Object(o.parseSegmentIndex)(n);if(i){var s=i.references,a=t.levelDetails;s.forEach(function(e,t){var n=e.info,i=a.fragments[t];if(0===i.byteRange.length&&i.setByteRange(String(1+n.end-n.start)+"@"+String(n.start)),i.initSegment){var s=Object(o.findBox)(r,["moov"])[0],u=s?s.length:null;i.initSegment.setByteRange(String(u)+"@0")}})}}},t.handleManifestParsingError=function(e,t,r,n){this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===l.PlaylistContextType.MANIFEST,url:e.url,reason:r,response:e,context:t,networkDetails:n})},t.handleNetworkError=function(e,t,r,n){void 0===r&&(r=!1),a.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var o=s.ErrorDetails.UNKNOWN,u=!1,c=this.getInternalLoader(e);switch(e.type){case l.PlaylistContextType.MANIFEST:o=r?s.ErrorDetails.MANIFEST_LOAD_TIMEOUT:s.ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case l.PlaylistContextType.LEVEL:o=r?s.ErrorDetails.LEVEL_LOAD_TIMEOUT:s.ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case l.PlaylistContextType.AUDIO_TRACK:o=r?s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case l.PlaylistContextType.SUBTITLE_TRACK:o=r?s.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:s.ErrorDetails.SUBTITLE_LOAD_ERROR,u=!1}c&&this.resetInternalLoader(e.type);var h={type:s.ErrorTypes.NETWORK_ERROR,details:o,fatal:u,url:e.url,loader:c,context:e,networkDetails:t};n&&(h.response=n),this.hls.trigger(i.Events.ERROR,h)},t.handlePlaylistLoaded=function(e,t,r,n){var s=r.type,a=r.level,o=r.id,u=r.groupId,c=r.loader,h=r.levelDetails,d=r.deliveryDirectives;if(!(null!=h&&h.targetduration)){this.handleManifestParsingError(e,r,"invalid target duration",n);return}if(c)switch(h.live&&(c.getCacheAge&&(h.ageHeader=c.getCacheAge()||0),(!c.getCacheAge||isNaN(h.ageHeader))&&(h.ageHeader=0)),s){case l.PlaylistContextType.MANIFEST:case l.PlaylistContextType.LEVEL:this.hls.trigger(i.Events.LEVEL_LOADED,{details:h,level:a||0,id:o||0,stats:t,networkDetails:n,deliveryDirectives:d});break;case l.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(i.Events.AUDIO_TRACK_LOADED,{details:h,id:o||0,groupId:u||"",stats:t,networkDetails:n,deliveryDirectives:d});break;case l.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADED,{details:h,id:o||0,groupId:u||"",stats:t,networkDetails:n,deliveryDirectives:d})}},e}();t.default=d},
24"./src/polyfills/number.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"isFiniteNumber",function(){return n}),r.d(t,"MAX_SAFE_INTEGER",function(){return i});var n=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},i=Number.MAX_SAFE_INTEGER||9007199254740991},
24"./src/remux/aac-helper.ts":function(e,t,r){"use strict";r.r(t);var n=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);else if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);else if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);else if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},e}();t.default=n},
vendor: 6,824 bytes, line 24
24"./src/remux/mp4-generator.ts":function(e,t,r){"use strict";r.r(t);var n=function(){function e(){}return e.init=function(){for(t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var t,r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:r,audio:n};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=s,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,a,u,a,o),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))},e.box=function(e){for(var t=8,r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];for(var s=n.length,a=s;s--;)t+=n[s].byteLength;var o=new Uint8Array(t);for(o[0]=t>>24&255,o[1]=t>>16&255,o[2]=t>>8&255,o[3]=255&t,o.set(e,4),s=0,t=8;s<a;s++)o.set(n[s],t),t+=n[s].byteLength;return o},e.hdlr=function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])},e.mdat=function(t){return e.box(e.types.mdat,t)},e.mdhd=function(t,r){var n=Math.floor((r*=t)/4294967296),i=Math.floor(r%4294967296);return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))},e.moov=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))},e.mvex=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))},e.mvhd=function(t,r){var n=Math.floor((r*=t)/4294967296),i=Math.floor(r%4294967296),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,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 e.box(e.types.mvhd,s)},e.sdtp=function(t){var r,n,i=t.samples||[],s=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,s[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return e.box(e.types.sdtp,s)},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(t){var r,n,i,s=[],a=[];for(r=0;r<t.sps.length;r++)i=(n=t.sps[r]).byteLength,s.push(i>>>8&255),s.push(255&i),s=s.concat(Array.prototype.slice.call(n));for(r=0;r<t.pps.length;r++)i=(n=t.pps[r]).byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));var o=e.box(e.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|t.sps.length].concat(s).concat([t.pps.length]).concat(a))),u=t.width,l=t.height,c=t.pixelRatio[0],h=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,255&u,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,h>>24,h>>16&255,h>>8&255,255&h])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var r=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var r=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},e.stsd=function(t){return"audio"!==t.type?e.box(e.types.stsd,e.STSD,e.avc1(t)):"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t))},e.tkhd=function(t){var r=t.id,n=t.duration*t.timescale,i=t.width,s=t.height,a=Math.floor(n/4294967296),o=Math.floor(n%4294967296);return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,s>>8&255,255&s,0,0]))},e.traf=function(t,r){var n=e.sdtp(t),i=t.id,s=Math.floor(r/4294967296),a=Math.floor(r%4294967296);return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a])),e.trun(t,n.length+16+20+8+16+8+8),n)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,r){var n,i,s,a,o,u,l=t.samples||[],c=l.length,h=12+16*c,d=new Uint8Array(h);for(r+=8+h,d.set(["video"===t.type?1:0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n<c;n++)s=(i=l[n]).duration,a=i.size,o=i.flags,u=i.cts,d.set([s>>>24&255,s>>>16&255,s>>>8&255,255&s,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*n);return e.box(e.types.trun,d)}
24,e.initSegment=function(t){e.types||e.init();var r=e.moov(t),n=new Uint8Array(e.FTYP.byteLength+r.byteLength);return n.set(e.FTYP),n.set(r,e.FTYP.byteLength),n},e}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0,t.default=n},
24"./src/remux/mp4-remuxer.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return p}),r.d(t,"normalizePts",function(){return g}),r.d(t,"flushTextTrackMetadataCueSamples",function(){return v}),r.d(t,"flushTextTrackUserdataCueSamples",function(){return y});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ./aac-helper */ "./src/remux/aac-helper.ts"),s=r(/*! ./mp4-generator */ "./src/remux/mp4-generator.ts"),a=r(/*! ../events */ "./src/events.ts"),o=r(/*! ../errors */ "./src/errors.ts"),u=r(/*! ../utils/logger */ "./src/utils/logger.ts"),l=r(/*! ../types/loader */ "./src/types/loader.ts"),c=r(/*! ../utils/timescale-conversion */ "./src/utils/timescale-conversion.ts");function h(){return(h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var d=null,f=null,p=function(){function e(e,t,r,n){if(void 0===n&&(n=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===d){var i=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);d=i?parseInt(i[1]):0}if(null===f){var s=navigator.userAgent.match(/Safari\/(\d+)/i);f=s?parseInt(s[1]):0}}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){u.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){u.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){u.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},t.getVideoStartPts=function(e){var t=!1,r=e.reduce(function(e,r){var n=r.pts-e;return n<-4294967296?(t=!0,g(e,r.pts)):n>0?e:r.pts},e[0].pts);return t&&u.logger.debug("PTS rollover detected"),r},t.remux=function(e,t,r,n,i,s,a,o){var c=i,h=i,d=e.pid>-1,f=t.pid>-1,p=t.samples.length,m=e.samples.length>0,b=a&&p>0||p>1;if((!d||m)&&(!f||b)||this.ISGenerated||a){this.ISGenerated||(T=this.generateIS(e,t,i));var E,S,T,w,A,x,_,R=this.isVideoContiguous,O=-1;if(b&&(O=function(e){for(var t=0;t<e.length;t++)if(e[t].key)return t;return -1}(t.samples),!R&&this.config.forceKeyFrameOnDiscontinuity)){if(x=!0,O>0){u.logger.warn("[mp4-remuxer]: Dropped "+O+" out of "+p+" video samples due to a missing keyframe");var k=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(O),t.dropped+=O,h+=(t.samples[0].pts-k)/t.inputTimeScale,_=h}else -1===O&&(u.logger.warn("[mp4-remuxer]: No keyframe found out of "+p+" video samples"),x=!1)}if(this.ISGenerated){if(m&&b){var L=this.getVideoStartPts(t.samples),C=(g(e.samples[0].pts,L)-L)/t.inputTimeScale;c+=Math.max(0,C),h+=Math.max(0,-C)}if(m){if(e.samplerate||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),T=this.generateIS(e,t,i)),S=this.remuxAudio(e,c,this.isAudioContiguous,s,f||b||o===l.PlaylistLevelType.AUDIO?h:void 0),b){var I=S?S.endPTS-S.startPTS:0;t.inputTimeScale||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),T=this.generateIS(e,t,i)),E=this.remuxVideo(t,h,R,I)}}else b&&(E=this.remuxVideo(t,h,R,0));E&&(E.firstKeyFrame=O,E.independent=-1!==O,E.firstKeyFramePTS=_)}}return this.ISGenerated&&(r.samples.length&&(A=v(r,i,this._initPTS,this._initDTS)),n.samples.length&&(w=y(n,i,this._initPTS))),{audio:S,video:E,initSegment:T,independent:x,text:w,id3:A}},t.generateIS=function(e,t,r){var i,a,o,u=e.samples,l=t.samples,c=this.typeSupported,h={},d=!Object(n.isFiniteNumber)(this._initPTS),f="audio/mp4";if(d&&(i=a=1/0),e.config&&u.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(c.mpeg?(f="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3")),h.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&c.mpeg?new Uint8Array(0):s.default.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(o=e.inputTimeScale,i=a=u[0].pts-Math.round(o*r))),t.sps&&t.pps&&l.length&&(t.timescale=t.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:s.default.initSegment([t]),metadata:{width:t.width,height:t.height}},d)){o=t.inputTimeScale;var p=this.getVideoStartPts(l),v=Math.round(o*r);a=Math.min(a,g(l[0].dts,p)-v),i=Math.min(i,p-v)}if(Object.keys(h).length)return this.ISGenerated=!0,d&&(this._initPTS=i,this._initDTS=a),{tracks:h,initPTS:i,timescale:o}},t.remuxVideo=function(e,t,r,n){var i,l,p,v=e.inputTimeScale,y=e.samples,b=[],E=y.length,S=this._initPTS,T=this.nextAvcDts,w=8,A=this.videoSampleDuration,x=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,R=!1;if(!r||null===T){var O=y[0].pts-g(y[0].dts,y[0].pts);T=t*v-O}for(var k=0;k<E;k++){var L=y[k];L.pts=g(L.pts-S,T),L.dts=g(L.dts-S,T),L.dts<y[k>0?k-1:k].dts&&(R=!0)}R&&y.sort(function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n}),i=y[0].dts;
vendor: 4,569 bytes, line 24
24var C=(l=y[y.length-1].dts)-i,I=C?Math.round(C/(E-1)):A||e.inputTimeScale/30;if(r){var D=i-T,P=D>I;if(P||D<-1){P?u.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(D,!0)+" ms ("+D+"dts) hole between fragments detected, filling it"):u.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-D,!0)+" ms ("+D+"dts) overlapping between fragments detected"),i=T;var M=y[0].pts-D;y[0].dts=i,y[0].pts=M,u.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(M,!0)+"/"+Object(c.toMsFromMpegTsClock)(i,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(D,!0)+" ms")}}i=Math.max(0,i);for(var U=0,F=0,B=0;B<E;B++){for(var N=y[B],j=N.units,q=j.length,H=0,z=0;z<q;z++)H+=j[z].data.length;F+=H,U+=q,N.length=H,N.dts=Math.max(N.dts,i),x=Math.min(N.pts,x),_=Math.max(N.pts,_)}l=y[E-1].dts;var G=F+4*U+8;try{p=new Uint8Array(G)}catch(K){this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:G,reason:"fail allocating video mdat "+G});return}var W=new DataView(p.buffer);W.setUint32(0,G),p.set(s.default.types.mdat,4);for(var V=!1,$=Number.POSITIVE_INFINITY,Q=Number.POSITIVE_INFINITY,Y=Number.NEGATIVE_INFINITY,X=Number.NEGATIVE_INFINITY,J=0;J<E;J++){for(var Z=y[J],ee=Z.units,et=0,er=0,en=ee.length;er<en;er++){var ei=ee[er],es=ei.data,ea=ei.data.byteLength;W.setUint32(w,ea),w+=4,p.set(es,w),w+=ea,et+=4+ea}var eo=void 0;if(J<E-1)A=y[J+1].dts-Z.dts,eo=y[J+1].pts-Z.pts;else{var eu=this.config,el=J>0?Z.dts-y[J-1].dts:I;if(eo=J>0?Z.pts-y[J-1].pts:I,eu.stretchShortVideoTrack&&null!==this.nextAudioPts){var ec=Math.floor(eu.maxBufferHole*v),eh=(n?x+n*v:this.nextAudioPts)-Z.pts;eh>ec?((A=eh-el)<0?A=el:V=!0,u.logger.log("[mp4-remuxer]: It is approximately "+eh/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=el}else A=el}var ed=Math.round(Z.pts-Z.dts);$=Math.min($,A),Y=Math.max(Y,A),Q=Math.min(Q,eo),X=Math.max(X,eo),b.push(new m(Z.key,A,et,ed))}if(b.length){if(d){if(d<70){var ef=b[0].flags;ef.dependsOn=2,ef.isNonSync=0}}else if(f&&X-Q<Y-$&&I/Y<.025&&0===b[0].cts){u.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var ep=i,eg=0,ev=b.length;eg<ev;eg++){var ey=ep+b[eg].duration,em=ep+b[eg].cts;if(eg<ev-1){var eb=ey+b[eg+1].cts;b[eg].duration=eb-em}else b[eg].duration=eg?b[eg-1].duration:I;b[eg].cts=0,ep=ey}}}console.assert(null!==A,"mp4SampleDuration must be computed"),A=V||!A?I:A,this.nextAvcDts=T=l+A,this.videoSampleDuration=A,this.isVideoContiguous=!0;var eE,eS={data1:s.default.moof(e.sequenceNumber++,i,h({},e,{samples:b})),data2:p,startPTS:x/v,endPTS:(_+A)/v,startDTS:i/v,endDTS:T/v,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:e.dropped};return e.samples=[],e.dropped=0,console.assert(p.length,"MDAT length must not be zero"),eS},t.remuxAudio=function(e,t,r,n,l){var c,d=e.inputTimeScale,f=e.samplerate?e.samplerate:d,p=d/f,v="aac"===e.segmentCodec?1024:1152,y=v*p,b=this._initPTS,E="mp3"===e.segmentCodec&&this.typeSupported.mpeg,S=[],T=void 0!==l,w=e.samples,A=E?0:8,x=this.nextAudioPts||-1,_=t*d;if(this.isAudioContiguous=r=r||w.length&&x>0&&(n&&9e3>Math.abs(_-x)||Math.abs(g(w[0].pts-b,_)-x)<20*y),w.forEach(function(e){e.pts=g(e.pts-b,_)}),!r||x<0){if(!(w=w.filter(function(e){return e.pts>=0})).length)return;x=0===l?0:n&&!T?Math.max(0,_):w[0].pts}if("aac"===e.segmentCodec)for(var R=this.config.maxAudioFramesDrift,O=0,k=x;O<w.length;O++){var L=w[O],C=L.pts,I=C-k,D=Math.abs(1e3*I/d);if(I<=-R*y&&T)0===O&&(u.logger.warn("Audio frame @ "+(C/d).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*I/d)+" ms."),this.nextAudioPts=x=k=C);else if(I>=R*y&&D<1e4&&T){var P=Math.round(I/y);(k=C-P*y)<0&&(P--,k+=y),0===O&&(this.nextAudioPts=x=k),u.logger.warn("[mp4-remuxer]: Injecting "+P+" audio frame @ "+(k/d).toFixed(3)+"s due to "+Math.round(1e3*I/d)+" ms gap.");for(var M=0;M<P;M++){var U=Math.max(k,0),F=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);F||(u.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),F=L.unit.subarray()),w.splice(O,0,{unit:F,pts:U}),k+=y,O++}}L.pts=k,k+=y}for(var B=null,N=null,j=0,q=w.length;q--;)j+=w[q].unit.byteLength;for(var H=0,z=w.length;H<z;H++){var G=w[H],K=G.unit,W=G.pts;if(null!==N)S[H-1].duration=Math.round((W-N)/p);else{if(r&&"aac"===e.segmentCodec&&(W=x),B=W,!(j>0))return;j+=A;try{c=new Uint8Array(j)}catch(V){this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ER
24ROR,fatal:!1,bytes:j,reason:"fail allocating audio mdat "+j});return}!E&&(new DataView(c.buffer).setUint32(0,j),c.set(s.default.types.mdat,4))}c.set(K,A);var $=K.byteLength;A+=$,S.push(new m(!0,v,$,0)),N=W}var Q=S.length;if(Q){var Y=S[S.length-1];this.nextAudioPts=x=N+p*Y.duration;var X=E?new Uint8Array(0):s.default.moof(e.sequenceNumber++,B/p,h({},e,{samples:S}));e.samples=[];var J=B/d,Z=x/d,ee={data1:X,data2:c,startPTS:J,endPTS:Z,startDTS:J,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:Q};return this.isAudioContiguous=!0,console.assert(c.length,"MDAT length must not be zero"),ee}},t.remuxEmptyAudio=function(e,t,r,n){var s=e.inputTimeScale,a=e.samplerate?e.samplerate:s,o=this.nextAudioPts,l=(null!==o?o:n.startDTS*s)+this._initDTS,c=n.endDTS*s+this._initDTS,h=s/a*1024,d=Math.ceil((c-l)/h),f=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(u.logger.warn("[mp4-remuxer]: remux empty Audio"),!f){u.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var p=[],g=0;g<d;g++){var v=l+g*h;p.push({unit:f,pts:v,dts:v})}return e.samples=p,this.remuxAudio(e,t,r,!1)},e}();function g(e,t){var r;if(null===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}function v(e,t,r,n){var i=e.samples.length;if(i){for(var s=e.inputTimeScale,a=0;a<i;a++){var o=e.samples[a];o.pts=g(o.pts-r,t*s)/s,o.dts=g(o.dts-n,t*s)/s}var u=e.samples;return e.samples=[],{samples:u}}}function y(e,t,r){var n=e.samples.length;if(n){for(var i=e.inputTimeScale,s=0;s<n;s++){var a=e.samples[s];a.pts=g(a.pts-r,t*i)/i}e.samples.sort(function(e,t){return e.pts-t.pts});var o=e.samples;return e.samples=[],{samples:o}}}var m=function(e,t,r,n){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=r,this.cts=n,this.flags=new b(e)},b=function(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}},
24"./src/remux/passthrough-remuxer.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ./mp4-remuxer */ "./src/remux/mp4-remuxer.ts"),s=r(/*! ../utils/mp4-tools */ "./src/utils/mp4-tools.ts"),a=r(/*! ../loader/fragment */ "./src/loader/fragment.ts"),o=r(/*! ../utils/logger */ "./src/utils/logger.ts"),u=function(){function e(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){this.initPTS=e,this.lastEndTime=null},t.resetNextTimestamp=function(){this.lastEndTime=null},t.resetInitSegment=function(e,t,r){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t=this.audioCodec,r=this.videoCodec;if(!e||!e.byteLength){this.initTracks=void 0,this.initData=void 0;return}var n=this.initData=Object(s.parseInitSegment)(e);t||(t=l(n.audio,a.ElementaryStreamTypes.AUDIO)),r||(r=l(n.video,a.ElementaryStreamTypes.VIDEO));var i={};n.audio&&n.video?i.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:n.audio?i.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?i.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:o.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},t.remux=function(e,t,r,a,u){var l,c=this.initPTS,h=this.lastEndTime,d={audio:void 0,video:void 0,text:a,id3:r,initSegment:void 0};Object(n.isFiniteNumber)(h)||(h=this.lastEndTime=u||0);var f=t.samples;if(!f||!f.length)return d;var p={initPTS:void 0,timescale:1},g=this.initData;if(g&&g.length||(this.generateInitSegment(f),g=this.initData),!g||!g.length)return o.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);var v=Object(s.getStartDTS)(g,f);Object(n.isFiniteNumber)(c)||(this.initPTS=p.initPTS=c=v-u);var y=Object(s.getDuration)(f,g),m=e?v-c:h,b=m+y;Object(s.offsetStartDTS)(g,f,c),y>0?this.lastEndTime=b:(o.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var E=!!g.audio,S=!!g.video,T="";E&&(T+="audio"),S&&(T+="video");var w={data1:f,startPTS:m,startDTS:m,endPTS:b,endDTS:b,type:T,hasAudio:E,hasVideo:S,nb:1,dropped:0};d.audio="audio"===w.type?w:void 0,d.video="audio"!==w.type?w:void 0,d.initSegment=p;var A=null!=(l=this.initPTS)?l:0;return d.id3=Object(i.flushTextTrackMetadataCueSamples)(r,u,A,A),a.samples.length&&(d.text=Object(i.flushTextTrackUserdataCueSamples)(a,u,A)),d},e}();function l(e,t){var r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r||"hev1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===a.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=u},
vendor: 1,193 bytes, line 24
24"./src/task-loop.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return n});var n=function(){function e(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var t=e.prototype;return t.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},t.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},t.onHandlerDestroyed=function(){},t.hasInterval=function(){return!!this._tickInterval},t.hasNextTick=function(){return!!this._tickTimer},t.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,e),!0)},t.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},t.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},t.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e}()},
24"./src/types/cmcd.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"CMCDVersion",function(){return l}),r.d(t,"CMCDObjectType",function(){return n}),r.d(t,"CMCDStreamingFormat",function(){return i}),r.d(t,"CMCDStreamType",function(){return s});var n,i,s,a,o,u,l=1;(a=n||(n={})).MANIFEST="m",a.AUDIO="a",a.VIDEO="v",a.MUXED="av",a.INIT="i",a.CAPTION="c",a.TIMED_TEXT="tt",a.KEY="k",a.OTHER="o",(o=i||(i={})).DASH="d",o.HLS="h",o.SMOOTH="s",o.OTHER="o",(u=s||(s={})).VOD="v",u.LIVE="l"},
24"./src/types/demuxer.ts":function(e,t,r){"use strict";var n,i;r.r(t),r.d(t,"MetadataSchema",function(){return n}),(i=n||(n={})).audioId3="org.id3",i.dateRange="com.apple.quicktime.HLS",i.emsg="https://aomedia.org/emsg/ID3"},
24"./src/types/level.ts":function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t){var r=e.canSkipUntil,n=e.canSkipDateRanges,i=e.endSN;return r&&(void 0!==t?t-i:0)<r?n?a.v2:a.Yes:(0,a.No)}r.r(t),r.d(t,"HlsSkip",function(){return a}),r.d(t,"getSkipValue",function(){return i}),r.d(t,"HlsUrlParameters",function(){return o}),r.d(t,"Level",function(){return u}),(s=a||(a={})).No="",s.Yes="YES",s.v2="v2";var s,a,o=function(){function e(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}return e.prototype.addDirectives=function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.toString()},e}(),u=function(){var e,t,r;function i(e){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[e.url],this.attrs=e.attrs,this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter(function(e){return e}).join(",").replace(/\.[^.,]+/g,"")}return t=[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(e){var t=e%this.url.length;this._urlId!==t&&(this.details=void 0,this._urlId=t)}}],n(i.prototype,t),r&&n(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}()},
24"./src/types/loader.ts":function(e,t,r){"use strict";var n,i,s,a;r.r(t),r.d(t,"PlaylistContextType",function(){return n}),r.d(t,"PlaylistLevelType",function(){return i}),(s=n||(n={})).MANIFEST="manifest",s.LEVEL="level",s.AUDIO_TRACK="audioTrack",s.SUBTITLE_TRACK="subtitleTrack",(a=i||(i={})).MAIN="main",a.AUDIO="audio",a.SUBTITLE="subtitle"},
24"./src/types/transmuxer.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"ChunkMetadata",function(){return n});var n=function(e,t,r,n,s,a){void 0===n&&(n=0),void 0===s&&(s=-1),void 0===a&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=i(),this.buffering={audio:i(),video:i(),audiovideo:i()},this.level=e,this.sn=t,this.id=r,this.size=n,this.part=s,this.partial=a};function i(){return{start:0,executeStart:0,executeEnd:0,end:0}}},
vendor: 1,496 bytes, line 24
24"./src/utils/attr-list.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"AttrList",function(){return s});var n=/^(\d+)x(\d+)$/,i=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function e(t){for(var r in"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(r)&&(this[r]=t[r])}var t=e.prototype;return t.decimalInteger=function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(!this[e])return null;var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(2*n,2*n+2),16);return r},t.hexadecimalIntegerAsNumber=function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var r=this[e];return r?parseFloat(r):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,r={};for(i.lastIndex=0;null!==(t=i.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r},e}()},"./src/utils/binary-search.ts":function(e,t,r){"use strict";r.r(t),t.default={search:function(e,t){for(var r=0,n=e.length-1,i=null,s=null;r<=n;){var a=t(s=e[i=(r+n)/2|0]);if(a>0)r=i+1;else{if(!(a<0))return s;n=i-1}}return null}}},
24"./src/utils/buffer-helper.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"BufferHelper",function(){return s});var n=r(/*! ./logger */ "./src/utils/logger.ts"),i={length:0,start:function(){return 0},end:function(){return 0}},s=function(){function e(){}return e.isBuffered=function(t,r){try{if(t){for(var n=e.getBuffered(t),i=0;i<n.length;i++)if(r>=n.start(i)&&r<=n.end(i))return!0}}catch(s){}return!1},e.bufferInfo=function(t,r,n){try{if(t){var i,s=e.getBuffered(t),a=[];for(i=0;i<s.length;i++)a.push({start:s.start(i),end:s.end(i)});return this.bufferedInfo(a,r,n)}}catch(o){}return{len:0,start:r,end:r,nextStart:void 0}},e.bufferedInfo=function(e,t,r){t=Math.max(0,t),e.sort(function(e,t){var r=e.start-t.start;return r||t.end-e.end});var n,i=[];if(r)for(var s=0;s<e.length;s++){var a=i.length;if(a){var o=i[a-1].end;e[s].start-o<r?e[s].end>o&&(i[a-1].end=e[s].end):i.push(e[s])}else i.push(e[s])}else i=e;for(var u=0,l=t,c=t,h=0;h<i.length;h++){var d=i[h].start,f=i[h].end;if(t+r>=d&&t<f)l=d,u=(c=f)-t;else if(t+r<d){n=d;break}}return{len:u,start:l||0,end:c||0,nextStart:n}},e.getBuffered=function(e){try{return e.buffered}catch(t){return n.logger.log("failed to get media.buffered",t),i}},e}()},
vendor: 10,317 bytes, line 24
24"./src/utils/cea-608-parser.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"Row",function(){return y}),r.d(t,"CaptionScreen",function(){return m});var n,i,s=r(/*! ../utils/logger */ "./src/utils/logger.ts"),a={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},o=function(e){var t=e;return a.hasOwnProperty(e)&&(t=a[e]),String.fromCharCode(t)},u={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},l={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},d=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];(i=n||(n={}))[i.ERROR=0]="ERROR",i[i.TEXT=1]="TEXT",i[i.WARNING=2]="WARNING",i[i.INFO=2]="INFO",i[i.DEBUG=3]="DEBUG",i[i.DATA=3]="DATA";var f=function(){function e(){this.time=null,this.verboseLevel=n.ERROR}return e.prototype.log=function(e,t){this.verboseLevel>=e&&s.logger.log(this.time+" ["+e+"] "+t)},e}(),p=function(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r].toString(16));return t},g=function(){function e(e,t,r,n,i){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=r||!1,this.background=n||"black",this.flash=i||!1}var t=e.prototype;return t.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.setStyles=function(e){for(var t=["foreground","underline","italics","background","flash"],r=0;r<t.length;r++){var n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}},t.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.equals=function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},t.copy=function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},t.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},e}(),v=function(){function e(e,t,r,n,i,s){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new g(t,r,n,i,s)}var t=e.prototype;return t.reset=function(){this.uchar=" ",this.penState.reset()},t.setChar=function(e,t){this.uchar=e,this.penState.copy(t)},t.setPenState=function(e){this.penState.copy(e)},t.equals=function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},t.copy=function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},t.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},e}(),y=function(){function e(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var t=0;t<100;t++)this.chars.push(new v);this.logger=e,this.pos=0,this.currPenState=new g}var t=e.prototype;return t.equals=function(e){for(var t=!0,r=0;r<100;r++)if(!this.chars[r].equals(e.chars[r])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<100;t++)this.chars[t].copy(e.chars[t])},t.isEmpty=function(){for(var e=!0,t=0;t<100;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},t.setCursor=function(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)},t.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.insertChar=function(e){e>=144&&this.backSpace();var t=o(e);if(this.pos>=100){this.logger.log(n.ERROR,"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)},t.clearFromPos=function(e){var t;for(t=e;t<100;t++)this.chars[t].reset()},t.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.getTextString=function(){for(var e=[],t=!0,r=0;r<100;r++){var n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")},t.setPenStyles=function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)},e}(),m=function(){function e(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var t=0;t<15;t++)this.rows.push(new y(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var t=e.prototype;return t.reset=function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},t.equals=function(e){for(var t=!0,r=0;r<15;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},t.isEmpty=function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},t.backSpace=function(){this.rows[this.currRow].backSpace()},t.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.insertChar=function(e){this.rows[this.currRow].insertChar(e)},t.setPen=function(e){this.rows[this.currRow].setPenStyles(e)},t.moveCursor=function(e){this.rows[this.currRow].moveCursor(e)},t.setCursor=function(e){this.logger.log(n.INFO,"setCursor: "+e),this.rows[this.currRow].setCursor(e)},t.setPAC=function(e){this.logger.log(n.INFO,"pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var r=0;r<15;r++)this.rows[r].clear();var i=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){var a=s.rows[i].cueStartTime,o=this.logger.time;if(a&&null!==o&&a<o)for(var u=0;u<this.nrRollUpRows;u++)this.rows[t-this.nrRollUpRows+u+1].copy(s.rows[i+u])}}this.currRow=t;var l=this.rows[this.currRow];if(null!==e.indent){var c=e.indent;l.setCursor(e.indent),e.color=l.chars[Math.max(c-1,0)].penState.foreground}var h={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(h)},t.setBkgData=function(e){this.logger.log(n.INFO,"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},t.setRollUpRows=function(e){this.nrRollUpRows=e},t.rollUp=function(){if(null===this.nrRollUpRows){this.logger.log(n.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(n.TEXT,this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(n.INFO,"Rolling up")},t.getDisplayText=function(e){e=e||!1;for(var t=[],r="",n=-1,i=0;i<15;i++){var s=this.rows[i].getTextString();s&&(n=i+1,e?t.push("Row "+n+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},t.getTextAndFormat=function(){return this.rows},e}(),b=function(){function e(e,t,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new m(r),this.nonDisplayedMemory=new m(r),this.lastOutputScreen=new m(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(n.INFO,"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars=function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,r+": "+this.writeScreen.getDisplayText(!0)),("MODE_PAINT-ON"===this.mode||"MODE_ROLL-UP"===this.mode)&&(this.logger.log(n.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},t.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.ccBS=function(){this.logger.log(n.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.ccAOF=function(){},t.ccAON=function(){},t.ccDER=function(){this.logger.log(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.ccRU=function(e){this.logger.log(n.INFO,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},t.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct 
24Captioning"),this.setMode("MODE_PAINT-ON")},t.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},t.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},t.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.ccEOC=function(){if(this.logger.log(n.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(n.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.ccTO=function(e){this.logger.log(n.INFO,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},t.ccMIDROW=function(e){var t={flash:!1};t.underline=e%2==1,t.italics=e>=46,t.italics?t.foreground="white":t.foreground=["white","green","blue","cyan","red","yellow","magenta"][Math.floor(e/2)-16],this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&!this.displayedMemory.isEmpty()&&(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e)},e}(),E=function(){function e(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var n=new f;this.channels=[null,new b(e,t,n),new b(e+1,r,n)],this.cmdHistory=w(),this.logger=n}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var r,i,s,a=!1;this.logger.time=e;for(var o=0;o<t.length;o+=2)if(i=127&t[o],s=127&t[o+1],0!==i||0!==s){if(this.logger.log(n.DATA,"["+p([t[o],t[o+1]])+"] -> ("+p([i,s])+")"),(r=this.parseCmd(i,s))||(r=this.parseMidrow(i,s)),r||(r=this.parsePAC(i,s)),r||(r=this.parseBackgroundAttributes(i,s)),!r&&(a=this.parseChars(i,s))){var u=this.currentChannel;u&&u>0?this.channels[u].insertChars(a):this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}r||a||this.logger.log(n.WARNING,"Couldn't parse cleaned data "+p([i,s])+" orig: "+p([t[o],t[o+1]]))}},t.parseCmd=function(e,t){var r=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(T(e,t,r))return S(null,null,r),this.logger.log(n.DEBUG,"Repeated command ("+p([e,t])+") is dropped"),!0;var i=20===e||21===e||23===e?1:2,s=this.channels[i];return 20===e||21===e||28===e||29===e?32===t?s.ccRCL():33===t?s.ccBS():34===t?s.ccAOF():35===t?s.ccAON():36===t?s.ccDER():37===t?s.ccRU(2):38===t?s.ccRU(3):39===t?s.ccRU(4):40===t?s.ccFON():41===t?s.ccRDC():42===t?s.ccTR():43===t?s.ccRTD():44===t?s.ccEDM():45===t?s.ccCR():46===t?s.ccENM():47===t&&s.ccEOC():s.ccTO(t-32),S(e,t,r),this.currentChannel=i,!0},t.parseMidrow=function(e,t){var r=0;if((17===e||25===e)&&t>=32&&t<=47){if((r=17===e?1:2)!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[r];return!!i&&(i.ccMIDROW(t),this.logger.log(n.DEBUG,"MIDROW ("+p([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var r,n=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(T(e,t,n))return S(null,null,n),!0;var i=e<=23?1:2;r=t>=64&&t<=95?1===i?u[e]:c[e]:1===i?l[e]:h[e];var s=this.channels[i];
24return!!s&&(s.setPAC(this.interpretPAC(r,t)),S(e,t,n),this.currentChannel=i,!0)},t.interpretPAC=function(e,t){var r,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=(1&r)==1,r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},t.parseChars=function(e,t){var r,i,s=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),a>=17&&a<=19?(i=17===a?t+80:18===a?t+112:t+144,this.logger.log(n.INFO,"Special char '"+o(i)+"' in channel "+r),s=[i]):e>=32&&e<=127&&(s=0===t?[e]:[e,t]),s){var u=p(s);this.logger.log(n.DEBUG,"Char codes =  "+u.join(",")),S(e,t,this.cmdHistory)}return s},t.parseBackgroundAttributes=function(e,t){if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var r,n={};return 16===e||24===e?(r=Math.floor((t-32)/2),n.background=d[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),this.channels[e<=23?1:2].setBkgData(n),S(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;e<Object.keys(this.channels).length;e++){var t=this.channels[e];t&&t.reset()}this.cmdHistory=w()},t.cueSplitAtTime=function(e){for(var t=0;t<this.channels.length;t++){var r=this.channels[t];r&&r.cueSplitAtTime(e)}},e}();function S(e,t,r){r.a=e,r.b=t}function T(e,t,r){return r.a===e&&r.b===t}function w(){return{a:null,b:null}}t.default=E},
24"./src/utils/codecs.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"isCodecType",function(){return i}),r.d(t,"isCodecSupportedInMp4",function(){return s});var n={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function i(e,t){var r=n[t];return!!r&&!0===r[e.slice(0,4)]}function s(e,t){return MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},
24"./src/utils/cues.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ./vttparser */ "./src/utils/vttparser.ts"),i=r(/*! ./webvtt-parser */ "./src/utils/webvtt-parser.ts"),s=r(/*! ./texttrack-utils */ "./src/utils/texttrack-utils.ts"),a=/\s/;t.default={newCue:function(e,t,r,o){for(var u,l,c,h,d,f=[],p=self.VTTCue||self.TextTrackCue,g=0;g<o.rows.length;g++)if(u=o.rows[g],c=!0,h=0,d="",!u.isEmpty()){for(var v=0;v<u.chars.length;v++)a.test(u.chars[v].uchar)&&c?h++:(d+=u.chars[v].uchar,c=!1);u.cueStartTime=t,t===r&&(r+=1e-4),h>=16?h--:h++;var y=Object(n.fixLineBreaks)(d.trim()),m=Object(i.generateCueId)(t,r,y);e&&e.cues&&e.cues.getCueById(m)||((l=new p(t,r,y)).id=m,l.line=g+1,l.align="left",l.position=10+Math.min(80,10*Math.floor(8*h/32)),f.push(l))}return e&&f.length&&(f.sort(function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line}),f.forEach(function(t){return Object(s.addCueToTrack)(e,t)})),f}}},
24"./src/utils/discontinuities.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"findFirstFragWithCC",function(){return a}),r.d(t,"shouldAlignOnDiscontinuities",function(){return o}),r.d(t,"findDiscontinuousReferenceFrag",function(){return u}),r.d(t,"adjustSlidingStart",function(){return c}),r.d(t,"alignStream",function(){return h}),r.d(t,"alignPDT",function(){return d}),r.d(t,"alignFragmentByPDTDelta",function(){return f}),r.d(t,"alignMediaPlaylistByPDT",function(){return p});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ./logger */ "./src/utils/logger.ts"),s=r(/*! ../controller/level-helper */ "./src/controller/level-helper.ts");function a(e,t){for(var r=null,n=0,i=e.length;n<i;n++){var s=e[n];if(s&&s.cc===t){r=s;break}}return r}function o(e,t,r){return!!t.details&&(!!(r.endCC>r.startCC)||!!e&&!!(e.cc<r.startCC))}function u(e,t){var r=e.fragments,n=t.fragments;if(!n.length||!r.length){i.logger.log("No fragments to align");return}var s=a(r,n[0].cc);if(!s||s&&!s.startPTS){i.logger.log("No frag in previous level to align on");return}return s}function l(e,t){if(e){var r=e.start+t;e.start=e.startPTS=r,e.endPTS=r+e.duration}}function c(e,t){for(var r=t.fragments,n=0,i=r.length;n<i;n++)l(r[n],e);t.fragmentHint&&l(t.fragmentHint,e),t.alignedSliding=!0}function h(e,t,r){t&&(function(e,t,r){if(o(e,r,t)){var s=u(r.details,t);s&&Object(n.isFiniteNumber)(s.start)&&(i.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),c(s.start,t))}}(e,r,t),!r.alignedSliding&&t.details&&d(r,t.details),r.alignedSliding||!t.details||r.skippedSegments||Object(s.adjustSliding)(t.details,r))}function d(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var r=t.fragments[0].programDateTime,s=e.fragments[0].programDateTime,a=(s-r)/1e3+t.fragments[0].start;a&&Object(n.isFiniteNumber)(a)&&(i.logger.log("Adjusting PTS using programDateTime delta "+(s-r)+"ms, sliding:"+a.toFixed(3)+" "+e.url+" "),c(a,e))}}function f(e,t){var r=e.programDateTime;if(r){var n=(r-t)/1e3;e.start=e.startPTS=n,e.endPTS=n+e.duration}}function p(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var r,n=t.fragments[0].programDateTime-1e3*t.fragments[0].start;e.fragments.forEach(function(e){f(e,n)}),e.fragmentHint&&f(e.fragmentHint,n),e.alignedSliding=!0}}},
vendor: 1,701 bytes, line 24
24"./src/utils/ewma-bandwidth-estimator.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../utils/ewma */ "./src/utils/ewma.ts"),i=function(){function e(e,t,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new n.default(e),this.fast_=new n.default(t)}var t=e.prototype;return t.update=function(e,t){var r=this.slow_,i=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new n.default(e,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==t&&(this.fast_=new n.default(t,i.getEstimate(),i.getTotalWeight()))},t.sample=function(e,t){var r=(e=Math.max(e,this.minDelayMs_))/1e3,n=8*t/r;this.fast_.sample(r,n),this.slow_.sample(r,n)},t.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.destroy=function(){},e}();t.default=i},"./src/utils/ewma.ts":function(e,t,r){"use strict";r.r(t);var n=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}var t=e.prototype;return t.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e}();t.default=n},
24"./src/utils/fetch-loader.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"fetchSupported",function(){return h});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ../loader/load-stats */ "./src/loader/load-stats.ts"),s=r(/*! ../demux/chunk-cache */ "./src/demux/chunk-cache.ts");function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){var r;if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}function o(e,t,r){return(o=!function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&u(i,r.prototype),i}:Reflect.construct.bind()).apply(null,arguments)}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function h(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}var d=function(){function e(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||f,this.controller=new self.AbortController,this.stats=new i.LoadStats}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},t.abortInternal=function(){var e=this.response;e&&e.ok||(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,r){var i,s,a,o=this,u=this.stats;if(u.loading.start)throw Error("Loader can only be used once.");u.loading.start=self.performance.now();var l=(i=e,s=this.controller.signal,a={method:"GET",mode:"cors",credentials:"same-origin",signal:s,headers:new self.Headers(c({},i.headers))},i.rangeEnd&&a.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),a),h=r.onProgress,d="arraybuffer"===e.responseType,f=d?"byteLength":"length";this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,l),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){o.abortInternal(),r.onTimeout(u,e,o.response)},t.timeout),self.fetch(this.request).then(function(r){if(o.response=o.loader=r,!r.ok){var i=r.status,s=r.statusText;throw new p(s||"fetch, bad network response",i,r)}return(u.loading.first=Math.max(self.performance.now(),u.loading.start),u.total=parseInt(r.headers.get("Content-Length")||"0"),h&&Object(n.isFiniteNumber)(t.highWaterMark))?o.loadProgressively(r,u,e,t.highWaterMark,h):d?r.arrayBuffer():r.text()}).then(function(i){var s=o.response;self.clearTimeout(o.requestTimeout),u.loading.end=Math.max(self.performance.now(),u.loading.first),u.loaded=u.total=i[f];var a={url:s.url,data:i};h&&!Object(n.isFiniteNumber)(t.highWaterMark)&&h(u,e,i,s),r.onSuccess(a,u,e,s)}).catch(function(t){if(self.clearTimeout(o.requestTimeout),!u.aborted){var n=t&&t.code||0,i=t?t.message:null;r.onError({code:n,text:i},e,t?t.details:null)}})},t.getCacheAge=function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e},t.loadProgressively=function(e,t,r,n,i){void 0===n&&(n=0);var a=new s.default,o=e.body.getReader();
24return function s(){return o.read().then(function(o){if(o.done)return a.dataLength&&i(t,r,a.flush(),e),Promise.resolve(new ArrayBuffer(0));var u=o.value,l=u.length;return t.loaded+=l,l<n||a.dataLength?(a.push(u),a.dataLength>=n&&i(t,r,a.flush(),e)):i(t,r,u,e),s()}).catch(function(){return Promise.reject()})}()},e}();function f(e,t){return new self.Request(e.url,t)}var p=function(e){var t,r;function n(t,r,n){var i;return(i=e.call(this,t)||this).code=void 0,i.details=void 0,i.code=r,i.details=n,i}return(t=n).prototype=Object.create(e.prototype),t.prototype.constructor=t,u(t,e),n}(a(Error));t.default=d},
24"./src/utils/imsc1-ttml-parser.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"IMSC1_CODEC",function(){return c}),r.d(t,"parseIMSC1",function(){return p});var n=r(/*! ./mp4-tools */ "./src/utils/mp4-tools.ts"),i=r(/*! ./vttparser */ "./src/utils/vttparser.ts"),s=r(/*! ./vttcue */ "./src/utils/vttcue.ts"),a=r(/*! ../demux/id3 */ "./src/demux/id3.ts"),o=r(/*! ./timescale-conversion */ "./src/utils/timescale-conversion.ts"),u=r(/*! ./webvtt-parser */ "./src/utils/webvtt-parser.ts");function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var c="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(e,t,r,i,c){var h=Object(n.findBox)(new Uint8Array(e),["mdat"]);if(0===h.length){c(Error("Could not parse IMSC1 mdat"));return}var d=h.map(function(e){return Object(a.utf8ArrayToStr)(e)}),p=Object(o.toTimescaleFromScale)(t,1,r);try{d.forEach(function(e){return i(function(e,t){var r=new DOMParser().parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!r)throw Error("Invalid ttml");var n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(n).reduce(function(e,t){return e[t]=r.getAttribute("ttp:"+t)||n[t],e},{}),a="preserve"!==r.getAttribute("xml:space"),o=v(g(r,"styling","style")),c=v(g(r,"layout","region")),h=g(r,"body","[begin]");return[].map.call(h,function(e){var r=function e(t,r){return[].slice.call(t.childNodes).reduce(function(t,n,i){var s;return"br"===n.nodeName&&i?t+"\n":null!==(s=n.childNodes)&&void 0!==s&&s.length?e(n,r):r?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}(e,a);if(!r||!e.hasAttribute("begin"))return null;var n=b(e.getAttribute("begin"),i),h=b(e.getAttribute("dur"),i),d=b(e.getAttribute("end"),i);if(null===n)throw m(e);if(null===d){if(null===h)throw m(e);d=n+h}var p=new s.default(n-t,d-t,r);p.id=Object(u.generateCueId)(p.startTime,p.endTime,p.text);var g,v,E,S,T,w,A=c[e.getAttribute("region")],x=o[e.getAttribute("style")];p.position=10,p.size=80;var _=(g=A,v=x,E=o,S="http://www.w3.org/ns/ttml#styling",T=null,w=null!=g&&g.hasAttribute("style")?g.getAttribute("style"):null,w&&E.hasOwnProperty(w)&&(T=E[w]),["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce(function(e,t){var r=y(v,S,t)||y(g,S,t)||y(T,S,t);return r&&(e[t]=r),e},{})),R=_.textAlign;if(R){var O=f[R];O&&(p.lineAlign=O),p.align=R}return l(p,_),p}).filter(function(e){return null!==e})}(e,p))})}catch(E){c(E)}}function g(e,t,r){var n=e.getElementsByTagName(t)[0];return n?[].slice.call(n.querySelectorAll(r)):[]}function v(e){return e.reduce(function(e,t){var r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function y(e,t,r){return e&&e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function m(e){return Error("Could not parse ttml timestamp "+e)}function b(e,t){if(!e)return null;var r,n,s,a,o=Object(i.parseTimeStamp)(e);return null===o&&(h.test(e)?(r=e,n=t,s=h.exec(r),a=(0|s[4])+(0|s[5])/n.subFrameRate,o=(0|s[1])*3600+(0|s[2])*60+(0|s[3])+a/n.frameRate):d.test(e)&&(o=function(e,t){var r=d.exec(e),n=Number(r[1]),i=r[2];switch(i){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}(e,t))),o}},
24"./src/utils/logger.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"enableLogs",function(){return a}),r.d(t,"logger",function(){return o});var n=function(){},i={trace:n,debug:n,log:n,warn:n,info:n,error:n},s=i;function a(e){if(self.console&&!0===e||"object"==typeof e){!function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];r.forEach(function(t){var r,i;s[t]=e[t]?e[t].bind(e):(i=self.console[t])?i.bind(self.console,"["+t+"] >"):n})}(e,"debug","log","info","warn","error");try{s.log()}catch(t){s=i}}else s=i}var o=s},
24"./src/utils/mediakeys-helper.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"KeySystems",function(){return i}),r.d(t,"requestMediaKeySystemAccess",function(){return s}),(n=i||(i={})).WIDEVINE="com.widevine.alpha",n.PLAYREADY="com.microsoft.playready";var n,i,s="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null},
24"./src/utils/mediasource-helper.ts":function(e,t,r){"use strict";function n(){return self.MediaSource||self.WebKitMediaSource}r.r(t),r.d(t,"getMediaSource",function(){return n})},
24"./src/utils/mp4-tools.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"RemuxerTrackIdConfig",function(){return o}),r.d(t,"bin2str",function(){return u}),r.d(t,"readUint16",function(){return l}),r.d(t,"readUint32",function(){return c}),r.d(t,"readSint32",function(){return h}),r.d(t,"writeUint32",function(){return d}),r.d(t,"findBox",function(){return f}),r.d(t,"parseSegmentIndex",function(){return p}),r.d(t,"parseInitSegment",function(){return g}),r.d(t,"getStartDTS",function(){return v}),r.d(t,"getDuration",function(){return y}),r.d(t,"computeRawDurationFromSamples",function(){return m}),r.d(t,"offsetStartDTS",function(){return b}),r.d(t,"segmentValidRange",function(){return E}),r.d(t,"appendUint8Array",function(){return S}),r.d(t,"parseSamples",function(){return T}),r.d(t,"parseSEIMessageFromNALu",function(){return A}),r.d(t,"parseEmsg",function(){return x});var n=r(/*! ./typed-array */ "./src/utils/typed-array.ts"),i=r(/*! ../loader/fragment */ "./src/loader/fragment.ts"),s=r(/*! ../demux/id3 */ "./src/demux/id3.ts"),a=[].push,o={video:1,audio:2,id3:3,text:4};function u(e){return String.fromCharCode.apply(null,e)}function l(e,t){var r=e[t]<<8|e[t+1];return r<0?65536+r:r}function c(e,t){var r=h(e,t);return r<0?4294967296+r:r}function h(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function d(e,t,r){e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function f(e,t){var r=[];if(!t.length)return r;for(var n=e.byteLength,i=0;i<n;){var s=c(e,i),o=u(e.subarray(i+4,i+8)),l=s>1?i+s:n;if(o===t[0]){if(1===t.length)r.push(e.subarray(i+8,l));else{var h=f(e.subarray(i+8,l),t.slice(1));h.length&&a.apply(r,h)}}i=l}return r}function p(e){var t=[],r=e[0],n=8,i=c(e,n);n+=4,0===r?n+=8:n+=16,n+=2;var s=e.length+0,a=l(e,n);n+=2;for(var o=0;o<a;o++){var u=n,h=c(e,u);u+=4;var d=2147483647&h;if(1==(2147483648&h)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var f=c(e,u);u+=4,t.push({referenceSize:d,subsegmentDuration:f,info:{duration:f/i,start:s,end:s+d-1}}),s+=d,u+=4,n=u}return{earliestPresentationTime:0,timescale:i,version:r,referencesCount:a,references:t}}function g(e){for(var t=[],r=f(e,["moov","trak"]),n=0;n<r.length;n++){var s=r[n],a=f(s,["tkhd"])[0];if(a){var o=a[0],l=0===o?12:20,h=c(a,l),d=f(s,["mdia","mdhd"])[0];if(d){l=0===(o=d[0])?12:20;var p=c(d,l),g=f(s,["mdia","hdlr"])[0];if(g){var v=u(g.subarray(8,12)),y={soun:i.ElementaryStreamTypes.AUDIO,vide:i.ElementaryStreamTypes.VIDEO}[v];if(y){var m=f(s,["mdia","minf","stbl","stsd"])[0],b=void 0;m&&(b=u(m.subarray(12,16))),t[h]={timescale:p,type:y},t[y]={timescale:p,id:h,codec:b}}}}}}return f(e,["moov","mvex","trex"]).forEach(function(e){var r=t[c(e,4)];r&&(r.default={duration:c(e,12),flags:c(e,20)})}),t}function v(e,t){return f(t,["moof","traf"]).reduce(function(t,r){var n=f(r,["tfdt"])[0],i=n[0],s=f(r,["tfhd"]).reduce(function(t,r){var s=e[c(r,4)];if(s){var a=c(n,4);1===i&&(a*=4294967296,a+=c(n,8));var o=a/(s.timescale||9e4);if(isFinite(o)&&(null===t||o<t))return o}return t},null);return null!==s&&isFinite(s)&&(null===t||s<t)?s:t},null)||0}function y(e,t){for(var r=0,n=0,s=0,a=f(e,["moof","traf"]),o=0;o<a.length;o++){var u=a[o],l=f(u,["tfhd"])[0],h=t[c(l,4)];if(h){var d=h.default,g=c(l,0)|(null==d?void 0:d.flags),v=null==d?void 0:d.duration;8&g&&(v=2&g?c(l,12):c(l,8));for(var y=h.timescale||9e4,b=f(u,["trun"]),E=0;E<b.length;E++){if(!(r=m(b[E]))&&v){var S=c(b[E],4);r=v*S}h.type===i.ElementaryStreamTypes.VIDEO?n+=r/y:h.type===i.ElementaryStreamTypes.AUDIO&&(s+=r/y)}}}if(0===n&&0===s){for(var T=0,w=f(e,["sidx"]),A=0;A<w.length;A++){var x=p(w[A]);null!=x&&x.references&&(T+=x.references.reduce(function(e,t){return e+t.info.duration||0},0))}return T}return n||s}function m(e){var t=c(e,0),r=8;1&t&&(r+=4),4&t&&(r+=4);for(var n=0,i=c(e,4),s=0;s<i;s++){if(256&t){var a=c(e,r);n+=a,r+=4}512&t&&(r+=4),1024&t&&(r+=4),2048&t&&(r+=4)}return n}function b(e,t,r){f(t,["moof","traf"]).forEach(function(t){f(t,["tfhd"]).forEach(function(n){var i=e[c(n,4)];if(i){var s=i.timescale||9e4;f(t,["tfdt"]).forEach(function(e){var t=e[0],n=c(e,4);if(0===t)n-=r*s,n=Math.max(n,0),d(e,4,n);else{n*=4294967296,n+=c(e,8),n-=r*s;var i=Math.floor((n=Math.max(n,0))/4294967296),a=Math.floor(n%4294967296);d(e,4,i),d(e,8,a)}})}})})}function E(e){var t={valid:null,remainder:null},r=f(e,["moof"]);if(!r)return t;if(r.length<2)return t.remainder=e,t;var i=r[r.length-1];return t.valid=Object(n.sliceUint8)(e,0,i.byteOffset-8),t.remainder=Object(n.sliceUint8)(e,i.byteOffset-8),t}
24function S(e,t){var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function T(e,t){var r=[],n=t.samples,s=t.timescale,a=t.id,o=!1;return f(n,["moof"]).map(function(u){var l=u.byteOffset-8;f(u,["traf"]).map(function(u){var d=f(u,["tfdt"]).map(function(e){var t=e[0],r=c(e,4);return 1===t&&(r*=4294967296,r+=c(e,8)),r/s})[0];return void 0!==d&&(e=d),f(u,["tfhd"]).map(function(d){var p=c(d,4),g=16777215&c(d,0),v=0,y=0,m=8;p===a&&((1&g)!=0&&(m+=8),(2&g)!=0&&(m+=4),(8&g)!=0&&(v=c(d,m),m+=4),(16&g)!=0&&(y=c(d,m),m+=4),(32&g)!=0&&(m+=4),"video"===t.type&&(o=function(e){if(!e)return!1;var t=e.indexOf("."),r=t<0?e:e.substring(0,t);return"hvc1"===r||"hev1"===r||"dvh1"===r||"dvhe"===r}(t.codec)),f(u,["trun"]).map(function(a){var u=a[0],d=16777215&c(a,0),f=0,p=(256&d)!=0,g=0,m=(512&d)!=0,b=0,E=(1024&d)!=0,S=(2048&d)!=0,T=0,x=c(a,4),_=8;(1&d)!=0&&(f=c(a,_),_+=4),(4&d)!=0&&(_+=4);for(var R=f+l,O=0;O<x;O++){if(p?(g=c(a,_),_+=4):g=v,m?(b=c(a,_),_+=4):b=y,E&&(_+=4),S&&(T=0===u?c(a,_):h(a,_),_+=4),t.type===i.ElementaryStreamTypes.VIDEO)for(var k=0;k<b;){var L=c(n,R),C=31&n[R+=4];if(w(o,C)){var I=n.subarray(R,R+L);A(I,e+T/s,r)}R+=L,k+=L+4}e+=g/s}}))})})}),r}function w(e,t){return e?39===t||40===t:6===t}function A(e,t,r){var n=function(e){for(var t=e.byteLength,r=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(0===r.length)return e;var i=t-r.length,s=new Uint8Array(i),a=0;for(n=0;n<i;a++,n++)a===r[0]&&(a++,r.shift()),s[n]=e[a];return s}(e),i=0;i++;for(var a=0,o=0,u=!1,h=0;i<n.length;){a=0;do{if(i>=n.length)break;a+=h=n[i++]}while(255===h);o=0;do{if(i>=n.length)break;o+=h=n[i++]}while(255===h);var d=n.length-i;if(!u&&4===a&&i<n.length){if(u=!0,181===n[i++]){var f=l(n,i);if(i+=2,49===f){var p=c(n,i);if(i+=4,1195456820===p){var g=n[i++];if(3===g){var v=n[i++],y=31&v,m=64&v,b=m?2+3*y:0,E=new Uint8Array(b);if(m){E[0]=v;for(var S=1;S<b;S++)E[S]=n[i++]}r.push({type:g,payloadType:a,pts:t,bytes:E})}}}}}else if(5===a&&o<d){if(u=!0,o>16){for(var T=[],w=0;w<16;w++){var A=n[i++].toString(16);T.push(1==A.length?"0"+A:A),(3===w||5===w||7===w||9===w)&&T.push("-")}for(var x=o-16,_=new Uint8Array(x),R=0;R<x;R++)_[R]=n[i++];r.push({payloadType:a,pts:t,uuid:T.join(""),userData:Object(s.utf8ArrayToStr)(_),userDataBytes:_})}}else if(o<d)i+=o;else if(o>d)break}}function x(e){var t=e[0],r="",n="",i=0,s=0,a=0,o=0,l=0,h=0;if(0===t){for(;"\0"!==u(e.subarray(h,h+1));)r+=u(e.subarray(h,h+1)),h+=1;for(r+=u(e.subarray(h,h+1)),h+=1;"\0"!==u(e.subarray(h,h+1));)n+=u(e.subarray(h,h+1)),h+=1;n+=u(e.subarray(h,h+1)),h+=1,i=c(e,12),s=c(e,16),o=c(e,20),l=c(e,24),h=28}else if(1===t){h+=4,i=c(e,h);var d=c(e,h+=4),f=c(e,h+=4);for(h+=4,Number.isSafeInteger(a=4294967296*d+f)||(a=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=c(e,h),h+=4,l=c(e,h),h+=4;"\0"!==u(e.subarray(h,h+1));)r+=u(e.subarray(h,h+1)),h+=1;for(r+=u(e.subarray(h,h+1)),h+=1;"\0"!==u(e.subarray(h,h+1));)n+=u(e.subarray(h,h+1)),h+=1;n+=u(e.subarray(h,h+1)),h+=1}var p=e.subarray(h,e.byteLength);return{schemeIdUri:r,value:n,timeScale:i,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:p}}},
24"./src/utils/output-filter.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return n});var n=function(){function e(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}var t=e.prototype;return t.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},t.newCue=function(e,t,r){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[],this.startTime=null},e}()},
24"./src/utils/texttrack-utils.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"sendAddTrackEvent",function(){return i}),r.d(t,"addCueToTrack",function(){return s}),r.d(t,"clearCurrentCues",function(){return a}),r.d(t,"removeCuesInRange",function(){return o}),r.d(t,"getCuesInRange",function(){return u});var n=r(/*! ./logger */ "./src/utils/logger.ts");function i(e,t){var r;try{r=new Event("addtrack")}catch(n){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function s(e,t){var r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw Error("addCue is failed for: "+t)}catch(s){n.logger.debug("[texttrack-utils]: "+s);var i=new self.TextTrackCue(t.startTime,t.endTime,t.text);i.id=t.id,e.addCue(i)}"disabled"===r&&(e.mode=r)}function a(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function o(e,t,r,n){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var s=u(e.cues,t,r),a=0;a<s.length;
vendor: 491 bytes, line 24
24a++)(!n||n(s[a]))&&e.removeCue(s[a]);"disabled"===i&&(e.mode=i)}function u(e,t,r){var n=[],i=function(e,t){if(t<e[0].startTime)return 0;var r=e.length-1;if(t>e[r].endTime)return -1;for(var n=0,i=r;n<=i;){var s=Math.floor((i+n)/2);if(t<e[s].startTime)i=s-1;else{if(!(t>e[s].startTime)||!(n<r))return s;n=s+1}}return e[n].startTime-t<t-e[i].startTime?n:i}(e,t);if(i>-1)for(var s=i,a=e.length;s<a;s++){var o=e[s];if(o.startTime>=t&&o.endTime<=r)n.push(o);else if(o.startTime>r)break}return n}},
24"./src/utils/time-ranges.ts":function(e,t,r){"use strict";r.r(t),t.default={toString:function(e){for(var t="",r=e.length,n=0;n<r;n++)t+="["+e.start(n).toFixed(3)+","+e.end(n).toFixed(3)+"]";return t}}},
24"./src/utils/timescale-conversion.ts":function(e,t,r){"use strict";function n(e,t,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);var i=e*t*r;return n?Math.round(i):i}function i(e,t,r,i){return void 0===r&&(r=1),void 0===i&&(i=!1),n(e,t,1/r,i)}function s(e,t){return void 0===t&&(t=!1),n(e,1e3,11111111111111112e-21,t)}function a(e,t){return void 0===t&&(t=1),n(e,9e4,1/t)}r.r(t),r.d(t,"toTimescaleFromBase",function(){return n}),r.d(t,"toTimescaleFromScale",function(){return i}),r.d(t,"toMsFromMpegTsClock",function(){return s}),r.d(t,"toMpegTsClockFromTimescale",function(){return a})},
24"./src/utils/typed-array.ts":function(e,t,r){"use strict";function n(e,t,r){return Uint8Array.prototype.slice?e.slice(t,r):new Uint8Array(Array.prototype.slice.call(e,t,r))}r.r(t),r.d(t,"sliceUint8",function(){return n})},
24"./src/utils/vttcue.ts":function(e,t,r){"use strict";r.r(t),t.default=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!=typeof t||!Array.isArray(e))return!1;var r=t.toLowerCase();return!!~e.indexOf(r)&&r}function n(e){return r(t,e)}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var a in s)e[a]=s[a]}return e}function s(t,s,a){var o=this,u={enumerable:!0};o.hasBeenReset=!1;var l="",c=!1,h=t,d=s,f=a,p=null,g="",v=!0,y="auto",m="start",b=50,E="middle",S=50,T="middle";Object.defineProperty(o,"id",i({},u,{get:function(){return l},set:function(e){l=""+e}})),Object.defineProperty(o,"pauseOnExit",i({},u,{get:function(){return c},set:function(e){c=!!e}})),Object.defineProperty(o,"startTime",i({},u,{get:function(){return h},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",i({},u,{get:function(){return d},set:function(e){if("number"!=typeof e)throw TypeError("End time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",i({},u,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",i({},u,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",i({},u,{get:function(){return g},set:function(t){var n,i=r(e,t);if(!1===i)throw SyntaxError("An invalid or illegal string was specified.");g=i,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",i({},u,{get:function(){return v},set:function(e){v=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",i({},u,{get:function(){return y},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("An invalid number or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",i({},u,{get:function(){return m},set:function(e){var t=n(e);if(!t)throw SyntaxError("An invalid or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",i({},u,{get:function(){return b},set:function(e){if(e<0||e>100)throw Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",i({},u,{get:function(){return E},set:function(e){var t=n(e);if(!t)throw SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",i({},u,{get:function(){return S},set:function(e){if(e<0||e>100)throw Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",i({},u,{get:function(){return T},set:function(e){var t=n(e);if(!t)throw SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),o.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}()},
24"./src/utils/vttparser.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"parseTimeStamp",function(){return s}),r.d(t,"fixLineBreaks",function(){return h}),r.d(t,"VTTParser",function(){return d});var n=r(/*! ./vttcue */ "./src/utils/vttcue.ts"),i=function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}();function s(e){function t(e,t,r,n){return(0|e)*3600+(0|t)*60+(0|r)+parseFloat(n||0)}var r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}var a=function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,r){for(var n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}},t.integer=function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},t.percent=function(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1},e}();function o(e,t,r,n){var i=n?e.split(n):[e];for(var s in i){if("string"==typeof i[s]){var a,o=i[s].split(r);if(2===o.length){t(o[0],o[1])}}}}var u=new n.default(0,0,""),l="middle"===u.align?"middle":"center";function c(e,t,r){var n,i,c,h,d,f=e;function p(){var t=s(e);if(null===t)throw Error("Malformed timestamp: "+f);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function g(){e=e.replace(/^\s+/,"")}if(g(),t.startTime=p(),g(),"-->"!==e.slice(0,3))throw Error("Malformed time stamp (time stamps must be separated by '-->'): "+f);e=e.slice(3),g(),t.endTime=p(),g(),n=e,i=t,c=new a,o(n,function(e,t){var n;switch(e){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===t){c.set(e,r[i].region);break}break;case"vertical":c.alt(e,t,["rl","lr"]);break;case"line":n=t.split(","),c.integer(e,n[0]),c.percent(e,n[0])&&c.set("snapToLines",!1),c.alt(e,n[0],["auto"]),2===n.length&&c.alt("lineAlign",n[1],["start",l,"end"]);break;case"position":n=t.split(","),c.percent(e,n[0]),2===n.length&&c.alt("positionAlign",n[1],["start",l,"end","line-left","line-right","auto"]);break;case"size":c.percent(e,t);break;case"align":c.alt(e,t,["start",l,"end","left","right"])}},/:/,/\s/),i.region=c.get("region",null),i.vertical=c.get("vertical",""),"auto"===(h=c.get("line","auto"))&&-1===u.line&&(h=-1),i.line=h,i.lineAlign=c.get("lineAlign","start"),i.snapToLines=c.get("snapToLines",!0),i.size=c.get("size",100),i.align=c.get("align",l),"auto"===(d=c.get("position","auto"))&&50===u.position&&(d="start"===i.align||"left"===i.align?0:"end"===i.align||"right"===i.align?100:50),i.position=d}function h(e){return e.replace(/<br(?: \/)?>/gi,"\n")}var d=function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new i,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){var t=this;function r(){var e=t.buffer,r=0;for(e=h(e);r<e.length&&"\r"!==e[r]&&"\n"!==e[r];)++r;var n=e.slice(0,r);return"\r"===e[r]&&++r,"\n"===e[r]&&++r,t.buffer=e.slice(r),n}function i(e){o(e,function(e,t){},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var s="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var a=(s=r()).match(/^()?WEBVTT([ \t].*)?$/);if(!a||!a[0])throw Error("Malformed WebVTT signature.");t.state="HEADER"}for(var u=!1;t.buffer&&/\r\n|\n/.test(t.buffer);)switch(u?u=!1:s=r(),t.state){case"HEADER":/:/.test(s)?i(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;if(t.cue=new n.default(0,0,""),t.state="CUE",-1===s.indexOf("-->")){t.cue.id=s;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{c(s,t.cue,t.regionList)}catch(l){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var d=-1!==s.indexOf("-->");if(!s||d&&(u=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=s;continue;case"BADCUE":s||(t.state="ID")}}catch(f){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){var e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this},e}()},
24"./src/utils/webvtt-parser.ts":function(e,t,r){"use strict";r.r(t),r.d(t,"generateCueId",function(){return d}),r.d(t,"parseWebVTT",function(){return p});var n=r(/*! ./src/polyfills/number */ "./src/polyfills/number.ts"),i=r(/*! ./vttparser */ "./src/utils/vttparser.ts"),s=r(/*! ../demux/id3 */ "./src/demux/id3.ts"),a=r(/*! ./timescale-conversion */ "./src/utils/timescale-conversion.ts"),o=r(/*! ../remux/mp4-remuxer */ "./src/remux/mp4-remuxer.ts"),u=/\r\n|\n\r|\n|\r/g,l=function(e,t,r){return void 0===r&&(r=0),e.slice(r,r+t.length)===t},c=function(e){var t=parseInt(e.slice(-3)),r=parseInt(e.slice(-6,-4)),i=parseInt(e.slice(-9,-7)),s=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!Object(n.isFiniteNumber)(t)||!Object(n.isFiniteNumber)(r)||!Object(n.isFiniteNumber)(i)||!Object(n.isFiniteNumber)(s))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*r,t+=6e4*i,t+=36e5*s},h=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()};function d(e,t,r){return h(e.toString())+h(t.toString())+h(r)}var f=function(e,t,r){var n,i=e[t],s=e[i.prevCC];if(!s||!s.new&&i.new){e.ccOffset=e.presentationOffset=i.start,i.new=!1;return}for(;null!==(n=s)&&void 0!==n&&n.new;)e.ccOffset+=i.start-s.start,i.new=!1,s=e[(i=s).prevCC];e.presentationOffset=r};function p(e,t,r,n,h,p,g,v){var y,m=new i.VTTParser,b=Object(s.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(u,"\n").split("\n"),E=[],S=Object(a.toMpegTsClockFromTimescale)(t,r),T="00:00.000",w=0,A=0,x=!0;m.oncue=function(e){var t=n[h],r=n.ccOffset,i=(w-S)/9e4;null!=t&&t.new&&(void 0!==A?r=n.ccOffset=t.start:f(n,h,i)),i&&(r=i-n.presentationOffset);var s=e.endTime-e.startTime,a=Object(o.normalizePts)((e.startTime+r-A)*9e4,9e4*p)/9e4;e.startTime=Math.max(a,0),e.endTime=Math.max(a+s,0);var u=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(u)),e.id||(e.id=d(e.startTime,e.endTime,u)),e.endTime>0&&E.push(e)},m.onparsingerror=function(e){y=e},m.onflush=function(){if(y){v(y);return}g(E)},b.forEach(function(e){if(x){if(l(e,"X-TIMESTAMP-MAP=")){x=!1,e.slice(16).split(",").forEach(function(e){l(e,"LOCAL:")?T=e.slice(6):l(e,"MPEGTS:")&&(w=parseInt(e.slice(7)))});try{A=c(T)/1e3}catch(t){y=t}return}""===e&&(x=!1)}m.parse(e+"\n")}),m.flush()}},
vendor: 3,721 bytes, line 24
24"./src/utils/xhr-loader.ts":function(e,t,r){"use strict";r.r(t);var n=r(/*! ../utils/logger */ "./src/utils/logger.ts"),i=r(/*! ../loader/load-stats */ "./src/loader/load-stats.ts"),s=/^age:\s*[\d.]+\s*$/m,a=function(){function e(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e?e.xhrSetup:null,this.stats=new i.LoadStats,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,r){if(this.stats.loading.start)throw Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.retryDelay=t.retryDelay,this.loadInternal()},t.loadInternal=function(){var e=this.config,t=this.context;if(e){var r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var i=this.xhrSetup;try{if(i)try{i(r,t.url)}catch(s){r.open("GET",t.url,!0),i(r,t.url)}r.readyState||r.open("GET",t.url,!0);var a=this.context.headers;if(a)for(var o in a)r.setRequestHeader(o,a[o])}catch(u){this.callbacks.onError({code:r.status,text:u.message},t,r);return}t.rangeEnd&&r.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=t.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),r.send()}},t.readystatechange=function(){var e=this.context,t=this.loader,r=this.stats;if(e&&t){var i=t.readyState,s=this.config;if(!r.aborted&&i>=2){if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===i){t.onreadystatechange=null,t.onprogress=null;var a=t.status;if(a>=200&&a<300){if(r.loading.end=Math.max(self.performance.now(),r.loading.first),u="arraybuffer"===e.responseType?(o=t.response).byteLength:(o=t.responseText).length,r.loaded=r.total=u,!this.callbacks)return;var o,u,l=this.callbacks.onProgress;if(l&&l(r,e,o,t),!this.callbacks)return;var c={url:t.responseURL,data:o};this.callbacks.onSuccess(c,r,e,t)}else r.retry>=s.maxRetry||a>=400&&a<499?(n.logger.error(a+" while loading "+e.url),this.callbacks.onError({code:a,text:t.statusText},e,t)):(n.logger.warn(a+" while loading "+e.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)}}},t.loadtimeout=function(){n.logger.warn("timeout while loading "+this.context.url);var e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&s.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},e}();t.default=a}
24}).default},e.exports=t())},645:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,u=(1<<o)-1,l=u>>1,c=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,s=f&(1<<-c)-1,f>>=-c,c+=o;c>0;s=256*s+e[t+h],h+=d,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===s)s=1-l;else{if(s===u)return a?NaN:(f?-1:1)*(1/0);a+=Math.pow(2,n),s-=l}return(f?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,u,l=8*s-i-1,c=(1<<l)-1,h=c>>1,d=23===i?5960464477539062e-23:0,f=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(o=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+h>=1?t+=d/u:t+=d*Math.pow(2,1-h),t*u>=2&&(a++,u/=2),a+h>=c?(o=0,a=c):a+h>=1?(o=(t*u-1)*Math.pow(2,i),a+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&o,f+=p,o/=256,i-=8);for(a=a<<i|o,l+=i;l>0;e[r+f]=255&a,f+=p,a/=256,l-=8);e[r+f-p]|=128*g}},3252:function(e,t,r){"use strict";r.d(t,{H:function(){return s},a:function(){return o},b:function(){return i}});var n=r(3062);r(3161),r(9653);var i={name:"Livepeer Studio",baseUrl:"https://livepeer.studio/api",apiKey:"a616be3b-8980-4932-8079-0122e0106f95"},s=function(e){(0,n.f)(r,e);var t=(0,n.g)(r);function r(e,i,s,a){var o;if((0,n.b)(this,r),!Number.isInteger(e))throw Error('"code" must be an integer.');if(!i||"string"!=typeof i)throw Error('"message" must be a nonempty string.');return o=t.call(this,i),(0,n.c)((0,n.h)(o),"code",void 0),(0,n.c)((0,n.h)(o),"data",void 0),(0,n.c)((0,n.h)(o),"internal",void 0),o.code=e,o.data=a,o.internal=s,o}return(0,n.a)(r)}((0,n.i)(Error));function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}}},3062:function(e,t,r){"use strict";function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(l){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i,s,a,o,u=Object.create((t&&t.prototype instanceof f?t:f).prototype),l=new x(n||[]);return u._invoke=(a=l,o="suspendedStart",function(t,n){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===t)throw n;return R()}for(a.method=t,a.arg=n;;){var i=a.delegate;if(i){var s=T(i,a);if(s){if(s===d)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===o)throw o="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o="executing";var u=h(e,r,a);if("normal"===u.type){if(o=a.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(o="completed",a.method="throw",a.arg=u.arg)}}),u}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}e.wrap=c;var d={};function f(){}function p(){}function g(){}var v={};u(v,s,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(_([])));m&&m!==t&&r.call(m,s)&&(v=m);var b=g.prototype=f.prototype=Object.create(v);function E(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;this._invoke=function(i,s){function a(){return new t(function(n,a){!function n(i,s,a,o){var u=h(e[i],e,s);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){n("next",e,a,o)},function(e){n("throw",e,a,o)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return n("throw",e,a,o)})}o(u.arg)}(i,s,n,a)})}return n=n?n.then(a,a):a()}}function T(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&
vendor: 4,964 bytes, line 24
24(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method))return d;t.method="throw",t.arg=TypeError("The iterator does not provide a 'throw' method")}return d}var n=h(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=TypeError("iterator result is not an object"),t.delegate=null,d)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function _(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return p.prototype=g,u(b,"constructor",g),u(g,"constructor",p),p.displayName=u(g,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,u(e,o,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},E(S.prototype),u(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var a=new S(c(t,r,n,i),s);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},E(b),u(b,o,"Generator"),u(b,s,function(){return this}),u(b,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var o=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(o&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(o){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:_(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function i(e,t,r,n,i,s,a){try{var o=e[s](a),u=o.value}catch(l){r(l);return}o.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,s){var a=e.apply(t,r);function o(e){i(a,n,s,o,u,"next",e)}function u(e){i(a,n,s,o,u,"throw",e)}o(void 0)})}}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
24t%2?o(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function y(e){var t=v();return function(){var r,n=g(e);if(t){var i=g(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return d(e)}(this,r)}}function m(e,t,r){return(m=v()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&f(i,r.prototype),i}).apply(null,arguments)}function b(e){var t="function"==typeof Map?new Map:void 0;return(b=function(e){var r;if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return m(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)})(e)}r.d(t,{_:function(){return u},a:function(){return h},b:function(){return l},c:function(){return a},d:function(){return s},e:function(){return n},f:function(){return p},g:function(){return y},h:function(){return d},i:function(){return b}})},4965:function(e,t,r){"use strict";r.d(t,{e:function(){return e1}});var n=r(3252),i=r(3062);r(1249),r(1539),r(8674),r(6992),r(8783),r(3948),r(8559),r(7327),r(9720);var s=r(8764).lW;let a="3.7.2",o="function"==typeof atob,u="function"==typeof btoa,l="function"==typeof s,c="function"==typeof TextDecoder?new TextDecoder:void 0,h="function"==typeof TextEncoder?new TextEncoder:void 0,d=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),f,p=(eJ=d,f={},eJ.forEach((e,t)=>f[e]=t),f),g=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,v=String.fromCharCode.bind(String),y="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=e=>e)=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),m=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),b=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),E=e=>{let t,r,n,i,s="",a=e.length%3;for(let o=0;o<e.length;){if((r=e.charCodeAt(o++))>255||(n=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError("invalid character found");s+=d[(t=r<<16|n<<8|i)>>18&63]+d[t>>12&63]+d[t>>6&63]+d[63&t]}return a?s.slice(0,a-3)+"===".substring(a):s},S=u?e=>btoa(e):l?e=>s.from(e,"binary").toString("base64"):E,T=l?e=>s.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(v.apply(null,e.subarray(r,r+4096)));return S(t.join(""))},w=(e,t=!1)=>t?m(T(e)):T(e),A=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?v(192|t>>>6)+v(128|63&t):v(224|t>>>12&15)+v(128|t>>>6&63)+v(128|63&t)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return v(240|t>>>18&7)+v(128|t>>>12&63)+v(128|t>>>6&63)+v(128|63&t)},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=e=>e.replace(x,A),R=l?e=>s.from(e,"utf8").toString("base64"):h?e=>T(h.encode(e)):e=>S(_(e)),O=(e,t=!1)=>t?m(R(e)):R(e),k=e=>O(e,!0),L=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,C=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return v((t>>>10)+55296)+v((1023&t)+56320);case 3:return v((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return v((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},I=e=>e.replace(L,C),D=e=>
24{if(e=e.replace(/\s+/g,""),!g.test(e))throw TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r="",n,i;for(let s=0;s<e.length;)t=p[e.charAt(s++)]<<18|p[e.charAt(s++)]<<12|(n=p[e.charAt(s++)])<<6|(i=p[e.charAt(s++)]),r+=64===n?v(t>>16&255):64===i?v(t>>16&255,t>>8&255):v(t>>16&255,t>>8&255,255&t);return r},P=o?e=>atob(b(e)):l?e=>s.from(e,"base64").toString("binary"):D,M=l?e=>y(s.from(e,"base64")):e=>y(P(e),e=>e.charCodeAt(0)),U=e=>M(B(e)),F=l?e=>s.from(e,"base64").toString("utf8"):c?e=>c.decode(M(e)):e=>I(P(e)),B=e=>b(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),N=e=>F(B(e)),j=e=>{if("string"!=typeof e)return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},q=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),H=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,q(t));e("fromBase64",function(){return N(this)}),e("toBase64",function(e){return O(this,e)}),e("toBase64URI",function(){return O(this,!0)}),e("toBase64URL",function(){return O(this,!0)}),e("toUint8Array",function(){return U(this)})},z=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,q(t));e("toBase64",function(e){return w(this,e)}),e("toBase64URI",function(){return w(this,!0)}),e("toBase64URL",function(){return w(this,!0)})},G=()=>{H(),z()},K={version:a,VERSION:a,atob:P,atobPolyfill:D,btoa:S,btoaPolyfill:E,fromBase64:N,toBase64:O,encode:O,encodeURI:k,encodeURL:k,utob:_,btou:I,decode:N,isValid:j,fromUint8Array:w,toUint8Array:U,extendString:H,extendUint8Array:z,extendBuiltins:G};var W=r(4564),V=r.n(W);function $(e){return($="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Y(e){var t="function"==typeof Map?new Map:void 0;return(Y=function(e){var r;if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return X(e,arguments,ee(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Z(n,e)})(e)}function X(e,t,r){return(X=J()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Z(i,r.prototype),i}).apply(null,arguments)}function J(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Z(e,t){return(Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z(e,t)}(o,e);var t,r,n,i,s,a=(r=J(),function(){var e,t=ee(o);if(r){var n=ee(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),(t=a.call(this,e)).originalRequest=n,t.originalResponse=i,t.causingError=r,null!=r&&(e+=", caused by ".concat(r.toString())),null!=n){var s=n.getHeader("X-Request-ID")||"n/a",u=n.getMethod(),l=n.getURL(),c=i?i.getStatus():"n/a",h=i?i.getBody()||"":"n/a";e+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(h,", request id: ").concat(s,")")}return t.message=e,t}
24return i&&Q(o.prototype,i),s&&Q(o,s),Object.defineProperty(o,"prototype",{writable:!1}),o}(Y(Error));function er(e){}function en(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var s=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);a=!0);}catch(u){o=!0,n=u}finally{try{a||null==i.return||i.return()}finally{if(o)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ei(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ei(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function es(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?es(Object(r),!0).forEach(function(t){eo(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):es(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var el=function(){var e,t,r;function n(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),"resume"in t&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=t,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return t=[{key:"findPreviousUploads",value:function(){var e=this;return this.options.fingerprint(this.file,this.options).then(function(t){return e._urlStorage.findUploadsByFingerprint(t)})}},{key:"resumeFromPreviousUpload",value:function(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}},{key:"start",value:function(){var e=this,t=this.file;if(!t){this._emitError(Error("tus: no file or stream to upload provided"));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(Error("tus: neither an endpoint or an upload URL is provided"));return}var r=this.options.retryDelays;if(null!=r&&"[object Array]"!==Object.prototype.toString.call(r)){this._emitError(Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var n=0,i=["uploadUrl","uploadSize","uploadLengthDeferred"];n<i.length;n++){var s=i[n];if(this.options[s]){this._emitError(Error("tus: cannot use the ".concat(s," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(t,this.options).then(function(r){return(null==r?er("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):er("Calculated fingerprint: ".concat(r)),e._fingerprint=r,e._source)?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)}).then(function(t){if(e._source=t,e.options.uploadLengthDeferred)e._size=null;else if(null!=e.options.uploadSize){if(e._size=Number(e.options.uploadSize),Number.isNaN(e._size)){e._emitError(Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(e._size=e._source.size,null==e._size){e._emitError(Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()}).catch(function(t){e._emitError(t)})}},{key:"_startParallelUpload",value:function(){var e,t,r=this,i=this._size,s=0;this._parallelUploads=[];var a=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,o=null!==(t=this.options.parallelUploadBoundaries)&&void 0!==t?t:function(e,t){for(var r=Math.floor(e/t),n=[],i=0;i<t;i++)n.push({start:r*i,end:r*(i+1)});return n[t-1].end=e,n}(this._source.size,a);this._parallelUploadUrls&&o.forEach(function(e,t){e.uploadUrl=r._parallelUploadUrls[t]||null}),this._parallelUploadUrls=Array(o.length),Promise.all(o.map(function(e,t){var a=0;return r._source.slice(e.start,e.end).then(function(u){var l=u.value;return new Promise(function(u,c){var h=ea(ea({},r.options),{},{uploadUrl:e.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:ea(ea({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:u,onError:c,onProgress:function(e){s=s-a+e,a=e,r._emitProgress(s,i)},_onUploadUrlAvailable:function(){r._parallelUploadUrls[t]=d.url,r._parallelUploadUrls.filter(function(e){return Boolean(e)}).length===o.length&&r._saveUploadInUrlStorage()}}),d=new n(l,h);d.start(),r._parallelUploads.push(d)})})})).then(function(){(e=r._openRequest("POST",r.options.endpoint)).setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var t=ec(r.options.metadata);return""!==t&&e.setHeader("Upload-Metadata",t),r._sendRequest(e,null)}).then(function(t){if(!eh(t.getStatus(),200)){r._emitHttpError(e,t,"tus: unexpected response while creating upload");return}var n=t.getHeader("Location");
24if(null==n){r._emitHttpError(e,t,"tus: invalid or missing Location header");return}r.url=eg(r.options.endpoint,n),er("Created upload at ".concat(r.url)),r._emitSuccess()}).catch(function(e){r._emitError(e)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,null!=this.url){er("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(null!=this.options.uploadUrl){er("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}er("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(e){var t=this;return(null!=this._parallelUploads&&this._parallelUploads.forEach(function(t){t.abort(e)}),null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),e&&null!=this.url)?n.terminate(this.url,this.options).then(function(){return t._removeFromUrlStorage()}):Promise.resolve()}},{key:"_emitHttpError",value:function(e,t,r,n){this._emitError(new et(r,n,e,t))}},{key:"_emitError",value:function(e){var t=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),ep(e,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){t.start()},r);return}if("function"==typeof this.options.onError)this.options.onError(e);else throw e}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,r)}},{key:"_createUpload",value:function(){var e,t=this;if(!this.options.endpoint){this._emitError(Error("tus: unable to create upload because no endpoint is provided"));return}var r=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?r.setHeader("Upload-Defer-Length",1):r.setHeader("Upload-Length",this._size);var n=ec(this.options.metadata);""!==n&&r.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,e=this._addChunkToRequest(r)):e=this._sendRequest(r,null),e.then(function(e){if(!eh(e.getStatus(),200)){t._emitHttpError(r,e,"tus: unexpected response while creating upload");return}var n=e.getHeader("Location");if(null==n){t._emitHttpError(r,e,"tus: invalid or missing Location header");return}if(t.url=eg(t.options.endpoint,n),er("Created upload at ".concat(t.url)),"function"==typeof t.options._onUploadUrlAvailable&&t.options._onUploadUrlAvailable(),0===t._size){t._emitSuccess(),t._source.close();return}t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(r,e):(t._offset=0,t._performUpload())})}).catch(function(e){t._emitHttpError(r,null,"tus: failed to create upload",e)})}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then(function(r){var n=r.getStatus();if(!eh(n,200)){if(423===n){e._emitHttpError(t,r,"tus: upload is currently locked; retry later");return}if(eh(n,400)&&e._removeFromUrlStorage(),!e.options.endpoint){e._emitHttpError(t,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}e.url=null,e._createUpload();return}var i=parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){e._emitHttpError(t,r,"tus: invalid or missing offset value");return}var s=parseInt(r.getHeader("Upload-Length"),10);if(Number.isNaN(s)&&!e.options.uploadLengthDeferred){e._emitHttpError(t,r,"tus: invalid or missing length value");return}"function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),e._saveUploadInUrlStorage().then(function(){if(i===s){e._emitProgress(s,s),e._emitSuccess();return}e._offset=i,e._performUpload()})}).catch(function(r){e._emitHttpError(t,null,"tus: failed to resume upload",r)})}},{key:"_performUpload",value:function(){var e,t=this;!this._aborted&&(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(e).then(function(r){if(!eh(r.getStatus(),200)){t._emitHttpError(e,r,"tus: unexpected response while uploading chunk");return}t._handleUploadResponse(e,r)}).catch(function(r){!t._aborted&&t._emitHttpError(e,null,"tus: failed to upload chunk at offset ".concat(t._offset),r)}))}},{key:"_addChunkToRequest",value:function(e){var t=this,r=this._offset,n=this._offset+this.options.chunkSize;return e.setProgressHandler(function(e){t._emitProgress(r+e,t._size)}),e.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then(function(r){var n=r.value,i=r.done;return(t.options.uploadLengthDeferred&&i&&(t._size=t._offset+(n&&n.size?n.size:0),e.setHeader("Upload-Length",t._size)),null===n)?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,n))})}},{key:"_handleUploadResponse",value:function(e,t){var r=parseInt(t.getHeader("Upload-Offset"),10);
24if(Number.isNaN(r)){this._emitHttpError(e,t,"tus: invalid or missing offset value");return}if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r===this._size){this._emitSuccess(),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(e,t){var r=ed(e,t,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(t){e._emitError(t)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();var t={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then(function(t){e._urlStorageKey=t})}},{key:"_sendRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ef(e,t,this.options)}}],r=[{key:"terminate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ed("DELETE",e,t);return ef(r,null,t).then(function(e){if(204!==e.getStatus())throw new et("tus: unexpected response while terminating upload",null,r,e)}).catch(function(i){if(i instanceof et||(i=new et("tus: failed to terminate upload",i,r,null)),!ep(i,0,t))throw i;var s=t.retryDelays[0],a=t.retryDelays.slice(1),o=ea(ea({},t),{},{retryDelays:a});return new Promise(function(e){return setTimeout(e,s)}).then(function(){return n.terminate(e,o)})})}}],t&&eu(n.prototype,t),r&&eu(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}();function ec(e){return Object.entries(e).map(function(e){var t=en(e,2),r=t[0],n=t[1];return"".concat(r," ").concat(K.encode(String(n)))}).join(",")}function eh(e,t){return e>=t&&e<t+100}function ed(e,t,r){var n=r.httpStack.createRequest(e,t);if(n.setHeader("Tus-Resumable","1.0.0"),Object.entries(r.headers||{}).forEach(function(e){var t=en(e,2),r=t[0],i=t[1];n.setHeader(r,i)}),r.addRequestId){var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});n.setHeader("X-Request-ID",i)}return n}function ef(e,t,r){return("function"==typeof r.onBeforeRequest?Promise.resolve(r.onBeforeRequest(e)):Promise.resolve()).then(function(){return e.send(t).then(function(t){return("function"==typeof r.onAfterResponse?Promise.resolve(r.onAfterResponse(e,t)):Promise.resolve()).then(function(){return t})})})}function ep(e,t,r){if(null==r.retryDelays||t>=r.retryDelays.length||null==e.originalRequest)return!1;if(r&&"function"==typeof r.onShouldRetry)return r.onShouldRetry(e,t,r);var n,i=e.originalResponse?e.originalResponse.getStatus():0;return(!eh(i,400)||409===i||423===i)&&(n=!0,"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(n=!1),n)}function eg(e,t){return new(V())(t,e).toString()}function ev(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}el.defaultOptions={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,_onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:null,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null};var ey=function(){var e,t,r;function n(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n)}return t=[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(e){return Promise.resolve([])}},{key:"removeUpload",value:function(e){return Promise.resolve()}},{key:"addUpload",value:function(e,t){return Promise.resolve(null)}}],ev(n.prototype,t),r&&ev(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}();function em(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var eb=!1;try{eb="localStorage"in window;var eE="tusSupport";localStorage.setItem(eE,localStorage.getItem(eE))}
24catch(eS){if(eS.code===eS.SECURITY_ERR||eS.code===eS.QUOTA_EXCEEDED_ERR)eb=!1;else throw eS}var eT=eb,ew=function(){var e,t,r;function n(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n)}return t=[{key:"findAllUploads",value:function(){return Promise.resolve(this._findEntries("tus::"))}},{key:"findUploadsByFingerprint",value:function(e){return Promise.resolve(this._findEntries("tus::".concat(e,"::")))}},{key:"removeUpload",value:function(e){return localStorage.removeItem(e),Promise.resolve()}},{key:"addUpload",value:function(e,t){var r="tus::".concat(e,"::").concat(Math.round(1e12*Math.random()));return localStorage.setItem(r,JSON.stringify(t)),Promise.resolve(r)}},{key:"_findEntries",value:function(e){for(var t=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);if(0===n.indexOf(e))try{var i=JSON.parse(localStorage.getItem(n));i.urlStorageKey=n,t.push(i)}catch(s){}}return t}}],em(n.prototype,t),r&&em(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}();function eA(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ex(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function e_(e,t,r){return t&&ex(e.prototype,t),r&&ex(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var eR=function(){function e(){eA(this,e)}return e_(e,[{key:"createRequest",value:function(e,t){return new eO(e,t)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),e}(),eO=function(){function e(t,r){eA(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={}}return e_(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}},{key:"getHeader",value:function(e){return this._headers[e]}},{key:"setProgressHandler",value:function(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(t){t.lengthComputable&&e(t.loaded)})}},{key:"send",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(function(r,n){e._xhr.onload=function(){r(new ek(e._xhr))},e._xhr.onerror=function(e){n(e)},e._xhr.send(t)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),ek=function(){function e(t){eA(this,e),this._xhr=t}return e_(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),eL=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};function eC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var eI=function(){var e,t,r;function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this._file=e,this.size=e.size}return t=[{key:"slice",value:function(e,t){var r;return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)?(r=this._file.slice(e,t),new Promise(function(e,t){var n=new FileReader;n.onload=function(){var t=new Uint8Array(n.result);e({value:t})},n.onerror=function(e){t(e)},n.readAsArrayBuffer(r)})):Promise.resolve({value:this._file.slice(e,t)})}},{key:"close",value:function(){}}],eC(n.prototype,t),r&&eC(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}();function eD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eP(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var eM=function(){var e,t,r;function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return t=[{key:"slice",value:function(e,t){return e<this._bufferOffset?Promise.reject(Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(e,t)}},{key:"_readUntilEnoughDataOrDone",value:function(e,t){var r=this,n=t<=this._bufferOffset+eP(this._buffer);if(this._done||n){var i=this._getDataFromBuffer(e,t),s=null==i&&this._done;return Promise.resolve({value:i,done:s})}return this._reader.read().then(function(n){var i=n.value;return n.done?r._done=!0:void 0===r._buffer?r._buffer=i:r._buffer=function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw Error("Unknown data type")}(r._buffer,i),r._readUntilEnoughDataOrDone(e,t)})}},{key:"_getDataFromBuffer",value:function(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===eP(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}],eD(n.prototype,t),r&&eD(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}();function eU(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var eF=function(){var e,t,r;function n(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n)}return t=[{key:"openFile",value:function(e,t){if(eL()&&e&&void 0!==e.uri){var r;return(r=e.uri,new Promise(function(e,t){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){e(n.response)},n.onerror=function(e){t(e)},n.open("GET",r),n.send()})).then(function(e){return new eI(e)}).catch(function(e){throw Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(e))})}return"function"==typeof e.slice&&void 0!==e.size?Promise.resolve(new eI(e)):"function"==typeof e.read?Number.isFinite(t=Number(t))?Promise.resolve(new eM(e,t)):Promise.reject(Error("cannot create source for stream without a finite value for the `chunkSize` option")):Promise.reject(Error("source object may only be an instance of File, Blob, or Reader in this environment"))}}],eU(n.prototype,t),r&&eU(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}();function eB(e){return(eB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eN(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}
24function ej(e,t){return(ej=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eq(e){return(eq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eH(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ez(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eH(Object(r),!0).forEach(function(t){eG(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eH(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eG(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var eK=ez(ez({},el.defaultOptions),{},{httpStack:new eR,fileReader:new eF,urlStorage:eT?new ew:new ey,fingerprint:function(e,t){var r,n,i;return eL()?Promise.resolve((r=e,n=t,i=r.exif?function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}(JSON.stringify(r.exif)):"noexif",["tus-rn",r.name||"noname",r.size||"nosize",i,n.endpoint].join("/"))):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}}),eW=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ej(e,t)}(o,e);var t,r,n,i,s,a=(r=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=eq(o);if(r){var n=eq(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===eB(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=ez(ez({},eK),t),a.call(this,e,t)}return s=[{key:"terminate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=ez(ez({},eK),t),el.terminate(e,t)}}],s&&eN(o,s),Object.defineProperty(o,"prototype",{writable:!1}),o}(el),eV=window,e$=eV.XMLHttpRequest,eQ=eV.Blob;e$&&eQ&&eQ.prototype.slice,r(2222);var eY=r(4098),eX=r.n(eY);r(3161),r(9653);var eJ,eZ=function(e){(0,i.f)(g,e);var t,r,n,s,a,o,u,l,c,h,d,f,p=(0,i.g)(g);function g(e){var t;return(0,i.b)(this,g),t=p.call(this,e),(0,i.c)((0,i.h)(t),"_defaultHeaders",void 0),t._defaultHeaders=e.apiKey?{Authorization:"Bearer ".concat(e.apiKey)}:{},t}return(0,i.a)(g,[{key:"createStream",value:(t=(0,i.d)((0,i.e)().mark(function e(t){var r;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._create("/stream",{json:t,headers:this._defaultHeaders});case 2:return r=e.sent,e.abrupt("return",this._mapToStream(r));case 4:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"updateStream",value:(r=(0,i.d)((0,i.e)().mark(function e(t){var r,n;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof t?t:t.streamId,e.next=3,this._update("/stream/".concat(n),{json:(0,i._)((0,i._)((0,i._)({},void 0!==(null==t?void 0:t.record)?{record:Boolean(t.record)}:{}),void 0!==(null==t?void 0:t.suspend)?{suspended:Boolean(t.suspend)}:{}),void 0!==(null==t?void 0:null===(r=t.multistream)||void 0===r?void 0:r.targets)?{multistream:{targets:t.multistream.targets.map(function(e){var t;return void 0===e.id||"url"in(null!==(t=e.spec)&&void 0!==t?t:{})?(0,i._)((0,i._)({},e),{},{id:void 0}):(0,i._)((0,i._)({},e),{},{spec:void 0})})}}:{}),headers:this._defaultHeaders});
24case 3:return e.abrupt("return",this.getStream(n));case 4:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"getStream",value:(n=(0,i.d)((0,i.e)().mark(function e(t){var r;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._get("/stream/".concat("string"==typeof t?t:t.streamId),{headers:this._defaultHeaders});case 2:return r=e.sent,e.abrupt("return",this._mapToStream(r));case 4:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"getStreamSession",value:(s=(0,i.d)((0,i.e)().mark(function e(t){var r;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._get("/session/".concat("string"==typeof t?t:t.streamSessionId),{headers:this._defaultHeaders});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"getStreamSessions",value:(a=(0,i.d)((0,i.e)().mark(function e(t){var r;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._get("/stream/".concat("string"==typeof t?t:t.streamId,"/sessions"),{headers:this._defaultHeaders});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"createAsset",value:(o=(0,i.d)((0,i.e)().mark(function e(t){var r,n,s;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._create("/asset/request-upload",{json:{name:t.name,meta:t.meta},headers:this._defaultHeaders});case 2:return n=(r=e.sent).tusEndpoint,s=r.asset.id,e.next=6,new Promise(function(e,r){var a=new eW(t.file,(0,i._)((0,i._)({endpoint:n,metadata:{id:s},uploadSize:t.uploadSize},t.file instanceof File?null:{chunkSize:5242880}),{},{onError:function(e){r(e)},onProgress:function(e,r){var n;null==t||null===(n=t.onUploadProgress)||void 0===n||n.call(t,e/r)},onSuccess:function(){var r;return null==t||null===(r=t.onUploadProgress)||void 0===r||r.call(t,1),e()}}));a.findPreviousUploads().then(function(e){(null==e?void 0:e.length)>0&&e[0]&&a.resumeFromPreviousUpload(e[0]),a.start()}).catch(r)});case 6:return e.abrupt("return",this.getAsset(s));case 7:case"end":return e.stop()}},e,this)})),function(e){return o.apply(this,arguments)})},{key:"getAsset",value:(u=(0,i.d)((0,i.e)().mark(function e(t){var r;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._get("/asset/".concat("string"==typeof t?t:t.assetId),{headers:this._defaultHeaders});case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"updateAsset",value:(l=(0,i.d)((0,i.e)().mark(function e(t){var r,n,s,a,o,u;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.assetId,a=t.name,o=t.storage,e.next=3,this._update("/asset/".concat(s),{json:{name:void 0!==a?String(a):void 0,storage:null!=o&&o.ipfs?{ipfs:{spec:{nftMetadata:null!==(r=null==o?void 0:o.metadata)&&void 0!==r?r:{},nftMetadataTemplate:null!==(n=null==o?void 0:o.metadataTemplate)&&void 0!==n?n:"player"}}}:void 0},headers:this._defaultHeaders});case 3:return u=e.sent,e.abrupt("return",u);case 5:case"end":return e.stop()}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"_getRtmpIngestUrl",value:function(e){return"rtmp://rtmp.livepeer.com/live/".concat(e)}},{key:"getPlaybackInfo",value:(c=(0,i.d)((0,i.e)().mark(function e(t){var r,n;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?t:t.playbackId,e.next=3,this._get("/playback/".concat(r),{headers:this._defaultHeaders});case 3:return n=e.sent,e.abrupt("return",this._mapToPlaybackInfo(n));case 5:case"end":return e.stop()}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"_getPlaybackUrl",value:function(e){return"https://livepeercdn.com/hls/".concat(e,"/index.m3u8")}},{key:"getAssetMetrics",value:(h=(0,i.d)((0,i.e)().mark(function e(t){var r,n;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof t?t:t.assetId,e.next=3,this._get("/data/views/".concat(r,"/total"),{headers:this._defaultHeaders});case 3:return n=e.sent,e.abrupt("return",this._mapToViewsMetrics(n));case 5:case"end":return e.stop()}},e,this)})),function(e){return h.apply(this,arguments)})},{key:"_mapToStream",value:(d=(0,i.d)((0,i.e)().mark(function e(t){return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=i._,e.t1=(0,i._)({},t),e.t2={},e.next=5,this._mapToMultistream(t.multistream);case 5:return e.t3=e.sent,e.t4=this._getRtmpIngestUrl(t.streamKey),e.t5=this._getPlaybackUrl(t.playbackId),e.t6={multistream:e.t3,rtmpIngestUrl:e.t4,playbackUrl:e.t5},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6));case 10:case"end":return e.stop()}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"_mapToMultistream",value:(f=(0,i.d)((0,i.e)().mark(function e(t){var r,n=this;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.targets){e.next=2;break}return e.abrupt("return",void 0);case 2:return r=t.targets.map(function(){var e=(0,i.d)((0,i.e)().mark(function e(t){var r,s;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._get("/multistream/target/".concat(t.id),{headers:n._defaultHeaders});case 2:return s=e.sent.name,e.abrupt("return",(0,i._)((0,i._)({},t),{}
24,{spec:{name:s}}));case 5:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=5,Promise.all(r);case 5:return e.t0=e.sent,e.abrupt("return",{targets:e.t0});case 7:case"end":return e.stop()}},e)})),function(e){return f.apply(this,arguments)})},{key:"_mapToPlaybackInfo",value:function(e){var t,r,n;return{type:null==e?void 0:e.type,meta:{live:null!=e&&null!==(t=e.meta)&&void 0!==t&&t.live?Boolean(null==e?void 0:e.meta.live):void 0,source:null==e?void 0:null===(r=e.meta)||void 0===r?void 0:null===(n=r.source)||void 0===n?void 0:n.map(function(e){return{hrn:null==e?void 0:e.hrn,type:null==e?void 0:e.type,url:null==e?void 0:e.url}})}}}},{key:"_mapToViewsMetrics",value:function(e){return{type:"ViewsMetrics",metrics:e}}}]),g}(function(){var e,t,r;function s(e){(0,i.b)(this,s),(0,i.c)(this,"_config",void 0),(0,i.c)(this,"_fetch",void 0),this._fetch=eX(),this._config=e}return(0,i.a)(s,[{key:"getConfig",value:function(){return this._config}},{key:"_get",value:(e=(0,i.d)((0,i.e)().mark(function e(t,r){var s;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetch("".concat(this._config.baseUrl).concat(t),(0,i._)({method:"GET"},r));case 2:if((s=e.sent).ok){e.next=10;break}return e.t0=n.H,e.t1=s.status,e.next=8,s.json();case 8:throw e.t2=e.sent,new e.t0(e.t1,"Provider failed to get object",e.t2);case 10:return e.abrupt("return",s.json());case 11:case"end":return e.stop()}},e,this)})),function(t,r){return e.apply(this,arguments)})},{key:"_create",value:(t=(0,i.d)((0,i.e)().mark(function e(t,r){var s;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetch("".concat(this._config.baseUrl).concat(t),(0,i._)((0,i._)((0,i._)({method:"POST"},r),null!=r&&r.json?{body:JSON.stringify(r.json)}:{}),{},{headers:(0,i._)((0,i._)({},null!=r&&r.json?{"content-type":"application/json"}:{}),null==r?void 0:r.headers)}));case 2:if((s=e.sent).ok){e.next=10;break}return e.t0=n.H,e.t1=s.status,e.next=8,s.json();case 8:throw e.t2=e.sent,new e.t0(e.t1,"Provider failed to create object",e.t2);case 10:return e.abrupt("return",s.json());case 11:case"end":return e.stop()}},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"_update",value:(r=(0,i.d)((0,i.e)().mark(function e(t,r){var s;return(0,i.e)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetch("".concat(this._config.baseUrl).concat(t),(0,i._)((0,i._)((0,i._)({method:"PATCH"},r),null!=r&&r.json?{body:JSON.stringify(r.json)}:{}),{},{headers:(0,i._)((0,i._)({},null!=r&&r.json?{"content-type":"application/json"}:{}),null==r?void 0:r.headers)}));case 2:if((s=e.sent).ok){e.next=10;break}return e.t0=n.H,e.t1=s.status,e.next=8,s.json();case 8:throw e.t2=e.sent,new e.t0(e.t1,"Provider failed to update object",e.t2);case 10:return e.abrupt("return",s.json());case 11:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})}]),s}()),e0=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.fromEntries(Object.entries(e).filter(function(e){var t,r,i=function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var s=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(s.push(r.value),!t||s.length!==t);a=!0);}catch(u){o=!0,n=u}finally{try{a||null==i.return||i.return()}finally{if(o)throw n}}return s}}(e,2)||(0,n.a)(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return i[0],void 0!==i[1]}))};function e1(e){return function(){return new eZ((0,i._)((0,i._)({},n.b),e0(e)))}}},3454:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(7663)},6840:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(4467)}])},4467:function(e,t,r){"use strict";r.r(t),r.d(t,{AptosContext:function(){return n4},default:function(){return n8}});var n=r(1799),i=r(5893);r(906);var s=r(780);function a(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function o(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}var u={number:a,bool:function(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)},bytes:o,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");a(e.outputLen),a(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")},output:function(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}};
24let l=BigInt(4294967296-1),c=BigInt(32);function h(e,t=!1){return t?{h:Number(e&l),l:Number(e>>c&l)}:{h:0|Number(e>>c&l),l:0|Number(e&l)}}let d=(e,t)=>BigInt(e>>>0)<<c|BigInt(t>>>0);var f={fromBig:h,split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:s,l:a}=h(e[i],t);[r[i],n[i]]=[s,a]}return[r,n]},toBig:d,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:function(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/4294967296|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/4294967296|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/4294967296|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/4294967296|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};"object"==typeof self&&"crypto"in self&&self.crypto;let p=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),g=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),v=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];if(!v)throw Error("Non little-endian hardware is not supported");let y=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function m(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=y[e[r]];return t}function b(e){if("string"!=typeof e)throw TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){let n=2*r,i=e.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw Error("Invalid byte sequence");t[r]=s}return t}function E(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}class S{clone(){return this._cloneInto()}}function T(e){let t=t=>e().update(E(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}let[w,A,x]=[[],[],[]],_=BigInt(0),R=BigInt(1),O=BigInt(2),k=BigInt(7),L=BigInt(256),C=BigInt(113);for(let I=0,D=R,P=1,M=0;I<24;I++){[P,M]=[M,(2*P+3*M)%5],w.push(2*(5*M+P)),A.push((I+1)*(I+2)/2%64);let U=_;for(let F=0;F<7;F++)(D=(D<<R^(D>>k)*C)%L)&O&&(U^=R<<(R<<BigInt(F))-R);x.push(U)}let[B,N]=f.split(x,!0),j=(e,t,r)=>r>32?f.rotlBH(e,t,r):f.rotlSH(e,t,r),q=(e,t,r)=>r>32?f.rotlBL(e,t,r):f.rotlSL(e,t,r);class H extends S{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,u.number(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=p(this.state)}keccak(){!function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,o=(s+2)%10,u=r[o],l=r[o+1],c=j(u,l,1)^r[a],h=q(u,l,1)^r[a+1];for(let d=0;d<50;d+=10)e[s+d]^=c,e[s+d+1]^=h}let f=e[2],p=e[3];for(let g=0;g<24;g++){let v=A[g],y=j(f,p,v),m=q(f,p,v),b=w[g];f=e[b],p=e[b+1],e[b]=y,e[b+1]=m}for(let E=0;E<50;E+=10){for(let S=0;S<10;S++)r[S]=e[E+S];for(let T=0;T<10;T++)e[E+T]^=~r[(T+2)%10]&r[(T+4)%10]}e[0]^=B[n],e[1]^=N[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){u.exists(this);let{blockLen:t,state:r}=this;e=E(e);let n=e.length;for(let i=0;i<n;){let s=Math.min(t-this.pos,n-i);for(let a=0;a<s;a++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){u.exists(this,!1),u.bytes(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return u.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(u.output(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new H(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}let z=(e,t,r)=>T(()=>new H(t,e,r));z(6,144,28);let G=z(6,136,32);z(6,104,48),z(6,72,64),z(1,144,28),z(1,136,32),z(1,104,48),z(1,72,64);let K=(e,t,r)=>(function(e){let t=(t,r)=>e(r).update(E(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t})((n={})=>new H(t,e,void 0===n.dkLen?r:n.dkLen,!0));K(31,168,16),K(31,136,32);var W=r(7286);class V extends S{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,u.hash(e);let r=E(t);
24if(this.iHash=e.create(),!(this.iHash instanceof S))throw TypeError("Expected instance of class which extends utils.Hash");let n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;let i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let s=0;s<i.length;s++)i[s]^=54;this.iHash.update(i),this.oHash=e.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),i.fill(0)}update(e){return u.exists(this),this.iHash.update(e),this}digestInto(e){u.exists(this),u.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let $=(e,t,r)=>new V(e,t).update(r).digest();$.create=(e,t)=>new V(e,t);class Q extends S{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=g(this.buffer)}update(e){u.exists(this);let{view:t,buffer:r,blockLen:n}=this;e=E(e);let i=e.length;for(let s=0;s<i;){let a=Math.min(n-this.pos,i-s);if(a===n){let o=g(e);for(;n<=i-s;s+=n)this.process(o,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){u.exists(this),u.output(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(r,0),s=0);for(let a=s;a<n;a++)t[a]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s);e.setUint32(t+(n?4:0),a,n),e.setUint32(t+(n?0:4),o,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let o=g(e);this.get().forEach((e,t)=>o.setUint32(4*t,e,i))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}let[Y,X]=f.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
245771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),J=new Uint32Array(80),Z=new Uint32Array(80);class ee extends Q{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:u,El:l,Fh:c,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,a,o,u,l,c,h,d,f,p,g]}set(e,t,r,n,i,s,a,o,u,l,c,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|u,this.El=0|l,this.Fh=0|c,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)J[r]=e.getUint32(t),Z[r]=e.getUint32(t+=4);for(let n=16;n<80;n++){let i=0|J[n-15],s=0|Z[n-15],a=f.rotrSH(i,s,1)^f.rotrSH(i,s,8)^f.shrSH(i,s,7),o=f.rotrSL(i,s,1)^f.rotrSL(i,s,8)^f.shrSL(i,s,7),u=0|J[n-2],l=0|Z[n-2],c=f.rotrSH(u,l,19)^f.rotrBH(u,l,61)^f.shrSH(u,l,6),h=f.rotrSL(u,l,19)^f.rotrBL(u,l,61)^f.shrSL(u,l,6),d=f.add4L(o,h,Z[n-7],Z[n-16]),p=f.add4H(d,a,c,J[n-7],J[n-16]);J[n]=0|p,Z[n]=0|d}let{Ah:g,Al:v,Bh:y,Bl:m,Ch:b,Cl:E,Dh:S,Dl:T,Eh:w,El:A,Fh:x,Fl:_,Gh:R,Gl:O,Hh:k,Hl:L}=this;for(let C=0;C<80;C++){let I=f.rotrSH(w,A,14)^f.rotrSH(w,A,18)^f.rotrBH(w,A,41),D=f.rotrSL(w,A,14)^f.rotrSL(w,A,18)^f.rotrBL(w,A,41),P=w&x^~w&R,M=A&_^~A&O,U=f.add5L(L,D,M,X[C],Z[C]),F=f.add5H(U,k,I,P,Y[C],J[C]),B=0|U,N=f.rotrSH(g,v,28)^f.rotrBH(g,v,34)^f.rotrBH(g,v,39),j=f.rotrSL(g,v,28)^f.rotrBL(g,v,34)^f.rotrBL(g,v,39),q=g&y^g&b^y&b,H=v&m^v&E^m&E;k=0|R,L=0|O,R=0|x,O=0|_,x=0|w,_=0|A,({h:w,l:A}=f.add(0|S,0|T,0|F,0|B)),S=0|b,T=0|E,b=0|y,E=0|m,y=0|g,m=0|v;let z=f.add3L(B,j,H);g=f.add3H(z,F,N,q),v=0|z}({h:g,l:v}=f.add(0|this.Ah,0|this.Al,0|g,0|v)),({h:y,l:m}=f.add(0|this.Bh,0|this.Bl,0|y,0|m)),({h:b,l:E}=f.add(0|this.Ch,0|this.Cl,0|b,0|E)),({h:S,l:T}=f.add(0|this.Dh,0|this.Dl,0|S,0|T)),({h:w,l:A}=f.add(0|this.Eh,0|this.El,0|w,0|A)),({h:x,l:_}=f.add(0|this.Fh,0|this.Fl,0|x,0|_)),({h:R,l:O}=f.add(0|this.Gh,0|this.Gl,0|R,0|O)),({h:k,l:L}=f.add(0|this.Hh,0|this.Hl,0|k,0|L)),this.set(g,v,y,m,b,E,S,T,w,A,x,_,R,O,k,L)}roundClean(){J.fill(0),Z.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class et extends ee{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class er extends ee{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}let en=T(()=>new ee);T(()=>new et),T(()=>new er);var ei=r(3026),es=r(6230),ea=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,eu=(e,t)=>
24{for(var r in t)ea(e,r,{get:t[r],enumerable:!0})},el=(e,t,r,n)=>{for(var i,s=n>1?void 0:n?eo(t,r):t,a=e.length-1;a>=0;a--)(i=e[a])&&(s=(n?i(t,r,s):i(s))||s);return n&&s&&ea(t,r,s),s},ec=/^m(\/[0-9]+')+$/,eh=e=>e.replace("'",""),ed=e=>{let t=$.create(en,"ed25519 seed"),r=t.update(b(e)).digest(),n=r.slice(0,32),i=r.slice(32);return{key:n,chainCode:i}},ef=({key:e,chainCode:t},r)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,r);let i=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...e,...i]),o=$.create(en,t).update(a).digest(),u=o.slice(0,32),l=o.slice(32);return{key:u,chainCode:l}},ep=e=>!!ec.test(e)&&!e.split("/").slice(1).map(eh).some(Number.isNaN),eg=(e,t,r=2147483648)=>{if(!ep(e))throw Error("Invalid derivation path");let{key:n,chainCode:i}=ed(t),s=e.split("/").slice(1).map(eh).map(e=>parseInt(e,10));return s.reduce((e,t)=>ef(e,t+r),{key:n,chainCode:i})},ev=class{static fromBuffer(e){return ev.fromUint8Array(e)}static fromUint8Array(e){return new ev(m(e))}static ensure(e){return"string"==typeof e?new ev(e):e}constructor(e){e.startsWith("0x")?this.hexString=e:this.hexString=`0x${e}`}hex(){return this.hexString}noPrefix(){return this.hexString.slice(2)}toString(){return this.hex()}toShortString(){let e=this.hexString.replace(/^0x0*/,"");return`0x${e}`}toUint8Array(){return Uint8Array.from(b(this.noPrefix()))}};async function ey(e){return new Promise(t=>{setTimeout(t,e)})}function em(e){let t,r,n;return"object"==typeof e?(t=e.hashFunction,r=e.ttlMs,n=e.tags):t=e,(e,i,s)=>{if(null!=s.value)s.value=eE(s.value,t,r,n);else if(null!=s.get)s.get=eE(s.get,t,r,n);else throw Error("Only put a Memoize() decorator on a method or get accessor.")}}var eb=new Map;function eE(e,t,r=0,n){let i=Symbol("__memoized_map__");return function(...s){let a;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let o=this[i];if(Array.isArray(n))for(let u of n)eb.has(u)?eb.get(u).push(o):eb.set(u,[o]);if(t||s.length>0||r>0){let l;l=!0===t?s.map(e=>e.toString()).join("!"):t?t.apply(this,s):s[0];let c=`${l}__timestamp`,h=!1;if(r>0){if(o.has(c)){let d=o.get(c);h=Date.now()-d>r}else h=!0}o.has(l)&&!h?a=o.get(l):(a=e.apply(this,s),o.set(l,a),r>0&&o.set(c,Date.now()))}else o.has(this)?a=o.get(this):(a=e.apply(this,s),o.set(this,a));return a}}var eS=class{static fromAptosAccountObject(e){return new eS(ev.ensure(e.privateKeyHex).toUint8Array(),e.address)}static fromDerivePath(e,t){if(!eS.isValidPath(e))throw Error("Invalid derivation path");let r=t.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" "),{key:n}=eg(e,m(W.Z1(r)));return new eS(n)}constructor(e,t){e?this.signingKey=s.sign.keyPair.fromSeed(e.slice(0,32)):this.signingKey=s.sign.keyPair(),this.accountAddress=ev.ensure(t||this.authKey().hex())}address(){return this.accountAddress}authKey(){let e=G.create();return e.update(this.signingKey.publicKey),e.update("\0"),ev.fromUint8Array(e.digest())}pubKey(){return ev.fromUint8Array(this.signingKey.publicKey)}signBuffer(e){let t=s.sign(e,this.signingKey.secretKey);return ev.fromUint8Array(t.slice(0,64))}signHexString(e){let t=ev.ensure(e).toUint8Array();return this.signBuffer(t)}toPrivateKeyObject(){return{address:this.address().hex(),publicKeyHex:this.pubKey().hex(),privateKeyHex:ev.fromUint8Array(this.signingKey.secretKey.slice(0,32)).hex()}}},eT=eS;eT.isValidPath=e=>!!/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'+$/.test(e),el([em()],eT.prototype,"authKey",1),eu({},{$AccountData:()=>e9,$AccountSignature:()=>e7,$AccountSignature_Ed25519Signature:()=>te,$AccountSignature_MultiEd25519Signature:()=>tt,$Address:()=>tr,$AptosError:()=>tn,$AptosErrorCode:()=>ti,$Block:()=>ts,$BlockMetadataTransaction:()=>ta,$DecodedTableData:()=>to,$DeleteModule:()=>tl,$DeleteResource:()=>tc,$DeleteTableItem:()=>th,$DeletedTableData:()=>tu,$DirectWriteSet:()=>td,$Ed25519Signature:()=>tf,$EncodeSubmissionRequest:()=>tp,$EntryFunctionId:()=>tg,$EntryFunctionPayload:()=>tv,$Event:()=>ty,$EventGuid:()=>tm,$GasEstimation:()=>tb,$GenesisPayload:()=>tE,$GenesisPayload_WriteSetPayload:()=>tS,$GenesisTransaction:()=>tT,$HashValue:()=>tw,$HealthCheckSuccess:()=>tA,$HexEncodedBytes:()=>tx,$IdentifierWrapper:()=>t_,$IndexResponse:()=>tR,$ModuleBundlePayload:()=>tO,$MoveAbility:()=>tk,$MoveFunction:()=>tL,$MoveFunctionGenericTypeParam:()=>tC,$MoveFunctionVisibility:()=>tI,$MoveModule:()=>tD,$MoveModuleBytecode:()=>tP,$MoveModuleId:()=>tM,$MoveResource:()=>tU,$MoveScriptBytecode:()=>tF,$MoveStruct:()=>tB,$MoveStructField:()=>tN,$MoveStructGenericTypeParam:()=>tj,$MoveStructTag:()=>tq,$MoveStructValue:()=>tH,$MoveType:()=>tz,$MoveValue:()=>tG,$MultiAgentSignature:()=>tK,$MultiEd25519Signature:()=>tW,$PendingTransaction:()=>tV,$RoleType:()=>t$,$ScriptPayload:()=>tQ,$ScriptWriteSet:()=>tY,$StateCheckpointTransaction:()=>tX,$SubmitTransactionRequest:()=>tJ,$TableItemRequest:()=>tZ,$Transaction:()=>t0,$TransactionPayload:()=>t4,$TransactionPayload_EntryFunctionPayload:()=>t8,$TransactionPayload_ModuleBundlePayload:()=>t9,$TransactionPayload_ScriptPayload:()=>t7,$TransactionSignature:()=>rr,$TransactionSignature_Ed25519Signature:()=>rn,$TransactionSignature_MultiAgentSignature:()=>ri,$TransactionSignature_MultiEd25519Signature:()=>rs,$Transaction_BlockMetadataTransaction:()=>t1,$Transaction_GenesisTransaction:()=>t2,$Transaction_PendingTransaction:()=>t5,$Transaction_StateCheckpointTransaction:()=>t3,$Transaction_UserTransaction:()=>t6,$TransactionsBatchSingleSubmissionFailure:()=>re,$TransactionsBatchSubmissionResult:()=>rt,$U128:()=>ra,$U64:()=>ro,$UserTransaction:()=>ru,$VersionedEvent:()=>rl,$WriteModule:()=>rc,$WriteResource:()=>rh,$WriteSet:()=>rd,$WriteSetChange:()=>rg,$WriteSetChange_DeleteModule:()=>rv,$WriteSetChange_DeleteResource:()=>ry,$WriteSetChange_DeleteTableItem:()=>rm,$WriteSetChange_WriteModule:()=>rb,$WriteSetChange_WriteResource:()=>rE,$WriteSetChange_WriteTableItem:()=>rS,$WriteSetPayload:()=>rT,$WriteSet_DirectWriteSet:()=>rf,$WriteSet_ScriptWriteSet:()=>rp,$WriteTableItem:()=>rw,AccountsService:()=>eX,ApiError:()=>
24eA,AptosErrorCode:()=>e6,AptosGeneratedClient:()=>e5,BaseHttpRequest:()=>ew,BlocksService:()=>eJ,CancelError:()=>ex,CancelablePromise:()=>e_,EventsService:()=>eZ,GeneralService:()=>e0,MoveFunctionVisibility:()=>e4,OpenAPI:()=>e3,RoleType:()=>e8,TablesService:()=>e1,TransactionsService:()=>e2});var ew=class{constructor(e){this.config=e}},eA=class extends Error{constructor(e,t,r){super(r),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}},ex=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},e_=class{constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this._cancelHandlers=[],this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r;let n=e=>{var t;!this._isResolved&&!this._isRejected&&!this._isCancelled&&(this._isResolved=!0,null==(t=this._resolve)||t.call(this,e))},i=e=>{var t;!this._isResolved&&!this._isRejected&&!this._isCancelled&&(this._isRejected=!0,null==(t=this._reject)||t.call(this,e))},s=e=>{!this._isResolved&&!this._isRejected&&!this._isCancelled&&this._cancelHandlers.push(e)};return Object.defineProperty(s,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(s,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(s,"isCancelled",{get:()=>this._isCancelled}),e(n,i,s)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){var e;if(!this._isResolved&&!this._isRejected&&!this._isCancelled){if(this._isCancelled=!0,this._cancelHandlers.length)try{for(let t of this._cancelHandlers)t()}catch(r){console.warn("Cancellation threw an error",r);return}this._cancelHandlers.length=0,null==(e=this._reject)||e.call(this,new ex("Request aborted"))}}get isCancelled(){return this._isCancelled}},eR=class{constructor(e=new Map){this.jar=e}setCookie(e,t){var r;let n=e.origin.toLowerCase();this.jar.has(n)||this.jar.set(n,[]);let i=eR.parse(t);this.jar.set(n,[...(null==(r=this.jar.get(n))?void 0:r.filter(e=>e.name!==i.name))||[],i])}getCookies(e){var t;let r=e.origin.toLowerCase();return this.jar.get(r)&&(null==(t=this.jar.get(r))?void 0:t.filter(e=>!e.expires||e.expires>new Date))||[]}static parse(e){if("string"!=typeof e)throw Error("argument str must be a string");let t=e.split(";").map(e=>e.trim()),r;if(t.length>0){let[n,i]=t[0].split("=");if(!n||!i)throw Error("Invalid cookie");r={name:n,value:i}}else throw Error("Invalid cookie");return t.slice(1).forEach(e=>{let[t,n]=e.split("=");if(!t.trim())throw Error("Invalid cookie");let i=t.toLowerCase(),s=(null==n?void 0:n.charAt(0))==="'"||(null==n?void 0:n.charAt(0))==='"'?null==n?void 0:n.slice(1,-1):n;if("expires"===i&&(r.expires=new Date(s)),"path"===i&&(r.path=s),"samesite"===i){if("Lax"!==s&&"None"!==s&&"Strict"!==s)throw Error("Invalid cookie SameSite value");r.sameSite=s}"secure"===i&&(r.secure=!0)}),r}},eO=new eR;ei.interceptors.response.use(e=>(Array.isArray(e.headers["set-cookie"])&&e.headers["set-cookie"].forEach(t=>{eO.setCookie(new URL(e.config.url),t)}),e)),ei.interceptors.request.use(function(e){let t=eO.getCookies(new URL(e.url));return(null==t?void 0:t.length)>0&&e.headers&&(e.headers.cookie=t.map(e=>`${e.name}=${e.value}`).join("; ")),e});var ek,eL,eC,eI=e=>null!=e,eD=e=>"string"==typeof e,eP=e=>eD(e)&&""!==e,eM=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),eU=e=>e instanceof es,eF=e=>e>=200&&e<300,eB=e=>btoa(e),eN=e=>{let t=[],r=(e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)},n=(e,t)=>{eI(t)&&(Array.isArray(t)?t.forEach(t=>{n(e,t)}):"object"==typeof t?Object.entries(t).forEach(([t,r])=>{n(`${e}[${t}]`,r)}):r(e,t))};return(Object.entries(e).forEach(([e,t])=>{n(e,t)}),t.length>0)?`?${t.join("&")}`:""},ej=(e,t)=>{let r=e.ENCODE_PATH||encodeURI,n=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,(e,n)=>{var i;return(null==(i=t.path)?void 0:i.hasOwnProperty(n))?r(String(t.path[n])):e}),i=`${e.BASE}${n}`;return t.query?`${i}${eN(t.query)}`:i},eq=e=>{if(e.formData){let t=new es,r=(e,r)=>{eD(r)||eM(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter(([e,t])=>
24eI(t)).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>r(e,t)):r(e,t)}),t}},eH=async(e,t)=>"function"==typeof t?t(e):t,ez=async(e,t,r)=>{let n=await eH(t,e.TOKEN),i=await eH(t,e.USERNAME),s=await eH(t,e.PASSWORD),a=await eH(t,e.HEADERS),o="function"==typeof(null==r?void 0:r.getHeaders)&&(null==r?void 0:r.getHeaders())||{},u=Object.entries({Accept:"application/json",...a,...t.headers,...o}).filter(([e,t])=>eI(t)).reduce((e,[t,r])=>({...e,[t]:String(r)}),{});if(eP(n)&&(u.Authorization=`Bearer ${n}`),eP(i)&&eP(s)){let l=eB(`${i}:${s}`);u.Authorization=`Basic ${l}`}return t.body&&(t.mediaType?u["Content-Type"]=t.mediaType:eM(t.body)?u["Content-Type"]=t.body.type||"application/octet-stream":eD(t.body)?u["Content-Type"]="text/plain":eU(t.body)||(u["Content-Type"]="application/json")),u},eG=e=>{if(e.body)return e.body},eK=async(e,t,r,n,i,s,a)=>{let o=ei.CancelToken.source(),u={url:r,headers:s,data:null!=n?n:i,method:t.method,withCredentials:e.WITH_CREDENTIALS,cancelToken:o.token},l=Object.keys(e.HEADERS||{}).filter(e=>"accept"===e.toLowerCase()).map(t=>e.HEADERS[t]).includes("application/x-bcs");l&&(u.responseType="arraybuffer"),a(()=>o.cancel("The user aborted a request."));try{return await ei.request(u)}catch(c){if(c.response)return c.response;throw c}},eW=(e,t)=>{if(t){let r=e.headers[t];if(eD(r))return r}},eV=e=>{if(204!==e.status)return e.data},e$=(e,t)=>{let r={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...e.errors},n=r[t.status];if(n)throw new eA(e,t,n);if(!t.ok)throw new eA(e,t,"Generic Error")},eQ=(e,t)=>new e_(async(r,n,i)=>{try{let s=ej(e,t),a=eq(t),o=eG(t),u=await ez(e,t,a);if(!i.isCancelled){let l=await eK(e,t,s,o,a,u,i),c=eV(l),h=eW(l,t.responseHeader),d={url:s,ok:eF(l.status),status:l.status,statusText:l.statusText,body:null!=h?h:c};e$(t,d),r(d.body)}}catch(f){n(f)}}),eY=class extends ew{constructor(e){super(e)}request(e){return eQ(this.config,e)}},eX=class{constructor(e){this.httpRequest=e}getAccount(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}",path:{address:e},query:{ledger_version:t}})}getAccountResources(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/resources",path:{address:e},query:{ledger_version:t}})}getAccountModules(e,t){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/modules",path:{address:e},query:{ledger_version:t}})}getAccountResource(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/resource/{resource_type}",path:{address:e,resource_type:t},query:{ledger_version:r}})}getAccountModule(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/module/{module_name}",path:{address:e,module_name:t},query:{ledger_version:r}})}},eJ=class{constructor(e){this.httpRequest=e}getBlockByHeight(e,t){return this.httpRequest.request({method:"GET",url:"/blocks/by_height/{block_height}",path:{block_height:e},query:{with_transactions:t}})}getBlockByVersion(e,t){return this.httpRequest.request({method:"GET",url:"/blocks/by_version/{version}",path:{version:e},query:{with_transactions:t}})}},eZ=class{constructor(e){this.httpRequest=e}getEventsByCreationNumber(e,t,r,n){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/events/{creation_number}",path:{address:e,creation_number:t},query:{start:r,limit:n}})}getEventsByEventHandle(e,t,r,n,i){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/events/{event_handle}/{field_name}",path:{address:e,event_handle:t,field_name:r},query:{start:n,limit:i}})}},e0=class{constructor(e){this.httpRequest=e}spec(){return this.httpRequest.request({method:"GET",url:"/spec"})}healthy(e){return this.httpRequest.request({method:"GET",url:"/-/healthy",query:{duration_secs:e}})}getLedgerInfo(){return this.httpRequest.request({method:"GET",url:"/"})}},e1=class{constructor(e){this.httpRequest=e}getTableItem(e,t,r){return this.httpRequest.request({method:"POST",url:"/tables/{table_handle}/item",path:{table_handle:e},query:{ledger_version:r},body:t,mediaType:"application/json"})}},e2=class{constructor(e){this.httpRequest=e}getTransactions(e,t){return this.httpRequest.request({method:"GET",url:"/transactions",query:{start:e,limit:t}})}submitTransaction(e){return this.httpRequest.request({method:"POST",url:"/transactions",body:e,mediaType:"application/json"})}getTransactionByHash(e){return this.httpRequest.request({method:"GET",url:"/transactions/by_hash/{txn_hash}",path:{txn_hash:e}})}getTransactionByVersion(e){return this.httpRequest.request({method:"GET",url:"/transactions/by_version/{txn_version}",path:{txn_version:e}})}getAccountTransactions(e,t,r){return this.httpRequest.request({method:"GET",url:"/accounts/{address}/transactions",path:{address:e},query:{start:t,limit:r}})}submitBatchTransactions(e){return this.httpRequest.request({method:"POST",url:"/transactions/batch",body:e,mediaType:"application/json"})}simulateTransaction(e,t,r){return this.httpRequest.request({method:"POST",url:"/transactions/simulate",query:{estimate_max_gas_amount:t,estimate_gas_unit_price:r},body:e,mediaType:"application/json"})}encodeSubmission(e){return this.httpRequest.request({method:"POST",url:"/transactions/encode_submission",body:e,mediaType:"application/json"})}estimateGasPrice(){return this.httpRequest.request({method:"GET",url:"/estimate_gas_price"})}},e5=class{constructor(e,t=eY){var r,n,i,s;this.request=new t({BASE:null!=(r=null==e?void 0:e.BASE)?r:"/v1",VERSION:null!=(n=null==e?void 0:e.VERSION)?n:"1.2.0",WITH_CREDENTIALS:null!=(i=null==e?void 0:e.WITH_CREDENTIALS)&&i,CREDENTIALS:null!=(s=null==e?void 0:e.CREDENTIALS)?s:"include",TOKEN:null==e?void 0:e.TOKEN,USERNAME:null==e?void 0:e.USERNAME,PASSWORD:null==e?void 0:e.PASSWORD,HEADERS:null==e?void 0:e.HEADERS,ENCODE_PATH:null==e?void 0:e.ENCODE_PATH}),this.accounts=new eX(this.request),this.blocks=new eJ(this.request),this.events=new eZ(this.request),this.general=new e0(this.request),this.tables=new e1(this.request),this.transactions=new e2(this.request)}},e3={BASE:"/v1",VERSION:"1.2.0",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0},e6=((ek=e6||{}).ACCOUNT_NOT_FOUND="account_not_found",ek.RESOURCE_NOT_FOUND="resource_not_found",ek.MODULE_NOT_FOUND="module_not_found",ek.STRUCT_FIELD_NOT_FOUND="struct_field_not_found",ek.VERSION_NOT_FOUND="version_not_found",ek.TRANSACTION_NOT_FOUND="transaction_not_found",ek.TABLE_ITEM_NOT_FOUND="table_item_not_found",ek.BLOCK_NOT_FOUND="block_not_found",ek.VERSION_PRUNED="version_pruned",ek.BLOCK_PRUNED="block_pruned",ek.INVALID_INPUT="invalid_input",ek.INVALID_TRANSACTION_UPDATE="invalid_transaction_update",ek.SEQUENCE_NUMBER_TOO_OLD="sequence_number_too_old",ek.VM_ERROR="vm_error",ek.HEALTH_CHECK_FAILED="health_check_failed",ek.MEMPOOL_IS_FULL="mempool_is_full",ek.INTERNAL_ERROR="internal_error",ek.WEB_FRAMEWORK_ERROR="web_framework_error",ek.BCS_NOT_SUPPORTED="bcs_not_supported",ek.API_DISABLED="api_disabled",ek
24),e4=((eL=e4||{}).PRIVATE="private",eL.PUBLIC="public",eL.FRIEND="friend",eL),e8=((eC=e8||{}).VALIDATOR="validator",eC.FULL_NODE="full_node",eC),e9={description:`Account data
25
26    A simplified version of the onchain Account resource`,properties:{sequence_number:{type:"U64",isRequired:!0},authentication_key:{type:"HexEncodedBytes",isRequired:!0}}},e7={type:"one-of",description:`Account signature scheme
27
28    The account signature scheme allows you to have two types of accounts:
29
30    1. A single Ed25519 key account, one private key
31    2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.`,contains:[{type:"AccountSignature_Ed25519Signature"},{type:"AccountSignature_MultiEd25519Signature"}]},te={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"Ed25519Signature"}]},tt={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiEd25519Signature"}]},tr={type:"string",description:`A hex encoded 32 byte Aptos account address.
32
33    This is represented in a string as a 64 character hex string, sometimes
34    shortened by stripping leading 0s, and adding a 0x.
35
36    For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
37    `,format:"hex"},tn={description:`This is the generic struct we use for all API errors, it contains a string
38    message and an Aptos API specific error code.`,properties:{message:{type:"string",description:"A message describing the error",isRequired:!0},error_code:{type:"AptosErrorCode",isRequired:!0},vm_error_code:{type:"number",description:"A code providing VM error details when submitting transactions to the VM",format:"uint64"}}},ti={type:"Enum"},ts={description:`A Block with or without transactions
39
40    This contains the information about a transactions along with
41    associated transactions if requested`,properties:{block_height:{type:"U64",isRequired:!0},block_hash:{type:"HashValue",isRequired:!0},block_timestamp:{type:"U64",isRequired:!0},first_version:{type:"U64",isRequired:!0},last_version:{type:"U64",isRequired:!0},transactions:{type:"array",contains:{type:"Transaction"}}}},ta={description:`A block metadata transaction
42
43    This signifies the beginning of a block, and contains information
44    about the specific block`,properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},id:{type:"HashValue",isRequired:!0},epoch:{type:"U64",isRequired:!0},round:{type:"U64",isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0},previous_block_votes_bitvec:{type:"array",contains:{type:"number",format:"uint8"},isRequired:!0},proposer:{type:"Address",isRequired:!0},failed_proposer_indices:{type:"array",contains:{type:"number",format:"uint32"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},to={description:"Decoded table data",properties:{key:{description:"Key of table in JSON",properties:{},isRequired:!0},key_type:{type:"string",description:"Type of key",isRequired:!0},value:{description:"Value of table in JSON",properties:{},isRequired:!0},value_type:{type:"string",description:"Type of value",isRequired:!0}}},tu={description:"Deleted table data",properties:{key:{description:"Deleted key",properties:{},isRequired:!0},key_type:{type:"string",description:"Deleted key type",isRequired:!0}}},tl={description:"Delete a module",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},module:{type:"MoveModuleId",isRequired:!0}}},tc={description:"Delete a resource",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},resource:{type:"MoveStructTag",isRequired:!0}}},th={description:"Delete a table item",properties:{state_key_hash:{type:"string",isRequired:!0},handle:{type:"HexEncodedBytes",isRequired:!0},key:{type:"HexEncodedBytes",isRequired:!0},data:{type:"DeletedTableData"}}},td={properties:{changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0}}},tf={description:"A single Ed25519 signature",properties:{public_key:{type:"HexEncodedBytes",isRequired:!0},signature:{type:"HexEncodedBytes",isRequired:!0}}},tp={description:"Request to encode a submission",properties:{sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},secondary_signers:{type:"array",contains:{type:"Address"}}}},tg={type:"string",description:`Entry function id is string representation of a entry function defined on-chain.
45
46    Format: \`{address}::{module name}::{function name}\`
47
48    Both \`module name\` and \`function name\` are case-sensitive.
49    `},tv={description:"Payload which runs a single entry function",properties:{function:{type:"EntryFunctionId",isRequired:!0},type_arguments:{type:"array",contains:{type:"MoveType"},isRequired:!0},arguments:{type:"array",contains:{properties:{}},isRequired:!0}}},ty={description:"An event from a transaction",properties:{guid:{type:"EventGuid",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},type:{type:"MoveType",isRequired:!0},data:{description:"The JSON representation of the event",properties:{},isRequired:!0}}},tm={properties:{creation_number:{type:"U64",isRequired:!0},account_address:{type:"Address",isRequired:!0}}},tb={description:"Struct holding the outputs of the estimate gas API",properties:{gas_estimate:{type:"number",description:"The current estimate for the gas unit price",isRequired:!0,format:"uint64"}}},tE={type:"one-of",description:"The writeset payload of the Genesis transaction",contains:[{type:"GenesisPayload_WriteSetPayload"}]},tS={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteSetPayload"}]},tT={description:`The genesis transaction
50
51    This only occurs at the genesis transaction (version 0)`,properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},payload:{type:"GenesisPayload",isRequired:!0},events:{type:"array",contains:{type:"Event"},isRequired:!0}}},tw={type:"string"},tA={description:"Representation of a successful healthcheck",properties:{message:{type:"string",isRequired:!0}}},tx={type:"string",description:`All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with \`0x\` and fulfilled with
52    two hex digits per byte.
53
54    Unlike the \`Address\` type, HexEncodedBytes will not trim any zeros.
55    `,format:"hex"},t_={type:"string"},tR={description:`The struct holding all data returned to the client by the
56    index endpoint (i.e., GET "/").  Only for responding in JSON`,properties:{chain_id:{type:"number",description:"Chain ID of the current chain",isRequired:!0,format:"uint8"},epoch:{type:"U64",isRequired:!0},ledger_version:{type:"U64",isRequired:!0},oldest_ledger_version:{type:"U64",isRequired:!0},ledger_timestamp:{type:"U64",isRequired:!0},node_role:{type:"RoleType",isRequired:!0},oldest_block_height:{type:"U64",isRequired:!0},block_height:{type:"U64",isRequired:!0},git_hash:{type:"string"}}},tO={properties:{modules:{type:"array",contains:{type:"MoveModuleBytecode"},isRequired:!0}}},tk={type:"string"},tL={description:"Move function",properties:{name:{type:"IdentifierWrapper",isRequired:!0},visibility:{type:"MoveFunctionVisibility",isRequired:!0},is_entry:{type:"boolean",description:"Whether the function can be called as an entry function directly in a transaction",isRequired:!0},generic_type_params:{type:"array",contains:{type:"MoveFunctionGenericTypeParam"},isRequired:!0},params:{type:"array",contains:{type:"MoveType"},isRequired:!0},return:{type:"array",contains:{type:"MoveType"},isRequired:!0}}},tC={description:"Move function generic type param",properties:{constraints:{type:"array",contains:{type:"MoveAbility"},isRequired:!0}}},tI={type:"Enum"},tD={description:"A Move module",properties:{address:{type:"Address",isRequired:!0},name:{type:"IdentifierWrapper",isRequired:!0},friends:{type:"array",contains:{type:"MoveModuleId"},isRequired:!0},exposed_functions:{type:"array",contains:{type:"MoveFunction"},isRequired:!0},structs:{type:"array",contains:{type:"MoveStruct"},isRequired:!0}}},tP={description:"Move module bytecode along with it's ABI",properties:{bytecode:{type:"HexEncodedBytes",isRequired:!0},abi:{type:"MoveModule"}}},tM={type:"string",description:`Move module id is a string representation of Move module.
57
58    Format: \`{address}::{module name}\`
59
60    \`address\` should be hex-encoded 32 byte account address that is prefixed with \`0x\`.
61
62    Module name is case-sensitive.
63    `},tU={description:"A parsed Move resource",properties:{type:{type:"MoveStructTag",isRequired:!0},data:{type:"MoveStructValue",isRequired:!0}}},tF={description:"Move script bytecode",properties:{bytecode:{type:"HexEncodedBytes",isRequired:!0},abi:{type:"MoveFunction"}}},tB={description:"A move struct",properties:{name:{type:"IdentifierWrapper",isRequired:!0},is_native:{type:"boolean",description:"Whether the struct is a native struct of Move",isRequired:!0},abilities:{type:"array",contains:{type:"MoveAbility"},isRequired:!0},generic_type_params:{type:"array",contains:{type:"MoveStructGenericTypeParam"},isRequired:!0},fields:{type:"array",contains:{type:"MoveStructField"},isRequired:!0}}},tN={description:"Move struct field",properties:{name:{type:"IdentifierWrapper",isRequired:!0},type:{type:"MoveType",isRequired:!0}}},tj={description:"Move generic type param",properties:{constraints:{type:"array",contains:{type:"MoveAbility"},isRequired:!0}}},tq={type:"string",description:`String representation of a MoveStructTag (on-chain Move struct type). This exists so you
64    can specify MoveStructTags as path / query parameters, e.g. for get_events_by_event_handle.
65
66    It is a combination of:
67    1. \`move_module_address\`, \`module_name\` and \`struct_name\`, all joined by \`::\`
68    2. \`struct generic type parameters\` joined by \`, \`
69
70    Examples:
71     * \`0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>\`
72     * \`0x1::account::Account\`
73
74    Note:
75    1. Empty chars should be ignored when comparing 2 struct tag ids.
76    2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
77
78    See [doc](https://aptos.dev/concepts/basics-accounts) for more details.
79    `,pattern:"^0x[0-9a-zA-Z:_<>]+$"},tH={description:`This is a JSON representation of some data within an account resource. More specifically,
80    it is a map of strings to arbitrary JSON values / objects, where the keys are top level
81    fields within the given resource.
82
83    To clarify, you might query for 0x1::account::Account and see the example data.
84
85    Move \`bool\` type value is serialized into \`boolean\`.
86
87    Move \`u8\` type value is serialized into \`integer\`.
88
89    Move \`u64\` and \`u128\` type value is serialized into \`string\`.
90
91    Move \`address\` type value (32 byte Aptos account address) is serialized into a HexEncodedBytes string.
92    For example:
93    - \`0x1\`
94    - \`0x1668f6be25668c1a17cd8caf6b8d2f25\`
95
96    Move \`vector\` type value is serialized into \`array\`, except \`vector<u8>\` which is serialized into a
97    HexEncodedBytes string with \`0x\` prefix.
98    For example:
99    - \`vector<u64>{255, 255}\` => \`["255", "255"]\`
100    - \`vector<u8>{255, 255}\` => \`0xffff\`
101
102    Move \`struct\` type value is serialized into \`object\` that looks like this (except some Move stdlib types, see the following section):
103    \`\`\`json
104    {
105        field1_name: field1_value,
106        field2_name: field2_value,
107        ......
108    }
109    \`\`\`
110
111    For example:
112    \`{ "created": "0xa550c18", "role_id": "0" }\`
113
114     **Special serialization for Move stdlib types**:
115    - [0x1::string::String](https://github.com/aptos-labs/aptos-core/blob/main/language/move-stdlib/docs/ascii.md)
116    is serialized into \`string\`. For example, struct value \`0x1::string::String{bytes: b"Hello World!"}\`
117    is serialized as \`"Hello World!"\` in JSON.
118    `,properties:{}},tz={type:"string",description:`String representation of an on-chain Move type tag that is exposed in transaction payload.
119    Values:
120    - bool
121    - u8
122    - u64
123    - u128
124    - address
125    - signer
126    - vector: \`vector<{non-reference MoveTypeId}>\`
127    - struct: \`{address}::{module_name}::{struct_name}::<{generic types}>\`
128
129    Vector type value examples:
130    - \`vector<u8>\`
131    - \`vector<vector<u64>>\`
132    - \`vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>\`
133
134    Struct type value examples:
135    - \`0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
136    - \`0x1::account::Account\`
137
138    Note:
139    1. Empty chars should be ignored when comparing 2 struct tag ids.
140    2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).
141    `,pattern:"^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$"},tG={type:"any-of",description:"An enum of the possible Move value types",contains:[{type:"number",format:"uint8"},{type:"U64"},{type:"U128"},{type:"boolean"},{type:"Address"},{type:"array",contains:{type:"MoveValue"}},{type:"HexEncodedBytes"},{type:"MoveStructValue"},{type:"string"}]},tK={description:`Multi agent signature for multi agent transactions
142
143    This allows you to have transactions across multiple accounts`,properties:{sender:{type:"AccountSignature",isRequired:!0},secondary_signer_addresses:{type:"array",contains:{type:"Address"},isRequired:!0},secondary_signers:{type:"array",contains:{type:"AccountSignature"},isRequired:!0}}},tW={description:`A Ed25519 multi-sig signature
144
145    This allows k-of-n signing for a transaction`,properties:{public_keys:{type:"array",contains:{type:"HexEncodedBytes"},isRequired:!0},signatures:{type:"array",contains:{type:"HexEncodedBytes"},isRequired:!0},threshold:{type:"number",description:"The number of signatures required for a successful transaction",isRequired:!0,format:"uint8"},bitmap:{type:"HexEncodedBytes",isRequired:!0}}},tV={description:"A transaction waiting in mempool",properties:{hash:{type:"HashValue",isRequired:!0},sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature"}}},t$={type:"Enum"},tQ={description:"Payload which runs a script that can run multiple functions",properties:{code:{type:"MoveScriptBytecode",isRequired:!0},type_arguments:{type:"array",contains:{type:"MoveType"},isRequired:!0},arguments:{type:"array",contains:{properties:{}},isRequired:!0}}},tY={properties:{execute_as:{type:"Address",isRequired:!0},script:{type:"ScriptPayload",isRequired:!0}}},tX={description:"A state checkpoint transaction",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},tJ={description:`A request to submit a transaction
146
147    This requires a transaction and a signature of it`,properties:{sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature",isRequired:!0}}},tZ={description:"Table Item request for the GetTableItem API",properties:{key_type:{type:"MoveType",isRequired:!0},value_type:{type:"MoveType",isRequired:!0},key:{description:"The value of the table item's key",properties:{},isRequired:!0}}},t0={type:"one-of",description:"Enum of the different types of transactions in Aptos",contains:[{type:"Transaction_PendingTransaction"},{type:"Transaction_UserTransaction"},{type:"Transaction_GenesisTransaction"},{type:"Transaction_BlockMetadataTransaction"},{type:"Transaction_StateCheckpointTransaction"}]},t1={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"BlockMetadataTransaction"}]},t2={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"GenesisTransaction"}]},t5={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"PendingTransaction"}]},t3={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"StateCheckpointTransaction"}]},t6={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"UserTransaction"}]},t4={type:"one-of",description:"An enum of the possible transaction payloads",contains:[{type:"TransactionPayload_EntryFunctionPayload"},{type:"TransactionPayload_ScriptPayload"},{type:"TransactionPayload_ModuleBundlePayload"}]},t8={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"EntryFunctionPayload"}]},t9={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ModuleBundlePayload"}]},t7={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ScriptPayload"}]},re={description:"Information telling which batch submission transactions failed",properties:{error:{type:"AptosError",isRequired:!0},transaction_index:{type:"number",description:"The index of which transaction failed, same as submission order",isRequired:!0,format:"uint64"}}},rt={description:`Batch transaction submission result
148
149    Tells which transactions failed`,properties:{transaction_failures:{type:"array",contains:{type:"TransactionsBatchSingleSubmissionFailure"},isRequired:!0}}},rr={type:"one-of",description:"An enum representing the different transaction signatures available",contains:[{type:"TransactionSignature_Ed25519Signature"},{type:"TransactionSignature_MultiEd25519Signature"},{type:"TransactionSignature_MultiAgentSignature"}]},rn={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"Ed25519Signature"}]},ri={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiAgentSignature"}]},rs={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"MultiEd25519Signature"}]},ra={type:"string",description:`A string containing a 128-bit unsigned integer.
150
151    We represent u128 values as a string to ensure compatibility with languages such
152    as JavaScript that do not parse u64s in JSON natively.
153    `,format:"uint64"},ro={type:"string",description:`A string containing a 64-bit unsigned integer.
154
155    We represent u64 values as a string to ensure compatibility with languages such
156    as JavaScript that do not parse u64s in JSON natively.
157    `,format:"uint64"},ru={description:"A transaction submitted by a user to change the state of the blockchain",properties:{version:{type:"U64",isRequired:!0},hash:{type:"HashValue",isRequired:!0},state_change_hash:{type:"HashValue",isRequired:!0},event_root_hash:{type:"HashValue",isRequired:!0},state_checkpoint_hash:{type:"HashValue"},gas_used:{type:"U64",isRequired:!0},success:{type:"boolean",description:"Whether the transaction was successful",isRequired:!0},vm_status:{type:"string",description:"The VM status of the transaction, can tell useful information in a failure",isRequired:!0},accumulator_root_hash:{type:"HashValue",isRequired:!0},changes:{type:"array",contains:{type:"WriteSetChange"},isRequired:!0},sender:{type:"Address",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},max_gas_amount:{type:"U64",isRequired:!0},gas_unit_price:{type:"U64",isRequired:!0},expiration_timestamp_secs:{type:"U64",isRequired:!0},payload:{type:"TransactionPayload",isRequired:!0},signature:{type:"TransactionSignature"},events:{type:"array",contains:{type:"Event"},isRequired:!0},timestamp:{type:"U64",isRequired:!0}}},rl={description:"An event from a transaction with a version",properties:{version:{type:"U64",isRequired:!0},guid:{type:"EventGuid",isRequired:!0},sequence_number:{type:"U64",isRequired:!0},type:{type:"MoveType",isRequired:!0},data:{description:"The JSON representation of the event",properties:{},isRequired:!0}}},rc={description:"Write a new module or update an existing one",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},data:{type:"MoveModuleBytecode",isRequired:!0}}},rh={description:"Write a resource or update an existing one",properties:{address:{type:"Address",isRequired:!0},state_key_hash:{type:"string",description:"State key hash",isRequired:!0},data:{type:"MoveResource",isRequired:!0}}},rd={type:"one-of",description:"The associated writeset with a payload",contains:[{type:"WriteSet_ScriptWriteSet"},{type:"WriteSet_DirectWriteSet"}]},rf={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DirectWriteSet"}]},rp={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"ScriptWriteSet"}]},rg={type:"one-of",description:"A final state change of a transaction on a resource or module",contains:[{type:"WriteSetChange_DeleteModule"},{type:"WriteSetChange_DeleteResource"},{type:"WriteSetChange_DeleteTableItem"},{type:"WriteSetChange_WriteModule"},{type:"WriteSetChange_WriteResource"},{type:"WriteSetChange_WriteTableItem"}]},rv={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteModule"}]},ry={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteResource"}]},rm={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"DeleteTableItem"}]},rb={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteModule"}]},rE={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteResource"}]},rS={type:"all-of",contains:[{properties:{type:{type:"string",isRequired:!0}}},{type:"WriteTableItem"}]},rT={description:"A writeset payload, used only for genesis",properties:{write_set:{type:"WriteSet",isRequired:!0}}},rw={description:"Change set to write a table item",properties:{state_key_hash:{type:"string",isRequired:!0},handle:{type:"HexEncodedBytes",isRequired:!0},key:{type:"HexEncodedBytes",isRequired:!0},value:{type:"HexEncodedBytes",isRequired:!0},data:{type:"DecodedTableData"}}},rA={};eu(rA,{AccountAddress:()=>r_,AccountAuthenticator:()=>r5,AccountAuthenticatorEd25519:()=>r3,AccountAuthenticatorMultiEd25519:()=>r6,AuthenticationKey:()=>nC,ChainId:()=>nE,ChangeSet:()=>nd,Ed25519PublicKey:()=>rV,Ed25519Signature:()=>rQ,EntryFunction:()=>nl,Identifier:()=>r4,Module:()=>nc,ModuleId:()=>nh,MultiAgentRawTransaction:()=>nv,MultiEd25519PublicKey:()=>rY,MultiEd25519Signature:()=>rJ,RawTransaction:()=>no,RawTransactionWithData:()=>ng,RotationProofChallenge:()=>nI,Script:()=>nu,SignedTransaction:()=>np,StructTag:()=>na,Transaction:()=>nO,TransactionArgument:()=>nS,TransactionArgumentAddress:()=>nx,TransactionArgumentBool:()=>nR,TransactionArgumentU128:()=>nA,TransactionArgumentU64:()=>nw,TransactionArgumentU8:()=>nT,TransactionArgumentU8Vector:()=>n_,TransactionAuthenticator:()=>rZ,TransactionAuthenticatorEd25519:()=>r0,TransactionAuthenticatorMultiAgent:()=>r2,TransactionAuthenticatorMultiEd25519:()=>r1,TransactionPayload:()=>ny,TransactionPayloadEntryFunction:()=>nb,TransactionPayloadScript:()=>nm,TypeTag:()=>r8,TypeTagAddress:()=>nr,TypeTagBool:()=>r9,TypeTagSigner:()=>nn,TypeTagStruct:()=>ns,TypeTagU128:()=>nt,TypeTagU64:()=>ne,TypeTagU8:()=>r7,TypeTagVector:()=>ni,UserTransaction:()=>nk,WriteSet:()=>nf});var rx=class{constructor(e){if(e.length!==rx.LENGTH)throw Error("Expected address of length 32");this.address=e}static fromHex(e){let t=ev.ensure(e);t.noPrefix().length%2!=0&&(t=new ev(`0${t.noPrefix()}`));let r=t.toUint8Array();if(r.length>rx.LENGTH)throw Error("Hex string is too long. Address's length is 32 bytes.");if(r.length===rx.LENGTH)return new rx(r);let n=new Uint8Array(rx.LENGTH);return n.set(r,rx.LENGTH-r.length),new rx(n)}serialize(e){e.serializeFixedBytes(this.address)}static deserialize(e){return new rx(e.deserializeFixedBytes(rx.LENGTH))}},r_=rx;r_.LENGTH=32,r_.CORE_CODE_ADDRESS=rx.fromHex("0x1"),eu({},{Deserializer:()=>rI,Serializer:()=>rL,bcsSerializeBool:()=>rH,bcsSerializeBytes:()=>rG,bcsSerializeFixedBytes:()=>rK,bcsSerializeStr:()=>rz,bcsSerializeU128:()=>rq,bcsSerializeU16:()=>rN,bcsSerializeU32:()=>rj,bcsSerializeU8:()=>rB,bcsSerializeUint64:()=>rF,bcsToBytes:()=>rU,deserializeVector:()=>rM,serializeVector:()=>rD,serializeVectorWithFunc:()=>rP});var rR=4294967296-1,rO=BigInt(18446744073709552e3)-BigInt(1),rk=BigInt(3402823669209385e23)-BigInt(1),rL=class{constructor(){this.buffer=new ArrayBuffer(64),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let t=new ArrayBuffer(2*this.buffer.byteLength);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t}}serialize(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,t,r){this.ensureBufferWillHandleSize(t);let n=new DataView(this.buffer,this.offset);e.apply(n,[0,r,!0]),this.offset+=t}serializeStr(e){let t=new TextEncoder;this.serializeBytes(t.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.serialize(e)}serializeFixedBytes(e){this.serialize(e)}serializeBool(e){if("boolean"!=typeof e)throw Error("Value needs to be a boolean");this.serialize(new Uint8Array([e?1:0]))}serializeU8(e){this.serialize(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let t=BigInt(e.toString())&BigInt(rR),r=BigInt(e.toString())>>BigInt(32);this.serializeU32(Number(t)),this.serializeU32(Number(r))}serializeU128(e){let t=BigInt(e.toString())&rO,r=BigInt(e.toString())>>BigInt(64);this.serializeU64(t),this.serializeU64(r)}serializeU32AsUleb128(e){let t=e,r=[];for(;t>>>7!=0;)r.push(127&t|128),t>>>=7;r.push(t),this.serialize(new Uint8Array(r))}getBytes(){return new Uint8Array(this.buffer).slice(0,this.offset)}};function rC(e,t,r){return(n,i,s)=>{let a=s.value;return s.value=function(n){let i=BigInt(n.toString());if(i>BigInt(t.toString())||i<BigInt(e.toString()))throw Error(r||"Value is out of range");a.apply(this,[n])},s}}el([rC(0,255)],rL.prototype,"serializeU8",1),el([rC(0,65535)],rL.prototype,"serializeU16",1),el([rC(0,rR)],rL.prototype,"serializeU32",1),el([rC(BigInt(0),rO)],rL.prototype,"serializeU64",1),el([rC(BigInt(0),rk)],rL.prototype,"serializeU128",1),el([rC(0,rR)],rL.prototype,"serializeU32AsUleb128",1);var rI=class{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}read(e){if(this.offset+e>this.buffer.byteLength)throw Error("Reached to the end of buffer");let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}deserializeStr(){let e=this.deserializeBytes(),t=new TextDecoder;return t.decode(e)}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(1!==e&&0!==e)throw Error("Invalid boolean value");return 1===e}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),t=this.deserializeU32();return BigInt(BigInt(t)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),t=this.deserializeU64();return BigInt(t<<BigInt(64)|e)}deserializeUleb128AsU32(){let e=BigInt(0),t=0;for(;e<rR;){let r=this.deserializeU8();if(e|=BigInt(127&r)<<BigInt(t),(128&r)==0)break;t+=7}if(e>rR)throw Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}};
157function rD(e,t){t.serializeU32AsUleb128(e.length),e.forEach(e=>{e.serialize(t)})}function rP(e,t){let r=new rL;r.serializeU32AsUleb128(e.length);let n=r[t];return e.forEach(e=>{n.call(r,e)}),r.getBytes()}function rM(e,t){let r=e.deserializeUleb128AsU32(),n=[];for(let i=0;i<r;i+=1)n.push(t.deserialize(e));return n}function rU(e){let t=new rL;return e.serialize(t),t.getBytes()}function rF(e){let t=new rL;return t.serializeU64(e),t.getBytes()}function rB(e){let t=new rL;return t.serializeU8(e),t.getBytes()}function rN(e){let t=new rL;return t.serializeU16(e),t.getBytes()}function rj(e){let t=new rL;return t.serializeU32(e),t.getBytes()}function rq(e){let t=new rL;return t.serializeU128(e),t.getBytes()}function rH(e){let t=new rL;return t.serializeBool(e),t.getBytes()}function rz(e){let t=new rL;return t.serializeStr(e),t.getBytes()}function rG(e){let t=new rL;return t.serializeBytes(e),t.getBytes()}function rK(e){let t=new rL;return t.serializeFixedBytes(e),t.getBytes()}var rW=class{constructor(e){if(e.length!==rW.LENGTH)throw Error(`Ed25519PublicKey length should be ${rW.LENGTH}`);this.value=e}serialize(e){e.serializeBytes(this.value)}static deserialize(e){let t=e.deserializeBytes();return new rW(t)}},rV=rW;rV.LENGTH=32;var r$=class{constructor(e){if(this.value=e,e.length!==r$.LENGTH)throw Error(`Ed25519Signature length should be ${r$.LENGTH}`)}serialize(e){e.serializeBytes(this.value)}static deserialize(e){let t=e.deserializeBytes();return new r$(t)}},rQ=r$;rQ.LENGTH=64;var rY=class{constructor(e,t){if(this.public_keys=e,this.threshold=t,t>32)throw Error('"threshold" cannot be larger than 32')}toBytes(){let e=new Uint8Array(this.public_keys.length*rV.LENGTH+1);return this.public_keys.forEach((t,r)=>{e.set(t.value,r*rV.LENGTH)}),e[this.public_keys.length*rV.LENGTH]=this.threshold,e}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){let t=e.deserializeBytes(),r=t[t.length-1],n=[];for(let i=0;i<t.length-1;i+=rV.LENGTH)n.push(new rV(t.subarray(i,i+rV.LENGTH)));return new rY(n,r)}},rX=class{constructor(e,t){if(this.signatures=e,this.bitmap=t,t.length!==rX.BITMAP_LEN)throw Error(`"bitmap" length should be ${rX.BITMAP_LEN}`)}toBytes(){let e=new Uint8Array(this.signatures.length*rQ.LENGTH+rX.BITMAP_LEN);return this.signatures.forEach((t,r)=>{e.set(t.value,r*rQ.LENGTH)}),e.set(this.bitmap,this.signatures.length*rQ.LENGTH),e}static createBitmap(e){let t=new Uint8Array([0,0,0,0]),r=new Set;return e.forEach(e=>{if(e>=32)throw Error(`Invalid bit value ${e}.`);if(r.has(e))throw Error("Duplicated bits detected.");r.add(e);let n=Math.floor(e/8),i=t[n];i|=128>>e%8,t[n]=i}),t}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){let t=e.deserializeBytes(),r=t.subarray(t.length-4),n=[];for(let i=0;i<t.length-r.length;i+=rQ.LENGTH)n.push(new rQ(t.subarray(i,i+rQ.LENGTH)));return new rX(n,r)}},rJ=rX;rJ.BITMAP_LEN=4;var rZ=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return r0.load(e);case 1:return r1.load(e);case 2:return r2.load(e);default:throw Error(`Unknown variant index for TransactionAuthenticator: ${t}`)}}},r0=class extends rZ{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=rV.deserialize(e),r=rQ.deserialize(e);return new r0(t,r)}},r1=class extends rZ{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=rY.deserialize(e),r=rJ.deserialize(e);return new r1(t,r)}},r2=class extends rZ{constructor(e,t,r){super(),this.sender=e,this.secondary_signer_addresses=t,this.secondary_signers=r}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),rD(this.secondary_signer_addresses,e),rD(this.secondary_signers,e)}static load(e){let t=r5.deserialize(e),r=rM(e,r_),n=rM(e,r5);return new r2(t,r,n)}},r5=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return r3.load(e);case 1:return r6.load(e);default:throw Error(`Unknown variant index for AccountAuthenticator: ${t}`)}}},r3=class extends r5{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=rV.deserialize(e),r=rQ.deserialize(e);return new r3(t,r)}},r6=class extends r5{constructor(e,t){super(),this.public_key=e,this.signature=t}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let t=rY.deserialize(e),r=rJ.deserialize(e);return new r6(t,r)}},r4=class{constructor(e){this.value=e}serialize(e){e.serializeStr(this.value)}static deserialize(e){let t=e.deserializeStr();return new r4(t)}},r8=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return r9.load(e);case 1:return r7.load(e);case 2:return ne.load(e);case 3:return nt.load(e);case 4:return nr.load(e);case 5:return nn.load(e);case 6:return ni.load(e);case 7:return ns.load(e);default:throw Error(`Unknown variant index for TypeTag: ${t}`)}}}
157,r9=class extends r8{serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new r9}},r7=class extends r8{serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new r7}},ne=class extends r8{serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new ne}},nt=class extends r8{serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new nt}},nr=class extends r8{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new nr}},nn=class extends r8{serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new nn}},ni=class extends r8{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let t=r8.deserialize(e);return new ni(t)}},ns=class extends r8{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let t=na.deserialize(e);return new ns(t)}},na=class{constructor(e,t,r,n){this.address=e,this.module_name=t,this.name=r,this.type_args=n}static fromString(e){if(e.includes("<"))throw Error("Not implemented");let t=e.split("::");if(3!==t.length)throw Error("Invalid struct tag string literal.");return new na(r_.fromHex(t[0]),new r4(t[1]),new r4(t[2]),[])}serialize(e){this.address.serialize(e),this.module_name.serialize(e),this.name.serialize(e),rD(this.type_args,e)}static deserialize(e){let t=r_.deserialize(e),r=r4.deserialize(e),n=r4.deserialize(e),i=rM(e,r8);return new na(t,r,n,i)}},no=class{constructor(e,t,r,n,i,s,a){this.sender=e,this.sequence_number=t,this.payload=r,this.max_gas_amount=n,this.gas_unit_price=i,this.expiration_timestamp_secs=s,this.chain_id=a}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let t=r_.deserialize(e),r=e.deserializeU64(),n=ny.deserialize(e),i=e.deserializeU64(),s=e.deserializeU64(),a=e.deserializeU64(),o=nE.deserialize(e);return new no(t,r,n,i,s,a,o)}},nu=class{constructor(e,t,r){this.code=e,this.ty_args=t,this.args=r}serialize(e){e.serializeBytes(this.code),rD(this.ty_args,e),rD(this.args,e)}static deserialize(e){let t=e.deserializeBytes(),r=rM(e,r8),n=rM(e,nS);return new nu(t,r,n)}},nl=class{constructor(e,t,r,n){this.module_name=e,this.function_name=t,this.ty_args=r,this.args=n}static natural(e,t,r,n){return new nl(nh.fromStr(e),new r4(t),r,n)}static natual(e,t,r,n){return nl.natural(e,t,r,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),rD(this.ty_args,e),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{e.serializeBytes(t)})}static deserialize(e){let t=nh.deserialize(e),r=r4.deserialize(e),n=rM(e,r8),i=e.deserializeUleb128AsU32(),s=[];for(let a=0;a<i;a+=1)s.push(e.deserializeBytes());return new nl(t,r,n,s)}},nc=class{constructor(e){this.code=e}serialize(e){e.serializeBytes(this.code)}static deserialize(e){let t=e.deserializeBytes();return new nc(t)}},nh=class{constructor(e,t){this.address=e,this.name=t}static fromStr(e){let t=e.split("::");if(2!==t.length)throw Error("Invalid module id.");return new nh(r_.fromHex(new ev(t[0])),new r4(t[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let t=r_.deserialize(e),r=r4.deserialize(e);return new nh(t,r)}},nd=class{serialize(e){throw Error("Not implemented.")}static deserialize(e){throw Error("Not implemented.")}},nf=class{serialize(e){throw Error("Not implmented.")}static deserialize(e){throw Error("Not implmented.")}},np=class{constructor(e,t){this.raw_txn=e,this.authenticator=t}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let t=no.deserialize(e),r=rZ.deserialize(e);return new np(t,r)}},ng=class{static deserialize(e){let t=e.deserializeUleb128AsU32();if(0===t)return nv.load(e);throw Error(`Unknown variant index for RawTransactionWithData: ${t}`)}},nv=class extends ng{constructor(e,t){super(),this.raw_txn=e,this.secondary_signer_addresses=t}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),rD(this.secondary_signer_addresses,e)}static load(e){let t=no.deserialize(e),r=rM(e,r_);return new nv(t,r)}},ny=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return nm.load(e);case 2:return nb.load(e);default:throw Error(`Unknown variant index for TransactionPayload: ${t}`)}}},nm=class extends ny{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){let t=nu.deserialize(e);return new nm(t)}},nb=class extends ny{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),this.value.serialize(e)}static load(e){let t=nl.deserialize(e);return new nb(t)}},nE=class{constructor(e){this.value=e}serialize(e){e.serializeU8(this.value)}static deserialize(e){let t=e.deserializeU8();return new nE(t)}},nS=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return nT.load(e);case 1:return nw.load(e);case 2:return nA.load(e);case 3:return nx.load(e);case 4:return n_.load(e);case 5:return nR.load(e);default:throw Error(`Unknown variant index for TransactionArgument: ${t}`)}}},nT=class extends nS{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),e.serializeU8(this.value)}static load(e){let t=e.deserializeU8();return new nT(t)}},nw=class extends nS{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(1),e.serializeU64(this.value)}static load(e){let t=e.deserializeU64();return new nw(t)}},nA=class extends nS{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),e.serializeU128(this.value)}static load(e){let t=e.deserializeU128();return new nA(t)}},nx=class extends nS{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(3),this.value.serialize(e)}static load(e){let t=r_.deserialize(e);return new nx(t)}},n_=class extends nS{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(4),e.serializeBytes(this.value)}static load(e){let t=e.deserializeBytes();return new n_(t)}},nR=class extends nS{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(5),e.serializeBool(this.value)}static load(e){let t=e.deserializeBool();return new nR(t)}},nO=class{getHashSalt(){let e=G.create();return e.update("APTOS::Transaction"),e.digest()}static deserialize(e){let t=e.deserializeUleb128AsU32();if(0===t)return nk.load(e);throw Error(`Unknown variant index for Transaction: ${t}`)}},nk=class extends nO{constructor(e){super(),this.value=e}hash(){let e=G.create();return e.update(this.getHashSalt()),e.update(rU(this)),e.digest()}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){return new nk(np.deserialize(e))}},nL=class{constructor(e){if(e.length!==nL.LENGTH)throw Error("Expected a byte array of length 32");this.bytes=e}
157static fromMultiEd25519PublicKey(e){let t=e.toBytes(),r=new Uint8Array(t.length+1);r.set(t),r.set([nL.MULTI_ED25519_SCHEME],t.length);let n=G.create();return n.update(r),new nL(n.digest())}derivedAddress(){return ev.fromUint8Array(this.bytes)}},nC=nL;nC.LENGTH=32,nC.MULTI_ED25519_SCHEME=1;var nI=class{constructor(e,t,r,n,i,s,a){this.accountAddress=e,this.moduleName=t,this.structName=r,this.sequenceNumber=n,this.originator=i,this.currentAuthKey=s,this.newPublicKey=a}serialize(e){this.accountAddress.serialize(e),e.serializeStr(this.moduleName),e.serializeStr(this.structName),e.serializeU64(this.sequenceNumber),this.originator.serialize(e),this.currentAuthKey.serialize(e),e.serializeBytes(this.newPublicKey)}},nD=class{constructor(e){this.name=e}serialize(e){e.serializeStr(this.name)}static deserialize(e){let t=e.deserializeStr();return new nD(t)}},nP=class{constructor(e,t){this.name=e,this.type_tag=t}serialize(e){e.serializeStr(this.name),this.type_tag.serialize(e)}static deserialize(e){let t=e.deserializeStr(),r=r8.deserialize(e);return new nP(t,r)}},nM=class{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return nU.load(e);case 1:return nF.load(e);default:throw Error(`Unknown variant index for TransactionPayload: ${t}`)}}},nU=class extends nM{constructor(e,t,r,n,i){super(),this.name=e,this.doc=t,this.co
157de=r,this.ty_args=n,this.args=i}serialize(e){e.serializeU32AsUleb128(0),e.serializeStr(this.name),e.serializeStr(this.doc),e.serializeBytes(this.code),rD(this.ty_args,e),rD(this.args,e)}static load(e){let t=e.deserializeStr(),r=e.deserializeStr(),n=e.deserializeBytes(),i=rM(e,nD),s=rM(e,nP);return new nU(t,r,n,i,s)}},nF=class extends nM{constructor(e,t,r,n,i){super(),this.name=e,this.module_name=t,this.doc=r,this.ty_args=n,this.args=i}serialize(e){e.serializeU32AsUleb128(1),e.serializeStr(this.name),this.module_name.serialize(e),e.serializeStr(this.doc),rD(this.ty_args,e),rD(this.args,e)}static load(e){let t=e.deserializeStr(),r=nh.deserialize(e),n=e.deserializeStr(),i=rM(e,nD),s=rM(e,nP);return new nF(t,r,n,i,s)}};function nB(e,t,r){if(!(null==t?void 0:t.includes(typeof e)))throw Error(r||`Invalid arg: ${e} type should be ${t instanceof Array?t.join(" or "):t}`)}function nN(e){throw Error(e)}function nj(e){return!!e.match(/\s/)}function nq(e){return!!e.match(/[_A-Za-z0-9]/g)}function nH(e,t){let r=e[t];if(":"===r){if("::"===e.slice(t,t+2))return[["COLON","::"],2];nN("Unrecognized token.")}else if("<"===r)return[["LT","<"],1];else if(">"===r)return[["GT",">"],1];else if(","===r)return[["COMMA",","],1];else if(nj(r)){let n="";for(let i=t;i<e.length;i+=1){let s=e[i];if(nj(s))n=`${n}${s}`;else break}return[["SPACE",n],n.length]}else if(nq(r)){let a="";for(let o=t;o<e.length;o+=1){let u=e[o];if(nq(u))a=`${a}${u}`;else break}return[["IDENT",a],a.length]}throw Error("Unrecognized token.")}var nz=class{constructor(e){this.tokens=function(e){let t=0,r=[];for(;t<e.length;){let[n,i]=nH(e,t);"SPACE"!==n[0]&&r.push(n),t+=i}return r}(e)}consume(e){let t=this.tokens.shift();t&&t[1]===e||nN("Invalid type tag.")}parseCommaList(e,t){let r=[];for(this.tokens.length<=0&&nN("Invalid type tag.");this.tokens[0][1]!==e&&(r.push(this.parseTypeTag()),!(this.tokens.length>0)||this.tokens[0][1]!==e)&&(this.consume(","),!(this.tokens.length>0)||this.tokens[0][1]!==e||!t);){this.tokens.length<=0&&nN("Invalid type tag.")}return r}parseTypeTag(){0===this.tokens.length&&nN("Invalid type tag.");let[e,t]=this.tokens.shift();if("u8"===t)return new r7;if("u64"===t)return new ne;if("u128"===t)return new nt;if("bool"===t)return new r9;if("address"===t)return new nr;if("vector"===t){this.consume("<");let r=this.parseTypeTag();return this.consume(">"),new ni(r)}
157if("IDENT"===e&&(t.startsWith("0x")||t.startsWith("0X"))){this.consume("::");let[n,i]=this.tokens.shift();"IDENT"!==n&&nN("Invalid type tag."),this.consume("::");let[s,a]=this.tokens.shift();"IDENT"!==s&&nN("Invalid type tag.");let o=[];this.tokens.length>0&&"<"===this.tokens[0][1]&&(this.consume("<"),o=this.parseCommaList(">",!0),this.consume(">"));let u=new na(r_.fromHex(t),new r4(i),new r4(a),o);return new ns(u)}throw Error("Invalid type tag.")}};function nG(e){if(nB(e,["boolean","string"]),"boolean"==typeof e)return e;if("true"===e)return!0;if("false"===e)return!1;throw Error("Invalid boolean string.")}function nK(e){if(nB(e,["number","string"]),"number"==typeof e)return e;let t=Number.parseInt(e,10);if(Number.isNaN(t))throw Error("Invalid number string.");return t}function nW(e){return nB(e,["number","bigint","string"]),BigInt(e)}var nV=class{constructor(e,t){this.rawTxnBuilder=t,this.signingFunction=e}build(e,t,r){if(!this.rawTxnBuilder)throw Error("this.rawTxnBuilder doesn't exist.");return this.rawTxnBuilder.build(e,t,r)}static getSigningMessage(e){let t=G.create();if(e instanceof no)t.update("APTOS::RawTransaction");else if(e instanceof nv)t.update("APTOS::RawTransactionWithData");else throw Error("Unknown transaction type.");let r=t.digest(),n=rU(e),i=new Uint8Array(r.length+n.length);return i.set(r),i.set(n,r.length),i}},n$=class extends nV{constructor(e,t,r){super(e,r),this.publicKey=t}rawToSigned(e){let t=nV.getSigningMessage(e),r=this.signingFunction(t),n=new r0(new rV(this.publicKey),r);return new np(e,n)}sign(e){return rU(this.rawToSigned(e))}},nQ=class{constructor(e,t){this.abiMap=new Map,e.forEach(e=>{let t=new rI(e),r=nM.deserialize(t),n;if(r instanceof nF){let{address:i,name:s}=r.module_name;n=`${ev.fromUint8Array(i.address).toShortString()}::${s.value}::${r.name}`}else n=r.name;if(this.abiMap.has(n))throw Error("Found conflicting ABI interfaces");this.abiMap.set(n,r)}),this.builderConfig={maxGasAmount:BigInt(2e4),expSecFromNow:20,...t}}static toBCSArgs(e,t){if(e.length!==t.length)throw Error("Wrong number of args provided.");return t.map((t,r)=>{let n=new rL;return!function e(t,r,n){if(r instanceof r9){n.serializeBool(nG(t));return}if(r instanceof r7){n.serializeU8(nK(t));return}if(r instanceof ne){n.serializeU64(nW(t));return}if(r instanceof nt){n.serializeU128(nW(t));return}if(r instanceof nr){let i;if("string"==typeof t||t instanceof ev)i=r_.fromHex(t);else if(t instanceof r_)i=t;else throw Error("Invalid account address.");i.serialize(n);return}if(r instanceof ni){if(r.value instanceof r7){if(t instanceof Uint8Array){n.serializeBytes(t);return}if("string"==typeof t){n.serializeStr(t);return}}if(!(t instanceof Array))throw Error("Invalid vector args.");n.serializeU32AsUleb128(t.length),t.forEach(t=>e(t,r.value,n));return}if(r instanceof ns){let{address:s,module_name:a,name:o}=r.value;if("0x1::string::String"!=`${ev.fromUint8Array(s.address).toShortString()}::${a.value}::${o.value}`)throw Error("The only supported struct arg is of type 0x1::string::String");nB(t,["string"]),n.serializeStr(t);return}throw Error("Unsupported arg type.")}(t,e[r].type_tag,n),n.getBytes()})}static toTransactionArguments(e,t){if(e.length!==t.length)throw Error("Wrong number of args provided.");return t.map((t,r)=>(function(e,t){if(t instanceof r9)return new nR(nG(e));if(t instanceof r7)return new nT(nK(e));if(t instanceof ne)return new nw(nW(e));if(t instanceof nt)return new nA(nW(e));if(t instanceof nr){let r;if("string"==typeof e||e instanceof ev)r=r_.fromHex(e);else if(e instanceof r_)r=e;else throw Error("Invalid account address.");return new nx(r)}if(t instanceof ni&&t.value instanceof r7){if(!(e instanceof Uint8Array))throw Error(`${e} should be an instance of Uint8Array`);return new n_(e)}throw Error("Unknown type for TransactionArgument.")})(t,e[r].type_tag))}setSequenceNumber(e){this.builderConfig.sequenceNumber=BigInt(e)}buildTransactionPayload(e,t,r){let n=t.map(e=>new nz(e).parseTypeTag()),i;if(!this.abiMap.has(e))throw Error(`Cannot find function: ${e}`);let s=this.abiMap.get(e);if(s instanceof nF){let a=nQ.toBCSArgs(s.args,r);i=new nb(new nl(s.module_name,new r4(s.name),n,a))}else if(s instanceof nU){let o=nQ.toTransactionArguments(s.args,r);i=new nm(new nu(s.code,n,o))}else throw Error("Unknown ABI format.");return i}build(e,t,r){let{sender:n,sequenceNumber:i,gasUnitPrice:s,maxGasAmount:a,expSecFromNow:o,chainId:u}=this.builderConfig;if(!s)throw Error("No gasUnitPrice provided.");let l=n instanceof r_?n:r_.fromHex(n),c=BigInt(Math.floor(Date.now()/1e3)+Number(o)),h=this.buildTransactionPayload(e,t,r);if(h)return new no(l,BigInt(i),h,BigInt(a),BigInt(s),c,new nE(Number(u)));throw Error("Invalid ABI.")}},nY=class{constructor(e,t){this.aptosClient=e,this.builderConfig=t}async fetchABI(e){let t=await this.aptosClient.getAccountModules(e),r=t.map(e=>e.abi).flatMap(e=>e.exposed_functions.filter(e=>e.is_entry).map(t=>({fullName:`${e.address}::${e.name}::${t.name}`,...t}))),n=new Map;
157return r.forEach(e=>{n.set(e.fullName,e)}),n}async build(e,t,r){e=e.replace(/^0[xX]0*/g,"0x");let n=e.split("::");if(3!==n.length)throw Error("'func' needs to be a fully qualified function name in format <address>::<module>::<function>, e.g. 0x1::coins::transfer");let[i,s]=e.split("::"),a=await this.fetchABI(i);if(!a.has(e))throw Error(`${e} doesn't exist.`);let o=a.get(e),u=o.params.filter(e=>"signer"!==e&&"&signer"!==e),l=u.map((e,t)=>new nP(`var${t}`,new nz(e).parseTypeTag())),c=new nF(o.name,nh.fromStr(`${i}::${s}`),"",o.generic_type_params.map((e,t)=>new nD(`${t}`)),l),{sender:h,...d}=this.builderConfig,f=h instanceof r_?ev.fromUint8Array(h.address):h,[{sequence_number:p},g,{gas_estimate:v}]=await Promise.all([(null==d?void 0:d.sequenceNumber)?Promise.resolve({sequence_number:null==d?void 0:d.sequenceNumber}):this.aptosClient.getAccount(f),(null==d?void 0:d.chainId)?Promise.resolve(null==d?void 0:d.chainId):this.aptosClient.getChainId(),(null==d?void 0:d.gasUnitPrice)?Promise.resolve({gas_estimate:null==d?void 0:d.gasUnitPrice}):this.aptosClient.estimateGasPrice()]),y=new nQ([rU(c)],{sender:h,sequenceNumber:p,chainId:g,gasUnitPrice:BigInt(v),...d});return y.build(e,t,r)}};el([em({ttlMs:6e5,hashFunction:void 0})],nY.prototype,"fetchABI",1);var nX=class{constructor(e,t,r=!1){if(!e)throw Error("Node URL cannot be empty.");let n=null==t?{}:{...t};if(r)this.nodeUrl=e;else{var i;let s;this.nodeUrl=((s=`${e}`).endsWith("/")&&(s=s.substring(0,s.length-1)),s.endsWith("/v1")||(s=`${s}/v1`),s)}n.BASE=this.nodeUrl,(null==t?void 0:t.WITH_CREDENTIALS)===!1?n.WITH_CREDENTIALS=!1:n.WITH_CREDENTIALS=!0,this.client=new e5(n)}async getAccount(e){return this.client.accounts.getAccount(ev.ensure(e).hex())}async getAccountTransactions(e,t){var r;return this.client.transactions.getAccountTransactions(ev.ensure(e).hex(),null==(r=null==t?void 0:t.start)?void 0:r.toString(),null==t?void 0:t.limit)}async getAccountModules(e,t){var r;return this.client.accounts.getAccountModules(ev.ensure(e).hex(),null==(r=null==t?void 0:t.ledgerVersion)?void 0:r.toString())}async getAccountModule(e,t,r){var n;return this.client.accounts.getAccountModule(ev.ensure(e).hex(),t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}async getAccountResources(e,t){var r;return this.client.accounts.getAccountResources(ev.ensure(e).hex(),null==(r=null==t?void 0:t.ledgerVersion)?void 0:r.toString())}async getAccountResource(e,t,r){var n;return this.client.accounts.getAccountResource(ev.ensure(e).hex(),t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString())}static generateBCSTransaction(e,t){let r=new n$(t=>{let r=e.signBuffer(t);return new rA.Ed25519Signature(r.toUint8Array())},e.pubKey().toUint8Array());return r.sign(t)}static generateBCSSimulation(e,t){let r=new n$(e=>{let t=new Uint8Array(64);return new rA.Ed25519Signature(t)},e.pubKey().toUint8Array());return r.sign(t)}async generateTransaction(e,t,r){let n={sender:e};if((null==r?void 0:r.sequence_number)&&(n.sequenceNumber=r.sequence_number),(null==r?void 0:r.gas_unit_price)&&(n.gasUnitPrice=r.gas_unit_price),(null==r?void 0:r.max_gas_amount)&&(n.maxGasAmount=r.max_gas_amount),null==r?void 0:r.expiration_timestamp_secs){let i=Number.parseInt(r.expiration_timestamp_secs,10);n.expSecFromNow=i-Math.floor(Date.now()/1e3)}let s=new nY(this,n);return s.build(t.function,t.type_arguments,t.arguments)}async signTransaction(e,t){return Promise.resolve(nX.generateBCSTransaction(e,t))}async getEventsByCreationNumber(e,t,r){var n;return this.client.events.getEventsByCreationNumber(ev.ensure(e).hex(),t.toString(),null==(n=null==r?void 0:r.start)?void 0:n.toString(),null==r?void 0:r.limit)}async getEventsByEventHandle(e,t,r,n){var i;return this.client.events.getEventsByEventHandle(ev.ensure(e).hex(),t,r,null==(i=null==n?void 0:n.start)?void 0:i.toString(),null==n?void 0:n.limit)}async submitTransaction(e){return this.submitSignedBCSTransaction(e)}async simulateTransaction(e,t,r){let n=nX.generateBCSSimulation(e,t);return this.submitBCSSimulation(n,r)}async submitSignedBCSTransaction(e){return this.client.request.request({url:"/transactions",method:"POST",body:e,mediaType:"application/x.aptos.signed_transaction+bcs"})}async submitBCSSimulation(e,t){var r,n;let i={estimate_gas_unit_price:null!=(r=null==t?void 0:t.estimateGasUnitPrice)&&r,estimate_max_gas_amount:null!=(n=null==t?void 0:t.estimateMaxGasAmount)&&n};return this.client.request.request({url:"/transactions/simulate",query:i,method:"POST",body:e,mediaType:"application/x.aptos.signed_transaction+bcs"})}async getTransactions(e){var t;return this.client.transactions.getTransactions(null==(t=null==e?void 0:e.start)?void 0:t.toString(),null==e?void 0:e.limit)}async getTransactionByHash(e){return this.client.transactions.getTransactionByHash(e)}async getTransactionByVersion(e){return this.client.transactions.getTransactionByVersion(e.toString())}async transactionPending(e){try{let t=await this.client.transactions.getTransactionByHash(e);return"pending_transaction"===t.type}catch(r){if((null==r?void 0:r.status)===404)return!0;throw r}}async waitForTransactionWithResult(e,t){var r,n;
157let i=null!=(r=null==t?void 0:t.timeoutSecs)?r:20,s=null!=(n=null==t?void 0:t.checkSuccess)&&n,a=!0,o=0,u;for(;a&&!(o>=i);){try{if(u=await this.client.transactions.getTransactionByHash(e),!(a="pending_transaction"===u.type))break}catch(h){let l=h instanceof eA,c=l&&404!==h.status&&h.status>=400&&h.status<500;if(!l||c)throw h}await ey(1e3),o+=1}if(void 0===u)throw Error(`Waiting for transaction ${e} failed`);if(a)throw new nZ(`Waiting for transaction ${e} timed out after ${i} seconds`,u);if(!s)return u;if(!(null==u?void 0:u.success))throw new n0(`Transaction ${e} committed to the blockchain but execution failed`,u);return u}async waitForTransaction(e,t){await this.waitForTransactionWithResult(e,t)}async getLedgerInfo(){return this.client.general.getLedgerInfo()}async getChainId(){let e=await this.getLedgerInfo();return e.chain_id}async getTableItem(e,t,r){var n;let i=await this.client.tables.getTableItem(e,t,null==(n=null==r?void 0:r.ledgerVersion)?void 0:n.toString());return i}async generateRawTransaction(e,t,r){let[{sequence_number:n},i,{gas_estimate:s}]=await Promise.all([this.getAccount(e),this.getChainId(),(null==r?void 0:r.gasUnitPrice)?Promise.resolve({gas_estimate:r.gasUnitPrice}):this.estimateGasPrice()]),{maxGasAmount:a,gasUnitPrice:o,expireTimestamp:u}={maxGasAmount:BigInt(2e4),gasUnitPrice:BigInt(s),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+20),...r};return new rA.RawTransaction(rA.AccountAddress.fromHex(e),BigInt(n),t,a,o,u,new rA.ChainId(i))}async generateSignSubmitTransaction(e,t,r){let n=await this.generateRawTransaction(e.address(),t,r),i=nX.generateBCSTransaction(e,n),s=await this.submitSignedBCSTransaction(i);return s.hash}async publishPackage(e,t,r,n){let i=new rL;rD(r,i);let s=new rA.TransactionPayloadEntryFunction(rA.EntryFunction.natural("0x1::code","publish_package_txn",[],[rG(t),i.getBytes()]));return this.generateSignSubmitTransaction(e,s,n)}async generateSignSubmitWaitForTransaction(e,t,r){let n=await this.generateSignSubmitTransaction(e,t,r);return this.waitForTransactionWithResult(n,r)}async estimateGasPrice(){return this.client.transactions.estimateGasPrice()}async estimateMaxGasAmount(e){let[{gas_estimate:t},r]=await Promise.all([this.estimateGasPrice(),this.getAccountResources(e)]),n=r.find(e=>"0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>"===e.type),i=BigInt(n.data.coin.value);return i/BigInt(t)}async rotateAuthKeyEd25519(e,t,r){let{sequence_number:n,authentication_key:i}=await this.getAccount(e.address()),s=new eT(t),a=new rA.RotationProofChallenge(rA.AccountAddress.CORE_CODE_ADDRESS,"account","RotationProofChallenge",BigInt(n),rA.AccountAddress.fromHex(e.address()),new rA.AccountAddress(new ev(i).toUint8Array()),s.pubKey().toUint8Array()),o=ev.fromUint8Array(rU(a)),u=e.signHexString(o),l=s.signHexString(o),c=new rA.TransactionPayloadEntryFunction(rA.EntryFunction.natural("0x1::account","rotate_authentication_key",[],[rB(0),rG(e.pubKey().toUint8Array()),rB(0),rG(s.pubKey().toUint8Array()),rG(u.toUint8Array()),rG(l.toUint8Array())])),h=await this.generateRawTransaction(e.address(),c,r),d=nX.generateBCSTransaction(e,h);return this.submitSignedBCSTransaction(d)}async lookupOriginalAddress(e){let t=await this.getAccountResource("0x1","0x1::account::OriginatingAddress"),{address_map:{handle:r}}=t.data,n=await this.getTableItem(r,{key_type:"address",value_type:"address",key:ev.ensure(e).hex()});return new ev(n)}async getBlockByHeight(e,t){return this.client.blocks.getBlockByHeight(e,t)}async getBlockByVersion(e,t){return this.client.blocks.getBlockByVersion(e,t)}clearCache(e){!function(e){let t=new Set;for(let r of e){let n=eb.get(r);if(n)for(let i of n)t.has(i)||(i.clear(),t.add(i))}return t.size}(e)}};el([n1],nX.prototype,"getAccount",1),el([n1],nX.prototype,"getAccountTransactions",1),el([n1],nX.prototype,"getAccountModules",1),el([n1],nX.prototype,"getAccountModule",1),el([n1],nX.prototype,"getAccountResources",1),el([n1],nX.prototype,"getAccountResource",1),el([n1],nX.prototype,"getEventsByCreationNumber",1),el([n1],nX.prototype,"getEventsByEventHandle",1),el([n1],nX.prototype,"submitSignedBCSTransaction",1),el([n1],nX.prototype,"submitBCSSimulation",1),el([n1],nX.prototype,"getTransactions",1),el([n1],nX.prototype,"getTransactionByHash",1),el([n1],nX.prototype,"getTransactionByVersion",1),el([n1],nX.prototype,"getLedgerInfo",1),el([em()],nX.prototype,"getChainId",1),el([n1],nX.prototype,"getTableItem",1),el([n1,em({ttlMs:3e5,tags:["gas_estimates"]})],nX.prototype,"estimateGasPrice",1),el([n1],nX.prototype,"estimateMaxGasAmount",1),el([n1],nX.prototype,"getBlockByHeight",1),el([n1],nX.prototype,"getBlockByVersion",1);
157var nJ=class extends Error{constructor(e,t,r,n){super(t),this.status=e,this.message=t,this.errorCode=r,this.vmErrorCode=n}},nZ=class extends Error{constructor(e,t){super(e),this.lastSubmittedTransaction=t}},n0=class extends Error{constructor(e,t){super(e),this.transaction=t}};function n1(e,t,r){let n=r.value;return r.value=async function(...e){var t,r;try{let i=await n.apply(this,[...e]);return i}catch(s){if(s instanceof eA)throw new nJ(s.status,JSON.stringify({message:s.message,...s.body}),null==(t=s.body)?void 0:t.error_code,null==(r=s.body)?void 0:r.vm_error_code);throw s}},r}var n2=r(5799),n5=r(4965),n3=r(2834),n6=r(7294),n4=(0,n6.createContext)(null),n8=function(e){var t=e.Component,r=e.pageProps,s=(0,n2.Rs)({provider:(0,n5.e)({apiKey:"12b2af71-16c7-4c1d-9902-89cb2bb26c18"})}),a=(0,n6.useMemo)(function(){return new nX("https://fullnode.devnet.aptoslabs.com/v1")},[]);return(0,i.jsx)(n4.Provider,{value:a,children:(0,i.jsx)(n3.L,{client:s,children:(0,i.jsx)(t,(0,n.Z)({},r))})})}},906:function(){},7663:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(n){r=a}}();var u=[],l=!1,c=-1;function h(){l&&n&&(l=!1,n.length?u=n.concat(u):c=-1,u.length&&d())}function d(){if(!l){var e=o(h);l=!0;for(var t=u.length;t;){for(n=u,u=[];++c<t;)n&&n[c].run();c=-1,t=u.length}n=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(n){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new f(e,t)),1!==u.length||l||o(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var s=r[e]={exports:{}},a=!0;try{t[e](s,s.exports,n),a=!1}finally{a&&delete r[e]}return s.exports}n.ab="//";var i=n(229);e.exports=i}()},7129:function(e,t){"use strict";var r,n=Object.prototype.hasOwnProperty;function i(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function s(e){try{return encodeURIComponent(e)}catch(t){return null}}t.stringify=function(e,t){var i,a,o=[];for(a in"string"!=typeof(t=t||"")&&(t="?"),e)if(n.call(e,a)){if(!(i=e[a])&&(null===i||i===r||isNaN(i))&&(i=""),a=s(a),i=s(i),null===a||null===i)continue;o.push(a+"="+i)}return o.length?t+o.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,n={};t=r.exec(e);){var s=i(t[1]),a=i(t[2]);null!==s&&null!==a&&!(s in n)&&(n[s]=a)}return n}},7418:function(e){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},780:function(e,t,r){!function(e){"use strict";var t,n=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},i=function(){throw Error("no PRNG")},s=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=n(),u=n([1]),l=n([56129,1]),c=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),f=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function g(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function v(e,t,r,n,i){var s,a=0;for(s=0;s<i;s++)a|=e[t+s]^r[n+s];return(1&a-1>>>8)-1}function y(e,t,r,n){return v(e,t,r,n,16)}function m(e,t,r,n){return v(e,t,r,n,32)}function b(e,t,r,n){!function(e,t,r,n){for(var i,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,l=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,f=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,v=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,E=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,S=s,T=a,w=o,A=u,x=l,_=c,R=h,O=d,k=f,L=p,C=g,I=v,D=y,P=m,M=b,U=E,F=0;F<20;F+=2)x^=(i=S+D|0)<<7|i>>>25,k^=(i=x+S|0)<<9|i>>>23,D^=(i=k+x|0)<<13|i>>>19,S^=(i=D+k|0)<<18|i>>>14,L^=(i=_+T|0)<<7|i>>>
vendor: 8,778 bytes, line 157
15725,P^=(i=L+_|0)<<9|i>>>23,T^=(i=P+L|0)<<13|i>>>19,_^=(i=T+P|0)<<18|i>>>14,M^=(i=C+R|0)<<7|i>>>25,w^=(i=M+C|0)<<9|i>>>23,R^=(i=w+M|0)<<13|i>>>19,C^=(i=R+w|0)<<18|i>>>14,A^=(i=U+I|0)<<7|i>>>25,O^=(i=A+U|0)<<9|i>>>23,I^=(i=O+A|0)<<13|i>>>19,U^=(i=I+O|0)<<18|i>>>14,T^=(i=S+A|0)<<7|i>>>25,w^=(i=T+S|0)<<9|i>>>23,A^=(i=w+T|0)<<13|i>>>19,S^=(i=A+w|0)<<18|i>>>14,R^=(i=_+x|0)<<7|i>>>25,O^=(i=R+_|0)<<9|i>>>23,x^=(i=O+R|0)<<13|i>>>19,_^=(i=x+O|0)<<18|i>>>14,I^=(i=C+L|0)<<7|i>>>25,k^=(i=I+C|0)<<9|i>>>23,L^=(i=k+I|0)<<13|i>>>19,C^=(i=L+k|0)<<18|i>>>14,D^=(i=U+M|0)<<7|i>>>25,P^=(i=D+U|0)<<9|i>>>23,M^=(i=P+D|0)<<13|i>>>19,U^=(i=M+P|0)<<18|i>>>14;S=S+s|0,T=T+a|0,w=w+o|0,A=A+u|0,x=x+l|0,_=_+c|0,R=R+h|0,O=O+d|0,k=k+f|0,L=L+p|0,C=C+g|0,I=I+v|0,D=D+y|0,P=P+m|0,M=M+b|0,U=U+E|0,e[0]=S>>>0&255,e[1]=S>>>8&255,e[2]=S>>>16&255,e[3]=S>>>24&255,e[4]=T>>>0&255,e[5]=T>>>8&255,e[6]=T>>>16&255,e[7]=T>>>24&255,e[8]=w>>>0&255,e[9]=w>>>8&255,e[10]=w>>>16&255,e[11]=w>>>24&255,e[12]=A>>>0&255,e[13]=A>>>8&255,e[14]=A>>>16&255,e[15]=A>>>24&255,e[16]=x>>>0&255,e[17]=x>>>8&255,e[18]=x>>>16&255,e[19]=x>>>24&255,e[20]=_>>>0&255,e[21]=_>>>8&255,e[22]=_>>>16&255,e[23]=_>>>24&255,e[24]=R>>>0&255,e[25]=R>>>8&255,e[26]=R>>>16&255,e[27]=R>>>24&255,e[28]=O>>>0&255,e[29]=O>>>8&255,e[30]=O>>>16&255,e[31]=O>>>24&255,e[32]=k>>>0&255,e[33]=k>>>8&255,e[34]=k>>>16&255,e[35]=k>>>24&255,e[36]=L>>>0&255,e[37]=L>>>8&255,e[38]=L>>>16&255,e[39]=L>>>24&255,e[40]=C>>>0&255,e[41]=C>>>8&255,e[42]=C>>>16&255,e[43]=C>>>24&255,e[44]=I>>>0&255,e[45]=I>>>8&255,e[46]=I>>>16&255,e[47]=I>>>24&255,e[48]=D>>>0&255,e[49]=D>>>8&255,e[50]=D>>>16&255,e[51]=D>>>24&255,e[52]=P>>>0&255,e[53]=P>>>8&255,e[54]=P>>>16&255,e[55]=P>>>24&255,e[56]=M>>>0&255,e[57]=M>>>8&255,e[58]=M>>>16&255,e[59]=M>>>24&255,e[60]=U>>>0&255,e[61]=U>>>8&255,e[62]=U>>>16&255,e[63]=U>>>24&255}(e,t,r,n)}function E(e,t,r,n){!function(e,t,r,n){for(var i,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,l=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,h=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,f=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,v=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,E=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,S=s,T=a,w=o,A=u,x=l,_=c,R=h,O=d,k=f,L=p,C=g,I=v,D=y,P=m,M=b,U=E,F=0;F<20;F+=2)x^=(i=S+D|0)<<7|i>>>25,k^=(i=x+S|0)<<9|i>>>23,D^=(i=k+x|0)<<13|i>>>19,S^=(i=D+k|0)<<18|i>>>14,L^=(i=_+T|0)<<7|i>>>25,P^=(i=L+_|0)<<9|i>>>23,T^=(i=P+L|0)<<13|i>>>19,_^=(i=T+P|0)<<18|i>>>14,M^=(i=C+R|0)<<7|i>>>25,w^=(i=M+C|0)<<9|i>>>23,R^=(i=w+M|0)<<13|i>>>19,C^=(i=R+w|0)<<18|i>>>14,A^=(i=U+I|0)<<7|i>>>25,O^=(i=A+U|0)<<9|i>>>23,I^=(i=O+A|0)<<13|i>>>19,U^=(i=I+O|0)<<18|i>>>14,T^=(i=S+A|0)<<7|i>>>25,w^=(i=T+S|0)<<9|i>>>23,A^=(i=w+T|0)<<13|i>>>19,S^=(i=A+w|0)<<18|i>>>14,R^=(i=_+x|0)<<7|i>>>25,O^=(i=R+_|0)<<9|i>>>23,x^=(i=O+R|0)<<13|i>>>19,_^=(i=x+O|0)<<18|i>>>14,I^=(i=C+L|0)<<7|i>>>25,k^=(i=I+C|0)<<9|i>>>23,L^=(i=k+I|0)<<13|i>>>19,C^=(i=L+k|0)<<18|i>>>14,D^=(i=U+M|0)<<7|i>>>25,P^=(i=D+U|0)<<9|i>>>23,M^=(i=P+D|0)<<13|i>>>19,U^=(i=M+P|0)<<18|i>>>14;e[0]=S>>>0&255,e[1]=S>>>8&255,e[2]=S>>>16&255,e[3]=S>>>24&255,e[4]=_>>>0&255,e[5]=_>>>8&255,e[6]=_>>>16&255,e[7]=_>>>24&255,e[8]=C>>>0&255,e[9]=C>>>8&255,e[10]=C>>>16&255,e[11]=C>>>24&255,e[12]=U>>>0&255,e[13]=U>>>8&255,e[14]=U>>>16&255,e[15]=U>>>24&255,e[16]=R>>>0&255,e[17]=R>>>8&255,e[18]=R>>>16&255,e[19]=R>>>24&255,e[20]=O>>>0&255,e[21]=O>>>8&255,e[22]=O>>>16&255,e[23]=O>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=L>>>0&255,e[29]=L>>>8&255,e[30]=L>>>16&255,e[31]=L>>>24&255}(e,t,r,n)}var S=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(e,t,r,n,i,s,a){var o,u,l=new Uint8Array(16),c=new Uint8Array(64);for(u=0;u<16;u++)l[u]=0;for(u=0;u<8;u++)l[u]=s[u];for(;i>=64;){for(b(c,l,a,S),u=0;u<64;u++)e[t+u]=r[n+u]^c[u];for(u=8,o=1;u<16;u++)o=o+(255&l[u])|0,l[u]=255&o,o>>>=8;i-=64,t+=64,n+=64}if(i>0)for(b(c,l,a,S),u=0;u<i;u++)e[t+u]=r[n+u]^c[u];return 0}function w(e,t,r,n,i){var s,a,o=new Uint8Array(16),u=new Uint8Array(64);for(a=0;a<16;a++)o[a]=0;for(a=0;a<8;a++)o[a]=n[a];for(;r>=64;){for(b(u,o,i,S),a=0;a<64;a++)e[t+a]=u[a];for(a=8,s=1;a<16;a++)s=s+(255&o[a])|0,o[a]=255&s,s>>>=8;r-=64,t+=64}if(r>0)for(b(u,o,i,S),a=0;a<r;a++)e[t+a]=u[a];return 0}function A(e,t,r,n,i){var s=new Uint8Array(32);E(s,n,i,S);for(var a=new Uint8Array(8),o=0;o<8;o++)a[o]=n[o+16];return w(e,t,r,a,s)}function x(e,t,r,n,i,s,a){var o=new Uint8Array(32);E(o,s,a,S);for(var u=new Uint8Array(8),l=0;l<8;l++)u[l]=s[l+16];return T(e,t,r,n,i,u,o)}var _=function(e){var t,r,n,i,s,a,o,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=(t>>>13|r<<3)&8191,n=255&e[4]|(255&e[5])<<8,this.r[2]=(r>>>10|n<<6)&7939,i=255&e[6]|(255&e[7])<<8,this.r[3]=(n>>>7|i<<9)&8191,s=255&e[8]|(255&e[9])<<8,this.r[4]=(i>>>4|s<<12)&255,this.r[5]=s>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=(s>>>14|a<<2)&8191,o=255&e[12]|(255&e[13])<<8,this.r[7]=(a>>>11|o<<5)&8065,u=255&e[14]|(255&e[15])<<8,this.r[8]=(o>>>8|u<<8)&8191,this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function R(e,t,r,n,i,s){var a=new _(s);return a.update(r,n,i),a.finish(e,t),0}function O(e,t,r,n,i,s){var a=new Uint8Array(16);return R(a,0,r,n,i,s),y(e,t,a,0)}function k(e,t,r,n,i){var s;if(r<32)return -1;for(x(e,0,t,0,r,n,i),R(e,16,e,32,r-32,e),s=0;s<16;s++)e[s]=0;return 0}function L(e,t,r,n,i){var s,a=new Uint8Array(32);if(r<32||(A(a,0,32,n,i),0!==O(t,16,t,32,r-32,a)))return -1;for(x(e,0,t,0,r,n,i),s=0;s<32;s++)e[s]=0;return 0}function C(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function I(e){var t,r,n=1;for(t=0;t<16;t++)n=Math.floor((r=e[t]+n+65535)/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function D(e,t,r){for(var n,i=~(r-1),s=0;s<16;s++)n=i&(e[s]^t[s]),e[s]^=n,t[s]^=n}function P(e,t){var r,i,s,a=n(),o=n();for(r=0;r<16;r++)o[r]=t[r];for(I(o),I(o),I(o),i=0;i<2;i++){for(r=1,a[0]=o[0]-65517;r<15;r++)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),s=a[15]>>16&1,a[14]&=65535,D(o,a,1-s)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function M(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return P(r,e),P(n,t),m(r,0,n,0)}function U(e){var t=new Uint8Array(32);return P(t,e),1&t[0]}function F(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function B(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function N(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function j(e,t,r){var n,i,s=0,a=0,o=0,u=0,l=0,c=0,h=0,d=0,f=0,p=0,g=0,v=0,y=0,m=0,b=0,E=0,S=0,T=0,w=0,A=0,x=0,_=0,R=0,O=0,k=0,L=0,C=0,I=0,D=0,P=0,M=0,U=r[0],F=r[1],B=r[2],N=r[3],j=r[4],q=r[5],H=r[6],z=r[7],G=r[8],K=r[9],W=r[10],V=r[11],$=r[12],Q=r[13],Y=r[14],X=r[15];s+=(n=t[0])*U,a+=n*F,o+=n*B,u+=n*N,l+=n*j,c+=n*q,h+=n*H,d+=n*z,f+=n*G,p+=n*K,g+=n*W,v+=n*V,y+=n*$,m+=n*Q,b+=n*Y,E+=n*X,a+=(n=t[1])*U,o+=n*F,u+=n*B,l+=n*N,c+=n*j,h+=n*q,d+=n*H,f+=n*z,p+=n*G,g+=n*K,v+=n*W,y+=n*V,m+=n*$,b+=n*Q,E+=n*Y,S+=n*X,o+=(n=t[2])*U,u+=n*F,l+=n*B,c+=n*N,h+=n*j,d+=n*q,f+=n*H,p+=n*z,g+=n*G,v+=n*K,y+=n*W,m+=n*V,b+=n*$,E+=n*Q,S+=n*Y,T+=n*X,u+=(n=t[3])*U,l+=n*F,c+=n*B,h+=n*N,d+=n*j,f+=n*q,p+=n*H,g+=n*z,v+=n*G,y+=n*K,m+=n*W,b+=n*V,E+=n*$,S+=n*Q,T+=n*Y,w+=n*X,l+=(n=t[4])*U,c+=n*F,h+=n*B,d+=n*N,f+=n*j,p+=n*q,g+=n*H,v+=n*z,y+=n*G,m+=n*K,b+=n*W,E+=n*V,S+=n*$,T+=n*Q,w+=n*Y,A+=n*X,c+=(n=t[5])*U,h+=n*F,d+=n*B,f+=n*N,p+=n*j,g+=n*q,v+=n*H,y+=n*z,m+=n*G,b+=n*K,E+=n*W,S+=n*V,T+=n*$,w+=n*Q,A+=n*Y,x+=n*X,h+=(n=t[6])*U,d+=n*F,f+=n*B,p+=n*N,g+=n*j,v+=n*q,y+=n*H,m+=n*z,b+=n*G,E+=n*K,S+=n*W,T+=n*V,w+=n*$,A+=n*Q,x+=n*Y,_+=n*X,d+=(n=t[7])*U,f+=n*F,p+=n*B,g+=n*N,v+=n*j,y+=n*q,m+=n*H,b+=n*z,E+=n*G,S+=n*K,T+=n*W,w+=n*V,A+=n*$,x+=n*Q,_+=n*Y,R+=n*X,f+=(n=t[8])*U,p+=n*F,g+=n*B,v+=n*N,y+=n*j,m+=n*q,b+=n*H,E+=n*z,S+=n*G,T+=n*K,w+=n*W,A+=n*V,x+=n*$,_+=n*Q,R+=n*Y,O+=n*X,p+=(n=t[9])*U,g+=n*F,v+=n*B,y+=n*N,m+=n*j,b+=n*q,E+=n*H,S+=n*z,T+=n*G,
157w+=n*K,A+=n*W,x+=n*V,_+=n*$,R+=n*Q,O+=n*Y,k+=n*X,g+=(n=t[10])*U,v+=n*F,y+=n*B,m+=n*N,b+=n*j,E+=n*q,S+=n*H,T+=n*z,w+=n*G,A+=n*K,x+=n*W,_+=n*V,R+=n*$,O+=n*Q,k+=n*Y,L+=n*X,v+=(n=t[11])*U,y+=n*F,m+=n*B,b+=n*N,E+=n*j,S+=n*q,T+=n*H,w+=n*z,A+=n*G,x+=n*K,_+=n*W,R+=n*V,O+=n*$,k+=n*Q,L+=n*Y,C+=n*X,y+=(n=t[12])*U,m+=n*F,b+=n*B,E+=n*N,S+=n*j,T+=n*q,w+=n*H,A+=n*z,x+=n*G,_+=n*K,R+=n*W,O+=n*V,k+=n*$,L+=n*Q,C+=n*Y,I+=n*X,m+=(n=t[13])*U,b+=n*F,E+=n*B,S+=n*N,T+=n*j,w+=n*q,A+=n*H,x+=n*z,_+=n*G,R+=n*K,O+=n*W,k+=n*V,L+=n*$,C+=n*Q,I+=n*Y,D+=n*X,b+=(n=t[14])*U,E+=n*F,S+=n*B,T+=n*N,w+=n*j,A+=n*q,x+=n*H,_+=n*z,R+=n*G,O+=n*K,k+=n*W,L+=n*V,C+=n*$,I+=n*Q,D+=n*Y,P+=n*X,E+=(n=t[15])*U,S+=n*F,T+=n*B,w+=n*N,A+=n*j,x+=n*q,_+=n*H,R+=n*z,O+=n*G,k+=n*K,L+=n*W,C+=n*V,I+=n*$,D+=n*Q,P+=n*Y,M+=n*X,s+=38*S,a+=38*T,o+=38*w,u+=38*A,l+=38*x,c+=38*_,h+=38*R,d+=38*O,f+=38*k,p+=38*L,g+=38*C,v+=38*I,y+=38*D,m+=38*P,b+=38*M,i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=E+i+65535)/65536),E=n-65536*i,s+=i-1+37*(i-1),i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=E+i+65535)/65536),E=n-65536*i,s+=i-1+37*(i-1),e[0]=s,e[1]=a,e[2]=o,e[3]=u,e[4]=l,e[5]=c,e[6]=h,e[7]=d,e[8]=f,e[9]=p,e[10]=g,e[11]=v,e[12]=y,e[13]=m,e[14]=b,e[15]=E}function q(e,t){j(e,t,t)}function H(e,t){var r,i=n();for(r=0;r<16;r++)i[r]=t[r];for(r=253;r>=0;r--)q(i,i),2!==r&&4!==r&&j(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function z(e,t){var r,i=n();for(r=0;r<16;r++)i[r]=t[r];for(r=250;r>=0;r--)q(i,i),1!==r&&j(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function G(e,t,r){var i,s,a=new Uint8Array(32),o=new Float64Array(80),u=n(),c=n(),h=n(),d=n(),f=n(),p=n();for(s=0;s<31;s++)a[s]=t[s];for(a[31]=127&t[31]|64,a[0]&=248,F(o,r),s=0;s<16;s++)c[s]=o[s],d[s]=u[s]=h[s]=0;for(s=254,u[0]=d[0]=1;s>=0;--s)D(u,c,i=a[s>>>3]>>>(7&s)&1),D(h,d,i),B(f,u,h),N(u,u,h),B(h,c,d),N(c,c,d),q(d,f),q(p,u),j(u,h,u),j(h,c,f),B(f,u,h),N(u,u,h),q(c,u),N(h,d,p),j(u,h,l),B(u,u,d),j(h,h,u),j(u,d,p),j(d,c,o),q(c,f),D(u,c,i),D(h,d,i);for(s=0;s<16;s++)o[s+16]=u[s],o[s+32]=h[s],o[s+48]=c[s],o[s+64]=d[s];var g=o.subarray(32),v=o.subarray(16);return H(g,g),j(v,v,g),P(e,v),0}function K(e,t){return G(e,t,a)}function W(e,t){return i(t,32),K(e,t)}function V(e,t,r){var n=new Uint8Array(32);return G(n,r,t),E(e,s,n,S)}_.prototype.blocks=function(e,t,r){for(var n,i,s,a,o,u,l,c,h,d,f,p,g,v,y,m,b,E,S,T=this.fin?0:2048,w=this.h[0],A=this.h[1],x=this.h[2],_=this.h[3],R=this.h[4],O=this.h[5],k=this.h[6],L=this.h[7],C=this.h[8],I=this.h[9],D=this.r[0],P=this.r[1],M=this.r[2],U=this.r[3],F=this.r[4],B=this.r[5],N=this.r[6],j=this.r[7],q=this.r[8],H=this.r[9];r>=16;)w+=8191&(n=255&e[t+0]|(255&e[t+1])<<8),A+=(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3)&8191,x+=(i>>>10|(s=255&e[t+4]|(255&e[t+5])<<8)<<6)&8191,_+=(s>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9)&8191,R+=(a>>>4|(o=255&e[t+8]|(255&e[t+9])<<8)<<12)&8191,O+=o>>>1&8191,k+=(o>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2)&8191,L+=(u>>>11|(l=255&e[t+12]|(255&e[t+13])<<8)<<5)&8191,C+=(l>>>8|(c=255&e[t+14]|(255&e[t+15])<<8)<<8)&8191,I+=c>>>5|T,d=h=0,d+=w*D,d+=A*(5*H),d+=x*(5*q),d+=_*(5*j),d+=R*(5*N),h=d>>>13,d&=8191,d+=O*(5*B),d+=k*(5*F),d+=L*(5*U),d+=C*(5*M),d+=I*(5*P),h+=d>>>13,d&=8191,f=h,f+=w*P,f+=A*D,f+=x*(5*H),f+=_*(5*q),f+=R*(5*j),h=f>>>13,f&=8191,f+=O*(5*N),f+=k*(5*B),f+=L*(5*F),f+=C*(5*U),f+=I*(5*M),h+=f>>>13,f&=8191,p=h,p+=w*M,p+=A*P,p+=x*D,p+=_*(5*H),p+=R*(5*q),h=p>>>13,p&=8191,p+=O*(5*j),p+=k*(5*N),p+=L*(5*B),p+=C*(5*F),p+=I*(5*U),h+=p>>>13,p&=8191,g=h,g+=w*U,g+=A*M,g+=x*P,g+=_*D,g+=R*(5*H),h=g>>>13,g&=8191,g+=O*(5*q),g+=k*(5*j),g+=L*(5*N),g+=C*(5*B),g+=I*(5*F),h+=g>>>13,g&=8191,v=h,v+=w*F,v+=A*U,v+=x*M,v+=_*P,v+=R*D,h=v>>>13,v&=8191,v+=O*(5*H),v+=k*(5*q),v+=L*(5*j),v+=C*(5*N),v+=I*(5*B),h+=v>>>13,v&=8191,y=h,y+=w*B,y+=A*F,y+=x*U,y+=_*M,y+=R*P,h=y>>>13,y&=8191,y+=O*D,y+=k*(5*H),y+=L*(5*q),y+=C*(5*j),y+=I*(5*N),h+=y>>>13,y&=8191,m=h,m+=w*N,m+=A*B,m+=x*F,m+=_*U,m+=R*M,h=m>>>13,m&=8191,m+=O*P,m+=k*D,m+=L*(5*H),m+=C*(5*q),m+=I*(5*j),h+=m>>>13,m&=8191,b=h,b+=w*j,b+=A*N,b+=x*B,b+=_*F,b+=R*U,h=b>>>13,b&=8191,b+=O*M,b+=k*P,b+=L*D,b+=C*(5*H),b+=I*(5*q),h+=b>>>13,b&=8191,E=h,E+=w*q,E+=A*j,E+=x*N,E+=_*B,E+=R*F,h=E>>>13,E&=8191,E+=O*U,E+=k*M,E+=L*P,E+=C*D,E+=I*(5*H),h+=E>>>13,E&=8191,S=h,S+=w*H,S+=A*q,S+=x*j,S+=_*N,S+=R*B,h=S>>>13,S&=8191,S+=O*F,S+=k*U,S+=L*M,S+=C*P,S+=I*D,h+=S>>>13,S&=8191,d=8191&(h=(h=(h<<2)+h|0)+d|0),h>>>=13,f+=h,w=d,A=f,x=p,_=g,R=v,O=y,k=m,L=b,C=E,I=S,t+=16,r-=16;this.h[0]=w,this.h[1]=A,this.h[2]=x,this.h[3]=_,this.h[4]=R,this.h[5]=O,this.h[6]=k,this.h[7]=L,this.h[8]=C,this.h[9]=I},_.prototype.finish=function(e,t){var r,n,i,s,a=new Uint16Array(10);if(this.leftover){for(s=this.leftover,this.buffer[s++]=1;s<16;s++)this.buffer[s]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,s=2;s<10;s++)this.h[s]+=r,r=this.h[s]>>>13,this.h[s]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,s=1;s<10;s++)a[s]=this.h[s]+r,r=a[s]>>>13,a[s]&=8191;for(a[9]-=8192,n=(1^r)-1,s=0;s<10;s++)a[s]&=n;for(s=0,n=~n;s<10;s++)this.h[s]=this.h[s]&n|a[s];for(s=1,this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>
vendor: 8,561 bytes, line 157
157>>8|this.h[9]<<5)&65535,i=this.h[0]+this.pad[0],this.h[0]=65535&i;s<8;s++)i=(this.h[s]+this.pad[s]|0)+(i>>>16)|0,this.h[s]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},_.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var $=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Q(e,t,r,n){for(var i,s,a,o,u,l,c,h,d,f,p,g,v,y,m,b,E,S,T,w,A,x,_,R,O,k,L=new Int32Array(16),C=new Int32Array(16),I=e[0],D=e[1],P=e[2],M=e[3],U=e[4],F=e[5],B=e[6],N=e[7],j=t[0],q=t[1],H=t[2],z=t[3],G=t[4],K=t[5],W=t[6],V=t[7],Q=0;n>=128;){for(T=0;T<16;T++)w=8*T+Q,L[T]=r[w+0]<<24|r[w+1]<<16|r[w+2]<<8|r[w+3],C[T]=r[w+4]<<24|r[w+5]<<16|r[w+6]<<8|r[w+7];for(T=0;T<80;T++)if(i=I,s=D,a=P,o=M,u=U,l=F,c=B,h=N,d=j,f=q,p=H,g=z,v=G,y=K,m=W,b=V,A=N,_=65535&(x=V),R=x>>>16,O=65535&A,k=A>>>16,A=(U>>>14|G<<18)^(U>>>18|G<<14)^(G>>>9|U<<23),_+=65535&(x=(G>>>14|U<<18)^(G>>>18|U<<14)^(U>>>9|G<<23)),R+=x>>>16,O+=65535&A,k+=A>>>16,A=U&F^~U&B,_+=65535&(x=G&K^~G&W),R+=x>>>16,O+=65535&A,k+=A>>>16,A=$[2*T],_+=65535&(x=$[2*T+1]),R+=x>>>16,O+=65535&A,k+=A>>>16,A=L[T%16],_+=65535&(x=C[T%16]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,E=65535&O|k<<16,S=65535&_|R<<16,A=E,_=65535&(x=S),R=x>>>16,O=65535&A,k=A>>>16,A=(I>>>28|j<<4)^(j>>>2|I<<30)^(j>>>7|I<<25),_+=65535&(x=(j>>>28|I<<4)^(I>>>2|j<<30)^(I>>>7|j<<25)),R+=x>>>16,O+=65535&A,k+=A>>>16,A=I&D^I&P^D&P,_+=65535&(x=j&q^j&H^q&H),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,h=65535&O|k<<16,b=65535&_|R<<16,A=o,_=65535&(x=g),R=x>>>16,O=65535&A,k=A>>>16,A=E,_+=65535&(x=S),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,o=65535&O|k<<16,g=65535&_|R<<16,D=i,P=s,M=a,U=o,F=u,B=l,N=c,I=h,q=d,H=f,z=p,G=g,K=v,W=y,V=m,j=b,T%16==15)for(w=0;w<16;w++)A=L[w],_=65535&(x=C[w]),R=x>>>16,O=65535&A,k=A>>>16,A=L[(w+9)%16],_+=65535&(x=C[(w+9)%16]),R+=x>>>16,O+=65535&A,k+=A>>>16,A=((E=L[(w+1)%16])>>>1|(S=C[(w+1)%16])<<31)^(E>>>8|S<<24)^E>>>7,_+=65535&(x=(S>>>1|E<<31)^(S>>>8|E<<24)^(S>>>7|E<<25)),R+=x>>>16,O+=65535&A,k+=A>>>16,A=((E=L[(w+14)%16])>>>19|(S=C[(w+14)%16])<<13)^(S>>>29|E<<3)^E>>>6,_+=65535&(x=(S>>>19|E<<13)^(E>>>29|S<<3)^(S>>>6|E<<26)),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,L[w]=65535&O|k<<16,C[w]=65535&_|R<<16;A=I,_=65535&(x=j),R=x>>>16,O=65535&A,k=A>>>16,A=e[0],_+=65535&(x=t[0]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[0]=I=65535&O|k<<16,t[0]=j=65535&_|R<<16,A=D,_=65535&(x=q),R=x>>>16,O=65535&A,k=A>>>16,A=e[1],_+=65535&(x=t[1]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[1]=D=65535&O|k<<16,t[1]=q=65535&_|R<<16,A=P,_=65535&(x=H),R=x>>>16,O=65535&A,k=A>>>16,A=e[2],_+=65535&(x=t[2]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[2]=P=65535&O|k<<16,t[2]=H=65535&_|R<<16,A=M,_=65535&(x=z),R=x>>>16,O=65535&A,k=A>>>16,A=e[3],_+=65535&(x=t[3]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[3]=M=65535&O|k<<16,t[3]=z=65535&_|R<<16,A=U,_=65535&(x=G),R=x>>>16,O=65535&A,k=A>>>16,A=e[4],_+=65535&(x=t[4]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[4]=U=65535&O|k<<16,t[4]=G=65535&_|R<<16,A=F,_=65535&(x=K),R=x>>>16,O=65535&A,k=A>>>16,A=e[5],_+=65535&(x=t[5]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[5]=F=65535&O|k<<16,t[5]=K=65535&_|R<<16,A=B,_=65535&(x=W),R=x>>>16,O=65535&A,k=A>>>16,A=e[6],_+=65535&(x=t[6]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[6]=B=65535&O|k<<16,t[6]=W=65535&_|R<<16,A=N,_=65535&(x=V),R=x>>>16,O=65535&A,k=A>>>16,A=e[7],_+=65535&(x=t[7]),R+=x>>>16,O+=65535&A,k+=A>>>16,R+=_>>>16,O+=R>>>16,k+=O>>>16,e[7]=N=65535&O|k<<16,t[7]=V=65535&_|R<<16,Q+=128,n-=128}return n}function Y(e,t,r){var n,i=new Int32Array(8),s=new Int32Array(8),a=new Uint8Array(256),o=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,s[0]=4089235720,s[1]=2227873595,s[2]=4271175723,s[3]=1595750129,s[4]=2917565137,s[5]=725511199,s[6]=4215389547,s[7]=327033209,Q(i,s,t,r),r%=128,n=0;n<r;n++)a[n]=t[o-r+n];for(a[r]=128,a[(r=256-128*(r<112?1:0))-9]=0,g(a,r-8,o/536870912|0,o<<3),Q(i,s,a,r),n=0;n<8;n++)g(e,8*n,i[n],s[n]);return 0}function X(e,t){var r=n(),i=n(),s=n(),a=n(),o=n(),u=n(),l=n(),c=n(),d=n();N(r,e[1],e[0]),N(d,t[1],t[0]),j(r,r,d),B(i,e[0],e[1]),B(d,t[0],t[1]),j(i,i,d),j(s,e[3],t[3]),j(s,s,h),j(a,e[2],t[2]),B(a,a,a),N(o,i,r),N(u,a,s),B(l,a,s),B(c,i,r),j(e[0],o,u),j(e[1],c,l),j(e[2],l,u),j(e[3],o,c)}function J(e,t,r){var n;for(n=0;n<4;n++)D(e[n],t[n],r)}function Z(e,t){var r=n(),i=n(),s=n();H(s,t[2]),j(r,t[0],s),j(i,t[1],s),P(e,i),e[31]^=U(r)<<7}function ee(e,t,r){var n,i;for(C(e[0],o),C(e[1],u),C(e[2],u),C(e[3],o),i=255;i>=0;--i)J(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),J(e,t,n)}function et(e,t){var r=[n(),n(),n(),n()];C(r[0],d),C(r[1],f),C(r[2],u),j(r[3],d,f),ee(e,r,t)}function er(e,t,r){var s,a=new Uint8Array(64),o=[n(),n(),n(),n()];for(r||i(t,32),Y(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64,et(o,a),Z(e,o),s=0;s<32;s++)t[s+32]=e[s];return 0}var en=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ei(e,t){var r,n,i,s;for(n=63;n>=32;--n){for(r=0,i=n-32,s=n-12;i<s;++i)t[i]+=r-16*t[n]*en[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(i=0,r=0;i<32;i++)t[i]+=r-(t[31]>>4)*en[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*en[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function es(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ei(e,r)}function ea(e,t,r,i){var s,a,o=new Uint8Array(64),u=new Uint8Array(64),l=new Uint8Array(64),c=new Float64Array(64),h=[n(),n(),n(),n()];for(Y(o,i,32),o[0]&=248,o[31]&=127,o[31]|=64,s=0;s<r;s++)e[64+s]=t[s];for(s=0;s<32;s++)e[32+s]=o[32+s];for(Y(l,e.subarray(32),r+32),es(l),et(h,l),Z(e,h),s=32;s<64;s++)e[s]=i[s];for(Y(u,e,r+64),es(u),s=0;s<64;s++)c[s]=0;for(s=0;s<32;s++)c[s]=l[s];for(s=0;s<32;s++)for(a=0;a<32;a++)c[s+a]+=u[s]*o[a];return ei(e.subarray(32),c),r+64}function eo(e,t,r,i){var s,a,l,h,d,f,g,v,y,b,E=new Uint8Array(32),S=new Uint8Array(64),T=[n(),n(),n(),n()],w=[n(),n(),n(),n()];if(r<64||(l=n(),h=n(),d=n(),f=n(),g=n(),v=n(),y=n(),(C(w[2],u),F(w[1],i),q(d,w[1]),j(f,d,c),N(d,d,w[2]),B(f,w[2],f),q
157(g,f),q(v,g),j(y,v,g),j(l,y,d),j(l,l,f),z(l,l),j(l,l,d),j(l,l,f),j(l,l,f),j(w[0],l,f),q(h,w[0]),j(h,h,f),M(h,d)&&j(w[0],w[0],p),q(h,w[0]),j(h,h,f),M(h,d))?-1:(U(w[0])===i[31]>>7&&N(w[0],o,w[0]),j(w[3],w[0],w[1]),0)))return -1;for(b=0;b<r;b++)e[b]=t[b];for(b=0;b<32;b++)e[b+32]=i[b];if(Y(S,e,r),es(S),ee(T,w,S),et(w,t.subarray(32)),X(T,w),Z(E,T),r-=64,m(t,0,E,0)){for(b=0;b<r;b++)e[b]=0;return -1}for(b=0;b<r;b++)e[b]=t[b+64];return r}function eu(e,t){if(32!==e.length)throw Error("bad key size");if(24!==t.length)throw Error("bad nonce size")}function el(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw TypeError("unexpected type, use Uint8Array")}function ec(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:E,crypto_stream_xor:x,crypto_stream:A,crypto_stream_salsa20_xor:T,crypto_stream_salsa20:w,crypto_onetimeauth:R,crypto_onetimeauth_verify:O,crypto_verify_16:y,crypto_verify_32:m,crypto_secretbox:k,crypto_secretbox_open:L,crypto_scalarmult:G,crypto_scalarmult_base:K,crypto_box_beforenm:V,crypto_box_afternm:k,crypto_box:function(e,t,r,n,i,s){var a=new Uint8Array(32);return V(a,i,s),k(e,t,r,n,a)},crypto_box_open:function(e,t,r,n,i,s){var a=new Uint8Array(32);return V(a,i,s),L(e,t,r,n,a)},crypto_box_keypair:W,crypto_hash:Y,crypto_sign:ea,crypto_sign_keypair:er,crypto_sign_open:eo,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:n,D:c,L:en,pack25519:P,unpack25519:F,M:j,A:B,S:q,Z:N,pow2523:z,add:X,set25519:C,modL:ei,scalarmult:ee,scalarbase:et},e.randomBytes=function(e){var t=new Uint8Array(e);return i(t,e),t},e.secretbox=function(e,t,r){el(e,t,r),eu(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),s=0;s<e.length;s++)n[s+32]=e[s];return k(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){el(e,t,r),eu(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),s=0;s<e.length;s++)n[s+16]=e[s];return n.length<32||0!==L(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(el(e,t),32!==e.length)throw Error("bad n size");if(32!==t.length)throw Error("bad p size");var r=new Uint8Array(32);return G(r,e,t),r},e.scalarMult.base=function(e){if(el(e),32!==e.length)throw Error("bad n size");var t=new Uint8Array(32);return K(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var s=e.box.before(n,i);return e.secretbox(t,r,s)},e.box.before=function(e,t){el(e,t),function(e,t){if(32!==e.length)throw Error("bad public key size");if(32!==t.length)throw Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return V(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var s=e.box.before(n,i);return e.secretbox.open(t,r,s)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return W(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(el(e),32!==e.length)throw Error("bad secret key size");var t=new Uint8Array(32);return K(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(el(e,t),64!==t.length)throw Error("bad secret key size");var r=new Uint8Array(64+e.length);return ea(r,e,e.length,t),r},e.sign.open=function(e,t){if(el(e,t),32!==t.length)throw Error("bad public key size");var r=new Uint8Array(e.length),n=eo(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),s=0;s<i.length;s++)i[s]=r[s];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(64),s=0;s<i.length;s++)i[s]=n[s];return i},e.sign.detached.verify=function(e,t,r){if(el(e,t,r),64!==t.length)throw Error("bad signature size");if(32!==r.length)throw Error("bad public key size");var n,i=new Uint8Array(64+e.length),s=new Uint8Array(64+e.length);for(n=0;n<64;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+64]=e[n];return eo(s,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(64);return er(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(el(e),64!==e.length)throw Error("bad secret key size");for(var t=new Uint8Array(32),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(el(e),32!==e.length)throw Error("bad seed size");for(var t=new Uint8Array(32),r=new Uint8Array(64),n=0;n<32;n++)r[n]=e[n];return er(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=32,e.sign.secretKeyLength=64,e.sign.seedLength=32,e.sign.signatureLength=64,e.hash=function(e){el(e);var t=new Uint8Array(64);return Y(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return el(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===v(e,0,t,0,e.length)},e.setPRNG=function(e){i=e},(t="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&t.getRandomValues?e.setPRNG(function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];ec(i)}):(t=r(5024))&&t.randomBytes&&e.setPRNG(function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];ec(i)})}(e.exports?e.exports:self.nacl=self.nacl||{})},4564:function(e,t,r){"use strict";var n=r(7418),i=r(7129),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a=/[\n\r\t]/g,o=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function h(e){return(e||"").toString().replace(s,"")}var d=[["#","hash"],["?","query"],function(e,t){return g(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};function p(e){var t,n,i=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},s={},a=typeof(e=e||i);if("blob:"===e.protocol)s=new y(unescape(e.pathname),{});else if("string"===a)for(n in s=new y(e,{}),f)delete s[n];else if("object"===a){for(n in e)n in f||(s[n]=e[n]);void 0===s.slashes&&(s.slashes=o.test(e.href))}return s}function g(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function v(e,t){e=(e=h(e)).replace(a,""),t=t||{};var r,n=l.exec(e),i=n[1]?n[1].toLowerCase():"",s=!!n[2],o=!!n[3],u=0;return s?o?(r=n[2]+n[3]+n[4],u=n[2].length+n[3].length):(r=n[2]+n[4],u=n[2].length):o?(r=n[3]+n[4],u=n[3].length):r=n[4],"file:"===i?u>=2&&(r=r.slice(2)):g(i)?r=n[4]:i?s&&(r=r.slice(2)):u>=2&&g(t.protocol)&&(r=n[4]),{protocol:i,slashes:s||g(i),slashesCount:u,rest:r}}function y(e,t,r){if(e=(e=h(e)).replace(a,""),!(this instanceof y))return new y(e,t,r);var s,o,u,l,f,m,b=d.slice(),E=typeof t,S=this,T=0;for("object"!==E&&"string"!==E&&(r=t,t=null),r&&"function"!=typeof r&&(r=i.parse),t=p(t),s=!(o=v(e||"",t)).protocol&&!o.slashes,S.slashes=o.slashes||s&&t.slashes,S.protocol=o.protocol||t.protocol||"",e=o.rest,("file:"===o.protocol&&(2!==o.slashesCount||c.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!g(S.protocol)))&&(b[3]=[/(.*)/,"pathname"]);T<b.length;T++){if("function"==typeof(l=b[T])){e=l(e,S);continue}
157u=l[0],m=l[1],u!=u?S[m]=e:"string"==typeof u?~(f="@"===u?e.lastIndexOf(u):e.indexOf(u))&&("number"==typeof l[2]?(S[m]=e.slice(0,f),e=e.slice(f+l[2])):(S[m]=e.slice(f),e=e.slice(0,f))):(f=u.exec(e))&&(S[m]=f[1],e=e.slice(0,f.index)),S[m]=S[m]||s&&l[3]&&t[m]||"",l[4]&&(S[m]=S[m].toLowerCase())}r&&(S.query=r(S.query)),s&&t.slashes&&"/"!==S.pathname.charAt(0)&&(""!==S.pathname||""!==t.pathname)&&(S.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,i=r[n-1],s=!1,a=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),a++):a&&(0===n&&(s=!0),r.splice(n,1),a--);return s&&r.unshift(""),("."===i||".."===i)&&r.push(""),r.join("/")}(S.pathname,t.pathname)),"/"!==S.pathname.charAt(0)&&g(S.protocol)&&(S.pathname="/"+S.pathname),n(S.port,S.protocol)||(S.host=S.hostname,S.port=""),S.username=S.password="",S.auth&&(~(f=S.auth.indexOf(":"))?(S.username=S.auth.slice(0,f),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=S.auth.slice(f+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(S.auth)),S.auth=S.password?S.username+":"+S.password:S.username),S.origin="file:"!==S.protocol&&g(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString()}y.prototype={set:function(e,t,r){var s=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||i.parse)(t)),s[e]=t;break;case"port":s[e]=t,n(t,s.protocol)?t&&(s.host=s.hostname+":"+t):(s.host=s.hostname,s[e]="");break;case"hostname":s[e]=t,s.port&&(t+=":"+s.port),s.host=t;break;case"host":s[e]=t,u.test(t)?(t=t.split(":"),s.port=t.pop(),s.hostname=t.join(":")):(s.hostname=t,s.port="");break;case"protocol":s.protocol=t.toLowerCase(),s.slashes=!r;break;case"pathname":case"hash":if(t){var a="pathname"===e?"/":"#";s[e]=t.charAt(0)!==a?a+t:t}else s[e]=t;break;case"username":case"password":s[e]=encodeURIComponent(t);break;case"auth":var o=t.indexOf(":");~o?(s.username=t.slice(0,o),s.username=encodeURIComponent(decodeURIComponent(s.username)),s.password=t.slice(o+1),s.password=encodeURIComponent(decodeURIComponent(s.password))):s.username=encodeURIComponent(decodeURIComponent(t))}for(var l=0;l<d.length;l++){var c=d[l];c[4]&&(s[c[1]]=s[c[1]].toLowerCase())}return s.auth=s.password?s.username+":"+s.password:s.username,s.origin="file:"!==s.protocol&&g(s.protocol)&&s.host?s.protocol+"//"+s.host:"null",s.href=s.toString(),s},toString:function(e){e&&"function"==typeof e||(e=i.stringify);var t,r=this.host,n=this.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var s=n+(this.protocol&&this.slashes||g(this.protocol)?"//":"");return this.username?(s+=this.username,this.password&&(s+=":"+this.password),s+="@"):this.password?(s+=":"+this.password,s+="@"):"file:"!==this.protocol&&g(this.protocol)&&!r&&"/"!==this.pathname&&(s+="@"),(":"===r[r.length-1]||u.test(this.hostname)&&!this.port)&&(r+=":"),s+=r+this.pathname,(t="object"==typeof this.query?e(this.query):this.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),this.hash&&(s+=this.hash),s}},y.extractProtocol=v,y.location=p,y.trimLeft=h,y.qs=i,e.exports=y},3250:function(e,t,r){"use strict";/**
158 * @license React
159 * use-sync-external-store-shim.production.min.js
160 *
161 * Copyright (c) Facebook, Inc. and its affiliates.
162 *
163 * This source code is licensed under the MIT license found in the
164 * LICENSE file in the root directory of this source tree.
165 */ var n=r(7294),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,a=n.useEffect,o=n.useLayoutEffect,u=n.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(n){return!0}}function c(e,t){return t()}var h="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?c:function(e,t){var r=t(),n=s({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return o(function(){i.value=r,i.getSnapshot=t,l(i)&&c({inst:i})},[e,r,t]),a(function(){return l(i)&&c({inst:i}),e(function(){l(i)&&c({inst:i})})},[e]),u(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:h},139:function(e,t,r){"use strict";/**
166 * @license React
167 * use-sync-external-store-shim/with-selector.production.min.js
168 *
169 * Copyright (c) Facebook, Inc. and its affiliates.
170 *
171 * This source code is licensed under the MIT license found in the
172 * LICENSE file in the root directory of this source tree.
173 */ var n=r(7294),i=r(1688),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useSyncExternalStore,o=n.useRef,u=n.useEffect,l=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var h=o(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;var f=a(e,(h=l(function(){function e(e){if(!u){if(u=!0,a=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return o=t}return o=e}if(t=o,s(a,e))return t;var r=n(e);return void 0!==i&&i(t,r)?t:(a=e,o=r)}var a,o,u=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,i]))[0],h[1]);return u(function(){d.hasValue=!0,d.value=f},[f]),c(f),f}},1688:function(e,t,r){"use strict";e.exports=r(3250)},2798:function(e,t,r){"use strict";e.exports=r(139)},5024:function(){},1799:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
173))),i.forEach(function(t){n(e,t,r[t])})}return e}r.d(t,{Z:function(){return i}})},819:function(e,t,r){"use strict";r.r(t),r.d(t,{defaultLogger:function(){return n}});let n=console},8070:function(e,t,r){"use strict";r.r(t),r.d(t,{unstable_batchedUpdates:function(){return i}});var n=r(3935);let i=n.unstable_batchedUpdates},464:function(e,t,r){"use strict";r.r(t),r.d(t,{useSyncExternalStore:function(){return i}});var n=r(1688);let i=n.useSyncExternalStore}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(6840),t(387)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.