vendor: 29,395 bytes, lines 1-9
1function SO(s,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in s)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(s,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function e(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=e(i);fetch(i.href,a)}})();function D1(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Wm={exports:{}},Pl={};/** 2 * @license React 3 * react-jsx-runtime.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var VS;function EO(){if(VS)return Pl;VS=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function e(n,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:s,type:n,key:o,ref:i!==void 0?i:null,props:a}}return Pl.Fragment=t,Pl.jsx=e,Pl.jsxs=e,Pl}var GS;function TO(){return GS||(GS=1,Wm.exports=EO()),Wm.exports}var A=TO(),da=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},AO=class extends da{#e;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const t=()=>s();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(s){this.#e!==s&&(this.#e=s,this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(t=>{t(s)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},E0=new AO,RO={setTimeout:(s,t)=>setTimeout(s,t),clearTimeout:s=>clearTimeout(s),setInterval:(s,t)=>setInterval(s,t),clearInterval:s=>clearInterval(s)},wO=class{#e=RO;#t=!1;setTimeoutProvider(s){this.#e=s}setTimeout(s,t){return this.#e.setTimeout(s,t)}clearTimeout(s){this.#e.clearTimeout(s)}setInterval(s,t){return this.#e.setInterval(s,t)}clearInterval(s){this.#e.clearInterval(s)}},ea=new wO;function LO(s){setTimeout(s,0)}var _O=typeof window>"u"||"Deno"in globalThis;function os(){}function CO(s,t){return typeof s=="function"?s(t):s}function sg(s){return typeof s=="number"&&s>=0&&s!==1/0}function I1(s,t){return Math.max(s+(t||0)-Date.now(),0)}function mr(s,t){return typeof s=="function"?s(t):s}function $s(s,t){return typeof s=="function"?s(t):s}function HS(s,t){const{type:e="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:c}=s;if(o){if(n){if(t.queryHash!==T0(o,t.options))return!1}else if(!_o(t.queryKey,o))return!1}if(e!=="all"){const d=t.isActive();if(e==="active"&&!d||e==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||a&&!a(t))}function zS(s,t){const{exact:e,status:n,predicate:i,mutationKey:a}=s;if(a){if(!t.options.mutationKey)return!1;if(e){if(yr(t.options.mutationKey)!==yr(a))return!1}else if(!_o(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function T0(s,t){return(t?.queryKeyHashFn||yr)(s)}function yr(s){return JSON.stringify(s,(t,e)=>ng(e)?Object.keys(e).sort().reduce((n,i)=>(n[i]=e[i],n),{}):e)}function _o(s,t){if(s===t)return!0;if(typeof s!=typeof t)return!1;if(s&&t&&typeof s=="object"&&typeof t=="object"){if(Array.isArray(s)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!_o(s[n],t[n]))return!1;return!0}const e=Object.keys(t);for(const n of e)if(!_o(s[n],t[n]))return!1;return!0}return!1}var DO=Object.prototype.hasOwnProperty;function A0(s,t,e=0){if(s===t)return s;if(e>500)return t;const n=KS(s)&&KS(t);if(!n&&!(ng(s)&&ng(t)))return t;const a=(n?s:Object.keys(s)).length,o=n?t:Object.keys(t),c=o.length,d=n?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=n?h:o[h],g=s[p],v=t[p];if(g===v){d[p]=g,(n?h<a:DO.call(s,p))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){d[p]=v;continue}const x=A0(g,v,e+1);d[p]=x,x===g&&f++}return a===c&&f===a?s:d}function ic(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}function KS(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function ng(s){if(!qS(s))return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(!qS(e)||!e.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function qS(s){return Object.prototype.toString.call(s)==="[object Object]"}function IO(s){return new Promise(t=>{ea.setTimeout(t,s)})}function ig(s,t,e){return typeof e.structuralSharing=="function"?e.structuralSharing(s,t):e.structuralSharing!==!1?A0(s,t):t}function OO(s,t,e=0){const n=[...s,t];return e&&n.length>e?n.slice(1):n}function kO(s,t,e=0){const n=[t,...s];return e&&n.length>e?n.slice(0,-1):n}var zs=Symbol();function O1(s,t){return!s.queryFn&&t?.initialPromise?()=>t.initialPromise:!s.queryFn||s.queryFn===zs?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function R0(s,t){return typeof s=="function"?s(...t):!!s}function PO(s,t,e){let n=!1,i;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(i??=t(),n||(n=!0,i.aborted?e():i.addEventListener("abort",e,{once:!0})),i)}),s}var rc=(()=>{let s=()=>_O;return{isServer(){return s()},setIsServer(t){s=t}}})();function rg(){let s,t;const e=new Promise((i,a)=>{s=i,t=a});e.status="pending",e.catch(()=>{});function n(i){Object.assign(e,i),delete e.resolve,delete e.reject}return e.resolve=i=>{n({status:"fulfilled",value:i}),s(i)},e.reject=i=>{n({status:"rejected",reason:i}),t(i)},e}var MO=LO;function NO(){let s=[],t=0,e=c=>{c()},n=c=>{c()},i=MO;const a=c=>{t?s.push(c):i(()=>{e(c)})},o=()=>{const c=s;s=[],c.length&&i(()=>{n(()=>{c.forEach(d=>{e(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{e=c},setBatchNotifyFunction:c=>{n=c},setScheduler:c=>{i=c}}}var Te=NO(),BO=class extends da{#e=!0;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const t=()=>s(!0),e=()=>s(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",e,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(this.setOnline.bind(this))}setOnline(s){this.#e!==s&&(this.#e=s,this.listeners.forEach(e=>{e(s)}))}isOnline(){return this.#e}},Gd=new BO;function FO(s){return Math.min(1e3*2**s,3e4)}function k1(s){return(s??"online")==="online"?Gd.isOnline():!0}var ag=class extends Error{constructor(s){super("CancelledError"),this.revert=s?.revert,this.silent=s?.silent}};function P1(s){let t=!1,e=0,n;const i=rg(),a=()=>i.status!=="pending",o=S=>{if(!a()){const E=new ag(S);g(E),s.onCancel?.(E)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>E0.isFocused()&&(s.networkMode==="always"||Gd.isOnline())&&s.canRun(),h=()=>k1(s.networkMode)&&s.canRun(),p=S=>{a()||(n?.(),i.resolve(S))},g=S=>{a()||(n?.(),i.reject(S))},v=()=>new Promise(S=>{n=E=>{(a()||f())&&S(E)},s.onPause?.()}).then(()=>{n=void 0,a()||s.onContinue?.()}),x=()=>{if(a())return;let S;const E=e===0?s.initialPromise:void 0;try{S=E??s.fn()}catch(T){S=Promise.reject(T)}Promise.resolve(S).then(p).catch(T=>{if(a())return;const L=s.retry??(rc.isServer()?0:3),_=s.retryDelay??FO,P=typeof _=="function"?_(e,T):_,D=L===!0||typeof L=="number"&&e<L||typeof L=="function"&&L(e,T);if(t||!D){g(T);return}e++,s.onFail?.(e,T),IO(P).then(()=>f()?void 0:v()).then(()=>{t?g(T):x()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n?.(),i),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?x():v().then(x),i)}}var M1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sg(this.gcTime)&&(this.#e=ea.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(rc.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ea.clearTimeout(this.#e),this.#e=void 0)}};function UO(s){return{onFetch:(t,e)=>{const n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=x=>{PO(x,()=>t.signal,()=>h=!0)},g=O1(t.options,t.fetchOptions),v=async(x,S,E)=>{if(h)return Promise.reject(t.signal.reason);if(S==null&&x.pages.length)return Promise.resolve(x);const L=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};return p(B),B})(),_=await g(L),{maxPages:P}=t.options,D=E?kO:OO;return{pages:D(x.pages,_,P),pageParams:D(x.pageParams,S,P)}};if(i&&a.length){const x=i==="backward",S=x?N1:og,E={pages:a,pageParams:o},T=S(n,E);c=await v(E,T,x)}else{const x=s??a.length;do{const S=d===0?o[0]??n.initialPageParam:og(n,c);if(d>0&&S==null)break;c=await v(c,S),d++}while(d<x)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e):t.fetchFn=f}}}function og(s,{pages:t,pageParams:e}){const n=t.length-1;return t.length>0?s.getNextPageParam(t[n],t,e[n],e):void 0}function N1(s,{pages:t,pageParams:e}){return t.length>0?s.getPreviousPageParam?.(t[0],t,e[0],e):void 0}function jO(s,t){return t?og(s,t)!=null:!1}function $O(s,t){return!t||!s.getPreviousPageParam?!1:N1(s,t)!=null}var VO=class extends M1{#e;#t;#s;#n;#i;#r;#o;#a;constructor(s){super(),this.#a=!1,this.#o=s.defaultOptions,this.setOptions(s.options),this.observers=[],this.#i=s.client,this.#n=this.#i.getQueryCache(),this.queryKey=s.queryKey,this.queryHash=s.queryHash,this.#t=WS(this.options),this.state=s.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(s){if(this.options={...this.#o,...s},s?._type&&(this.#e=s._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=WS(this.options);t.data!==void 0&&(this.setState(YS(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(s,t){const e=ig(this.state.data,s,this.options);return this.#l({data:e,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),e}setState(s){this.#l({type:"setState",state:s})}cancel(s){const t=this.#r?.promise;return this.#r?.cancel(s),t?t.then(os).catch(os):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>$s(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>mr(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!I1(this.state.dataUpdatedAt,s)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(t=>t!==s),this.observers.length||(this.#r&&(this.#a||this.#u()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(s,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(s&&this.setOptions(s),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const e=new AbortController,n=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#a=!0,e.signal)})},i=()=>{const d=O1(this.options,t),h=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return n(p),p})();return this.#a=!1,this.options.persister?this.options.persister(d,h,this):d(h)},o=(()=>{const d={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return n(d),d})();(this.#e==="infinite"?UO(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#s=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#l({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=P1({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:d=>{d instanceof ag&&d.revert&&this.setState({...this.#s,fetchStatus:"idle"}),e.abort()},onFail:(d,f)=>{this.#l({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const d=await this.#r.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#n.config.onSuccess?.(d,this),this.#n.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof ag){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#l({type:"error",error:d}),this.#n.config.onError?.(d,this),this.#n.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#l(s){const t=e=>{switch(s.type){case"failed":return{...e,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...B1(e.data,this.options),fetchMeta:s.meta??null};case"success":const n={...e,...YS(s.data,s.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=s.manual?n:void 0,n;case"error":const i=s.error;return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...s.state}}};this.state=t(this.state),Te.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:s})})}};function B1(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:k1(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function YS(s,t){return{data:s,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function WS(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,e=t!==void 0,n=e?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:e?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:e?"success":"pending",fetchStatus:"idle"}}var wc=class extends da{constructor(s,t){super(),this.options=t,this.#e=s,this.#a=null,this.#o=rg(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#s=void 0;#n=void 0;#i;#r;#o;#a;#u;#l;#h;#d;#m;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),QS(this.#t,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lg(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lg(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(s){const t=this.options,e=this.#t;if(this.options=this.#e.defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $s(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!ic(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&XS(this.#t,e,this.options,t)&&this.#f(),this.updateResult(),n&&(this.#t!==e||$s(this.options.enabled,this.#t)!==$s(t.enabled,this.#t)||mr(this.options.staleTime,this.#t)!==mr(t.staleTime,this.#t))&&this.#g();const i=this.#y();n&&(this.#t!==e||$s(this.options.enabled,this.#t)!==$s(t.enabled,this.#t)||i!==this.#c)&&this.#v(i)}getOptimisticResult(s){const t=this.#e.getQueryCache().build(this.#e,s),e=this.createResult(t,s);return HO(this,e)&&(this.#n=e,this.#r=this.options,this.#i=this.#t.state),e}getCurrentResult(){return this.#n}trackResult(s,t){return new Proxy(s,{get:(e,n)=>(this.trackProp(n),t?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(s){this.#p.add(s)}getCurrentQuery(){return this.#t}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const t=this.#e.defaultQueryOptions(s),e=this.#e.getQueryCache().build(this.#e,t);return e.fetch().then(()=>this.createResult(e,t))}fetch(s){return this.#f({...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(s){this.#E();let t=this.#t.fetch(this.options,s);return s?.throwOnError||(t=t.catch(os)),t}#g(){this.#b();const s=mr(this.options.staleTime,this.#t);if(rc.isServer()||this.#n.isStale||!sg(s))return;const e=I1(this.#n.dataUpdatedAt,s)+1;this.#d=ea.setTimeout(()=>{this.#n.isStale||this.updateResult()},e)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(s){this.#S(),this.#c=s,!(rc.isServer()||$s(this.options.enabled,this.#t)===!1||!sg(this.#c)||this.#c===0)&&(this.#m=ea.setInterval(()=>{(this.options.refetchIntervalInBackground||E0.isFocused())&&this.#f()},this.#c))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#d!==void 0&&(ea.clearTimeout(this.#d),this.#d=void 0)}#S(){this.#m!==void 0&&(ea.clearInterval(this.#m),this.#m=void 0)}createResult(s,t){const e=this.#t,n=this.options,i=this.#n,a=this.#i,o=this.#r,d=s!==e?s.state:this.#s,{state:f}=s;let h={...f},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),F=!I&&QS(s,t),U=I&&XS(s,e,t,n);(F||U)&&(h={...h,...B1(f.data,s.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:S}=h;g=h.data;let E=!1;if(t.placeholderData!==void 0&&g===void 0&&S==="pending"){let I;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(I=i.data,E=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,I!==void 0&&(S="success",g=ig(i?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!E)if(i&&g===a?.data&&t.select===this.#u)g=this.#l;else try{this.#u=t.select,g=t.select(g),g=ig(i?.data,g,t),this.#l=g,this.#a=null}catch(I){this.#a=I}this.#a&&(v=this.#a,g=this.#l,x=Date.now(),S="error");const T=h.fetchStatus==="fetching",L=S==="pending",_=S==="error",P=L&&T,D=g!==void 0,C={status:S,fetchStatus:h.fetchStatus,isPending:L,isSuccess:S==="success",isError:_,isInitialLoading:P,isLoading:P,data:g,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:T,isRefetching:T&&!L,isLoadingError:_&&!D,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&D,isStale:w0(s,t),refetch:this.refetch,promise:this.#o,isEnabled:$s(t.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const I=C.data!==void 0,F=C.status==="error"&&!I,U=nt=>{F?nt.reject(C.error):I&&nt.resolve(C.data)},z=()=>{const nt=this.#o=C.promise=rg();U(nt)},Y=this.#o;switch(Y.status){case"pending":s.queryHash===e.queryHash&&U(Y);break;case"fulfilled":(F||C.data!==Y.value)&&z();break;case"rejected":(!F||C.error!==Y.reason)&&z();break}}return C}updateResult(){const s=this.#n,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#h=this.#t),ic(t,s))return;this.#n=t;const e=()=>{if(!s)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const a=new Set(i??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#n).some(o=>{const c=o;return this.#n[c]!==s[c]&&a.has(c)})};this.#T({listeners:e()})}#E(){const s=this.#e.getQueryCache().build(this.#e,this.options);if(s===this.#t)return;const t=this.#t;this.#t=s,this.#s=s.state,this.hasListeners()&&(t?.removeObserver(this),s.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#T(s){Te.batch(()=>{s.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function GO(s,t){return $s(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&$s(t.retryOnMount,s)===!1)}function QS(s,t){return GO(s,t)||s.state.data!==void 0&&lg(s,t,t.refetchOnMount)}function lg(s,t,e){if($s(t.enabled,s)!==!1&&mr(t.staleTime,s)!=="static"){const n=typeof e=="function"?e(s):e;return n==="always"||n!==!1&&w0(s,t)}return!1}function XS(s,t,e,n){return(s!==t||$s(n.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&w0(s,e)}function w0(s,t){return $s(t.enabled,s)!==!1&&s.isStaleByTime(mr(t.staleTime,s))}function HO(s,t){return!ic(s.getCurrentResult(),t)}var F1=class extends wc{constructor(s,t){super(s,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,t){const{state:e}=s,n=super.createResult(s,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:c}=n,d=e.fetchMeta?.fetchMore?.direction,f=o&&d==="forward",h=i&&d==="forward",p=o&&d==="backward",g=i&&d==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:jO(t,e.data),hasPreviousPage:$O(t,e.data),isFetchNextPageError:f,isFetchingNextPage:h,isFetchPreviousPageError:p,isFetchingPreviousPage:g,isRefetchError:c&&!f&&!p,isRefetching:a&&!h&&!g}}},zO=class extends M1{#e;#t;#s;#n;constructor(s){super(),this.#e=s.client,this.mutationId=s.mutationId,this.#s=s.mutationCache,this.#t=[],this.state=s.state||U1(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){this.#t.includes(s)||(this.#t.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){this.#t=this.#t.filter(t=>t!==s),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(s){const t=()=>{this.#i({type:"continue"})},e={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=P1({fn:()=>this.options.mutationFn?this.options.mutationFn(s,e):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#i({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const n=this.state.status==="pending",i=!this.#n.canStart();try{if(n)t();else{this.#i({type:"pending",variables:s,isPaused:i}),this.#s.config.onMutate&&await this.#s.config.onMutate(s,this,e);const o=await this.options.onMutate?.(s,e);o!==this.state.context&&this.#i({type:"pending",context:o,variables:s,isPaused:i})}const a=await this.#n.start();return await this.#s.config.onSuccess?.(a,s,this.state.context,this,e),await this.options.onSuccess?.(a,s,this.state.context,e),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,e),await this.options.onSettled?.(a,null,s,this.state.context,e),this.#i({type:"success",data:a}),a}catch(a){try{await this.#s.config.onError?.(a,s,this.state.context,this,e)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,s,this.state.context,e)}catch(o){Promise.reject(o)}try{await this.#s.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,e)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,s,this.state.context,e)}catch(o){Promise.reject(o)}throw this.#i({type:"error",error:a}),a}finally{this.#s.runNext(this)}}#i(s){const t=e=>{switch(s.type){case"failed":return{...e,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...e,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:s.error,failureCount:e.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Te.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(s)}),this.#s.notify({mutation:this,type:"updated",action:s})})}};function U1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var KO=class extends da{constructor(s={}){super(),this.config=s,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(s,t,e){const n=new zO({client:s,mutationCache:this,mutationId:++this.#s,options:s.defaultMutationOptions(t),state:e});return this.add(n),n}add(s){this.#e.add(s);const t=Yu(s);if(typeof t=="string"){const e=this.#t.get(t);e?e.push(s):this.#t.set(t,[s])}this.notify({type:"added",mutation:s})}remove(s){if(this.#e.delete(s)){const t=Yu(s);if(typeof t=="string"){const e=this.#t.get(t);if(e)if(e.length>1){const n=e.indexOf(s);n!==-1&&e.splice(n,1)}else e[0]===s&&this.#t.delete(t)}}this.notify({type:"removed",mutation:s})}canRun(s){const t=Yu(s);if(typeof t=="string"){const n=this.#t.get(t)?.find(i=>i.state.status==="pending");return!n||n===s}else return!0}runNext(s){const t=Yu(s);return typeof t=="string"?this.#t.get(t)?.find(n=>n!==s&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Te.batch(()=>{this.#e.forEach(s=>{this.notify({type:"removed",mutation:s})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(s){const t={exact:!0,...s};return this.getAll().find(e=>zS(t,e))}findAll(s={}){return this.getAll().filter(t=>zS(s,t))}notify(s){Te.batch(()=>{this.listeners.forEach(t=>{t(s)})})}resumePausedMutations(){const s=this.getAll().filter(t=>
9t.state.isPaused);return Te.batch(()=>Promise.all(s.map(t=>t.continue().catch(os))))}};function Yu(s){return s.options.scope?.id}var qO=class extends da{#e;#t=void 0;#s;#n;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),ic(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&yr(e.mutationKey)!==yr(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#r(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#i(),this.#r()}mutate(t,e){return this.#n=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#i(){const t=this.#s?.state??U1();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){Te.batch(()=>{if(this.#n&&this.hasListeners()){const e=this.#t.variables,n=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#n.onSuccess?.(t.data,e,n,i)}catch(a){Promise.reject(a)}try{this.#n.onSettled?.(t.data,null,e,n,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#n.onError?.(t.error,e,n,i)}catch(a){Promise.reject(a)}try{this.#n.onSettled?.(void 0,t.error,e,n,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ZS(s,t){const e=new Set(t);return s.filter(n=>!e.has(n))}function YO(s,t,e){const n=s.slice(0);return n[t]=e,n}var WO=class extends da{#e;#t;#s;#n;#i;#r;#o;#a;#u;#l=[];constructor(s,t,e){super(),this.#e=s,this.#n=e,this.#s=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(s=>{s.subscribe(t=>{this.#p(s,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(s=>{s.destroy()})}setQueries(s,t){this.#s=s,this.#n=t,Te.batch(()=>{const e=this.#i,n=this.#c(this.#s);n.forEach(h=>h.observer.setOptions(h.defaultedQueryOptions));const i=n.map(h=>h.observer),a=i.map(h=>h.getCurrentResult()),o=e.length!==i.length,c=i.some((h,p)=>h!==e[p]),d=o||c,f=d?!0:a.some((h,p)=>{const g=this.#t[p];return!g||!ic(h,g)});!d&&!f||(d&&(this.#l=n,this.#i=i),this.#t=a,this.hasListeners()&&(d&&(ZS(e,i).forEach(h=>{h.destroy()}),ZS(i,e).forEach(h=>{h.subscribe(p=>{this.#p(h,p)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(s=>s.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(s,t){const e=this.#c(s),n=e.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=e.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#d(a??n,t,i),()=>this.#h(n,e)]}#h(s,t){return t.map((e,n)=>{const i=s[n];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,a=>{t.forEach(o=>{o.observer.trackProp(a)})})})}#d(s,t,e){if(t){const n=this.#u,i=e!==void 0&&n!==void 0&&(n.length!==e.length||e.some((a,o)=>a!==n[o]));return(!this.#r||this.#t!==this.#a||i||t!==this.#o)&&(this.#o=t,this.#a=this.#t,e!==void 0&&(this.#u=e),this.#r=A0(this.#r,t(s))),this.#r}return s}#m(){return this.#n?.combine!==void 0&&this.#i.some((s,t)=>s.options.suspense&&this.#t[t]?.data===void 0)}#c(s){const t=new Map;this.#i.forEach(n=>{const i=n.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(n):t.set(i,[n])});const e=[];return s.forEach(n=>{const i=this.#e.defaultQueryOptions(n),o=t.get(i.queryHash)?.shift()??new wc(this.#e,i);e.push({defaultedQueryOptions:i,observer:o})}),e}#p(s,t){const e=this.#i.indexOf(s);e!==-1&&(this.#t=YO(this.#t,e,t),this.#f())}#f(){if(this.hasListeners()){const s=this.#h(this.#t,this.#l),t=this.#m(),e=this.#r,n=t?e:this.#d(s,this.#n?.combine);(t||e!==n)&&Te.batch(()=>
vendor: 8,083 bytes, lines 9-17
9{this.listeners.forEach(i=>{i(this.#t)})})}}},QO=class extends da{constructor(s={}){super(),this.config=s,this.#e=new Map}#e;build(s,t,e){const n=t.queryKey,i=t.queryHash??T0(n,t);let a=this.get(i);return a||(a=new VO({client:s,queryKey:n,queryHash:i,options:s.defaultQueryOptions(t),state:e,defaultOptions:s.getQueryDefaults(n)}),this.add(a)),a}add(s){this.#e.has(s.queryHash)||(this.#e.set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const t=this.#e.get(s.queryHash);t&&(s.destroy(),t===s&&this.#e.delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){Te.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return this.#e.get(s)}getAll(){return[...this.#e.values()]}find(s){const t={exact:!0,...s};return this.getAll().find(e=>HS(t,e))}findAll(s={}){const t=this.getAll();return Object.keys(s).length>0?t.filter(e=>HS(s,e)):t}notify(s){Te.batch(()=>{this.listeners.forEach(t=>{t(s)})})}onFocus(){Te.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){Te.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},XO=class{#e;#t;#s;#n;#i;#r;#o;#a;constructor(s={}){this.#e=s.queryCache||new QO,this.#t=s.mutationCache||new KO,this.#s=s.defaultOptions||{},this.#n=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=E0.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Gd.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(s){return this.#e.findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return this.#t.findAll({...s,status:"pending"}).length}getQueryData(s){const t=this.defaultQueryOptions({queryKey:s});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(s){const t=this.defaultQueryOptions(s),e=this.#e.build(this,t),n=e.state.data;return n===void 0?this.fetchQuery(s):(s.revalidateIfStale&&e.isStaleByTime(mr(t.staleTime,e))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(s){return this.#e.findAll(s).map(({queryKey:t,state:e})=>{const n=e.data;return[t,n]})}setQueryData(s,t,e){const n=this.defaultQueryOptions({queryKey:s}),a=this.#e.get(n.queryHash)?.state.data,o=CO(t,a);if(o!==void 0)return this.#e.build(this,n).setData(o,{...e,manual:!0})}setQueriesData(s,t,e){return Te.batch(()=>this.#e.findAll(s).map(({queryKey:n})=>[n,this.setQueryData(n,t,e)]))}getQueryState(s){const t=this.defaultQueryOptions({queryKey:s});return this.#e.get(t.queryHash)?.state}removeQueries(s){const t=this.#e;Te.batch(()=>{t.findAll(s).forEach(e=>{t.remove(e)})})}resetQueries(s,t){const e=this.#e;return Te.batch(()=>(e.findAll(s).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...s},t)))}cancelQueries(s,t={}){const e={revert:!0,...t},n=Te.batch(()=>this.#e.findAll(s).map(i=>i.cancel(e)));return Promise.all(n).then(os).catch(os)}invalidateQueries(s,t={}){return Te.batch(()=>(this.#e.findAll(s).forEach(e=>{e.invalidate()}),s?.refetchType==="none"?Promise.resolve():this.refetchQueries({...s,type:s?.refetchType??s?.type??"active"},t)))}refetchQueries(s,t={}){const e={...t,cancelRefetch:t.cancelRefetch??!0},n=Te.batch(()=>this.#e.findAll(s).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,e);return e.throwOnError||(a=a.catch(os)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(os)}fetchQuery(s){const t=this.defaultQueryOptions(s);t.retry===void 0&&(t.retry=!1);const e=this.#e.build(this,t);return e.isStaleByTime(mr(t.staleTime,e))?e.fetch(t):Promise.resolve(e.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(os).catch(os)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(os).catch(os)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return Gd.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(s){this.#s=s}setQueryDefaults(s,t){this.#n.set(yr(s),{queryKey:s,defaultOptions:t})}getQueryDefaults(s){const t=[...this.#n.values()],e={};return t.forEach(n=>{_o(s,n.queryKey)&&Object.assign(e,n.defaultOptions)}),e}setMutationDefaults(s,t){this.#i.set(yr(s),{mutationKey:s,defaultOptions:t})}getMutationDefaults(s){const t=[...this.#i.values()],e={};return t.forEach(n=>{_o(s,n.mutationKey)&&Object.assign(e,n.defaultOptions)}),e}defaultQueryOptions(s){if(s._defaulted)return s;const t={...this.#s.queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return t.queryHash||(t.queryHash=T0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zs&&(t.enabled=!1),t}defaultMutationOptions(s){return s?._defaulted?s:{...this.#s.mutations,...s?.mutationKey&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Qm={exports:{}},It={};/** 10 * @license React 11 * react.production.js 12 * 13 * Copyright (c) Meta Platforms, Inc. and affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var JS;function ZO(){if(JS)return It;JS=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function T(O,G,K){this.props=O,this.context=G,this.refs=E,this.updater=K||x}T.prototype.isReactComponent={},T.prototype.setState=function(O,G){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,G,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function L(){}L.prototype=T.prototype;function _(O,G,K){this.props=O,this.context=G,this.refs=E,this.updater=K||x}var P=_.prototype=new L;P.constructor=_,S(P,T.prototype),P.isPureReactComponent=!0;var D=Array.isArray;function B(){}var C={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function F(O,G,K){var J=K.ref;return{$$typeof:s,type:O,key:G,ref:J!==void 0?J:null,props:K}}function U(O,G){return F(O.type,G,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===s}function Y(O){var G={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(K){return G[K]})}var nt=/\/+/g;function it(O,G){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):G.toString(36)}function rt(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(B,B):(O.status="pending",O.then(function(G){O.status==="pending"&&(O.status="fulfilled",O.value=G)},function(G){O.status==="pending"&&(O.status="rejected",O.reason=G)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,G,K,J,ot){var ft=typeof O;(ft==="undefined"||ft==="boolean")&&(O=null);var ht=!1;if(O===null)ht=!0;else switch(ft){case"bigint":case"string":case"number":ht=!0;break;case"object":switch(O.$$typeof){case s:case t:ht=!0;break;case h:return ht=O._init,M(ht(O._payload),G,K,J,ot)}}if(ht)return ot=ot(O),ht=J===""?"."+it(O,0):J,D(ot)?(K="",ht!=null&&(K=ht.replace(nt,"$&/")+"/"),M(ot,G,K,"",function(Zt){return Zt}
17)):ot!=null&&(z(ot)&&(ot=U(ot,K+(ot.key==null||O&&O.key===ot.key?"":(""+ot.key).replace(nt,"$&/")+"/")+ht)),G.push(ot)),1;ht=0;var xt=J===""?".":J+":";if(D(O))for(var wt=0;wt<O.length;wt++)J=O[wt],ft=xt+it(J,wt),ht+=M(J,G,K,ft,ot);else if(wt=v(O),typeof wt=="function")for(O=wt.call(O),wt=0;!(J=O.next()).done;)J=J.value,ft=xt+it(J,wt++),ht+=M(J,G,K,ft,ot);else if(ft==="object"){if(typeof O.then=="function")return M(rt(O),G,K,J,ot);throw G=String(O),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ht}function j(O,G,K){if(O==null)return O;var J=[],ot=0;return M(O,J,"","",function(ft){return G.call(K,ft,ot++)}),J}function N(O){if(O._status===-1){var G=O._result;G=G(),G.then(function(K){(O._status===0||O._status===-1)&&(O._status=1,O._result=K)},function(K){(O._status===0||O._status===-1)&&(O._status=2,O._result=K)}),O._status===-1&&(O._status=0,O._result=G)}if(O._status===1)return O._result.default;throw O._result}var V=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},X={map:j,forEach:function(O,G,K){j(O,function(){G.apply(this,arguments)},K)},count:function(O){var G=0;return j(O,function(){G++}),G},toArray:function(O){return j(O,function(G){return G})||[]},only:function(O){if(!z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return It.Activity=p,It.Children=X,It.Component=T,It.Fragment=e,It.Profiler=i,It.PureComponent=_,It.StrictMode=n,It.Suspense=d,It.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,It.__COMPILER_RUNTIME={__proto__:null,c:function(O){return C.H.useMemoCache(O)}},It.cache=function(O){return function(){return O.apply(null,arguments)}},It.cacheSignal=function(){return null},It.cloneElement=function(O,G,K){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var J=S({},O.props),ot=O.key;if(G!=null)for(ft in G.key!==void 0&&(ot=""+G.key),G)!I.call(G,ft)||ft==="key"||ft==="__self"||ft==="__source"||ft==="ref"&&G.ref===void 0||(J[ft]=G[ft]);var ft=arguments.length-2;if(ft===1)J.children=K;else if(1<ft){for(var ht=Array(ft),xt=0;xt<ft;xt++)ht[xt]=arguments[xt+2];J.children=ht}return F(O.type,ot,J)},It.createContext=function(O){return O={$$typeof:o,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:a,_context:O},O},It.createElement=function(O,G,K){var J,ot={},ft=null;if(G!=null)for(J in G.key!==void 0&&(ft=""+G.key),G)I.call(G,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ot[J]=G[J]);var ht=arguments.length-2;if(ht===1)ot.children=K;else if(1<ht){for(var xt=Array(ht),wt=0;wt<ht;wt++)xt[wt]=arguments[wt+2];ot.children=xt}if(O&&O.defaultProps)for(J in ht=O.defaultProps,ht)ot[J]===void 0&&(ot[J]=ht[J]);return F(O,ft,ot)},It.createRef=function(){return{current:null}},It.forwardRef=function(O){return{$$typeof:c,render:O}},It.isValidElement=z,It.lazy=function(O){return{$$typeof:h,_payload:{_status:-1,_result:O},_init:N}},It.memo=function(O,G){return{$$typeof:f,type:O,compare:G===void 0?null:G}},It.startTransition=function(O){var G=C.T,K={};C.T=K;try{var J=O(),ot=C.S;ot!==null&&ot(K,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(B,V)}catch(ft){V(ft)}finally{G!==null&&K.types!==null&&(G.types=K.types),C.T=G}},It.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},It.use=function(O){return C.H.use(O)},It.useActionState=function(O,G,K){return C.H.useActionState(O,G,K)},It.useCallback=function(O,G){return C.H.useCallback(O,G)},It.useContext=function(O){return C.H.useContext(O)},It.useDebugValue=function(){},It.useDeferredValue=function(O,G){return C.H.useDeferredValue(O,G)},It.useEffect=function(O,G){return C.H.useEffect(O,G)},It.useEffectEvent=function(O){return C.H.useEffectEvent(O)},It.useId=function(){return C.H.useId()},It.useImperativeHandle=function(O,G,K){return C.H.useImperativeHandle(O,G,K)},It.useInsertionEffect=function(O,G){return C.H.useInsertionEffect(O,G)},It.useLayoutEffect=function(O,G){return C.H.useLayoutEffect(O,G)},It.useMemo=function(O,G){return C.H.useMemo(O,G)},It.useOptimistic=function(O,G){return C.H.useOptimistic(O,G)},It.useReducer=function(O,G,K){return C.H.useReducer(O,G,K)},It.useRef=function(O){return C.H.useRef(O)},It.useState=function(O){return C.H.useState(O)},It.useSyncExternalStore=function(O,G,K){return C.H.useSyncExternalStore(O,G,K)},It.useTransition=function(){return C.H.useTransition()},It.version="19.2.1",It}var tE;function mf(){return tE||(tE=1,Qm.exports=ZO()),Qm.exports}var $=mf();const mt=D1($),j1=SO({__proto__:null,default:mt},[$]);var $1=$.createContext(void 0),Lc=s=>{const t=$.useContext($1);if(s)return s;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},JO=({client:s,children:t})=>($.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),A.jsx($1.Provider,{value:s,children:t})),V1=$.createContext(!1),G1=()=>$.useContext(V1);V1.Provider;function tk(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var ek=$.createContext(tk()),H1=()=>$.useContext(ek),z1=(s,t,e)=>{const n=e?.state.error&&typeof s.throwOnError=="function"?R0(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||n)&&(t.isReset()||(s.retryOnMount=!1))},K1=s=>{$.useEffect(()=>{s.clearReset()},[s])},q1=({result:s,errorResetBoundary:t,throwOnError:e,query:n,suspense:i})=>s.isError&&!t.isReset()&&!s.isFetching&&n&&(i&&s.data===void 0||R0(e,[s.error,n])),L0=(s,t)=>t.state.data===void 0,Y1=s=>{if(s.suspense){const e=i=>i==="static"?i:Math.max(i??1e3,1e3),n=s.staleTime;s.staleTime=typeof n=="function"?(...i)=>e(n(...i)):e(n),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},sk=(s,t)=>s.isLoading&&s.isFetching&&!t,cg=(s,t)=>s?.suspense&&t.isPending,ug=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function W1({queries:s,...t},e){const n=Lc(e),i=G1(),a=H1(),o=$.useMemo(()=>s.map(S=>{const E=n.defaultQueryOptions(S);return E._optimisticResults=i?"isRestoring":"optimistic",E}),[s,n,i]);o.forEach(S=>{Y1(S);const E=n.getQueryCache().get(S.queryHash);z1(S,a,E)}),K1(a);const[c]=$.useState(()=>new WO(n,o,t)),[d,f,h]=c.getOptimisticResult(o,t.combine),p=!i&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(S=>p?c.subscribe(Te.batchCalls(S)):os,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),$.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const v=d.some((S,E)=>cg(o[E],S))?d.flatMap((S,E)=>{const T=o[E];if(T&&cg(T,S)){const L=new wc(n,T);return ug(T,L,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const x=d.find((S,E)=>{const T=o[E];return T&&q1({result:S,errorResetBoundary:a,throwOnError:T.throwOnError,query:n.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(x?.error)throw x.error;return f(h())}function pf(s,t,e){const n=G1(),i=H1(),a=Lc(e),o=a.defaultQueryOptions(s);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=a.getQueryCache().get(o.queryHash),d=s.subscribed!==!1;o._optimisticResults=n?"isRestoring":d?"optimistic":void 0,Y1(o),z1(o,i,c),K1(i);const f=!a.getQueryCache().get(o.queryHash),[h]=$.useState(()=>new t(a,o)),p=h.getOptimisticResult(o),g=!n&&d;if($.useSyncExternalStore($.useCallback(v=>{const x=g?h.subscribe(Te.batchCalls(v)):os;return h.updateResult(),x},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),$.useEffect(()=>{h.setOptions(o)},[o,h]),cg(o,p))throw ug(o,h,i);if(q1({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!rc.isServer()&&sk(p,n)&&(f?ug(o,h,i):c?.promise)?.catch(os).finally(()=>{h.updateResult()}),o.notifyOnChangeProps?p:h.trackResult(p)}function nk(s,t){return pf(s,wc,t)}function ik(s,t){return pf({...s,enabled:!0,suspense:!0,throwOnError:L0,placeholderData:void 0},wc,t)}function rk(s,t){return pf({...s,enabled:!0,suspense:!0,throwOnError:L0},F1,t)}function ak(s,t){return W1({...s,queries:s.queries.map(e=>({...e,suspense:!0,throwOnError:L0,enabled:!0,placeholderData:void 0}))},t)}function ok(s,t){const e=Lc(t);e.getQueryState(s.queryKey)||e.prefetchQuery(s)}function lk(s,t){const e=Lc(t);e.getQueryState(s.queryKey)||e.prefetchInfiniteQuery(s)}function ck(s,t){const e=Lc(t),[n]=$.useState(()=>new qO(e,s));$.useEffect(()=>{n.setOptions(s)},[n,s]);const i=$.useSyncExternalStore($.useCallback(o=>n.subscribe(Te.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=$.useCallback((o,c)=>{n.mutate(o,c).catch(os)},[n]);if(i.error&&R0(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function uk(s,t){return pf(s,F1,t)}function oa(s){return!!s&&!Array.isArray(s)&&typeof s=="object"}function dk(){return Object.create(null)}const fk=typeof Symbol=="function"&&!!Symbol.asyncIterator;function Q1(s){return fk&&oa(s)&&Symbol.asyncIterator in s}var hk=Object.create,X1=Object.defineProperty,mk=Object.getOwnPropertyDescriptor,Z1=Object.getOwnPropertyNames,pk=Object.getPrototypeOf,gk=Object.prototype.hasOwnProperty,_c=(s,t)=>function(){return t||(0,s[Z1(s)[0]])((t={exports:{}}).exports,t),t.exports},yk=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Z1(t),a=0,o=i.length,c;a<o;a++)c=i[a],!gk.call(s,c)&&c!==e&&X1(s,c,{get:(d=>
17t[d]).bind(null,c),enumerable:!(n=mk(t,c))||n.enumerable});return s},gf=(s,t,e)=>(e=s!=null?hk(pk(s)):{},yk(X1(e,"default",{value:s,enumerable:!0}),s));const J1=()=>{},eE=s=>{Object.freeze&&Object.freeze(s)};function tR(s,t,e){var n;const i=t.join(".");return(n=e[i])!==null&&n!==void 0||(e[i]=new Proxy(J1,{get(a,o){if(!(typeof o!="string"||o==="then"))return tR(s,[...t,o],e)},apply(a,o,c){const d=t[t.length-1];if(d==="valueOf"||d==="toString"||d==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let f={args:c,path:t};return d==="call"?f={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:d==="apply"&&(f={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),eE(f.args),eE(f.path),s(f)}})),e[i]}const yf=s=>tR(s,[],dk()),_0=s=>new Proxy(J1,{get(t,e){if(e!=="then")return s(e)}});var eR=_c({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(s,t){function e(n){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),vk=_c({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(s,t){var e=eR().default;function n(i,a){if(e(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var c=o.call(i,a||"default");if(e(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),xk=_c({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(s,t){var e=eR().default,n=vk();function i(a){var o=n(a,"string");return e(o)=="symbol"?o:o+""}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),sR=_c({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(s,t){var e=xk();function n(i,a,o){return(a=e(a))in i?Object.defineProperty(i,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[a]=o,i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),C0=_c({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(s,t){var e=sR();function n(a,o){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);o&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),c.push.apply(c,d)}return c}function i(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?n(Object(c),!0).forEach(function(d){e(a,d,c[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(d){Object.defineProperty(a,d,Object.getOwnPropertyDescriptor(c,d))})}return a}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});gf(C0());gf(sR());var Wu=gf(C0());function bk(s,t){if("error"in s){const n=t.deserialize(s.error);return{ok:!1,error:(0,Wu.default)((0,Wu.default)({},s),{},{error:n})}}return{ok:!0,result:(0,Wu.default)((0,Wu.default)({},s.result),(!s.result.type||s.result.type==="data")&&{type:"data",data:t.deserialize(s.result.data)})}}var Xm=class extends Error{constructor(){super("Unable to transform response from server")}};function Sk(s,t){let e;try{e=bk(s,t)}catch{throw new Xm}if(!e.ok&&(!oa(e.error.error)||typeof e.error.error.code!="number"))throw new Xm;if(e.ok&&!oa(e.result))throw new Xm;return e}gf(C0());function vf(s){const t={subscribe(e){let n=null,i=!1,a=!1,o=!1;function c(){if(n===null){o=!0;return}a||(a=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=s({next(d){var f;i||(f=e.next)===null||f===void 0||f.call(e,d)},error(d){var f;i||(i=!0,(f=e.error)===null||f===void 0||f.call(e,d),c())},complete(){var d;i||(i=!0,(d=e.complete)===null||d===void 0||d.call(e),c())}}),o&&c(),{unsubscribe:c}},pipe(...e){return e.reduce(Ek,t)}};return t}function Ek(s,t){return t(s)}function Tk(s){const t=new AbortController;return new Promise((n,i)=>{let a=!1;function o(){a||(a=!0,c.unsubscribe())}t.signal.addEventListener("abort",()=>{i(t.signal.reason)});const c=s.subscribe({next(d){a=!0,n(d),o()},error(d){i(d)},complete(){t.abort(),o()}})})}var Ak=Object.create,nR=Object.defineProperty,Rk=Object.getOwnPropertyDescriptor,iR=Object.getOwnPropertyNames,wk=Object.getPrototypeOf,Lk=Object.prototype.hasOwnProperty,Rr=(s,t)=>function(){return t||(0,s[iR(s)[0]])((t={exports:{}}).exports,t),t.exports},_k=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=iR(t),a=0,o=i.length,c;a<o;a++)c=i[a],!Lk.call(s,c)&&c!==e&&nR(s,c,{get:(d=>
17t[d]).bind(null,c),enumerable:!(n=Rk(t,c))||n.enumerable});return s},fa=(s,t,e)=>(e=s!=null?Ak(wk(s)):{},_k(t||!s||!s.__esModule?nR(e,"default",{value:s,enumerable:!0}):e,s)),Ck=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(s,t){function e(n,i){if(n==null)return{};var a={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(i.includes(o))continue;a[o]=n[o]}return a}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),Dk=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(s,t){var e=Ck();function n(i,a){if(i==null)return{};var o,c,d=e(i,a);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(i);for(c=0;c<f.length;c++)o=f[c],a.includes(o)||{}.propertyIsEnumerable.call(i,o)&&(d[o]=i[o])}return d}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),rR=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(s,t){function e(n){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ik=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(s,t){var e=rR().default;function n(i,a){if(e(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var c=o.call(i,a||"default");if(e(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ok=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(s,t){var e=rR().default,n=Ik();function i(a){var o=n(a,"string");return e(o)=="symbol"?o:o+""}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),kk=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(s,t){var e=Ok();function n(i,a,o){return(a=e(a))in i?Object.defineProperty(i,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[a]=o,i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Cc=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(s,t){var e=kk();function n(a,o){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);o&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),c.push.apply(c,d)}return c}function i(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?n(Object(c),!0).forEach(function(d){e(a,d,c[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(d){Object.defineProperty(a,d,Object.getOwnPropertyDescriptor(c,d))})}return a}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pk=fa(Dk(),1),sE=fa(Cc(),1);const Mk=["cursor","direction"];function $n(s,t,e){const n=s.flatMap(i=>i.split("."));if(!t&&(!e||e==="any"))return n.length?[n]:[];if(e==="infinite"&&oa(t)&&("direction"in t||"cursor"in t)){const{cursor:i,direction:a}=t,o=(0,Pk.default)(t,Mk);return[n,{input:o,type:"infinite"}]}return[n,(0,sE.default)((0,sE.default)({},typeof t<"u"&&t!==zs&&{input:t}),e&&e!=="any"&&{type:e})]}function Td(s){return $n(s,void 0,"any")}var Nk=Object.create,aR=Object.defineProperty,Bk=Object.getOwnPropertyDescriptor,oR=Object.getOwnPropertyNames,Fk=Object.getPrototypeOf,Uk=Object.prototype.hasOwnProperty,ti=(s,t)=>function(){return t||(0,s[oR(s)[0]])((t={exports:{}}).exports,t),t.exports},jk=(s,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=oR(t),a=0,o=i.length,c;a<o;a++)c=i[a],!Uk.call(s,c)&&c!==e&&aR(s,c,{get:(d=>
17t[d]).bind(null,c),enumerable:!(n=Bk(t,c))||n.enumerable});return s},Ce=(s,t,e)=>(e=s!=null?Nk(Fk(s)):{},jk(t||!s||!s.__esModule?aR(e,"default",{value:s,enumerable:!0}):e,s)),lR=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(s,t){function e(n){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),$k=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(s,t){var e=lR().default;function n(i,a){if(e(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var c=o.call(i,a||"default");if(e(c)!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Vk=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(s,t){var e=lR().default,n=$k();function i(a){var o=n(a,"string");return e(o)=="symbol"?o:o+""}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),ha=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(s,t){var e=Vk();function n(i,a,o){return(a=e(a))in i?Object.defineProperty(i,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[a]=o,i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),_n=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(s,t){var e=ha();function n(a,o){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);o&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),c.push.apply(c,d)}return c}function i(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?n(Object(c),!0).forEach(function(d){e(a,d,c[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(d){Object.defineProperty(a,d,Object.getOwnPropertyDescriptor(c,d))})}return a}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function Gk(s){return t=>{let e=0,n=null;const i=[];function a(){n||(n=t.subscribe({next(c){for(const f of i){var d;(d=f.next)===null||d===void 0||d.call(f,c)}},error(c){for(const f of i){var d;(d=f.error)===null||d===void 0||d.call(f,c)}},complete(){for(const d of i){var c;(c=d.complete)===null||c===void 0||c.call(d)}}}))}function o(){if(e===0&&n){const c=n;n=null,c.unsubscribe()}}return vf(c=>(e++,i.push(c),a(),{unsubscribe(){e--,o();const d=i.findIndex(f=>f===c);d>-1&&i.splice(d,1)}}))}}function Hk(s){let t=s;const e=[],n=o=>{t!==void 0&&o.next(t),e.push(o)},i=o=>{e.splice(e.indexOf(o),1)},a=vf(o=>(n(o),()=>{i(o)}));return a.next=o=>{if(t!==o){t=o;for(const c of e)c.next(o)}},a.get=()=>t,a}function zk(s){return vf(t=>{function e(i=0,a=s.op){const o=s.links[i];if(!o)throw new Error("No more links to execute - did you forget to add an ending link?");return o({op:a,next(d){return e(i+1,d)}})}return e().subscribe(t)})}var Qu=Ce(ha(),1),ro=Ce(_n(),1);function Kk(s){return s instanceof ac}function qk(s){return oa(s)&&oa(s.error)&&typeof s.error.code=="number"&&typeof s.error.message=="string"}function Yk(s,t){return typeof s=="string"?s:oa(s)&&typeof s.message=="string"?s.message:t}
17var ac=class Ad extends Error{constructor(t,e){var n,i;const a=e?.cause;super(t,{cause:a}),(0,Qu.default)(this,"cause",void 0),(0,Qu.default)(this,"shape",void 0),(0,Qu.default)(this,"data",void 0),(0,Qu.default)(this,"meta",void 0),this.meta=e?.meta,this.cause=a,this.shape=e==null||(n=e.result)===null||n===void 0?void 0:n.error,this.data=e==null||(i=e.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ad.prototype)}static from(t,e={}){const n=t;return Kk(n)?(e.meta&&(n.meta=(0,ro.default)((0,ro.default)({},n.meta),e.meta)),n):qk(n)?new Ad(n.error.message,(0,ro.default)((0,ro.default)({},e),{},{result:n,cause:e.cause})):new Ad(Yk(n,"Unknown error"),(0,ro.default)((0,ro.default)({},e),{},{cause:n}))}};function Wk(s){const t=s;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}const nE=s=>typeof s=="function";function Qk(s){if(s)return s;if(typeof window<"u"&&nE(window.fetch))return window.fetch;if(typeof globalThis<"u"&&nE(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Kl=Ce(_n());function Xk(s){return{url:s.url.toString(),fetch:s.fetch,transformer:Wk(s.transformer),methodOverride:s.methodOverride}}function Zk(s){const t={};for(let e=0;e<s.length;e++){const n=s[e];t[e]=n}return t}const Jk={query:"GET",mutation:"POST",subscription:"PATCH"};function cR(s){return"input"in s?s.transformer.input.serialize(s.input):Zk(s.inputs.map(t=>s.transformer.input.serialize(t)))}const uR=s=>{const t=s.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+s.path;const i=[];if(t[1]&&i.push(t[1]),"inputs"in s&&i.push("batch=1"),s.type==="query"||s.type==="subscription"){const a=cR(s);a!==void 0&&s.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(a))}`)}return i.length&&(n+="?"+i.join("&")),n},tP=s=>{if(s.type==="query"&&s.methodOverride!=="POST")return;const t=cR(s);return t!==void 0?JSON.stringify(t):void 0},eP=s=>rP((0,Kl.default)((0,Kl.default)({},s),{},{contentTypeHeader:"application/json",getUrl:uR,getBody:tP}));var sP=class extends Error{constructor(){const s="AbortError";super(s),this.name=s,this.message=s}};const nP=s=>{var t;if(s?.aborted)throw(t=s.throwIfAborted)===null||t===void 0||t.call(s),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new sP};async function iP(s){var t,e;nP(s.signal);const n=s.getUrl(s),i=s.getBody(s),a=(t=s.methodOverride)!==null&&t!==void 0?t:Jk[s.type],o=await(async()=>{const d=await s.headers();return Symbol.iterator in d?Object.fromEntries(d):d})(),c=(0,Kl.default)((0,Kl.default)((0,Kl.default)({},s.contentTypeHeader&&a!=="GET"?{"content-type":s.contentTypeHeader}:{}),s.trpcAcceptHeader?{[(e=s.trpcAcceptHeaderKey)!==null&&e!==void 0?e:"trpc-accept"]:s.trpcAcceptHeader}:void 0),o);return Qk(s.fetch)(n,{method:a,signal:s.signal,body:i,headers:c})}async function rP(s){const t={},e=await iP(s);t.response=e;const n=await e.json();return t.responseJSON=n,{json:n,meta:t}}Ce(_n(),1);const iE=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function rE(s){let t=null,e=null;const n=()=>{clearTimeout(e),e=null,t=null};function i(c){const d=[[]];let f=0;for(;;){const g=c[f];if(!g)break;const v=d[d.length-1];if(g.aborted){var h;(h=g.reject)===null||h===void 0||h.call(g,new Error("Aborted")),f++;continue}if(s.validate(v.concat(g).map(S=>S.key))){v.push(g),f++;continue}if(v.length===0){var p;(p=g.reject)===null||p===void 0||p.call(g,new Error("Input is too big for a single dispatch")),f++;continue}d.push([])}return d}function a(){const c=i(t);n();for(const d of c){if(!d.length)continue;const f={items:d};for(const p of d)p.batch=f;s.fetch(f.items.map(p=>p.key)).then(async p=>{await Promise.all(p.map(async(v,x)=>{const S=f.items[x];try{var E;const L=await Promise.resolve(v);(E=S.resolve)===null||E===void 0||E.call(S,L)}catch(L){var T;(T=S.reject)===null||T===void 0||T.call(S,L)}S.batch=null,S.reject=null,S.resolve=null}));for(const v of f.items){var g;(g=v.reject)===null||g===void 0||g.call(v,new Error("Missing result")),v.batch=null}}).catch(p=>{for(const v of f.items){var g;(g=v.reject)===null||g===void 0||g.call(v,p),v.batch=null}})}}function o(c){var d;const f={aborted:!1,key:c,batch:null,resolve:iE,reject:iE},h=new Promise((p,g)=>{var v;f.reject=g,f.resolve=p,(v=t)!==null&&v!==void 0||(t=[]),t.push(f)});return(d=e)!==null&&d!==void 0||(e=setTimeout(a)),h}return{load:o}}function aP(...s){const t=new AbortController,e=s.length;let n=0;const i=()=>{++n===e&&t.abort()};for(const a of s)a?.aborted?i():a?.addEventListener("abort",i,{once:!0});return t.signal}var Xu=Ce(_n(),1);function oP(s){var t,e;const n=Xk(s),i=(t=s.maxURLLength)!==null&&t!==void 0?t:1/0,a=(e=s.maxItems)!==null&&e!==void 0?e:1/0;return()=>{const o=h=>
17({validate(p){if(i===1/0&&a===1/0)return!0;if(p.length>a)return!1;const g=p.map(S=>S.path).join(","),v=p.map(S=>S.input);return uR((0,Xu.default)((0,Xu.default)({},n),{},{type:h,path:g,inputs:v,signal:null})).length<=i},async fetch(p){const g=p.map(L=>L.path).join(","),v=p.map(L=>L.input),x=aP(...p.map(L=>L.signal)),S=await eP((0,Xu.default)((0,Xu.default)({},n),{},{path:g,inputs:v,type:h,headers(){return s.headers?typeof s.headers=="function"?s.headers({opList:p}):s.headers:{}},signal:x}));return(Array.isArray(S.json)?S.json:p.map(()=>S.json)).map(L=>({meta:S.meta,json:L}))}}),c=rE(o("query")),d=rE(o("mutation")),f={query:c,mutation:d};return({op:h})=>vf(p=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const v=f[h.type].load(h);let x;return v.then(S=>{x=S;const E=Sk(S.json,n.transformer.output);if(!E.ok){p.error(ac.from(E.error,{meta:S.meta}));return}p.next({context:S.meta,result:E.result}),p.complete()}).catch(S=>{p.error(ac.from(S,{meta:x?.meta}))}),()=>{}})}}Ce(_n(),1);const dR=(s,...t)=>typeof s=="function"?s(...t):s;Ce(ha(),1);function lP(){let s,t;return{promise:new Promise((n,i)=>{s=n,t=i}),resolve:s,reject:t}}async function cP(s){const t=await dR(s.url);if(!s.connectionParams)return t;const n=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+n}async function uP(s,t){const e={method:"connectionParams",data:await dR(s)};return t.encode(e)}Ce(ha(),1);var cr=Ce(ha(),1);function dP(s){const{promise:t,resolve:e,reject:n}=lP();return s.addEventListener("open",()=>{s.removeEventListener("error",n),e()}),s.addEventListener("error",n),t}function fP(s,{intervalMs:t,pongTimeoutMs:e}){let n,i;function a(){n=setTimeout(()=>{s.send("PING"),i=setTimeout(()=>{s.close()},e)},t)}function o(){clearTimeout(n),a()}function c(){clearTimeout(i),o()}s.addEventListener("open",a),s.addEventListener("message",({data:d})=>{clearTimeout(n),a(),d==="PONG"&&c()}),s.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}var hP=class dg{constructor(t){var e;if((0,cr.default)(this,"id",++dg.connectCount),(0,cr.default)(this,"WebSocketPonyfill",void 0),(0,cr.default)(this,"urlOptions",void 0),(0,cr.default)(this,"keepAliveOpts",void 0),(0,cr.default)(this,"encoder",void 0),(0,cr.default)(this,"wsObservable",Hk(null)),(0,cr.default)(this,"openPromise",null),this.WebSocketPonyfill=(e=t.WebSocketPonyfill)!==null&&e!==void 0?e:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++dg.connectCount;const e=cP(t.urlOptions).then(n=>new t.WebSocketPonyfill(n));t.openPromise=e.then(async n=>{t.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&fP(n,t.keepAliveOpts),n.addEventListener("close",()=>{t.ws===n&&(t.ws=null)}),await dP(n),t.urlOptions.connectionParams&&n.send(await uP(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var e;(e=t.ws)===null||e===void 0||e.close()}}};(0,cr.default)(hP,"connectCount",0);Ce(ha(),1);Ce(_n(),1);var Zm=Ce(ha(),1),aE=Ce(_n(),1),xf=class{constructor(s){(0,Zm.default)(this,"links",void 0),(0,Zm.default)(this,"runtime",void 0),(0,Zm.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=s.links.map(t=>t(this.runtime))}$request(s){var t;return zk({links:this.links,op:(0,aE.default)((0,aE.default)({},s),{},{context:(t=s.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Gk())}async requestAsPromise(s){var t=this;try{const e=t.$request(s);return(await Tk(e)).result.data}catch(e){throw ac.from(e)}}query(s,t,e){return this.requestAsPromise({type:"query",path:s,input:t,context:e?.context,signal:e?.signal})}mutation(s,t,e){return this.requestAsPromise({type:"mutation",path:s,input:t,context:e?.context,signal:e?.signal})}subscription(s,t,e){return this.$request({type:"subscription",path:s,input:t,context:e.context,signal:e.signal}).subscribe({next(i){switch(i.result.type){case"state":{var a;(a=e.onConnectionStateChange)===null||a===void 0||a.call(e,i.result);break}case"started":{var o;(o=e.onStarted)===null||o===void 0||o.call(e,{context:i.context});break}case"stopped":{var c;
17(c=e.onStopped)===null||c===void 0||c.call(e);break}case"data":case void 0:{var d;(d=e.onData)===null||d===void 0||d.call(e,i.result.data);break}}},error(i){var a;(a=e.onError)===null||a===void 0||a.call(e,i)},complete(){var i;(i=e.onComplete)===null||i===void 0||i.call(e)}})}};const fR=Symbol.for("trpc_untypedClient"),mP={query:"query",mutate:"mutation",subscribe:"subscription"},pP=s=>mP[s];function hR(s){const t=yf(({path:e,args:n})=>{const i=[...e],a=pP(i.pop()),o=i.join(".");return s[a](o,...n)});return _0(e=>e===fR?s:t[e])}function gP(s){const t=new xf(s);return hR(t)}function D0(s){return s[fR]}Ce(_n(),1);Ce(_n(),1);var yP=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(s,t){function e(i){var a,o,c,d=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,c=Symbol.iterator);d--;){if(o&&(a=i[o])!=null)return a.call(i);if(c&&(a=i[c])!=null)return new n(a.call(i));o="@@asyncIterator",c="@@iterator"}throw new TypeError("Object is not async iterable")}function n(i){function a(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var c=o.done;return Promise.resolve(o.value).then(function(d){return{value:d,done:c}})}return n=function(c){this.s=c,this.n=c.next},n.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(c){var d=this.s.return;return d===void 0?Promise.resolve({value:c,done:!0}):a(d.apply(this.s,arguments))},throw:function(c){var d=this.s.return;return d===void 0?Promise.reject(c):a(d.apply(this.s,arguments))}},new n(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}});Ce(yP(),1);Ce(_n(),1);var vP=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(s,t){function e(){var n=typeof SuppressedError=="function"?SuppressedError:function(c,d){var f=Error();return f.name="SuppressedError",f.error=c,f.suppressed=d,f},i={},a=[];function o(c,d){if(d!=null){if(Object(d)!==d)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(c)var f=d[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(f===void 0&&(f=d[Symbol.dispose||Symbol.for("Symbol.dispose")],c))var h=f;if(typeof f!="function")throw new TypeError("Object is not disposable.");h&&(f=function(){try{h.call(d)}catch(g){return Promise.reject(g)}}),a.push({v:d,d:f,a:c})}else c&&a.push({d,a:c});return d}return{e:i,u:o.bind(null,!1),a:o.bind(null,!0),d:function(){var d,f=this.e,h=0;function p(){for(;d=a.pop();)try{if(!d.a&&h===1)return h=0,a.push(d),Promise.resolve().then(p);if(d.d){var v=d.d.call(d.v);if(d.a)return h|=2,Promise.resolve(v).then(p,g)}else h|=1}catch(x){return g(x)}if(h===1)return f!==i?Promise.reject(f):Promise.resolve();if(f!==i)throw f}function g(v){return f=f!==i?new n(v,f):v,p()}return p()}}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),mR=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(s,t){function e(n,i){this.v=n,this.k=i}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),xP=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(s,t){var e=mR();function n(i){return new e(i,0)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),bP=ti({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(s,t){var e=mR();function n(a){return function(){return new i(a.apply(this,arguments))}}function i(a){var o,c;function d(h,p){try{var g=a[h](p),v=g.value,x=v instanceof e;Promise.resolve(x?v.v:v).then(function(S){if(x){var E=h==="return"?"return":"next";if(!v.k||S.done)return d(E,S);S=a[E](S).value}f(g.done?"return":"normal",S)},function(S){d("throw",S)})}catch(S){f("throw",S)}}function f(h,p){switch(h){case"return":o.resolve({value:p,done:!0});break;case"throw":o.reject(p);break;default:o.resolve({value:p,done:!1})}(o=o.next)?d(o.key,o.arg):c=null}this._invoke=function(h,p){return new Promise(function(g,v){var x={key:h,arg:p,resolve:g,reject:v,next:null};c?c=c.next=x:(o=c=x,d(h,p))})},typeof a.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(a){return this._invoke("next",a)},i.prototype.throw=function(a){return this._invoke("throw",a)},i.prototype.return=function(a){return this._invoke("return",a)}
17,t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});Ce(vP(),1);Ce(xP(),1);Ce(bP(),1);Ce(_n(),1);function SP(s){return yf(({path:t,args:e})=>{var n;const i=[...t],a=i.pop();if(a==="useMutation")return s[a](i,...e);if(a==="_def")return{path:i};const[o,...c]=e,d=(n=c[0])!==null&&n!==void 0?n:{};return s[a](i,o,d)})}var Jm;const EP=["client","ssrContext","ssrState","abortOnUnmount"],TP=(Jm=$.createContext)===null||Jm===void 0?void 0:Jm.call(j1,null),AP=s=>{switch(s){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function RP(s){return yf(t=>{const e=[...t.path],n=e.pop(),i=[...t.args],a=i.shift(),o=AP(n),c=$n(e,a,o);return{infiniteQueryOptions:()=>s.infiniteQueryOptions(e,c,i[0]),queryOptions:()=>s.queryOptions(e,c,...i),fetch:()=>s.fetchQuery(c,...i),fetchInfinite:()=>s.fetchInfiniteQuery(c,i[0]),prefetch:()=>s.prefetchQuery(c,...i),prefetchInfinite:()=>s.prefetchInfiniteQuery(c,i[0]),ensureData:()=>s.ensureQueryData(c,...i),invalidate:()=>s.invalidateQueries(c,...i),reset:()=>s.resetQueries(c,...i),refetch:()=>s.refetchQueries(c,...i),cancel:()=>s.cancelQuery(c,...i),setData:()=>{s.setQueryData(c,i[0],i[1])},setQueriesData:()=>s.setQueriesData(c,i[0],i[1],i[2]),setInfiniteData:()=>{s.setInfiniteQueryData(c,i[0],i[1])},getData:()=>s.getQueryData(c),getInfiniteData:()=>s.getInfiniteQueryData(c),setMutationDefaults:()=>s.setMutationDefaults(Td(e),a),getMutationDefaults:()=>s.getMutationDefaults(Td(e)),isMutating:()=>s.isMutating({mutationKey:Td(e)})}[n]()})}function wP(s){const t=hR(s.client),e=RP(s);return _0(n=>{const i=n;return i==="client"?t:EP.includes(i)?s[i]:e[n]})}var LP=fa(Cc(),1);function oE(s){const t=s instanceof xf?s:D0(s);return yf(e=>{const n=e.path,i=n.join("."),[a,o]=e.args;return(0,LP.default)({queryKey:$n(n,a,"query"),queryFn:()=>t.query(i,a,o?.trpc)},o)})}var tp=fa(Cc(),1);function fs(s,t,e){var n;const i=s[0];let a=(n=s[1])===null||n===void 0?void 0:n.input;if(e){var o;a=(0,tp.default)((0,tp.default)((0,tp.default)({},(o=a)!==null&&o!==void 0?o:{}),e.pageParam?{cursor:e.pageParam}:{}),{},{direction:e.direction})}return[i.join("."),a,t?.trpc]}var _P=Rr({"../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(s,t){function e(i){var a,o,c,d=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,c=Symbol.iterator);d--;){if(o&&(a=i[o])!=null)return a.call(i);if(c&&(a=i[c])!=null)return new n(a.call(i));o="@@asyncIterator",c="@@iterator"}throw new TypeError("Object is not async iterable")}function n(i){function a(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var c=o.done;return Promise.resolve(o.value).then(function(d){return{value:d,done:c}})}return n=function(c){this.s=c,this.n=c.next},n.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(c){var d=this.s.return;return d===void 0?Promise.resolve({value:c,done:!0}):a(d.apply(this.s,arguments))},throw:function(c){var d=this.s.return;return d===void 0?Promise.reject(c):a(d.apply(this.s,arguments))}},new n(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}}),CP=fa(_P(),1);function fg(s){return{path:s.path.join(".")}}function Ml(s){const t=fg(s);return $.useMemo(()=>t,[t])}async function pR(s,t,e){const i=t.getQueryCache().build(t,{queryKey:e});i.setState({data:[],status:"success"});const a=[];var o=!1,c=!1,d;try{for(var f=(0,CP.default)(s),h;o=!(h=await f.next()).done;o=!1){const p=h.value;a.push(p),i.setState({data:[...a]})}}catch(p){c=!0,d=p}finally{try{o&&f.return!=null&&await f.return()}finally{if(c)throw d}}return a}var Kt=fa(Cc(),1);function DP(s){const{client:t,queryClient:e}=s,n=t instanceof xf?t:D0(t);return{infiniteQueryOptions:(i,a,o)=>{var c,d;const f=((c=a[1])===null||c===void 0?void 0:c.input)===zs,h=async p=>{var g;const v=(0,Kt.default)((0,Kt.default)({},o),{},{trpc:(0,Kt.default)((0,Kt.default)({},o?.trpc),!(o==null||(g=o.trpc)===null||g===void 0)&&g.abortOnUnmount?{signal:p.signal}:{signal:null})});return await n.query(...fs(a,v,{direction:p.direction,pageParam:p.pageParam}))};return Object.assign((0,Kt.default)((0,Kt.default)({},o),{},{initialData:o?.initialData,queryKey:a,queryFn:f?zs:h,initialPageParam:(d=o?.initialCursor)!==null&&d!==void 0?d:null}),{trpc:fg({path:i})})},queryOptions:(i,a,o)=>{var c;const d=((c=a[1])===null||c===void 0?void 0:c.input)===zs,f=async h=>{var p;const g=(0,Kt.default)((0,Kt.default)({},o),{},{trpc:(0,Kt.default)((0,Kt.default)({},o?.trpc),!(o==null||(p=o.trpc)===null||p===void 0)&&p.abortOnUnmount?{signal:h.signal}:{signal:null})}),v=await n.query(...fs(a,g));return Q1(v)?pR(v,e,a):v};return Object.assign((0,Kt.default)((0,Kt.default)({},o),{},{initialData:o?.initialData,queryKey:a,queryFn:d?zs:f}),{trpc:fg({path:i})})},fetchQuery:(i,a)=>e.fetchQuery((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i,queryFn:()=>n.query(...fs(i,a))})),fetchInfiniteQuery:(i,a)=>{var o;return e.fetchInfiniteQuery((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i,queryFn:({pageParam:c,direction:d})=>n.query(...fs(i,a,{pageParam:c,direction:d})),initialPageParam:(o=a?.initialCursor)!==null&&o!==void 0?o:null}))},prefetchQuery:(i,a)=>e.prefetchQuery((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i,queryFn:()=>n.query(...fs(i,a))})),prefetchInfiniteQuery:(i,a)=>{var o;return e.prefetchInfiniteQuery((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i,queryFn:({pageParam:c,direction:d})=>n.query(...fs(i,a,{pageParam:c,direction:d})),initialPageParam:(o=a?.initialCursor)!==null&&o!==void 0?o:null}))},ensureQueryData:(i,a)=>e.ensureQueryData((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i,queryFn:()=>n.query(...fs(i,a))})),invalidateQueries:(i,a,o)=>e.invalidateQueries((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i}),o),resetQueries:(i,a,o)=>e.resetQueries((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i}),o),refetchQueries:(i,a,o)=>e.refetchQueries((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i}
17),o),cancelQuery:(i,a)=>e.cancelQueries({queryKey:i},a),setQueryData:(i,a,o)=>e.setQueryData(i,a,o),setQueriesData:(i,a,o,c)=>e.setQueriesData((0,Kt.default)((0,Kt.default)({},a),{},{queryKey:i}),o,c),getQueryData:i=>e.getQueryData(i),setInfiniteQueryData:(i,a,o)=>e.setQueryData(i,a,o),getInfiniteQueryData:i=>e.getQueryData(i),setMutationDefaults:(i,a)=>{const o=i[0],c=d=>n.mutation(...fs([o,{input:d}],s));return e.setMutationDefaults(i,typeof a=="function"?a({canonicalMutationFn:c}):a)},getMutationDefaults:i=>e.getMutationDefaults(i),isMutating:i=>e.isMutating((0,Kt.default)((0,Kt.default)({},i),{},{exact:!0}))}}var gt=fa(Cc());const lE=(s,t)=>new Proxy(s,{get(n,i){return t(i),n[i]}});function IP(s){var t,e;const n=(t=void 0)!==null&&t!==void 0?t:D=>D.originalFn(),i=(e=void 0)!==null&&e!==void 0?e:TP,a=gP,o=D=>{var B;const{abortOnUnmount:C=!1,queryClient:I,ssrContext:F}=D,[U,z]=$.useState((B=D.ssrState)!==null&&B!==void 0?B:!1),Y=D.client instanceof xf?D.client:D0(D.client),nt=$.useMemo(()=>DP({client:Y,queryClient:I}),[Y,I]),it=$.useMemo(()=>(0,gt.default)({abortOnUnmount:C,queryClient:I,client:Y,ssrContext:F??null,ssrState:U},nt),[C,Y,nt,I,F,U]);return $.useEffect(()=>{z(rt=>rt?"mounted":!1)},[]),A.jsx(i.Provider,{value:it,children:D.children})};function c(){const D=$.useContext(i);if(!D)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return D}function d(D,B){var C;const{queryClient:I,ssrState:F}=c();return F&&F!=="mounted"&&((C=I.getQueryCache().find({queryKey:D}))===null||C===void 0?void 0:C.state.status)==="error"?(0,gt.default)({retryOnMount:!1},B):B}function f(D,B,C){var I,F,U,z,Y;const nt=c(),{abortOnUnmount:it,client:rt,ssrState:M,queryClient:j,prefetchQuery:N}=nt,V=$n(D,B,"query"),X=j.getQueryDefaults(V),O=B===zs;typeof window>"u"&&M==="prepass"&&(C==null||(I=C.trpc)===null||I===void 0?void 0:I.ssr)!==!1&&((F=C?.enabled)!==null&&F!==void 0?F:X?.enabled)!==!1&&!O&&!j.getQueryCache().find({queryKey:V})&&N(V,C);const G=d(V,(0,gt.default)((0,gt.default)({},X),C)),K=(U=(z=C==null||(Y=C.trpc)===null||Y===void 0?void 0:Y.abortOnUnmount)!==null&&z!==void 0?z:void 0)!==null&&U!==void 0?U:it,J=nk((0,gt.default)((0,gt.default)({},G),{},{queryKey:V,queryFn:O?B:async ot=>{const ft=(0,gt.default)((0,gt.default)({},G),{},{trpc:(0,gt.default)((0,gt.default)({},G?.trpc),K?{signal:ot.signal}:{signal:null})}),ht=await rt.query(...fs(V,ft));return Q1(ht)?pR(ht,j,V):ht}}),j);return J.trpc=Ml({path:D}),J}function h(D,B,C){var I,F,U;const z=c(),Y=$n(D,B,"query"),nt=B===zs,it=(I=(F=C==null||(U=C.trpc)===null||U===void 0?void 0:U.abortOnUnmount)!==null&&F!==void 0?F:void 0)!==null&&I!==void 0?I:z.abortOnUnmount;ok((0,gt.default)((0,gt.default)({},C),{},{queryKey:Y,queryFn:nt?B:rt=>{const M={trpc:(0,gt.default)((0,gt.default)({},C?.trpc),it?{signal:rt.signal}:{})};return z.client.query(...fs(Y,M))}}))}function p(D,B,C){var I,F,U;const z=c(),Y=$n(D,B,"query"),nt=(I=(F=C==null||(U=C.trpc)===null||U===void 0?void 0:U.abortOnUnmount)!==null&&F!==void 0?F:void 0)!==null&&I!==void 0?I:z.abortOnUnmount,it=ik((0,gt.default)((0,gt.default)({},C),{},{queryKey:Y,queryFn:rt=>{const M=(0,gt.default)((0,gt.default)({},C),{},{trpc:(0,gt.default)((0,gt.default)({},C?.trpc),nt?{signal:rt.signal}:{signal:null})});return z.client.query(...fs(Y,M))}}),z.queryClient);return it.trpc=Ml({path:D}),[it.data,it]}function g(D,B){const{client:C,queryClient:I}=c(),F=Td(D),U=I.defaultMutationOptions(I.getMutationDefaults(F)),z=ck((0,gt.default)((0,gt.default)({},B),{},{mutationKey:F,mutationFn:Y=>C.mutation(...fs([D,{input:Y}],B)),onSuccess(...Y){var nt,it;return n({originalFn:()=>{var M,j,N;return(M=B==null||(j=B.onSuccess)===null||j===void 0?void 0:j.call(B,...Y))!==null&&M!==void 0?M:U==null||(N=U.onSuccess)===null||N===void 0?void 0:N.call(U,...Y)},queryClient:I,meta:(nt=(it=B?.meta)!==null&&it!==void 0?it:U?.meta)!==null&&nt!==void 0?nt:{}})}}),I);return z.trpc=Ml({path:D}),z}const v={data:void 0,error:null,status:"idle"},x={data:void 0,error:null,status:"connecting"};/* istanbul ignore next -- @preserve */function S(D,B,C){var I;const F=(I=C?.enabled)!==null&&I!==void 0?I:B!==zs,U=yr($n(D,B,"any")),{client:z}=c(),Y=$.useRef(C);$.useEffect(()=>{Y.current=C});const[nt]=$.useState(new Set([])),it=$.useCallback(O=>{nt.add(O)},[nt]),rt=$.useRef(null),M=$.useCallback(O=>{const G=N.current,K=N.current=O(G);let J=!1;for(const ot of nt)if(G[ot]!==K[ot]){J=!0;break}J&&X(lE(K,it))},[it,nt]),j=$.useCallback(()=>{var O;if((O=rt.current)===null||O===void 0||O.unsubscribe(),!F){M(()=>(0,gt.default)((0,gt.default)({},v),{},{reset:j}));return}M(()=>(0,gt.default)((0,gt.default)({},x),{},{reset:j}));const G=z.subscription(D.join("."),B??void 0,{onStarted:()=>{var K,J;(K=(J=Y.current).onStarted)===null||K===void 0||K.call(J),M(ot=>(0,gt.default)((0,gt.default)({},ot),{},{status:"pending",error:null}))},onData:K=>{var J,ot;(J=(ot=Y.current).onData)===null||J===void 0||J.call(ot,K),M(ft=>(0,gt.default)((0,gt.default)({},ft),{},{status:"pending",data:K,error:null}))},onError:K=>{var J,ot;(J=(ot=Y.current).onError)===null||J===void 0||J.call(ot,K),M(ft=>(0,gt.default)((0,gt.default)({},ft),{},{status:"error",error:K}
17))},onConnectionStateChange:K=>{M(J=>{switch(K.state){case"idle":return(0,gt.default)((0,gt.default)({},J),{},{status:K.state,error:null,data:void 0});case"connecting":return(0,gt.default)((0,gt.default)({},J),{},{error:K.error,status:K.state});case"pending":return J}})},onComplete:()=>{var K,J;(K=(J=Y.current).onComplete)===null||K===void 0||K.call(J),M(ot=>(0,gt.default)((0,gt.default)({},ot),{},{status:"idle",error:null,data:void 0}))}});rt.current=G},[z,U,F,M]);$.useEffect(()=>(j(),()=>{var O;(O=rt.current)===null||O===void 0||O.unsubscribe()}),[j]);const N=$.useRef(F?(0,gt.default)((0,gt.default)({},x),{},{reset:j}):(0,gt.default)((0,gt.default)({},v),{},{reset:j})),[V,X]=$.useState(lE(N.current,it));return V}function E(D,B,C){var I,F,U,z,Y;const{client:nt,ssrState:it,prefetchInfiniteQuery:rt,queryClient:M,abortOnUnmount:j}=c(),N=$n(D,B,"infinite"),V=M.getQueryDefaults(N),X=B===zs;typeof window>"u"&&it==="prepass"&&(C==null||(I=C.trpc)===null||I===void 0?void 0:I.ssr)!==!1&&((F=C?.enabled)!==null&&F!==void 0?F:V?.enabled)!==!1&&!X&&!M.getQueryCache().find({queryKey:N})&&rt(N,(0,gt.default)((0,gt.default)({},V),C));const O=d(N,(0,gt.default)((0,gt.default)({},V),C)),G=(U=C==null||(z=C.trpc)===null||z===void 0?void 0:z.abortOnUnmount)!==null&&U!==void 0?U:j,K=uk((0,gt.default)((0,gt.default)({},O),{},{initialPageParam:(Y=C.initialCursor)!==null&&Y!==void 0?Y:null,persister:C.persister,queryKey:N,queryFn:X?B:J=>{var ot;const ft=(0,gt.default)((0,gt.default)({},O),{},{trpc:(0,gt.default)((0,gt.default)({},O?.trpc),G?{signal:J.signal}:{signal:null})});return nt.query(...fs(N,ft,{pageParam:(ot=J.pageParam)!==null&&ot!==void 0?ot:C.initialCursor,direction:J.direction}))}}),M);return K.trpc=Ml({path:D}),K}function T(D,B,C){var I,F,U;const z=c(),Y=$n(D,B,"infinite"),nt=z.queryClient.getQueryDefaults(Y),it=B===zs,rt=d(Y,(0,gt.default)((0,gt.default)({},nt),C)),M=(I=C==null||(F=C.trpc)===null||F===void 0?void 0:F.abortOnUnmount)!==null&&I!==void 0?I:z.abortOnUnmount;lk((0,gt.default)((0,gt.default)({},C),{},{initialPageParam:(U=C.initialCursor)!==null&&U!==void 0?U:null,queryKey:Y,queryFn:it?B:j=>{var N;const V=(0,gt.default)((0,gt.default)({},rt),{},{trpc:(0,gt.default)((0,gt.default)({},rt?.trpc),M?{signal:j.signal}:{})});return z.client.query(...fs(Y,V,{pageParam:(N=j.pageParam)!==null&&N!==void 0?N:C.initialCursor,direction:j.direction}))}}))}function L(D,B,C){var I,F,U;const z=c(),Y=$n(D,B,"infinite"),nt=z.queryClient.getQueryDefaults(Y),it=d(Y,(0,gt.default)((0,gt.default)({},nt),C)),rt=(I=C==null||(F=C.trpc)===null||F===void 0?void 0:F.abortOnUnmount)!==null&&I!==void 0?I:z.abortOnUnmount,M=rk((0,gt.default)((0,gt.default)({},C),{},{initialPageParam:(U=C.initialCursor)!==null&&U!==void 0?U:null,queryKey:Y,queryFn:j=>{var N;const V=(0,gt.default)((0,gt.default)({},it),{},{trpc:(0,gt.default)((0,gt.default)({},it?.trpc),rt?{signal:j.signal}:{})});return z.client.query(...fs(Y,V,{pageParam:(N=j.pageParam)!==null&&N!==void 0?N:C.initialCursor,direction:j.direction}))}}),z.queryClient);return M.trpc=Ml({path:D}),[M.data,M]}return{Provider:o,createClient:a,useContext:c,useUtils:c,useQuery:f,usePrefetchQuery:h,useSuspenseQuery:p,useQueries:(D,B)=>{const{ssrState:C,queryClient:I,prefetchQuery:F,client:U}=c(),z=oE(U),Y=D(z);if(typeof window>"u"&&C==="prepass")for(const it of Y){var nt;const rt=it;((nt=rt.trpc)===null||nt===void 0?void 0:nt.ssr)!==!1&&!I.getQueryCache().find({queryKey:rt.queryKey})&&F(rt.queryKey,rt)}return W1({queries:Y.map(it=>(0,gt.default)((0,gt.default)({},it),{},{queryKey:it.queryKey})),combine:B?.combine},I)},useSuspenseQueries:D=>{const{queryClient:B,client:C}=c(),I=oE(C),F=D(I),U=ak({queries:F.map(z=>(0,gt.default)((0,gt.default)({},z),{},{queryFn:z.queryFn,queryKey:z.queryKey}))},B);return[U.map(z=>z.data),U]},useMutation:g,useSubscription:S,useInfiniteQuery:E,usePrefetchInfiniteQuery:T,useSuspenseInfiniteQuery:L}}function OP(s){const t=SP(s);return _0(e=>e==="useContext"||e==="useUtils"?()=>{const n=s.useUtils();return $.useMemo(()=>wP(n),[n])}:s.hasOwnProperty(e)?s[e]:t[e])}function kP(s){const t=IP();return OP(t)}const gR=kP(),PP="app_session_id",MP="Please login (10001)",NP="__Host-oauth_state",BP=s=>btoa(JSON.stringify(s));var ep={exports:{}},Nl={}
vendor: 11,538 bytes, lines 17-41
17,sp={exports:{}},np={};/** 18 * @license React 19 * scheduler.production.js 20 * 21 * Copyright (c) Meta Platforms, Inc. and affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */var cE;function FP(){return cE||(cE=1,(function(s){function t(M,j){var N=M.length;M.push(j);t:for(;0<N;){var V=N-1>>>1,X=M[V];if(0<i(X,j))M[V]=j,M[N]=X,N=V;else break t}}function e(M){return M.length===0?null:M[0]}function n(M){if(M.length===0)return null;var j=M[0],N=M.pop();if(N!==j){M[0]=N;t:for(var V=0,X=M.length,O=X>>>1;V<O;){var G=2*(V+1)-1,K=M[G],J=G+1,ot=M[J];if(0>i(K,N))J<X&&0>i(ot,K)?(M[V]=ot,M[J]=N,V=J):(M[V]=K,M[G]=N,V=G);else if(J<X&&0>i(ot,N))M[V]=ot,M[J]=N,V=J;else break t}}return j}function i(M,j){var N=M.sortIndex-j.sortIndex;return N!==0?N:M.id-j.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;s.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();s.unstable_now=function(){return o.now()-c}}var d=[],f=[],h=1,p=null,g=3,v=!1,x=!1,S=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function P(M){for(var j=e(f);j!==null;){if(j.callback===null)n(f);else if(j.startTime<=M)n(f),j.sortIndex=j.expirationTime,t(d,j);else break;j=e(f)}}function D(M){if(S=!1,P(M),!x)if(e(d)!==null)x=!0,B||(B=!0,Y());else{var j=e(f);j!==null&&rt(D,j.startTime-M)}}var B=!1,C=-1,I=5,F=-1;function U(){return E?!0:!(s.unstable_now()-F<I)}function z(){if(E=!1,B){var M=s.unstable_now();F=M;var j=!0;try{t:{x=!1,S&&(S=!1,L(C),C=-1),v=!0;var N=g;try{e:{for(P(M),p=e(d);p!==null&&!(p.expirationTime>M&&U());){var V=p.callback;if(typeof V=="function"){p.callback=null,g=p.priorityLevel;var X=V(p.expirationTime<=M);if(M=s.unstable_now(),typeof X=="function"){p.callback=X,P(M),j=!0;break e}p===e(d)&&n(d),P(M)}else n(d);p=e(d)}if(p!==null)j=!0;else{var O=e(f);O!==null&&rt(D,O.startTime-M),j=!1}}break t}finally{p=null,g=N,v=!1}j=void 0}}finally{j?Y():B=!1}}}var Y;if(typeof _=="function")Y=function(){_(z)};else if(typeof MessageChannel<"u"){var nt=new MessageChannel,it=nt.port2;nt.port1.onmessage=z,Y=function(){it.postMessage(null)}}else Y=function(){T(z,0)};function rt(M,j){C=T(function(){M(s.unstable_now())},j)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(M){M.callback=null},s.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<M?Math.floor(1e3/M):5},s.unstable_getCurrentPriorityLevel=function(){return g},s.unstable_next=function(M){switch(g){case 1:case 2:case 3:var j=3;break;default:j=g}var N=g;g=j;try{return M()}finally{g=N}},s.unstable_requestPaint=function(){E=!0},s.unstable_runWithPriority=function(M,j){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var N=g;g=M;try{return j()}finally{g=N}},s.unstable_scheduleCallback=function(M,j,N){var V=s.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?V+N:V):N=V,M){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=N+X,M={id:h++,callback:j,priorityLevel:M,startTime:N,expirationTime:X,sortIndex:-1},N>V?(M.sortIndex=N,t(f,M),e(d)===null&&M===e(f)&&(S?(L(C),C=-1):S=!0,rt(D,N-V))):(M.sortIndex=X,t(d,M),x||v||(x=!0,B||(B=!0,Y()))),M},s.unstable_shouldYield=U,s.unstable_wrapCallback=function(M){var j=g;return function(){var N=g;g=j;try{return M.apply(this,arguments)}finally{g=N}}}})(np)),np}var uE;function UP(){return uE||(uE=1,sp.exports=FP()),sp.exports}var ip={exports:{}},as={};/** 26 * @license React 27 * react-dom.production.js 28 * 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var dE;function jP(){if(dE)return as;dE=1;var s=mf();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(){}var n={d:{f:e,r:function(){throw Error(t(522))},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:d,containerInfo:f,implementation:h}}var o=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return as.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,as.createPortal=function(d,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,h)},as.flushSync=function(d){var f=o.T,h=n.p;try{if(o.T=null,n.p=2,d)return d()}finally{o.T=f,n.p=h,n.d.f()}},as.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,n.d.C(d,f))},as.prefetchDNS=function(d){typeof d=="string"&&n.d.D(d)},as.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var h=f.as,p=c(h,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?n.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:v}):h==="script"&&n.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},as.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=c(f.as,f.crossOrigin);n.d.M(d,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&n.d.M(d)},as.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,p=c(h,f.crossOrigin);n.d.L(d,h,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},as.preloadModule=function(d,f){if(typeof d=="string")if(f){var h=c(f.as,f.crossOrigin);n.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else n.d.m(d)},as.requestFormReset=function(d){n.d.r(d)},as.unstable_batchedUpdates=function(d,f){return d(f)},as.useFormState=function(d,f,h){return o.H.useFormState(d,f,h)},as.useFormStatus=function(){return o.H.useHostTransitionStatus()},as.version="19.2.1",as}var fE;function yR(){if(fE)return ip.exports;fE=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(t){console.error(t)}}return s(),ip.exports=jP(),ip.exports}/** 34 * @license React 35 * react-dom-client.production.js 36 * 37 * Copyright (c) Meta Platforms, Inc. and affiliates. 38 * 39 * This source code is licensed under the MIT license found in the 40 * LICENSE file in the root directory of this source tree. 41 */var hE;function $P(){if(hE)return Nl;hE=1;var s=UP(),t=mf(),e=yR();function n(r){var l="https://react.dev/errors/"+r;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var l=r,u=r;if(r.alternate)for(;l.return;)l=l.return;else{r=l;do l=r,(l.flags&4098)!==0&&(u=l.return),r=l.return;while(r)}return l.tag===3?u:null}function o(r){if(r.tag===13){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function c(r){if(r.tag===31){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function d(r){if(a(r)!==r)throw Error(n(188))}function f(r){var l=r.alternate;if(!l){if(l=a(r),l===null)throw Error(n(188));return l!==r?null:r}for(var u=r,m=l;;){var y=u.return;if(y===null)break;var b=y.alternate;if(b===null){if(m=y.return,m!==null){u=m;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===u)return d(y),r;if(b===m)return d(y),l;b=b.sibling}throw Error(n(188))}if(u.return!==m.return)u=y,m=b;else{for(var R=!1,k=y.child;k;){if(k===u){R=!0,u=y,m=b;break}if(k===m){R=!0,m=y,u=b;break}k=k.sibling}if(!R){for(k=b.child;k;){if(k===u){R=!0,u=b,m=y;break}if(k===m){R=!0,m=b,u=y;break}k=k.sibling}if(!R)throw Error(n(189))}}if(u.alternate!==m)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:l}function h(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r;for(r=r.child;r!==null;){if(l=h(r),l!==null)return l;r=r.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),_=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var nt=Symbol.for("react.client.reference");function it(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===nt?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case B:return"SuspenseList";case F:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case x:return"Portal";case _:return r.displayName||"Context";case L:return(r._context.displayName||"Context")+".Consumer";case P:var l=r.render;return r=r.displayName,r||(r=l.displayName||l.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case C:return l=r.displayName||null,l!==null?l:it(r.type)||"Memo";case I:l=r._payload,r=r._init;try{return it(r(l))}catch{}}return null}var rt=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N={pending:!1,data:null,method:null,action:null},V=[],X=-1;function O(r){return{current:r}}function G(r){0>X||(r.current=V[X],V[X]=null,X--)}
vendor: 10,719 bytes, lines 41-48
41function K(r,l){X++,V[X]=r.current,r.current=l}var J=O(null),ot=O(null),ft=O(null),ht=O(null);function xt(r,l){switch(K(ft,l),K(ot,r),K(J,null),l.nodeType){case 9:case 11:r=(r=l.documentElement)&&(r=r.namespaceURI)?dS(r):0;break;default:if(r=l.tagName,l=l.namespaceURI)l=dS(l),r=fS(l,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(J),K(J,r)}function wt(){G(J),G(ot),G(ft)}function Zt(r){r.memoizedState!==null&&K(ht,r);var l=J.current,u=fS(l,r.type);l!==u&&(K(ot,r),K(J,u))}function fe(r){ot.current===r&&(G(J),G(ot)),ht.current===r&&(G(ht),Dl._currentValue=N)}var Fe,Cs;function cs(r){if(Fe===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);Fe=l&&l[1]||"",Cs=-1<u.stack.indexOf(` 42 at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return` 43`+Fe+r+Cs}var ga=!1;function Mt(r,l){if(!r||ga)return"";ga=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(l){var dt=function(){throw Error()};if(Object.defineProperty(dt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(dt,[])}catch(at){var st=at}Reflect.construct(r,[],dt)}else{try{dt.call()}catch(at){st=at}r.call(dt.prototype)}}else{try{throw Error()}catch(at){st=at}(dt=r())&&typeof dt.catch=="function"&&dt.catch(function(){})}}catch(at){if(at&&st&&typeof at.stack=="string")return[at.stack,st.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=m.DetermineComponentFrameRoot(),R=b[0],k=b[1];if(R&&k){var H=R.split(` 44`),et=k.split(` 45`);for(y=m=0;m<H.length&&!H[m].includes("DetermineComponentFrameRoot");)m++;for(;y<et.length&&!et[y].includes("DetermineComponentFrameRoot");)y++;if(m===H.length||y===et.length)for(m=H.length-1,y=et.length-1;1<=m&&0<=y&&H[m]!==et[y];)y--;for(;1<=m&&0<=y;m--,y--)if(H[m]!==et[y]){if(m!==1||y!==1)do if(m--,y--,0>y||H[m]!==et[y]){var lt=` 46`+H[m].replace(" at new "," at ");return r.displayName&<.includes("<anonymous>")&&(lt=lt.replace("<anonymous>",r.displayName)),lt}while(1<=m&&0<=y);break}}}finally{ga=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?cs(u):""}function le(r,l){switch(r.tag){case 26:case 27:case 5:return cs(r.type);case 16:return cs("Lazy");case 13:return r.child!==l&&l!==null?cs("Suspense Fallback"):cs("Suspense");case 19:return cs("SuspenseList");case 0:case 15:return Mt(r.type,!1);case 11:return Mt(r.type.render,!1);case 1:return Mt(r.type,!0);case 31:return cs("Activity");default:return""}}function Ge(r){try{var l="",u=null;do l+=le(r,u),u=r,r=r.return;while(r);return l}catch(m){return` 47Error generating stack: `+m.message+` 48`+m.stack}}var Ae=Object.prototype.hasOwnProperty,Ye=s.unstable_scheduleCallback,Ys=s.unstable_cancelCallback,he=s.unstable_shouldYield,pn=s.unstable_requestPaint,Ie=s.unstable_now,ya=s.unstable_getCurrentPriorityLevel,Ds=s.unstable_ImmediatePriority,Lr=s.unstable_UserBlockingPriority,si=s.unstable_NormalPriority,ki=s.unstable_LowPriority,Ws=s.unstable_IdlePriority,Cn=s.log,Pi=s.unstable_setDisableYieldValue,_r=null,us=null;function gn(r){if(typeof Cn=="function"&&Pi(r),us&&typeof us.setStrictMode=="function")try{us.setStrictMode(_r,r)}catch{}}var is=Math.clz32?Math.clz32:Dn,Ff=Math.log,Ho=Math.LN2;function Dn(r){return r>>>=0,r===0?32:31-(Ff(r)/Ho|0)|0}var va=256,xa=262144,Cr=4194304;function In(r){var l=r&42;if(l!==0)return l;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Ct(r,l,u){var m=r.pendingLanes;if(m===0)return 0;var y=0,b=r.suspendedLanes,R=r.pingedLanes;r=r.warmLanes;var k=m&134217727;return k!==0?(m=k&~b,m!==0?y=In(m):(R&=k,R!==0?y=In(R):u||(u=k&~r,u!==0&&(y=In(u))))):(k=m&~b,k!==0?y=In(k):R!==0?y=In(R):u||(u=m&~r,u!==0&&(y=In(u)))),y===0?0:l!==0&&l!==y&&(l&b)===0&&(b=y&-y,u=l&-l,b>=u||b===32&&(u&4194048)!==0)?l:y}function ce(r,l){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&l)===0}function He(r,l){switch(r){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rs(){var r=Cr;return Cr<<=1,(Cr&62914560)===0&&(Cr=4194304),r}function Mi(r){for(var l=[],u=0;31>u;u++)l.push(r);return l}function me(r,l){r.pendingLanes|=l,l!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function ps(r,l,u,m,y,b){var R=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var k=r.entanglements,H=r.expirationTimes,et=r.hiddenUpdates;for(u=R&~u;0<u;){var lt=31-is(u),dt=1<<lt;k[lt]=0,H[lt]=-1;var st=et[lt];if(st!==null)for(et[lt]=null,lt=0;lt<st.length;lt++){var at=st[lt];at!==null&&(at.lane&=-536870913)}u&=~dt}m!==0&&Dr(r,m,0),b!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=b&~(R&~l))}function Dr(r,l,u){r.pendingLanes|=l,r.suspendedLanes&=~l;var m=31-is(l);r.entangledLanes|=l,r.entanglements[m]=r.entanglements[m]|1073741824|u&261930}function gs(r,l){var u=r.entangledLanes|=l;for(r=r.entanglements;u;){var m=31-is(u),y=1<<m;y&l|r[m]&l&&(r[m]|=l),u&=~y}}function ys(r,l){var u=l&-l;return u=(u&42)!==0?1:ba(u),(u&(r.suspendedLanes|l))!==0?0:u}function ba(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function yn(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Uf(){var r=j.p;return r!==0?r:(r=window.event,r===void 0?32:MS(r.type))}function Xy(r,l){var u=j.p;try{return j.p=r,l()}finally{j.p=u}}var Ni=Math.random().toString(36).slice(2),We="__reactFiber$"+Ni,vs="__reactProps$"+Ni,Sa="__reactContainer$"+Ni,jf="__reactEvents$"+Ni,uD="__reactListeners$"+Ni,dD="__reactHandles$"+Ni,Zy="__reactResources$"+Ni,zo="__reactMarker$"+Ni;function $f(r){delete r[We],delete r[vs],delete r[jf],delete r[uD],delete r[dD]}function Ea(r){var l=r[We];if(l)return l;for(var u=r.parentNode;u;){if(l=u[Sa]||u[We]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(r=xS(r);r!==null;){if(u=r[We])return u;r=xS(r)}return l}r=u,u=r.parentNode}return null}function Ta(r){if(r=r[We]||r[Sa]){var l=r.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return r}return null}function Ko(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r.stateNode;throw Error(n(33))}function Aa(r){var l=r[Zy];return l||(l=r[Zy]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function ze(r){r[zo]=!0}var Jy=new Set,tv={};function Ir(r,l){Ra(r,l),Ra(r+"Capture",l)}function Ra(r,l){for(tv[r]=l,r=0;r<l.length;r++)Jy.add(l[r])}var fD=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ev={},sv={};function hD(r){return Ae.call(sv,r)?!0:Ae.call(ev,r)?!1:fD.test(r)?sv[r]=!0:(ev[r]=!0,!1)}function Nc(r,l,u){if(hD(l))if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(l);return;case"boolean":var m=l.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){r.removeAttribute(l);return}}r.setAttribute(l,""+u)}}function Bc(r,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttribute(l,""+u)}}function ni(r,l,u,m){if(m===null)r.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(l,u,""+m)}}function Qs(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function nv(r){var l=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function mD(r,l,u){var m=Object.getOwnPropertyDescriptor(r.constructor.prototype,l);if(!r.hasOwnProperty(l)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,b=m.set;return Object.defineProperty(r,l,{configurable:!0,get:function(){return y.call(this)},set:function(R){u=""+R,b.call(this,R)}}),Object.defineProperty(r,l,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(R){u=""+R},stopTracking:function(){r._valueTracker=null,delete r[l]}}}}function Vf(r){if(!r._valueTracker){var l=nv(r)?"checked":"value";r._valueTracker=mD(r,l,""+r[l])}}function iv(r){if(!r)return!1;var l=r._valueTracker;if(!l)return!0;var u=l.getValue(),m="";return r&&(m=nv(r)?r.checked?"true":"false":r.value),r=m,r!==u?(l.setValue(r),!0):!1}function Fc(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var pD=/[\n"\\]/g;function Xs(r){return r.replace(pD,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Gf(r,l,u,m,y,b,R,k){r.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.type=R:r.removeAttribute("type"),l!=null?R==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+Qs(l)):r.value!==""+Qs(l)&&(r.value=""+Qs(l)):R!=="submit"&&R!=="reset"||r.removeAttribute("value"),l!=null?Hf(r,R,Qs(l)):u!=null?Hf(r,R,Qs(u)):m!=null&&r.removeAttribute("value"),y==null&&b!=null&&(r.defaultChecked=!!b),y!=null&&(r.checked=y&&t
vendor: 5,691 bytes, line 48
48ypeof y!="function"&&typeof y!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?r.name=""+Qs(k):r.removeAttribute("name")}function rv(r,l,u,m,y,b,R,k){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(r.type=b),l!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||l!=null)){Vf(r);return}u=u!=null?""+Qs(u):"",l=l!=null?""+Qs(l):u,k||l===r.value||(r.value=l),r.defaultValue=l}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=k?r.checked:!!m,r.defaultChecked=!!m,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(r.name=R),Vf(r)}function Hf(r,l,u){l==="number"&&Fc(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function wa(r,l,u,m){if(r=r.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=l.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&m&&(r[u].defaultSelected=!0)}else{for(u=""+Qs(u),l=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,m&&(r[y].defaultSelected=!0);return}l!==null||r[y].disabled||(l=r[y])}l!==null&&(l.selected=!0)}}function av(r,l,u){if(l!=null&&(l=""+Qs(l),l!==r.value&&(r.value=l),u==null)){r.defaultValue!==l&&(r.defaultValue=l);return}r.defaultValue=u!=null?""+Qs(u):""}function ov(r,l,u,m){if(l==null){if(m!=null){if(u!=null)throw Error(n(92));if(rt(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),l=u}u=Qs(l),r.defaultValue=u,m=r.textContent,m===u&&m!==""&&m!==null&&(r.value=m),Vf(r)}function La(r,l){if(l){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=l;return}}r.textContent=l}var gD=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function lv(r,l,u){var m=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?r.setProperty(l,""):l==="float"?r.cssFloat="":r[l]="":m?r.setProperty(l,u):typeof u!="number"||u===0||gD.has(l)?l==="float"?r.cssFloat=u:r[l]=(""+u).trim():r[l]=u+"px"}function cv(r,l,u){if(l!=null&&typeof l!="object")throw Error(n(62));if(r=r.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||l!=null&&l.hasOwnProperty(m)||(m.indexOf("--")===0?r.setProperty(m,""):m==="float"?r.cssFloat="":r[m]="");for(var y in l)m=l[y],l.hasOwnProperty(y)&&u[y]!==m&&lv(r,y,m)}else for(var b in l)l.hasOwnProperty(b)&&lv(r,b,l[b])}function zf(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yD=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
48-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vD=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Uc(r){return vD.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ii(){}var Kf=null;function qf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var _a=null,Ca=null;function uv(r){var l=Ta(r);if(l&&(r=l.stateNode)){var u=r[vs]||null;t:switch(r=l.stateNode,l.type){case"input":if(Gf(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Xs(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var m=u[l];if(m!==r&&m.form===r.form){var y=m[vs]||null;if(!y)throw Error(n(90));Gf(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)m=u[l],m.form===r.form&&iv(m)}break t;case"textarea":av(r,u.value,u.defaultValue);break t;case"select":l=u.value,l!=null&&wa(r,!!u.multiple,l,!1)}}}var Yf=!1;function dv(r,l,u){if(Yf)return r(l,u);Yf=!0;try{var m=r(l);return m}finally{if(Yf=!1,(_a!==null||Ca!==null)&&(wu(),_a&&(l=_a,r=Ca,Ca=_a=null,uv(l),r)))for(l=0;l<r.length;l++)uv(r[l])}}function qo(r,l){var u=r.stateNode;if(u===null)return null;var m=u[vs]||null;if(m===null)return null;u=m[l];t:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break t;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,l,typeof u));return u}var ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wf=!1;if(ri)try{var Yo={};Object.defineProperty(Yo,"passive",{get:function(){Wf=!0}}),window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{Wf=!1}var Bi=null,Qf=null,jc=null;function fv(){if(jc)return jc;var r,l=Qf,u=l.length,m,y="value"in Bi?Bi.value:Bi.textContent,b=y.length;for(r=0;r<u&&l[r]===y[r];r++);var R=u-r;for(m=1;m<=R&&l[u-m]===y[b-m];m++);return jc=y.slice(r,1<m?1-m:void 0)}function $c(r){var l=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&l===13&&(r=13)):r=l,r===10&&(r=13),32<=r||r===13?r:0}function Vc(){return!0}function hv(){return!1}function xs(r){function l(u,m,y,b,R){this._reactName=u,this._targetInst=y,this.type=m,this.nativeEvent=b,this.target=R,this.currentTarget=null;for(var k in r)r.hasOwnProperty(k)&&(u=r[k],this[k]=u?u(b):b[k]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Vc:hv,this.isPropagationStopped=hv,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Vc)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Vc)},persist:function(){},isPersistent:Vc}),l}var Or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gc=xs(Or),Wo=p({},Or,{view:0,detail:0}),xD=xs(Wo),Xf,Zf,Qo,Hc=p({},Wo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:th,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Qo&&(Qo&&r.type==="mousemove"?(Xf=r.screenX-Qo.screenX,Zf=r.screenY-Qo.screenY):Zf=Xf=0,Qo=r),Xf)},movementY:function(r){return"movementY"in r?r.movementY:Zf}}),mv=xs(Hc),bD=p({},Hc,{dataTransfer:0}),SD=xs(bD),ED=p({},Wo,{relatedTarget:0}),Jf=xs(ED),TD=p({},Or,{animationName:0,elapsedTime:0,pseudoElement:0}),AD=xs(TD),RD=p({},Or,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),wD=xs(RD),LD=p({},Or,{data:0}),pv=xs(LD),_D={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},DD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ID(r){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(r):(r=DD[r])?!!l[r]:!1}function th(){return ID}var OD=p({},Wo,{key:function(r){if(r.key){var l=_D[r.key]||r.key;if(l!=="Unidentified")return l}
vendor: 5,186 bytes, line 48
48return r.type==="keypress"?(r=$c(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?CD[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:th,charCode:function(r){return r.type==="keypress"?$c(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?$c(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),kD=xs(OD),PD=p({},Hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gv=xs(PD),MD=p({},Wo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:th}),ND=xs(MD),BD=p({},Or,{propertyName:0,elapsedTime:0,pseudoElement:0}),FD=xs(BD),UD=p({},Hc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),jD=xs(UD),$D=p({},Or,{newState:0,oldState:0}),VD=xs($D),GD=[9,13,27,32],eh=ri&&"CompositionEvent"in window,Xo=null;ri&&"documentMode"in document&&(Xo=document.documentMode);var HD=ri&&"TextEvent"in window&&!Xo,yv=ri&&(!eh||Xo&&8<Xo&&11>=Xo),vv=" ",xv=!1;function bv(r,l){switch(r){case"keyup":return GD.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Da=!1;function zD(r,l){switch(r){case"compositionend":return Sv(l);case"keypress":return l.which!==32?null:(xv=!0,vv);case"textInput":return r=l.data,r===vv&&xv?null:r;default:return null}}function KD(r,l){if(Da)return r==="compositionend"||!eh&&bv(r,l)?(r=fv(),jc=Qf=Bi=null,Da=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return yv&&l.locale!=="ko"?null:l.data;default:return null}}var qD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ev(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l==="input"?!!qD[r.type]:l==="textarea"}function Tv(r,l,u,m){_a?Ca?Ca.push(m):Ca=[m]:_a=m,l=ku(l,"onChange"),0<l.length&&(u=new Gc("onChange","change",null,u,m),r.push({event:u,listeners:l}))}var Zo=null,Jo=null;function YD(r){rS(r,0)}function zc(r){var l=Ko(r);if(iv(l))return r}function Av(r,l){if(r==="change")return l}var Rv=!1;if(ri){var sh;if(ri){var nh="oninput"in document;if(!nh){var wv=document.createElement("div");wv.setAttribute("oninput","return;"),nh=typeof wv.oninput=="function"}sh=nh}else sh=!1;Rv=sh&&(!document.documentMode||9<document.documentMode)}function Lv(){Zo&&(Zo.detachEvent("onpropertychange",_v),Jo=Zo=null)}function _v(r){if(r.propertyName==="value"&&zc(Jo)){var l=[];Tv(l,Jo,r,qf(r)),dv(YD,l)}}function WD(r,l,u){r==="focusin"?(Lv(),Zo=l,Jo=u,Zo.attachEvent("onpropertychange",_v)):r==="focusout"&&Lv()}function QD(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return zc(Jo)}function XD(r,l){if(r==="click")return zc(l)}function ZD(r,l){if(r==="input"||r==="change")return zc(l)}function JD(r,l){return r===l&&(r!==0||1/r===1/l)||r!==r&&l!==l}var Is=typeof Object.is=="function"?Object.is:JD;function tl(r,l){if(Is(r,l))return!0;if(typeof r!="object"||r===null||typeof l!="object"||l===null)return!1;var u=Object.keys(r),m=Object.keys(l);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var y=u[m];if(!Ae.call(l,y)||!Is(r[y],l[y]))return!1}return!0}function Cv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Dv(r,l){var u=Cv(r);r=0;for(var m;u;){if(u.nodeType===3){if(m=r+u.textContent.length,r<=l&&m>=l)return{node:u,offset:l-r};r=m}t:{for(;u;){if(u.nextSibling){u=u.nextSibling;break t}u=u.parentNode}u=void 0}u=Cv(u)}}function Iv(r,l){return r&&l?r===l?!0:r&&r.nodeType===3?!1:l&&l.nodeType===3?Iv(r,l.parentNode):"contains"in r?r.contains(l):r.compareDocumentPosition?!!(r.compareDocumentPosition(l)&16):!1:!1}function Ov(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var l=Fc(r.document);l instanceof r.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)r=l.contentWindow;else break;l=Fc(r.document)}return l}function ih(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l&&(l==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||l==="textarea"||r.contentEditable==="true")}var tI=ri&&"documentMode"in document&&11>=document.documentMode,Ia=null,rh=null,el=null,ah=!1;function kv(r,l,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ah||Ia==null||Ia!==Fc(m)||(m=Ia,"selectionStart"in m&&ih(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focu
vendor: 20,947 bytes, line 48
48sNode:m.focusNode,focusOffset:m.focusOffset}),el&&tl(el,m)||(el=m,m=ku(rh,"onSelect"),0<m.length&&(l=new Gc("onSelect","select",null,l,u),r.push({event:l,listeners:m}),l.target=Ia)))}function kr(r,l){var u={};return u[r.toLowerCase()]=l.toLowerCase(),u["Webkit"+r]="webkit"+l,u["Moz"+r]="moz"+l,u}var Oa={animationend:kr("Animation","AnimationEnd"),animationiteration:kr("Animation","AnimationIteration"),animationstart:kr("Animation","AnimationStart"),transitionrun:kr("Transition","TransitionRun"),transitionstart:kr("Transition","TransitionStart"),transitioncancel:kr("Transition","TransitionCancel"),transitionend:kr("Transition","TransitionEnd")},oh={},Pv={};ri&&(Pv=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function Pr(r){if(oh[r])return oh[r];if(!Oa[r])return r;var l=Oa[r],u;for(u in l)if(l.hasOwnProperty(u)&&u in Pv)return oh[r]=l[u];return r}var Mv=Pr("animationend"),Nv=Pr("animationiteration"),Bv=Pr("animationstart"),eI=Pr("transitionrun"),sI=Pr("transitionstart"),nI=Pr("transitioncancel"),Fv=Pr("transitionend"),Uv=new Map,lh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lh.push("scrollEnd");function vn(r,l){Uv.set(r,l),Ir(l,[r])}var Kc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Zs=[],ka=0,ch=0;function qc(){for(var r=ka,l=ch=ka=0;l<r;){var u=Zs[l];Zs[l++]=null;var m=Zs[l];Zs[l++]=null;var y=Zs[l];Zs[l++]=null;var b=Zs[l];if(Zs[l++]=null,m!==null&&y!==null){var R=m.pending;R===null?y.next=y:(y.next=R.next,R.next=y),m.pending=y}b!==0&&jv(u,y,b)}}function Yc(r,l,u,m){Zs[ka++]=r,Zs[ka++]=l,Zs[ka++]=u,Zs[ka++]=m,ch|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function uh(r,l,u,m){return Yc(r,l,u,m),Wc(r)}function Mr(r,l){return Yc(r,null,null,l),Wc(r)}function jv(r,l,u){r.lanes|=u;var m=r.alternate;m!==null&&(m.lanes|=u);for(var y=!1,b=r.return;b!==null;)b.childLanes|=u,m=b.alternate,m!==null&&(m.childLanes|=u),b.tag===22&&(r=b.stateNode,r===null||r._visibility&1||(y=!0)),r=b,b=b.return;return r.tag===3?(b=r.stateNode,y&&l!==null&&(y=31-is(u),r=b.hiddenUpdates,m=r[y],m===null?r[y]=[l]:m.push(l),l.lane=u|536870912),b):null}function Wc(r){if(50<Tl)throw Tl=0,xm=null,Error(n(185));for(var l=r.return;l!==null;)r=l,l=r.return;return r.tag===3?r.stateNode:null}var Pa={};function iI(r,l,u,m){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Os(r,l,u,m){return new iI(r,l,u,m)}function dh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ai(r,l){var u=r.alternate;return u===null?(u=Os(r.tag,l,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=l,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,l=r.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function $v(r,l){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=l,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,l=u.dependencies,r.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),r}function Qc(r,l,u,m,y,b){var R=0;if(m=r,typeof r=="function")dh(r)&&(R=1);else if(typeof r=="string")R=cO(r,u,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else t:switch(r){case F:return r=Os(31,u,l,y),r.elementType=F,r.lanes=b,r;case S:return Nr(u.children,y,b,l);case E:R=8,y|=24;break;case T:return r=Os(12,u,l,y|2),r.elementType=T,r.lanes=b,r;case D:return r=Os(13,u,l,y),r.elementType=D,r.lanes=b,r;case B:return r=Os(19,u,l,y),r.elementType=B,r.lanes=b,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _:R=10;break t;case L:R=9;break t;case P:R=11;break t;case C:R=14;break t;case I:R=16,m=null;break t}R=29,u=Error(n(130,r===null?"null":typeof r,"")),m=null}return l=Os(R,u,l,y),l.elementType=r,l.type=m,l.lanes=b,l}function Nr(r,l,u,m){return r=Os(7,r,m,l),r.lanes=u,r}function fh(r,l,u){return r=Os(6,r,null,l),r.lanes=u,r}function Vv(r){var l=Os(18,null,null,0);return l.stateNode=r,l}function hh(r,l,u){return l=Os(4,r.children!==null?r.children:[],r.key,l),l.lanes=u,l.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},l}var Gv=new WeakMap;function Js(r,l){if(typeof r=="object"&&r!==null){var u=Gv.get(r);return u!==void 0?u:(l={value:r,source:l,stack:Ge(l)},Gv.set(r,l),l)}return{value:r,source:l,stack:Ge(l)}}var Ma=[],Na=0,Xc=null,sl=0,tn=[],en=0,Fi=null,On=1,kn="";function oi(r,l){Ma[Na++]=sl,Ma[Na++]=Xc,Xc=r,sl=l}function Hv(r,l,u){tn[en++]=On,tn[en++]=kn,tn[en++]=Fi,Fi=r;var m=On;r=kn;var y=32-is(m)-1;m&=~(1<<y),u+=1;var b=32-is(l)+y;if(30<b){var R=y-y%5;b=(m&(1<<R)-1).toString(32),m>>=R,y-=R,On=1<<32-is(l)+y|u<<y|m,kn=b+r}else On=1<<b|u<<y|m,kn=r}function mh(r){r.return!==null&&(oi(r,1),Hv(r,1,0))}function ph(r){for(;r===Xc;)Xc=Ma[--Na],Ma[Na]=null,sl=Ma[--Na],Ma[Na]=null;for(;r===Fi;)Fi=tn[--en],tn[en]=null,kn=tn[--en],tn[en]=null,On=tn[--en],tn[en]=null}function zv(r,l){tn[en++]=On,tn[en++]=kn,tn[en++]=Fi,On=l.id,kn=l.overflow,Fi=r}var Qe=null,ae=null,Gt=!1,Ui=null,sn=!1,gh=Error(n(519));function ji(r){var l=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nl(Js(l,r)),gh}function Kv(r){var l=r.stateNode,u=r.type,m=r.memoizedProps;switch(l[We]=r,l[vs]=m,u){case"dialog":jt("cancel",l),jt("close",l);break;case"iframe":case"object":case"embed":jt("load",l);break;case"video":case"audio":for(u=0;u<Rl.length;u++)jt(Rl[u],l);break;case"source":jt("error",l);break;case"img":case"image":case"link":jt("error",l),jt("load",l);break;case"details":jt("toggle",l);break;case"input":jt("invalid",l),rv(l,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":jt("invalid",l);break;case"textarea":jt("invalid",l),ov(l,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||m.suppressHydrationWarning===!0||cS(l.textContent,u)?(m.popover!=null&&(jt("beforetoggle",l),jt("toggle",l)),m.onScroll!=null&&jt("scroll",l),m.onScrollEnd!=null&&jt("scrollend",l),m.onClick!=null&&(l.onclick=ii),l=!0):l=!1,l||ji(r,!0)}function qv(r){for(Qe=r.return;Qe;)switch(Qe.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:Qe=Qe.return}}function Ba(r){if(r!==Qe)return!1;if(!Gt)return qv(r),Gt=!0,!1;var l=r.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||Pm(r.type,r.memoizedProps)),u=!u),u&&ae&&ji(r),qv(r),l===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));ae=vS(r)}else if(l===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));ae=vS(r)}else l===27?(l=ae,tr(r.type)?(r=Um,Um=null,ae=r):ae=l):ae=Qe?rn(r.stateNode.nextSibling):null;return!0}function Br(){ae=Qe=null,Gt=!1}function yh(){var r=Ui;return r!==null&&(Ts===null?Ts=r:Ts.push.apply(Ts,r),Ui=null),r}function nl(r){Ui===null?Ui=[r]:Ui.push(r)}var vh=O(null),Fr=null,li=null;function $i(r,l,u){K(vh,l._currentValue),l._currentValue=u}function ci(r){r._currentValue=vh.current,G(vh)}function xh(r,l,u){for(;r!==null;){var m=r.alternate;if((r.childLanes&l)!==l?(r.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),r===u)break;r=r.return}}function bh(r,l,u,m){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var b=y.dependencies;if(b!==null){var R=y.child;b=b.firstContext;t:for(;b!==null;){var k=b;b=y;for(var H=0;H<l.length;H++)if(k.context===l[H]){b.lanes|=u,k=b.alternate,k!==null&&(k.lanes|=u),xh(b.return,u,r),m||(R=null);break t}b=k.next}}else if(y.tag===18){if(R=y.return,R===null)throw Error(n(341));R.lanes|=u,b=R.alternate,b!==null&&(b.lanes|=u),xh(R,u,r),R=null}else R=y.child;if(R!==null)R.return=y;else for(R=y;R!==null;){if(R===r){R=null;break}if(y=R.sibling,y!==null){y.return=R.return,R=y;break}R=R.return}y=R}}function Fa(r,l,u,m){r=null;for(var y=l,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var R=y.alternate;if(R===null)throw Error(n(387));if(R=R.memoizedProps,R!==null){var k=y.type;Is(y.pendingProps.value,R.value)||(r!==null?r.push(k):r=[k])}}else if(y===ht.current){if(R=y.alternate,R===null)throw Error(n(387));R.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(Dl):r=[Dl])}y=y.return}r!==null&&bh(l,r,u,m),l.flags|=262144}function Zc(r){for(r=r.firstContext;r!==null;){if(!Is(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ur(r){Fr=r,li=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Xe(r){return Yv(Fr,r)}function Jc(r,l){return Fr===null&&Ur(r),Yv(r,l)}function Yv(r,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},li===null){if(r===null)throw Error(n(308));li=l,r.dependencies={lanes:0,firstContext:l},r.flags|=524288}else li=li.next=l;return u}var rI=typeof AbortController<"u"?AbortController:function(){var r=[],l=this.signal={aborted:!1,addEventListener:function(u,m){r.push(m)}};this.abort=function(){l.aborted=!0,r.forEach(function(u){return u()})}},aI=s.unstable_scheduleCallback,oI=s.unstable_NormalPriority,Oe={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sh(){return{controller:new rI,data:new Map,refCount:0}}function il(r){r.refCount--,r.refCount===0&&aI(oI,function(){r.controller.abort()})}var rl=null,Eh=0,Ua=0,ja=null;function lI(r,l){if(rl===null){var u=rl=[];Eh=0,Ua=Rm(),ja={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Eh++,l.then(Wv,Wv),l}function Wv(){if(--Eh===0&&rl!==null){ja!==null&&(ja.status="fulfilled");var r=rl;rl=null,Ua=0,ja=null;for(var l=0;l<r.length;l++)(0,r[l])()}}function cI(r,l){var u=[],m={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return r.then(function(){m.status="fulfilled",m.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(m.status="rejected",m.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),m}var Qv=M.S;M.S=function(r,l){kb=Ie(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&lI(r,l),Qv!==null&&Qv(r,l)};var jr=O(null);function Th(){var r=jr.current;return r!==null?r:ne.pooledCache}function tu(r,l){l===null?K(jr,jr.current):K(jr,l.pool)}function Xv(){var r=Th();return r===null?null:{parent:Oe._currentValue,pool:r}}var $a=Error(n(460)),Ah=Error(n(474)),eu=Error(n(542)),su={then:function(){}};function Zv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Jv(r,l,u){switch(u=r[u],u===void 0?r.push(l):u!==l&&(l.then(ii,ii),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw r=l.reason,ex(r),r;default:if(typeof l.status=="string")l.then(ii,ii);else{if(r=ne,r!==null&&100<r.shellSuspendCounter)throw Error(n(482));r=l,r.status="pending",r.then(function(m){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=m}},function(m){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=m}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw r=l.reason,ex(r),r}throw Vr=l,$a}}function $r(r){try{var l=r._init;return l(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Vr=u,$a):u}}var Vr=null;function tx(){if(Vr===null)throw Error(n(459));var r=Vr;return Vr=null,r}function ex(r){if(r===$a||r===eu)throw Error(n(483))}var Va=null,al=0;function nu(r){var l=al;return al+=1,Va===null&&(Va=[]),Jv(Va,r,l)}function ol(r,l){l=l.props.ref,r.ref=l!==void 0?l:null}function iu(r,l){throw l.$$typeof===g?Error(n(525)):(r=Object.prototype.toString.call(l),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":r)))}function sx(r){function l(W,q){if(r){var tt=W.deletions;tt===null?(W.deletions=[q],W.flags|=16):tt.push(q)}}function u(W,q){if(!r)return null;for(;q!==null;)l(W,q),q=q.sibling;return null}function m(W){for(var q=new Map;W!==null;)W.key!==null?q.set(W.key,W):q.set(W.index,W),W=W.sibling;return q}function y(W,q){return W=ai(W,q),W.index=0,W.sibling=null,W}function b(W,q,tt){return W.index=tt,r?(tt=W.alternate,tt!==null?(tt=tt.index,tt<q?(W.flags|=67108866,q):tt):(W.flags|=67108866,q)):(W.flags|=1048576,q)}function R(W){return r&&W.alternate===null&&(W.flags|=67108866),W}function k(W,q,tt,ut){return q===null||q.tag!==6?(q=fh(tt,W.mode,ut),q.return=W,q):(q=y(q,tt),q.return=W,q)}function H(W,q,tt,ut){var At=tt.type;return At===S?lt(W,q,tt.props.children,ut,tt.key):q!==null&&(q.elementType===At||typeof At=="object"&&At!==null&&At.$$typeof===I&&$r(At)===q.type)?(q=y(q,tt.props),ol(q,tt),q.return=W,q):(q=Qc(tt.type,tt.key,tt.props,null,W.mode,ut),ol(q,tt),q.return=W,q)}function et(W,q,tt,ut){return q===null||q.tag!==4||q.stateNode.containerInfo!==tt.containerInfo||q.stateNode.implementation!==tt.implementation?(q=hh(tt,W.mode,ut),q.return=W,q):(q=y(q,tt.children||[]),q.return=W,q)}function lt(W,q,tt,ut,At){return q===null||q.tag!==7?(q=Nr(tt,W.mode,ut,At),q.return=W,q):(q=y(q,tt),q.return=W,q)}function dt(W,q,tt){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=fh(""+q,W.mode,tt),q.return=W,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return tt=Qc(q.type,q.key,q.props,null,W.mode,tt),ol(tt,q),tt.return=W,tt;case x:return q=hh(q,W.mode,tt),q.return=W,q;case I:return q=$r(q),dt(W,q,tt)}if(rt(q)||Y(q))return q=Nr(q,W.mode,tt,null),q.return=W,q;if(typeof q.then=="function")return dt(W,nu(q),tt);if(q.$$typeof===_)return dt(W,Jc(W,q),tt);iu(W,q)}return null}function st(W,q,tt,ut){var At=q!==null?q.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint")return At!==null?null:k(W,q,""+tt,ut);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case v:return tt.key===At?H(W,q,tt,ut):null;case x:return tt.key===At?et(W,q,tt,ut):null;case I:return tt=$r(tt),st(W,q,tt,ut)}if(rt(tt)||Y(tt))return At!==null?null:lt(W,q,tt,ut,null);if(typeof tt.then=="function")return st(W,q,nu(tt),ut);if(tt.$$typeof===_)return st(W,q,Jc(W,tt),ut);iu(W,tt)}return null}function at(W,q,tt,ut,At){if(typeof ut=="string"&&ut!==""||typeof ut=="number"||typeof ut=="bigint")return W=W.get(tt)||null,k(q,W,""+ut,At);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case v:return W=W.get(ut.key===null?tt:ut.key)||null,H(q,W,ut,At);case x:return W=W.get(ut.key===null?tt:ut.key)||null,et(q,W,ut,At);case I:return ut=$r(ut),at(W,q,tt,ut,At)}if(rt(ut)||Y(ut))return W=W.get(tt)||null,lt(q,W,ut,At,null);if(typeof ut.then=="function")return at(W,q,tt,nu(ut),At);if(ut.$$typeof===_)return at(W,q,tt,Jc(q,ut),At);iu(q,ut)}return null}function vt(W,q,tt,ut){for(var At=null,Ht=null,Et=q,kt=q=0,Vt=null;Et!==null&&kt<tt.length;kt++){Et.index>kt?(Vt=Et,Et=null):Vt=Et.sibling;var zt=st(W,Et,tt[kt],ut);if(zt===null){Et===null&&(Et=Vt);break}r&&Et&&zt.alternate===null&&l(W,Et),q=b(zt,q,kt),Ht===null?At=zt:Ht.sibling=zt,Ht=zt,Et=Vt}if(kt===tt.length)return u(W,Et),Gt&&oi(W,kt),At;if(Et===null){for(;kt<tt.length;kt++)Et=dt(W,tt[kt],ut),Et!==null&&(q=b(Et,q,kt),Ht===null?At=Et:Ht.sibling=Et,Ht=Et);return Gt&&oi(W,kt),At}for(Et=m(Et);kt<tt.length;kt++)Vt=at(Et,W,kt,tt[kt],ut),Vt!==null&&(r&&Vt.alternate!==null&&Et.delete(Vt.key===null?kt:Vt.key),q=b(Vt,q,kt),Ht===null?At=Vt:Ht.sibling=Vt,Ht=Vt);return r&&Et.forEach(function(rr){return l(W,rr)}),Gt&&oi(W,kt),At}function Rt(W,q,tt,ut){if(tt==null)throw Error(n(151));for(var At=null,Ht=null,Et=q,kt=q=0,Vt=null,zt=tt.next();Et!==null&&!zt.done;kt++,zt=tt.next()){Et.index>kt?(Vt=Et,Et=null):Vt=Et.sibling;var rr=st(W,Et,zt.value,ut);if(rr===null){Et===null&&(Et=Vt);break}r&&Et&&rr.alternate===null&&l(W,Et),q=b(rr,q,kt),Ht===null?At=rr:Ht.sibling=rr,Ht=rr,Et=Vt}if(zt.done)return u(W,Et),Gt&&oi(W,kt),At;if(Et===null){for(;!zt.done;kt++,zt=tt.next())zt=dt(W,zt.value,ut),zt!==null&&(q=b(zt,q,kt),Ht===null?At=zt:Ht.sibling=zt,Ht=zt);return Gt&&oi(W,kt),At}for(Et=m(Et);!zt.done;kt++,zt=tt.next())zt=at(Et,W,kt,zt.value,ut),zt!==null&&(r&&zt.alternate!==null&&Et.delete(zt.key===null?kt:zt.key),q=b(zt,q,kt),Ht===null?At=zt:Ht.sibling=zt,Ht=zt);return r&&Et.forEach(function(bO){return l(W,bO)}),Gt&&oi(W,kt),At}function ee(W,q,tt,ut){if(typeof tt=="object"&&tt!==null&&tt.type===S&&tt.key===null&&(tt=tt.props.children),typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case v:t:{for(var At=tt.key;q!==null;){if(q.key===At){if(At=tt.type,At===S){if(q.tag===7){u(W,q.sibling),ut=y(q,tt.props.children),ut.return=W,W=ut;break t}}else if(q.elementType===At||typeof At=="object"&&At!==null&&At.$$typeof===I&&$r(At)===q.type){u(W,q.sibling),ut=y(q,tt.props),ol(ut,tt),ut.return=W,W=ut;break t}u(W,q);break}else l(W,q);q=q.sibling}tt.type===S?(ut=Nr(tt.props.children,W.mode,ut,tt.key),ut.return=W,W=ut):(ut=Qc(tt.type,tt.key,tt.props,null,W.mode,ut),ol(ut,tt),ut.return=W,W=ut)}return R(W);case x:t:{for(At=tt.key;q!==null;){if(q.key===At)if(q.tag===4&&q.stateNode.containerInfo===tt.containerInfo&&q.stateNode.implementation===tt.implementation){u(W,q.sibling),ut=y(q,tt.children||[]),ut.return=W,W=ut;break t}else{u(W,q);break}else l(W,q);q=q.sibling}ut=hh(tt,W.mode,ut),ut.return=W,W=ut}return R(W);case I:return tt=$r(tt),ee(W,q,tt,ut)}if(rt(tt))return vt(W,q,tt,ut);if(Y(tt)){if(At=Y(tt),typeof At!="function")throw Error(n(150));return tt=At.call(tt),Rt(W,q,tt,ut)}if(typeof tt.then=="function")return ee(W,q,nu(tt),ut);if(tt.$$typeof===_)return ee(W,q,Jc(W,tt),ut);iu(W,tt)}return typeof tt=="string"&&tt!==""||typeof tt=="number"||typeof tt=="bigint"?(tt=""+tt,q!==null&&q.tag===6?(u(W,q.sibling),ut=y(q,tt),ut.return=W,W=ut):(u(W,q),ut=fh(tt,W.mode,ut),ut.return=W,W=ut),R(W)):u(W,q)}return function(W,q,tt,ut){try{al=0;var At=ee(W,q,tt,ut);return Va=null,At}catch(Et){if(Et===$a||Et===eu)throw Et;var Ht=Os(29,Et,null,W.mode);return Ht.lanes=ut,Ht.return=W,Ht}finally{}}}var Gr=sx(!0),nx=sx(!1),Vi=!1;function Rh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wh(r,l){r=r.updateQueue,l.updateQueue===r&&(l.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Gi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Hi(r,l,u){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(qt&2)!==0){var y=m.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),m.pending=l,l=Wc(r),jv(r,null,u),l}return Yc(r,m,l,u),Wc(r)}function ll(r,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var m=l.lanes;m&=r.pendingLanes,u|=m,l.lanes=u,gs(r,u)}}function Lh(r,l){var u=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var y=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var R={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?y=b=R:b=b.next=R,u=u.next}while(u!==null);b===null?y=b=l:b=b.next=l}else y=b=l;u={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:m.shared,callbacks:m.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=l:r.next=l,u.lastBaseUpdate=l}var _h=!1;
vendor: 5,662 bytes, line 48
48function cl(){if(_h){var r=ja;if(r!==null)throw r}}function ul(r,l,u,m){_h=!1;var y=r.updateQueue;Vi=!1;var b=y.firstBaseUpdate,R=y.lastBaseUpdate,k=y.shared.pending;if(k!==null){y.shared.pending=null;var H=k,et=H.next;H.next=null,R===null?b=et:R.next=et,R=H;var lt=r.alternate;lt!==null&&(lt=lt.updateQueue,k=lt.lastBaseUpdate,k!==R&&(k===null?lt.firstBaseUpdate=et:k.next=et,lt.lastBaseUpdate=H))}if(b!==null){var dt=y.baseState;R=0,lt=et=H=null,k=b;do{var st=k.lane&-536870913,at=st!==k.lane;if(at?($t&st)===st:(m&st)===st){st!==0&&st===Ua&&(_h=!0),lt!==null&&(lt=lt.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});t:{var vt=r,Rt=k;st=l;var ee=u;switch(Rt.tag){case 1:if(vt=Rt.payload,typeof vt=="function"){dt=vt.call(ee,dt,st);break t}dt=vt;break t;case 3:vt.flags=vt.flags&-65537|128;case 0:if(vt=Rt.payload,st=typeof vt=="function"?vt.call(ee,dt,st):vt,st==null)break t;dt=p({},dt,st);break t;case 2:Vi=!0}}st=k.callback,st!==null&&(r.flags|=64,at&&(r.flags|=8192),at=y.callbacks,at===null?y.callbacks=[st]:at.push(st))}else at={lane:st,tag:k.tag,payload:k.payload,callback:k.callback,next:null},lt===null?(et=lt=at,H=dt):lt=lt.next=at,R|=st;if(k=k.next,k===null){if(k=y.shared.pending,k===null)break;at=k,k=at.next,at.next=null,y.lastBaseUpdate=at,y.shared.pending=null}}while(!0);lt===null&&(H=dt),y.baseState=H,y.firstBaseUpdate=et,y.lastBaseUpdate=lt,b===null&&(y.shared.lanes=0),Wi|=R,r.lanes=R,r.memoizedState=dt}}function ix(r,l){if(typeof r!="function")throw Error(n(191,r));r.call(l)}function rx(r,l){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)ix(u[r],l)}var Ga=O(null),ru=O(0);function ax(r,l){r=vi,K(ru,r),K(Ga,l),vi=r|l.baseLanes}function Ch(){K(ru,vi),K(Ga,Ga.current)}function Dh(){vi=ru.current,G(Ga),G(ru)}var ks=O(null),nn=null;function zi(r){var l=r.alternate;K(Re,Re.current&1),K(ks,r),nn===null&&(l===null||Ga.current!==null||l.memoizedState!==null)&&(nn=r)}function Ih(r){K(Re,Re.current),K(ks,r),nn===null&&(nn=r)}function ox(r){r.tag===22?(K(Re,Re.current),K(ks,r),nn===null&&(nn=r)):Ki()}function Ki(){K(Re,Re.current),K(ks,ks.current)}function Ps(r){G(ks),nn===r&&(nn=null),G(Re)}var Re=O(0);function au(r){for(var l=r;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Bm(u)||Fm(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var ui=0,Ot=null,Jt=null,ke=null,ou=!1,Ha=!1,Hr=!1,lu=0,dl=0,za=null,uI=0;function xe(){throw Error(n(321))}function Oh(r,l){if(l===null)return!1;for(var u=0;u<l.length&&u<r.length;u++)if(!Is(r[u],l[u]))return!1;return!0}function kh(r,l,u,m,y,b){return ui=b,Ot=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=r===null||r.memoizedState===null?Hx:Yh,Hr=!1,b=u(m,y),Hr=!1,Ha&&(b=cx(l,u,m,y)),lx(r),b}function lx(r){M.H=ml;var l=Jt!==null&&Jt.next!==null;if(ui=0,ke=Jt=Ot=null,ou=!1,dl=0,za=null,l)throw Error(n(300));r===null||Pe||(r=r.dependencies,r!==null&&Zc(r)&&(Pe=!0))}function cx(r,l,u,m){Ot=r;var y=0;do{if(Ha&&(za=null),dl=0,Ha=!1,25<=y)throw Error(n(301));if(y+=1,ke=Jt=null,r.updateQueue!=null){var b=r.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}M.H=zx,b=l(u,m)}while(Ha);return b}function dI(){var r=M.H,l=r.useState()[0];return l=typeof l.then=="function"?fl(l):l,r=r.useState()[0],(Jt!==null?Jt.memoizedState:null)!==r&&(Ot.flags|=1024),l}function Ph(){var r=lu!==0;return lu=0,r}function Mh(r,l,u){l.updateQueue=r.updateQueue,l.flags&=-2053,r.lanes&=~u}function Nh(r){if(ou){for(r=r.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}ou=!1}ui=0,ke=Jt=Ot=null,Ha=!1,dl=lu=0,za=null}function ds(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ke===null?Ot.memoizedState=ke=r:ke=ke.next=r,ke}function we(){if(Jt===null){var r=Ot.alternate;r=r!==null?r.memoizedState:null}else r=Jt.next;var l=ke===null?Ot.memoizedState:ke.next;if(l!==null)ke=l,Jt=r;else{if(r===null)throw Ot.alternate===null?Error(n(467)):Error(n(310));Jt=r,r={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},ke===null?Ot.memoizedState=ke=r:ke=ke.next=r}return ke}function cu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fl(r){var l=dl;return dl+=1,za===null&&(za=[]),r=Jv(za,r,l),l=Ot,(ke===null?l.memoizedState:ke.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?Hx:Yh),r}function uu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return fl(r);if(r.$$typeof===_)return Xe(r)}throw Error(n(438,String(r)))}function Bh(r){var l=null,u=Ot.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var m=Ot.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(l={data:m.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=cu(),Ot.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(r),m=0;m<r;m++)u[m]=U;return l.index++,u}function di(r,l){return typeof l=="function"?l(r):l}function du(r){var l=we();return Fh(l,Jt,r)}function Fh(r,l,u){var m=r.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=u;var y=r.baseQueue,b=m.pending;if(b!==null){if(y!==null){var R=y.next;y.next=b.next,b.next=R}
vendor: 16,162 bytes, line 48
48l.baseQueue=y=b,m.pending=null}if(b=r.baseState,y===null)r.memoizedState=b;else{l=y.next;var k=R=null,H=null,et=l,lt=!1;do{var dt=et.lane&-536870913;if(dt!==et.lane?($t&dt)===dt:(ui&dt)===dt){var st=et.revertLane;if(st===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null}),dt===Ua&&(lt=!0);else if((ui&st)===st){et=et.next,st===Ua&&(lt=!0);continue}else dt={lane:0,revertLane:et.revertLane,gesture:null,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null},H===null?(k=H=dt,R=b):H=H.next=dt,Ot.lanes|=st,Wi|=st;dt=et.action,Hr&&u(b,dt),b=et.hasEagerState?et.eagerState:u(b,dt)}else st={lane:dt,revertLane:et.revertLane,gesture:et.gesture,action:et.action,hasEagerState:et.hasEagerState,eagerState:et.eagerState,next:null},H===null?(k=H=st,R=b):H=H.next=st,Ot.lanes|=dt,Wi|=dt;et=et.next}while(et!==null&&et!==l);if(H===null?R=b:H.next=k,!Is(b,r.memoizedState)&&(Pe=!0,lt&&(u=ja,u!==null)))throw u;r.memoizedState=b,r.baseState=R,r.baseQueue=H,m.lastRenderedState=b}return y===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function Uh(r){var l=we(),u=l.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var m=u.dispatch,y=u.pending,b=l.memoizedState;if(y!==null){u.pending=null;var R=y=y.next;do b=r(b,R.action),R=R.next;while(R!==y);Is(b,l.memoizedState)||(Pe=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),u.lastRenderedState=b}return[b,m]}function ux(r,l,u){var m=Ot,y=we(),b=Gt;if(b){if(u===void 0)throw Error(n(407));u=u()}else u=l();var R=!Is((Jt||y).memoizedState,u);if(R&&(y.memoizedState=u,Pe=!0),y=y.queue,Vh(hx.bind(null,m,y,r),[r]),y.getSnapshot!==l||R||ke!==null&&ke.memoizedState.tag&1){if(m.flags|=2048,Ka(9,{destroy:void 0},fx.bind(null,m,y,u,l),null),ne===null)throw Error(n(349));b||(ui&127)!==0||dx(m,l,u)}return u}function dx(r,l,u){r.flags|=16384,r={getSnapshot:l,value:u},l=Ot.updateQueue,l===null?(l=cu(),Ot.updateQueue=l,l.stores=[r]):(u=l.stores,u===null?l.stores=[r]:u.push(r))}function fx(r,l,u,m){l.value=u,l.getSnapshot=m,mx(l)&&px(r)}function hx(r,l,u){return u(function(){mx(l)&&px(r)})}function mx(r){var l=r.getSnapshot;r=r.value;try{var u=l();return!Is(r,u)}catch{return!0}}function px(r){var l=Mr(r,2);l!==null&&As(l,r,2)}function jh(r){var l=ds();if(typeof r=="function"){var u=r;if(r=u(),Hr){gn(!0);try{u()}finally{gn(!1)}}}return l.memoizedState=l.baseState=r,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:di,lastRenderedState:r},l}function gx(r,l,u,m){return r.baseState=u,Fh(r,Jt,typeof m=="function"?m:di)}function fI(r,l,u,m,y){if(mu(r))throw Error(n(485));if(r=l.action,r!==null){var b={payload:y,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){b.listeners.push(R)}};M.T!==null?u(!0):b.isTransition=!1,m(b),u=l.pending,u===null?(b.next=l.pending=b,yx(l,b)):(b.next=u.next,l.pending=u.next=b)}}function yx(r,l){var u=l.action,m=l.payload,y=r.state;if(l.isTransition){var b=M.T,R={};M.T=R;try{var k=u(y,m),H=M.S;H!==null&&H(R,k),vx(r,l,k)}catch(et){$h(r,l,et)}finally{b!==null&&R.types!==null&&(b.types=R.types),M.T=b}}else try{b=u(y,m),vx(r,l,b)}catch(et){$h(r,l,et)}}function vx(r,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){xx(r,l,m)},function(m){return $h(r,l,m)}):xx(r,l,u)}function xx(r,l,u){l.status="fulfilled",l.value=u,bx(l),r.state=u,l=r.pending,l!==null&&(u=l.next,u===l?r.pending=null:(u=u.next,l.next=u,yx(r,u)))}function $h(r,l,u){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do l.status="rejected",l.reason=u,bx(l),l=l.next;while(l!==m)}r.action=null}function bx(r){r=r.listeners;for(var l=0;l<r.length;l++)(0,r[l])()}function Sx(r,l){return l}function Ex(r,l){if(Gt){var u=ne.formState;if(u!==null){t:{var m=Ot;if(Gt){if(ae){e:{for(var y=ae,b=sn;y.nodeType!==8;){if(!b){y=null;break e}if(y=rn(y.nextSibling),y===null){y=null;break e}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){ae=rn(y.nextSibling),m=y.data==="F!";break t}}ji(m)}m=!1}m&&(l=u[0])}}return u=ds(),u.memoizedState=u.baseState=l,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sx,lastRenderedState:l},u.queue=m,u=$x.bind(null,Ot,m),m.dispatch=u,m=jh(!1),b=qh.bind(null,Ot,!1,m.queue),m=ds(),y={state:l,dispatch:null,action:r,pending:null},m.queue=y,u=fI.bind(null,Ot,y,b,u),y.dispatch=u,m.memoizedState=r,[l,u,!1]}function Tx(r){var l=we();return Ax(l,Jt,r)}function Ax(r,l,u){if(l=Fh(r,l,Sx)[0],r=du(di)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var m=fl(l)}catch(R){throw R===$a?eu:R}else m=l;l=we();var y=l.queue,b=y.dispatch;return u!==l.memoizedState&&(Ot.flags|=2048,Ka(9,{destroy:void 0},hI.bind(null,y,u),null)),[m,b,r]}function hI(r,l){r.action=l}function Rx(r){var l=we(),u=Jt;if(u!==null)return Ax(l,u,r);we(),l=l.memoizedState,u=we();var m=u.queue.dispatch;return u.memoizedState=r,[l,m,!1]}function Ka(r,l,u,m){return r={tag:r,create:u,deps:m,inst:l,next:null},l=Ot.updateQueue,l===null&&(l=cu(),Ot.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=r.next=r:(m=u.next,u.next=r,r.next=m,l.lastEffect=r),r}function wx(){return we().memoizedState}function fu(r,l,u,m){var y=ds();Ot.flags|=r,y.memoizedState=Ka(1|l,{destroy:void 0},u,m===void 0?null:m)}function hu(r,l,u,m){var y=we();m=m===void 0?null:m;var b=y.memoizedState.inst;Jt!==null&&m!==null&&Oh(m,Jt.memoizedState.deps)?y.memoizedState=Ka(l,b,u,m):(Ot.flags|=r,y.memoizedState=Ka(1|l,b,u,m))}function Lx(r,l){fu(8390656,8,r,l)}function Vh(r,l){hu(2048,8,r,l)}function mI(r){Ot.flags|=4;var l=Ot.updateQueue;if(l===null)l=cu(),Ot.updateQueue=l,l.events=[r];else{var u=l.events;u===null?l.events=[r]:u.push(r)}}function _x(r){var l=we().memoizedState;return mI({ref:l,nextImpl:r}),function(){if((qt&2)!==0)throw Error(n(440));return l.impl.apply(void 0,arguments)}}function Cx(r,l){return hu(4,2,r,l)}function Dx(r,l){return hu(4,4,r,l)}function Ix(r,l){if(typeof l=="function"){r=r();var u=l(r);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return r=r(),l.current=r,function(){l.current=null}}function Ox(r,l,u){u=u!=null?u.concat([r]):null,hu(4,4,Ix.bind(null,l,r),u)}function Gh(){}function kx(r,l){var u=we();l=l===void 0?null:l;var m=u.memoizedState;return l!==null&&Oh(l,m[1])?m[0]:(u.memoizedState=[r,l],r)}function Px(r,l){var u=we();l=l===void 0?null:l;var m=u.memoizedState;if(l!==null&&Oh(l,m[1]))return m[0];if(m=r(),Hr){gn(!0);try{r()}finally{gn(!1)}}return u.memoizedState=[m,l],m}function Hh(r,l,u){return u===void 0||(ui&1073741824)!==0&&($t&261930)===0?r.memoizedState=l:(r.memoizedState=u,r=Mb(),Ot.lanes|=r,Wi|=r,u)}function Mx(r,l,u,m){return Is(u,l)?u:Ga.current!==null?(r=Hh(r,u,m),Is(r,l)||(Pe=!0),r):(ui&42)===0||(ui&1073741824)!==0&&($t&261930)===0?(Pe=!0,r.memoizedState=u):(r=Mb(),Ot.lanes|=r,Wi|=r,l)}function Nx(r,l,u,m,y){var b=j.p;j.p=b!==0&&8>b?b:8;var R=M.T,k={};M.T=k,qh(r,!1,l,u);try{var H=y(),et=M.S;if(et!==null&&et(k,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var lt=cI(H,m);hl(r,l,lt,Bs(r))}else hl(r,l,m,Bs(r))}catch(dt){hl(r,l,{then:function(){},status:"rejected",reason:dt},Bs())}finally{j.p=b,R!==null&&k.types!==null&&(R.types=k.types),M.T=R}}function pI(){}function zh(r,l,u,m){if(r.tag!==5)throw Error(n(476));var y=Bx(r).queue;Nx(r,y,l,N,u===null?pI:function(){return Fx(r),u(m)})}function Bx(r){var l=r.memoizedState;if(l!==null)return l;l={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:di,lastRenderedState:N},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:di,lastRenderedState:u},next:null},r.memoizedState=l,r=r.alternate,r!==null&&(r.memoizedState=l),l}function Fx(r){var l=Bx(r);l.next===null&&(l=r.alternate.memoizedState),hl(r,l.next.queue,{},Bs())}function Kh(){return Xe(Dl)}function Ux(){return we().memoizedState}function jx(){return we().memoizedState}function gI(r){for(var l=r.return;l!==null;){switch(l.tag){case 24:case 3:var u=Bs();r=Gi(u);var m=Hi(l,r,u);m!==null&&(As(m,l,u),ll(m,l,u)),l={cache:Sh()},r.payload=l;return}l=l.return}}function yI(r,l,u){var m=Bs();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},mu(r)?Vx(l,u):(u=uh(r,l,u,m),u!==null&&(As(u,r,m),Gx(u,l,m)))}function $x(r,l,u){var m=Bs();hl(r,l,u,m)}function hl(r,l,u,m){var y={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(mu(r))Vx(l,y);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var R=l.lastRenderedState,k=b(R,u);if(y.hasEagerState=!0,y.eagerState=k,Is(k,R))return Yc(r,l,y,0),ne===null&&qc(),!1}catch{}finally{}if(u=uh(r,l,y,m),u!==null)return As(u,r,m),Gx(u,l,m),!0}return!1}function qh(r,l,u,m){if(m={lane:2,revertLane:Rm(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},mu(r)){if(l)throw Error(n(479))}else l=uh(r,u,m,2),l!==null&&As(l,r,2)}function mu(r){var l=r.alternate;return r===Ot||l!==null&&l===Ot}function Vx(r,l){Ha=ou=!0;var u=r.pending;u===null?l.next=l:(l.next=u.next,u.next=l),r.pending=l}function Gx(r,l,u){if((u&4194048)!==0){var m=l.lanes;m&=r.pendingLanes,u|=m,l.lanes=u,gs(r,u)}}var ml={readContext:Xe,use:uu,useCallback:xe,useContext:xe,useEffect:xe,useImperativeHandle:xe,useLayoutEffect:xe,useInsertionEffect:xe,useMemo:xe,useReducer:xe,useRef:xe,useState:xe,useDebugValue:xe,useDeferredValue:xe,useTransition:xe,useSyncExternalStore:xe,useId:xe,useHostTransitionStatus:xe,useFormState:xe,useActionState:xe,useOptimistic:xe,useMemoCache:xe,useCacheRefresh:xe};ml.useEffectEvent=xe;var Hx={readContext:Xe,use:uu,useCallback:function(r,l){return ds().memoizedState=[r,l===void 0?null:l],r},useContext:Xe,useEffect:Lx,useImperativeHandle:function(r,l,u){u=u!=null?u.concat([r]):null,fu(4194308,4,Ix.bind(null,l,r),u)},useLayoutEffect:function(r,l){return fu(4194308,4,r,l)},useInsertionEffect:function(r,l){fu(4,2,r,l)},useMemo:function(r,l){var u=ds();l=l===void 0?null:l;var m=r();if(Hr){gn(!0);try{r()}finally{gn(!1)}}return u.memoizedState=[m,l],m},useReducer:function(r,l,u){var m=ds();if(u!==void 0){var y=u(l);if(Hr){gn(!0);try{u(l)}finally{gn(!1)}}}else y=l;return m.memoizedState=m.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},m.queue=r,r=r.dispatch=yI.bind(null,Ot,r),[m.memoizedState,r]},useRef:function(r){var l=ds();return r={current:r},l.memoizedState=r},useState:function(r){r=jh(r);var l=r.queue,u=$x.bind(null,Ot,l);return l.dispatch=u,[r.memoizedState,u]},useDebugValue:Gh,useDeferredValue:function(r,l){var u=ds();return Hh(u,r,l)},useTransition:function(){var r=jh(!1);return r=Nx.bind(null,Ot,r.queue,!0,!1),ds().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,l,u){var m=Ot,y=ds();if(Gt){if(u===void 0)throw Error(n(407));u=u()}else{if(u=l(),ne===null)throw Error(n(349));($t&127)!==0||dx(m,l,u)}y.memoizedState=u;var b={value:u,getSnapshot:l};return y.queue=b,Lx(hx.bind(null,m,b,r),[r]),m.flags|=2048,Ka(9,{destroy:void 0},fx.bind(null,m,b,u,l),null),u},useId:function(){var r=ds(),l=ne.identifierPrefix;if(Gt){var u=kn,m=On;u=(m&~(1<<32-is(m)-1)).toString(32)+u,l="_"+l+"R_"+u,u=lu++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=uI++,l="_"+l+"r_"+u.toString(32)+"_";return r.memoizedState=l},useHostTransitionStatus:Kh,useFormState:Ex,useActionState:Ex,useOptimistic:function(r){var l=ds();l.memoizedState=l.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=qh.bind(null,Ot,!0,u),u.dispatch=l,[r,l]},useMemoCache:Bh,useCacheRefresh:function(){return ds().memoizedState=gI.bind(null,Ot)},useEffectEvent:function(r){var l=ds(),u={impl:r};return l.memoizedState=u,function(){if((qt&2)!==0)throw Error(n(440));return u.impl.apply(void 0,arguments)}}},Yh={readContext:Xe,use:uu,useCallback:kx,useContext:Xe,useEffect:Vh,useImperativeHandle:Ox,useInsertionEffect:Cx,useLayoutEffect:Dx,useMemo:Px,useReducer:du,useRef:wx,useState:function(){return du(di)},useDebugValue:Gh,useDeferredValue:function(r,l){var u=we();return Mx(u,Jt.memoizedState,r,l)},useTransition:function(){var r=du(di)[0],l=we().memoizedState;return[typeof r=="boolean"?r:fl(r),l]},useSyncExternalStore:ux,useId:Ux,useHostTransitionStatus:Kh,useFormState:Tx,useActionState:Tx,useOptimistic:function(r,l){var u=we();return gx(u,Jt,r,l)},useMemoCache:Bh,useCacheRefresh:jx};Yh.useEffectEvent=_x;var zx={readContext:Xe,use:uu,useCallback:kx,useContext:Xe,useEffect:Vh,useImperativeHandle:Ox,useInsertionEffect:Cx,useLayoutEffect:Dx,useMemo:Px,useReducer:Uh,useRef:wx,useState:function(){return Uh(di)},useDebugValue:Gh,useDeferredValue:function(r,l){var u=we();return Jt===null?Hh(u,r,l):Mx(u,Jt.memoizedState,r,l)},useTransition:function(){var r=Uh(di)[0],l=we().memoizedState;return[typeof r=="boolean"?r:fl(r),l]},useSyncExternalStore:ux,useId:Ux,useHostTransitionStatus:Kh,useFormState:Rx,useActionState:Rx,useOptimistic:function(r,l){var u=we();return Jt!==null?gx(u,Jt,r,l):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:Bh,useCacheRefresh:jx};zx.useEffectEvent=_x;function Wh(r,l,u,m){l=r.memoizedState,u=u(m,l),u=u==null?l:p({},l,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Qh={enqueueSetState:function(r,l,u){r=r._reactInternals;var m=Bs(),y=Gi(m);y.payload=l,u!=null&&(y.callback=u),l=Hi(r,y,m),l!==null&&(As(l,r,m),ll(l,r,m))},enqueueReplaceState:function(r,l,u){r=r._reactInternals;var m=Bs(),y=Gi(m);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=Hi(r,y,m),l!==null&&(As(l,r,m),ll(l,r,m))},enqueueForceUpdate:function(r,l){r=r._reactInternals;var u=Bs(),m=Gi(u);m.tag=2,l!=null&&(m.callback=l),l=Hi(r,m,u),l!==null&&(As(l,r,u),ll(l,r,u))}};function Kx(r,l,u,m,y,b,R){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,b,R):l.prototype&&l.prototype.isPureReactComponent?!tl(u,m)||!tl(y,b):!0}function qx(r,l,u,m){r=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,m),l.state!==r&&Qh.enqueueReplaceState(l,l.state,null)}function zr(r,l){var u=l;if("ref"in l){u={};for(var m in l)m!=="ref"&&(u[m]=l[m])}if(r=r.defaultProps){u===l&&(u=p({},u));for(var y in r)u[y]===void 0&&(u[y]=r[y])}return u}function Yx(r){Kc(r)}function Wx(r){console.error(r)}function Qx(r){Kc(r)}function pu(r,l){try{var u=r.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(m){setTimeout(function(){throw m})}}function Xx(r,l,u){try{var m=r.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Xh(r,l,u){return u=Gi(u),u.tag=3,u.payload={element:null},u.callback=function(){pu(r,l)},u}function Zx(r){return r=Gi(r),r.tag=3,r}function Jx(r,l,u,m){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var b=m.value;r.payload=function(){return y(b)},r.callback=function(){Xx(l,u,m)}}var R=u.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(r.callback=function(){Xx(l,u,m),typeof y!="function"&&(Qi===null?Qi=new Set([this]):Qi.add(this));var k=m.stack;this.componentDidCatch(m.value,{componentStack:k!==null?k:""})})}function vI(r,l,u,m,y){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(l=u.alternate,l!==null&&Fa(l,u,y,!0),u=ks.current,u!==null){switch(u.tag){case 31:case 13:return nn===null?Lu():u.alternate===null&&be===0&&(be=3),u.flags&=-257,u.flags|=65536,u.lanes=y,m===su?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([m]):l.add(m),Em(r,m,y)),!1;case 22:return u.flags|=65536,m===su?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([m]):u.add(m)),Em(r,m,y)),!1}throw Error(n(435,u.tag))}return Em(r,m,y),Lu(),!1}if(Gt)return l=ks.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,m!==gh&&(r=Error(n(422),{cause:m}),nl(Js(r,u)))):(m!==gh&&(l=Error(n(423),{cause:m}
vendor: 10,869 bytes, line 48
48),nl(Js(l,u))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,m=Js(m,u),y=Xh(r.stateNode,m,y),Lh(r,y),be!==4&&(be=2)),!1;var b=Error(n(520),{cause:m});if(b=Js(b,u),El===null?El=[b]:El.push(b),be!==4&&(be=2),l===null)return!0;m=Js(m,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,r=y&-y,u.lanes|=r,r=Xh(u.stateNode,m,r),Lh(u,r),!1;case 1:if(l=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Qi===null||!Qi.has(b))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Zx(y),Jx(y,r,u,m),Lh(u,y),!1}u=u.return}while(u!==null);return!1}var Zh=Error(n(461)),Pe=!1;function Ze(r,l,u,m){l.child=r===null?nx(l,null,u,m):Gr(l,r.child,u,m)}function tb(r,l,u,m,y){u=u.render;var b=l.ref;if("ref"in m){var R={};for(var k in m)k!=="ref"&&(R[k]=m[k])}else R=m;return Ur(l),m=kh(r,l,u,R,b,y),k=Ph(),r!==null&&!Pe?(Mh(r,l,y),fi(r,l,y)):(Gt&&k&&mh(l),l.flags|=1,Ze(r,l,m,y),l.child)}function eb(r,l,u,m,y){if(r===null){var b=u.type;return typeof b=="function"&&!dh(b)&&b.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=b,sb(r,l,b,m,y)):(r=Qc(u.type,null,m,l,l.mode,y),r.ref=l.ref,r.return=l,l.child=r)}if(b=r.child,!am(r,y)){var R=b.memoizedProps;if(u=u.compare,u=u!==null?u:tl,u(R,m)&&r.ref===l.ref)return fi(r,l,y)}return l.flags|=1,r=ai(b,m),r.ref=l.ref,r.return=l,l.child=r}function sb(r,l,u,m,y){if(r!==null){var b=r.memoizedProps;if(tl(b,m)&&r.ref===l.ref)if(Pe=!1,l.pendingProps=m=b,am(r,y))(r.flags&131072)!==0&&(Pe=!0);else return l.lanes=r.lanes,fi(r,l,y)}return Jh(r,l,u,m,y)}function nb(r,l,u,m){var y=m.children,b=r!==null?r.memoizedState:null;if(r===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((l.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,r!==null){for(m=l.child=r.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~b}else m=0,l.child=null;return ib(r,l,b,u,m)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},r!==null&&tu(l,b!==null?b.cachePool:null),b!==null?ax(l,b):Ch(),ox(l);else return m=l.lanes=536870912,ib(r,l,b!==null?b.baseLanes|u:u,u,m)}else b!==null?(tu(l,b.cachePool),ax(l,b),Ki(),l.memoizedState=null):(r!==null&&tu(l,null),Ch(),Ki());return Ze(r,l,y,u),l.child}function pl(r,l){return r!==null&&r.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function ib(r,l,u,m,y){var b=Th();return b=b===null?null:{parent:Oe._currentValue,pool:b},l.memoizedState={baseLanes:u,cachePool:b},r!==null&&tu(l,null),Ch(),ox(l),r!==null&&Fa(r,l,m,!0),l.childLanes=y,null}function gu(r,l){return l=vu({mode:l.mode,children:l.children},r.mode),l.ref=r.ref,r.child=l,l.return=r,l}function rb(r,l,u){return Gr(l,r.child,null,u),r=gu(l,l.pendingProps),r.flags|=2,Ps(l),l.memoizedState=null,r}function xI(r,l,u){var m=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,r===null){if(Gt){if(m.mode==="hidden")return r=gu(l,m),l.lanes=536870912,pl(null,r);if(Ih(l),(r=ae)?(r=yS(r,sn),r=r!==null&&r.data==="&"?r:null,r!==null&&(l.memoizedState={dehydrated:r,treeContext:Fi!==null?{id:On,overflow:kn}:null,retryLane:536870912,hydrationErrors:null},u=Vv(r),u.return=l,l.child=u,Qe=l,ae=null)):r=null,r===null)throw ji(l);return l.lanes=536870912,null}return gu(l,m)}var b=r.memoizedState;if(b!==null){var R=b.dehydrated;if(Ih(l),y)if(l.flags&256)l.flags&=-257,l=rb(r,l,u);else if(l.memoizedState!==null)l.child=r.child,l.flags|=128,l=null;else throw Error(n(558));else if(Pe||Fa(r,l,u,!1),y=(u&r.childLanes)!==0,Pe||y){if(m=ne,m!==null&&(R=ys(m,u),R!==0&&R!==b.retryLane))throw b.retryLane=R,Mr(r,R),As(m,r,R),Zh;Lu(),l=rb(r,l,u)}else r=b.treeContext,ae=rn(R.nextSibling),Qe=l,Gt=!0,Ui=null,sn=!1,r!==null&&zv(l,r),l=gu(l,m),l.flags|=4096;return l}return r=ai(r.child,{mode:m.mode,children:m.children}),r.ref=l.ref,l.child=r,r.return=l,r}function yu(r,l){var u=l.ref;if(u===null)r!==null&&r.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(n(284));(r===null||r.ref!==u)&&(l.flags|=4194816)}}function Jh(r,l,u,m,y){return Ur(l),u=kh(r,l,u,m,void 0,y),m=Ph(),r!==null&&!Pe?(Mh(r,l,y),fi(r,l,y)):(Gt&&m&&mh(l),l.flags|=1,Ze(r,l,u,y),l.child)}function ab(r,l,u,m,y,b){return Ur(l),l.updateQueue=null,u=cx(l,m,u,y),lx(r),m=Ph(),r!==null&&!Pe?(Mh(r,l,b),fi(r,l,b)):(Gt&&m&&mh(l),l.flags|=1,Ze(r,l,u,b),l.child)}function ob(r,l,u,m,y){if(Ur(l),l.stateNode===null){var b=Pa,R=u.contextType;typeof R=="object"&&R!==null&&(b=Xe(R)),b=new u(m,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Qh,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=m,b.state=l.memoizedState,b.refs={},Rh(l),R=u.contextType,b.context=typeof R=="object"&&R!==null?Xe(R):Pa,b.state=l.memoizedState,R=u.getDerivedStateFromProps,typeof R=="function"&&(Wh(l,u,R,m),b.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(R=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),R!==b.state&&Qh.enqueueReplaceState(b,b.state,null),ul(l,m,b,y),cl(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),m=!0}else if(r===null){b=l.stateNode;var k=l.memoizedProps,H=zr(u,k);b.props=H;var et=b.context,lt=u.contextType;R=Pa,typeof lt=="object"&<!==null&&(R=Xe(lt));var dt=u.getDerivedStateFromProps;lt=typeof dt=="function"||typeof b.getSnapshotBeforeUpdate=="function",k=l.pendingProps!==k,lt||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k||et!==R)&&qx(l,b,m,R),Vi=!1;var st=l.memoizedState;b.state=st,ul(l,m,b,y),cl(),et=l.memoizedState,k||st!==et||Vi?(typeof dt=="function"&&(Wh(l,u,dt,m),et=l.memoizedState),(H=Vi||Kx(l,u,H,m,st,et,R))?(lt||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=et),b.props=m,b.state=et,b.context=R,m=H):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{b=l.stateNode,wh(r,l),R=l.memoizedProps,lt=zr(u,R),b.props=lt,dt=l.pendingProps,st=b.context,et=u.contextType,H=Pa,typeof et=="object"&&et!==null&&(H=Xe(et)),k=u.getDerivedStateFromProps,(et=typeof k=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R!==dt||st!==H)&&qx(l,b,m,H),Vi=!1,st=l.memoizedState,b.state=st,ul(l,m,b,y),cl();var at=l.memoizedState;R!==dt||st!==at||Vi||r!==null&&r.dependencies!==null&&Zc(r.dependencies)?(typeof k=="function"&&(Wh(l,u,k,m),at=l.memoizedState),(lt=Vi||Kx(l,u,lt,m,st,at,H)||r!==null&&r.dependencies!==null&&Zc(r.dependencies))?(et||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(m,at,H),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(m,at,H)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||R===r.memoizedProps&&st===r.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&st===r.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=at),b.props=m,b.state=at,b.context=H,m=lt):(typeof b.componentDidUpdate!="function"||R===r.memoizedProps&&st===r.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&st===r.memoizedState||(l.flags|=1024),m=!1)}return b=m,yu(r,l),m=(l.flags&128)!==0,b||m?(b=l.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,r!==null&&m?(l.child=Gr(l,r.child,null,y),l.child=Gr(l,null,u,y)):Ze(r,l,u,y),l.memoizedState=b.state,r=l.child):r=fi(r,l,y),r}function lb(r,l,u,m){return Br(),l.flags|=256,Ze(r,l,u,m),l.child}var tm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function em(r){return{baseLanes:r,cachePool:Xv()}}function sm(r,l,u){return r=r!==null?r.childLanes&~u:0,l&&(r|=Ns),r}function cb(r,l,u){var m=l.pendingProps,y=!1,b=(l.flags&128)!==0,R;if((R=b)||(R=r!==null&&r.memoizedState===null?!1:(Re.current&2)!==0),R&&(y=!0,l.flags&=-129),R=(l.flags&32)!==0,l.flags&=-33,r===null){if(Gt){if(y?zi(l):Ki(),(r=ae)?(r=yS(r,sn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(l.memoizedState={dehydrated:r,treeContext:Fi!==null?{id:On,overflow:kn}:null,retryLane:536870912,hydrationErrors:null},u=Vv(r),u.return=l,l.child=u,Qe=l,ae=null)):r=null,r===null)throw ji(l);return Fm(r)?l.lanes=32:l.lanes=536870912,null}var k=m.children;return m=m.fallback,y?(Ki(),y=l.mode,k=vu({mode:"hidden",children:k},y),m=Nr(m,y,u,null),k.return=l,m.return=l,k.sibling=m,l.child=k,m=l.child,m.memoizedState=em(u),m.childLanes=sm(r,R,u),l.memoizedState=tm,pl(null,m)):(zi(l),nm(l,k))}var H=r.memoizedState;if(H!==null&&(k=H.dehydrated,k!==null)){if(b)l.flags&256?(zi(l),l.flags&=-257,l=im(r,l,u)):l.memoizedState!==null?(Ki(),l.child=r.child,l.flags|=128,l=null):(Ki(),k=m.fallback,y=l.mode,m=vu({mode:"visible",children:m.children},y),k=Nr(k,y,u,null),k.flags|=2,m.return=l,k.return=l,m.sibling=k,l.child=m,Gr(l,r.child,null,u),m=l.child,m.memoizedState=em(u),m.childLanes=sm(r,R,u),l.memoizedState=tm,l=pl(null,m));else if(zi(l),Fm(k)){if(R=k.nextSibling&&k.nextSibling.dataset,R)var et=R.dgst;R=et,m=Error(n(419)),m.stack="",m.digest=R,nl({value:m,source:null,stack:null}),l=im(r,l,u)}else if(Pe||Fa(r,l,u,!1),R=(u&r.childLanes)!==0,Pe||R){if(R=ne,R!==null&&(m=ys(R,u),m!==0&&m!==H.retryLane))throw H.retryLane=m,Mr(r,m),As(R,r,m),Zh;Bm(k)||Lu(),l=im(r,l,u)}else Bm(k)?(l.flags|=192,l.child=r.child,l=null):(r=H.treeContext,ae=rn(k.nextSibling),Qe=l,Gt=!0,Ui=null,sn=!1,r!==null&&zv(l,r),l=nm(l,m.children),l.flags|=4096);return l}return y?(Ki(),k=m.fallback,y=l.mode,H=r.child,et=H.sibling,m=ai(H,{mode:"hidden",children:m.children}),m.subtreeFlags=H.subtreeFlags&65011712,et!==null?k=ai(et,k):(k=Nr(k,y,u,null),k.flags|=2),k.return=l,m.return=l,m.sibling=k,l.child=m,pl(null,m),m=l.child,k=r.child.memoizedState,k===null?k=em(u):(y=k.cachePool,y!==null?(H=Oe._currentValue,y=y.parent!==H?{parent:H,pool:H}:y):y=Xv(),k={baseLanes:k.baseLanes|u,cachePool:y}),m.memoizedState=k,m.childLanes=sm(r,R,u),l.memoizedState=tm,pl(r.child,m)):(zi(l),u=r.child,r=u.sibling,u=ai(u,{mode:"visible",children:m.children}
vendor: 6,079 bytes, line 48
48),u.return=l,u.sibling=null,r!==null&&(R=l.deletions,R===null?(l.deletions=[r],l.flags|=16):R.push(r)),l.child=u,l.memoizedState=null,u)}function nm(r,l){return l=vu({mode:"visible",children:l},r.mode),l.return=r,r.child=l}function vu(r,l){return r=Os(22,r,null,l),r.lanes=0,r}function im(r,l,u){return Gr(l,r.child,null,u),r=nm(l,l.pendingProps.children),r.flags|=2,l.memoizedState=null,r}function ub(r,l,u){r.lanes|=l;var m=r.alternate;m!==null&&(m.lanes|=l),xh(r.return,l,u)}function rm(r,l,u,m,y,b){var R=r.memoizedState;R===null?r.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:y,treeForkCount:b}:(R.isBackwards=l,R.rendering=null,R.renderingStartTime=0,R.last=m,R.tail=u,R.tailMode=y,R.treeForkCount=b)}function db(r,l,u){var m=l.pendingProps,y=m.revealOrder,b=m.tail;m=m.children;var R=Re.current,k=(R&2)!==0;if(k?(R=R&1|2,l.flags|=128):R&=1,K(Re,R),Ze(r,l,m,u),m=Gt?sl:0,!k&&r!==null&&(r.flags&128)!==0)t:for(r=l.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ub(r,u,l);else if(r.tag===19)ub(r,u,l);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break t;for(;r.sibling===null;){if(r.return===null||r.return===l)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)r=u.alternate,r!==null&&au(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),rm(l,!1,y,u,b,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(r=y.alternate,r!==null&&au(r)===null){l.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}rm(l,!0,u,null,b,m);break;case"together":rm(l,!1,null,null,void 0,m);break;default:l.memoizedState=null}return l.child}function fi(r,l,u){if(r!==null&&(l.dependencies=r.dependencies),Wi|=l.lanes,(u&l.childLanes)===0)if(r!==null){if(Fa(r,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(r!==null&&l.child!==r.child)throw Error(n(153));if(l.child!==null){for(r=l.child,u=ai(r,r.pendingProps),l.child=u,u.return=l;r.sibling!==null;)r=r.sibling,u=u.sibling=ai(r,r.pendingProps),u.return=l;u.sibling=null}return l.child}function am(r,l){return(r.lanes&l)!==0?!0:(r=r.dependencies,!!(r!==null&&Zc(r)))}function bI(r,l,u){switch(l.tag){case 3:xt(l,l.stateNode.containerInfo),$i(l,Oe,r.memoizedState.cache),Br();break;case 27:case 5:Zt(l);break;case 4:xt(l,l.stateNode.containerInfo);break;case 10:$i(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Ih(l),null;break;case 13:var m=l.memoizedState;if(m!==null)return m.dehydrated!==null?(zi(l),l.flags|=128,null):(u&l.child.childLanes)!==0?cb(r,l,u):(zi(l),r=fi(r,l,u),r!==null?r.sibling:null);zi(l);break;case 19:var y=(r.flags&128)!==0;if(m=(u&l.childLanes)!==0,m||(Fa(r,l,u,!1),m=(u&l.childLanes)!==0),y){if(m)return db(r,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),K(Re,Re.current),m)break;return null;case 22:return l.lanes=0,nb(r,l,u,l.pendingProps);case 24:$i(l,Oe,r.memoizedState.cache)}return fi(r,l,u)}function fb(r,l,u){if(r!==null)if(r.memoizedProps!==l.pendingProps)Pe=!0;else{if(!am(r,u)&&(l.flags&128)===0)return Pe=!1,bI(r,l,u);Pe=(r.flags&131072)!==0}else Pe=!1,Gt&&(l.flags&1048576)!==0&&Hv(l,sl,l.index);switch(l.lanes=0,l.tag){case 16:t:{var m=l.pendingProps;if(r=$r(l.elementType),l.type=r,typeof r=="function")dh(r)?(m=zr(r,m),l.tag=1,l=ob(null,l,r,m,u)):(l.tag=0,l=Jh(null,l,r,m,u));else{if(r!=null){var y=r.$$typeof;if(y===P){l.tag=11,l=tb(null,l,r,m,u);break t}else if(y===C){l.tag=14,l=eb(null,l,r,m,u);break t}}throw l=it(r)||r,Error(n(306,l,""))}}return l;case 0:return Jh(r,l,l.type,l.pendingProps,u);case 1:return m=l.type,y=zr(m,l.pendingProps),ob(r,l,m,y,u);case 3:t:{if(xt(l,l.stateNode.containerInfo),r===null)throw Error(n(387));m=l.pendingProps;var b=l.memoizedState;y=b.element,wh(r,l),ul(l,m,null,u);var R=l.memoizedState;if(m=R.cache,$i(l,Oe,m),m!==b.cache&&bh(l,[Oe],u,!0),cl(),m=R.element,b.isDehydrated)if(b={element:m,isDehydrated:!1,cache:R.cache},l.updateQueue.baseState=b,l.memoizedState=b,l.flags&256){l=lb(r,l,m,u);break t}else if(m!==y){y=Js(Error(n(424)),l),nl(y),l=lb(r,l,m,u);break t}else{switch(r=l.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(ae=rn(r.firstChild),Qe=l,Gt=!0,Ui=null,sn=!0,u=nx(l,null,m,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Br(),m===y){l=fi(r,l,u);break t}Ze(r,l,m,u)}l=l.child}return l;case 26:return yu(r,l),r===null?(u=TS(l.type,null,l.pendingProps,null))?l.memoizedState=u:Gt||(u=l.type,r=l.pendingProps,m=Pu(ft.current).createElement(u),m[We]=l,m[vs]=r,Je(m,u,r),ze(m),l.stateNode=m):l.memoizedState=TS(l.type,r.memoizedProps,l.pendingProps,r.memoizedState),null;case 27:return Zt(l),r===null&&Gt&&(m=l.stateNode=bS(l.type,l.pendingProps,ft.current),Qe=l,sn=!0,y=ae,tr(l.type)?(Um=y,ae=rn(m.firstChild)):ae=y),Ze(r,l,l.pendingProps.children,u),yu(r,l),r===null&&(l.flags|=4194304),l.child;case 5:return r===null&&Gt&&((y=m=ae)&&(m=QI(m,l.type,l.pendingProps,sn),m!==null?(l.stateNode=m,Qe=l,ae=rn(m.firstChild),sn=!1,y=!0):y=!1),y||ji(l)),Zt(l),y=l.type,b=l.pendingProps,R=r!==null?r.memoizedProps:null,m=b.children,Pm(y,b)?m=null:R!==null&&Pm(y,R)&&(l.flags|=32),l.memoizedState!==null&&(y=kh(r,l,dI,null,null,u),Dl._currentValue=y),yu(r,l),Ze(r,l,m,u),l.child;case 6:return r===null&&Gt&&((r=u=ae)&&(u=XI(u,l.pendingProps,sn),u!==null?(l.stateNode=u,Qe=l,ae=null,r=!0):r=!1),r||ji(l)),null;case 13:return cb(r,l,u);case 4:return xt(l,l.stateNode.containerInfo),m=l.pendingProps,r===null?l.child=Gr(l,null,m,u):Ze(r,l,m,u),l.child;case 11:return tb(r,l,l.type,l.pendingProps,u);case 7:return Ze(r,l,l.pendingProps,u),l.child;case 8:return Ze(r,l,l.pendingProps.children,u),l.child;case 12:return Ze(r,l,l.pendingProps.children,u),l.child;case 10:return m=l.pendingProps,$i(l,l.type,m.value),Ze(r,l,m.children,u),l.child;case 9:return y=l.type._context,m=l.pendingProps.children,Ur(l),y=Xe(y),m=m(y),l.flags|=1,Ze(r,l,m,u),l.child;
vendor: 4,917 bytes, line 48
48case 14:return eb(r,l,l.type,l.pendingProps,u);case 15:return sb(r,l,l.type,l.pendingProps,u);case 19:return db(r,l,u);case 31:return xI(r,l,u);case 22:return nb(r,l,u,l.pendingProps);case 24:return Ur(l),m=Xe(Oe),r===null?(y=Th(),y===null&&(y=ne,b=Sh(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=u),y=b),l.memoizedState={parent:m,cache:y},Rh(l),$i(l,Oe,y)):((r.lanes&u)!==0&&(wh(r,l),ul(l,null,null,u),cl()),y=r.memoizedState,b=l.memoizedState,y.parent!==m?(y={parent:m,cache:m},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),$i(l,Oe,m)):(m=b.cache,$i(l,Oe,m),m!==y.cache&&bh(l,[Oe],u,!0))),Ze(r,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(n(156,l.tag))}function hi(r){r.flags|=4}function om(r,l,u,m,y){if((l=(r.mode&32)!==0)&&(l=!1),l){if(r.flags|=16777216,(y&335544128)===y)if(r.stateNode.complete)r.flags|=8192;else if(Ub())r.flags|=8192;else throw Vr=su,Ah}else r.flags&=-16777217}function hb(r,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!_S(l))if(Ub())r.flags|=8192;else throw Vr=su,Ah}function xu(r,l){l!==null&&(r.flags|=4),r.flags&16384&&(l=r.tag!==22?rs():536870912,r.lanes|=l,Qa|=l)}function gl(r,l){if(!Gt)switch(r.tailMode){case"hidden":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function oe(r){var l=r.alternate!==null&&r.alternate.child===r.child,u=0,m=0;if(l)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=m,r.childLanes=u,l}function SI(r,l,u){var m=l.pendingProps;switch(ph(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return oe(l),null;case 1:return oe(l),null;case 3:return u=l.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),l.memoizedState.cache!==m&&(l.flags|=2048),ci(Oe),wt(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Ba(l)?hi(l):r===null||r.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,yh())),oe(l),null;case 26:var y=l.type,b=l.memoizedState;return r===null?(hi(l),b!==null?(oe(l),hb(l,b)):(oe(l),om(l,y,null,m,u))):b?b!==r.memoizedState?(hi(l),oe(l),hb(l,b)):(oe(l),l.flags&=-16777217):(r=r.memoizedProps,r!==m&&hi(l),oe(l),om(l,y,r,m,u)),null;case 27:if(fe(l),u=ft.current,y=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==m&&hi(l);else{if(!m){if(l.stateNode===null)throw Error(n(166));return oe(l),null}r=J.current,Ba(l)?Kv(l):(r=bS(y,m,u),l.stateNode=r,hi(l))}return oe(l),null;case 5:if(fe(l),y=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==m&&hi(l);else{if(!m){if(l.stateNode===null)throw Error(n(166));return oe(l),null}if(b=J.current,Ba(l))Kv(l);else{var R=Pu(ft.current);switch(b){case 1:b=R.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=R.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=R.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof m.is=="string"?R.createElement("select",{is:m.is}):R.createElement("select"),m.multiple?b.multiple=!0:m.size&&(b.size=m.size);break;default:b=typeof m.is=="string"?R.createElement(y,{is:m.is}):R.createElement(y)}}b[We]=l,b[vs]=m;t:for(R=l.child;R!==null;){if(R.tag===5||R.tag===6)b.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===l)break t;for(;R.sibling===null;){if(R.return===null||R.return===l)break t;R=R.return}R.sibling.return=R.return,R=R.sibling}l.stateNode=b;t:switch(Je(b,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break t;case"img":m=!0;break t;default:m=!1}m&&hi(l)}}return oe(l),om(l,l.type,r===null?null:r.memoizedProps,l.pendingProps,u),null;case 6:if(r&&l.stateNode!=null)r.memoizedProps!==m&&hi(l);else{if(typeof m!="string"&&l.stateNode===null)throw Error(n(166));if(r=ft.current,Ba(l)){if(r=l.stateNode,u=l.memoizedProps,m=null,y=Qe,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}r[We]=l,r=!!(r.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||cS(r.nodeValue,u)),r||ji(l,!0)}else r=Pu(r).createTextNode(m),r[We]=l,l.stateNode=r}return oe(l),null;case 31:if(u=l.memoizedState,r===null||r.memoizedState!==null){if(m=Ba(l),u!==null){if(r===null){if(!m)throw Error(n(318));if(r=l.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(557)
vendor: 15,937 bytes, line 48
48);r[We]=l}else Br(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;oe(l),r=!1}else u=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return l.flags&256?(Ps(l),l):(Ps(l),null);if((l.flags&128)!==0)throw Error(n(558))}return oe(l),null;case 13:if(m=l.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=Ba(l),m!==null&&m.dehydrated!==null){if(r===null){if(!y)throw Error(n(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(n(317));y[We]=l}else Br(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;oe(l),y=!1}else y=yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Ps(l),l):(Ps(l),null)}return Ps(l),(l.flags&128)!==0?(l.lanes=u,l):(u=m!==null,r=r!==null&&r.memoizedState!==null,u&&(m=l.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),b=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(b=m.memoizedState.cachePool.pool),b!==y&&(m.flags|=2048)),u!==r&&u&&(l.child.flags|=8192),xu(l,l.updateQueue),oe(l),null);case 4:return wt(),r===null&&Cm(l.stateNode.containerInfo),oe(l),null;case 10:return ci(l.type),oe(l),null;case 19:if(G(Re),m=l.memoizedState,m===null)return oe(l),null;if(y=(l.flags&128)!==0,b=m.rendering,b===null)if(y)gl(m,!1);else{if(be!==0||r!==null&&(r.flags&128)!==0)for(r=l.child;r!==null;){if(b=au(r),b!==null){for(l.flags|=128,gl(m,!1),r=b.updateQueue,l.updateQueue=r,xu(l,r),l.subtreeFlags=0,r=u,u=l.child;u!==null;)$v(u,r),u=u.sibling;return K(Re,Re.current&1|2),Gt&&oi(l,m.treeForkCount),l.child}r=r.sibling}m.tail!==null&&Ie()>Au&&(l.flags|=128,y=!0,gl(m,!1),l.lanes=4194304)}else{if(!y)if(r=au(b),r!==null){if(l.flags|=128,y=!0,r=r.updateQueue,l.updateQueue=r,xu(l,r),gl(m,!0),m.tail===null&&m.tailMode==="hidden"&&!b.alternate&&!Gt)return oe(l),null}else 2*Ie()-m.renderingStartTime>Au&&u!==536870912&&(l.flags|=128,y=!0,gl(m,!1),l.lanes=4194304);m.isBackwards?(b.sibling=l.child,l.child=b):(r=m.last,r!==null?r.sibling=b:l.child=b,m.last=b)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=Ie(),r.sibling=null,u=Re.current,K(Re,y?u&1|2:u&1),Gt&&oi(l,m.treeForkCount),r):(oe(l),null);case 22:case 23:return Ps(l),Dh(),m=l.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(l.flags|=8192):m&&(l.flags|=8192),m?(u&536870912)!==0&&(l.flags&128)===0&&(oe(l),l.subtreeFlags&6&&(l.flags|=8192)):oe(l),u=l.updateQueue,u!==null&&xu(l,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==u&&(l.flags|=2048),r!==null&&G(jr),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),ci(Oe),oe(l),null;case 25:return null;case 30:return null}throw Error(n(156,l.tag))}function EI(r,l){switch(ph(l),l.tag){case 1:return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 3:return ci(Oe),wt(),r=l.flags,(r&65536)!==0&&(r&128)===0?(l.flags=r&-65537|128,l):null;case 26:case 27:case 5:return fe(l),null;case 31:if(l.memoizedState!==null){if(Ps(l),l.alternate===null)throw Error(n(340));Br()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 13:if(Ps(l),r=l.memoizedState,r!==null&&r.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Br()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 19:return G(Re),null;case 4:return wt(),null;case 10:return ci(l.type),null;case 22:case 23:return Ps(l),Dh(),r!==null&&G(jr),r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 24:return ci(Oe),null;case 25:return null;default:return null}}function mb(r,l){switch(ph(l),l.tag){case 3:ci(Oe),wt();break;case 26:case 27:case 5:fe(l);break;case 4:wt();break;case 31:l.memoizedState!==null&&Ps(l);break;case 13:Ps(l);break;case 19:G(Re);break;case 10:ci(l.type);break;case 22:case 23:Ps(l),Dh(),r!==null&&G(jr);break;case 24:ci(Oe)}}function yl(r,l){try{var u=l.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var y=m.next;u=y;do{if((u.tag&r)===r){m=void 0;var b=u.create,R=u.inst;m=b(),R.destroy=m}u=u.next}while(u!==y)}}catch(k){Wt(l,l.return,k)}}function qi(r,l,u){try{var m=l.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var b=y.next;m=b;do{if((m.tag&r)===r){var R=m.inst,k=R.destroy;if(k!==void 0){R.destroy=void 0,y=l;var H=u,et=k;try{et()}catch(lt){Wt(y,H,lt)}}}m=m.next}while(m!==b)}}catch(lt){Wt(l,l.return,lt)}}function pb(r){var l=r.updateQueue;if(l!==null){var u=r.stateNode;try{rx(l,u)}catch(m){Wt(r,r.return,m)}}}function gb(r,l,u){u.props=zr(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(m){Wt(r,l,m)}}function vl(r,l){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var m=r.stateNode;break;case 30:m=r.stateNode;break;default:m=r.stateNode}typeof u=="function"?r.refCleanup=u(m):u.current=m}}catch(y){Wt(r,l,y)}}function Pn(r,l){var u=r.ref,m=r.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(y){Wt(r,l,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Wt(r,l,y)}else u.current=null}function yb(r){var l=r.type,u=r.memoizedProps,m=r.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break t;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(y){Wt(r,r.return,y)}}function lm(r,l,u){try{var m=r.stateNode;HI(m,r.type,u,l),m[vs]=l}catch(y){Wt(r,r.return,y)}}function vb(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&tr(r.type)||r.tag===4}function cm(r){t:for(;;){for(;r.sibling===null;){if(r.return===null||vb(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&tr(r.type)||r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function um(r,l,u){var m=r.tag;if(m===5||m===6)r=r.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(r),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=ii));else if(m!==4&&(m===27&&tr(r.type)&&(u=r.stateNode,l=null),r=r.child,r!==null))for(um(r,l,u),r=r.sibling;r!==null;)um(r,l,u),r=r.sibling}function bu(r,l,u){var m=r.tag;if(m===5||m===6)r=r.stateNode,l?u.insertBefore(r,l):u.appendChild(r);else if(m!==4&&(m===27&&tr(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(bu(r,l,u),r=r.sibling;r!==null;)bu(r,l,u),r=r.sibling}function xb(r){var l=r.stateNode,u=r.memoizedProps;try{for(var m=r.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Je(l,m,u),l[We]=r,l[vs]=u}catch(b){Wt(r,r.return,b)}}var mi=!1,Me=!1,dm=!1,bb=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function TI(r,l){if(r=r.containerInfo,Om=$u,r=Ov(r),ih(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else t:{u=(u=r.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var y=m.anchorOffset,b=m.focusNode;m=m.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break t}var R=0,k=-1,H=-1,et=0,lt=0,dt=r,st=null;e:for(;;){for(var at;dt!==u||y!==0&&dt.nodeType!==3||(k=R+y),dt!==b||m!==0&&dt.nodeType!==3||(H=R+m),dt.nodeType===3&&(R+=dt.nodeValue.length),(at=dt.firstChild)!==null;)st=dt,dt=at;for(;;){if(dt===r)break e;if(st===u&&++et===y&&(k=R),st===b&&++lt===m&&(H=R),(at=dt.nextSibling)!==null)break;dt=st,st=dt.parentNode}dt=at}u=k===-1||H===-1?null:{start:k,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(km={focusedElem:r,selectionRange:u},$u=!1,Ke=l;Ke!==null;)if(l=Ke,r=l.child,(l.subtreeFlags&1028)!==0&&r!==null)r.return=l,Ke=r;else for(;Ke!==null;){switch(l=Ke,b=l.alternate,r=l.flags,l.tag){case 0:if((r&4)!==0&&(r=l.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)y=r[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&b!==null){r=void 0,u=l,y=b.memoizedProps,b=b.memoizedState,m=u.stateNode;try{var vt=zr(u.type,y);r=m.getSnapshotBeforeUpdate(vt,b),m.__reactInternalSnapshotBeforeUpdate=r}catch(Rt){Wt(u,u.return,Rt)}}break;case 3:if((r&1024)!==0){if(r=l.stateNode.containerInfo,u=r.nodeType,u===9)Nm(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Nm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(n(163))}if(r=l.sibling,r!==null){r.return=l.return,Ke=r;break}Ke=l.return}}function Sb(r,l,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:gi(r,u),m&4&&yl(5,u);break;case 1:if(gi(r,u),m&4)if(r=u.stateNode,l===null)try{r.componentDidMount()}catch(R){Wt(u,u.return,R)}else{var y=zr(u.type,l.memoizedProps);l=l.memoizedState;try{r.componentDidUpdate(y,l,r.__reactInternalSnapshotBeforeUpdate)}catch(R){Wt(u,u.return,R)}}m&64&&pb(u),m&512&&vl(u,u.return);break;case 3:if(gi(r,u),m&64&&(r=u.updateQueue,r!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{rx(r,l)}catch(R){Wt(u,u.return,R)}}break;case 27:l===null&&m&4&&xb(u);case 26:case 5:gi(r,u),l===null&&m&4&&yb(u),m&512&&vl(u,u.return);break;case 12:gi(r,u);break;case 31:gi(r,u),m&4&&Ab(r,u);break;case 13:gi(r,u),m&4&&Rb(r,u),m&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=OI.bind(null,u),ZI(r,u))));break;case 22:if(m=u.memoizedState!==null||mi,!m){l=l!==null&&l.memoizedState!==null||Me,y=mi;var b=Me;mi=m,(Me=l)&&!b?yi(r,u,(u.subtreeFlags&8772)!==0):gi(r,u),mi=y,Me=b}break;case 30:break;default:gi(r,u)}}function Eb(r){var l=r.alternate;l!==null&&(r.alternate=null,Eb(l)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(l=r.stateNode,l!==null&&$f(l)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var ue=null,bs=!1;function pi(r,l,u){for(u=u.child;u!==null;)Tb(r,l,u),u=u.sibling}function Tb(r,l,u){if(us&&typeof us.onCommitFiberUnmount=="function")try{us.onCommitFiberUnmount(_r,u)}catch{}switch(u.tag){case 26:Me||Pn(u,l),pi(r,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Me||Pn(u,l);var m=ue,y=bs;tr(u.type)&&(ue=u.stateNode,bs=!1),pi(r,l,u),Ll(u.stateNode),ue=m,bs=y;break;case 5:Me||Pn(u,l);case 6:if(m=ue,y=bs,ue=null,pi(r,l,u),ue=m,bs=y,ue!==null)if(bs)try{(ue.nodeType===9?ue.body:ue.nodeName==="HTML"?ue.ownerDocument.body:ue).removeChild(u.stateNode)}catch(b){Wt(u,l,b)}else try{ue.removeChild(u.stateNode)}catch(b){Wt(u,l,b)}break;case 18:ue!==null&&(bs?(r=ue,pS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),io(r)):pS(ue,u.stateNode));break;case 4:m=ue,y=bs,ue=u.stateNode.containerInfo,bs=!0,pi(r,l,u),ue=m,bs=y;break;case 0:case 11:case 14:case 15:qi(2,u,l),Me||qi(4,u,l),pi(r,l,u);break;case 1:Me||(Pn(u,l),m=u.stateNode,typeof m.componentWillUnmount=="function"&&gb(u,l,m)),pi(r,l,u);break;case 21:pi(r,l,u);break;case 22:Me=(m=Me)||u.memoizedState!==null,pi(r,l,u),Me=m;break;default:pi(r,l,u)}}function Ab(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{io(r)}catch(u){Wt(l,l.return,u)}}}function Rb(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{io(r)}catch(u){Wt(l,l.return,u)}}function AI(r){switch(r.tag){case 31:case 13:case 19:var l=r.stateNode;return l===null&&(l=r.stateNode=new bb),l;case 22:return r=r.stateNode,l=r._retryCache,l===null&&(l=r._retryCache=new bb),l;default:throw Error(n(435,r.tag))}}function Su(r,l){var u=AI(r);l.forEach(function(m){if(!u.has(m)){u.add(m);var y=kI.bind(null,r,m);m.then(y,y)}})}function Ss(r,l){var u=l.deletions;if(u!==null)for(var m=0;m<u.length;m++){var y=u[m],b=r,R=l,k=R;t:for(;k!==null;){switch(k.tag){case 27:if(tr(k.type)){ue=k.stateNode,bs=!1;break t}break;case 5:ue=k.stateNode,bs=!1;break t;case 3:case 4:ue=k.stateNode.containerInfo,bs=!0;break t}k=k.return}if(ue===null)throw Error(n(160));Tb(b,R,y),ue=null,bs=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)wb(l,r),l=l.sibling}var xn=null;function wb(r,l){var u=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Ss(l,r),Es(r),m&4&&(qi(3,r,r.return),yl(3,r),qi(5,r,r.return));break;case 1:Ss(l,r),Es(r),m&512&&(Me||u===null||Pn(u,u.return)),m&64&&mi&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var y=xn;if(Ss(l,r),Es(r),m&512&&(Me||u===null||Pn(u,u.return)),m&4){var b=u!==null?u.memoizedState:null;if(m=r.memoizedState,u===null)if(m===null)if(r.stateNode===null){t:{m=r.type,u=r.memoizedProps,y=y.ownerDocument||y;e:switch(m){case"title":b=y.getElementsByTagName("title")[0],(!b||b[zo]||b[We]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(m),y.head.insertBefore(b,y.querySelector("head > title"))),Je(b,m,u),b[We]=r,ze(b),m=b;break t;case"link":var R=wS("link","href",y).get(m+(u.href||""));if(R){for(var k=0;k<R.length;k++)if(b=R[k],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){R.splice(k,1);break e}}b=y.createElement(m),Je(b,m,u),y.head.appendChild(b);break;case"meta":if(R=wS("meta","content",y).get(m+(u.content||""))){for(k=0;k<R.length;k++)if(b=R[k],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){R.splice(k,1);break e}}b=y.createElement(m),Je(b,m,u),y.head.appendChild(b);break;default:throw Error(n(468,m))}b[We]=r,ze(b),m=b}r.stateNode=m}else LS(y,r.type,r.stateNode);else r.stateNode=RS(y,m,r.memoizedProps);else b!==m?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,m===null?LS(y,r.type,r.stateNode):RS(y,m,r.memoizedProps)):m===null&&r.stateNode!==null&&lm(r,r.memoizedProps,u.memoizedProps)}break;case 27:Ss(l,r),Es(r),m&512&&(Me||u===null||Pn(u,u.return)),u!==null&&m&4&&lm(r,r.memoizedProps,u.memoizedProps);break;case 5:if(Ss(l,r),Es(r),m&512&&(Me||u===null||Pn(u,u.return)),r.flags&32){y=r.stateNode;try{La(y,"")}catch(vt){Wt(r,r.return,vt)}}m&4&&r.stateNode!=null&&(y=r.memoizedProps,lm(r,y,u!==null?u.memoizedProps:y)),m&1024&&(dm=!0);break;case 6:if(Ss(l,r),Es(r),m&4){if(r.stateNode===null)throw Error(n(162));m=r.memoizedProps,u=r.stateNode;try{u.nodeValue=m}catch(vt){Wt(r,r.return,vt)}}break;case 3:if(Bu=null,y=xn,xn=Mu(l.containerInfo),Ss(l,r),xn=y,Es(r),m&4&&u!==null&&u.memoizedState.isDehydrated)try{io(l.containerInfo)}catch(vt){Wt(r,r.return,vt)}dm&&(dm=!1,Lb(r));break;case 4:m=xn,xn=Mu(r.stateNode.containerInfo),Ss(l,r),Es(r),xn=m;break;case 12:Ss(l,r),Es(r);break;case 31:Ss(l,r),Es(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,Su(r,m)));break;case 13:Ss(l,r),Es(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Tu=Ie()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,Su(r,m)));break;case 22:y=r.memoizedState!==null;var H=u!==null&&u.memoizedState!==null,et=mi,lt=Me;if(mi=et||y,Me=lt||H,Ss(l,r),Me=lt,mi=et,Es(r),m&8192)t:for(l=r.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||H||mi||Me||Kr(r)),u=null,l=r;;
vendor: 10,034 bytes, line 48
48){if(l.tag===5||l.tag===26){if(u===null){H=u=l;try{if(b=H.stateNode,y)R=b.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{k=H.stateNode;var dt=H.memoizedProps.style,st=dt!=null&&dt.hasOwnProperty("display")?dt.display:null;k.style.display=st==null||typeof st=="boolean"?"":(""+st).trim()}}catch(vt){Wt(H,H.return,vt)}}}else if(l.tag===6){if(u===null){H=l;try{H.stateNode.nodeValue=y?"":H.memoizedProps}catch(vt){Wt(H,H.return,vt)}}}else if(l.tag===18){if(u===null){H=l;try{var at=H.stateNode;y?gS(at,!0):gS(H.stateNode,!1)}catch(vt){Wt(H,H.return,vt)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===r)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break t;for(;l.sibling===null;){if(l.return===null||l.return===r)break t;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}m&4&&(m=r.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,Su(r,u))));break;case 19:Ss(l,r),Es(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,Su(r,m)));break;case 30:break;case 21:break;default:Ss(l,r),Es(r)}}function Es(r){var l=r.flags;if(l&2){try{for(var u,m=r.return;m!==null;){if(vb(m)){u=m;break}m=m.return}if(u==null)throw Error(n(160));switch(u.tag){case 27:var y=u.stateNode,b=cm(r);bu(r,b,y);break;case 5:var R=u.stateNode;u.flags&32&&(La(R,""),u.flags&=-33);var k=cm(r);bu(r,k,R);break;case 3:case 4:var H=u.stateNode.containerInfo,et=cm(r);um(r,et,H);break;default:throw Error(n(161))}}catch(lt){Wt(r,r.return,lt)}r.flags&=-3}l&4096&&(r.flags&=-4097)}function Lb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var l=r;Lb(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),r=r.sibling}}function gi(r,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Sb(r,l.alternate,l),l=l.sibling}function Kr(r){for(r=r.child;r!==null;){var l=r;switch(l.tag){case 0:case 11:case 14:case 15:qi(4,l,l.return),Kr(l);break;case 1:Pn(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&gb(l,l.return,u),Kr(l);break;case 27:Ll(l.stateNode);case 26:case 5:Pn(l,l.return),Kr(l);break;case 22:l.memoizedState===null&&Kr(l);break;case 30:Kr(l);break;default:Kr(l)}r=r.sibling}}function yi(r,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var m=l.alternate,y=r,b=l,R=b.flags;switch(b.tag){case 0:case 11:case 15:yi(y,b,u),yl(4,b);break;case 1:if(yi(y,b,u),m=b,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(et){Wt(m,m.return,et)}if(m=b,y=m.updateQueue,y!==null){var k=m.stateNode;try{var H=y.shared.hiddenCallbacks;if(H!==null)for(y.shared.hiddenCallbacks=null,y=0;y<H.length;y++)ix(H[y],k)}catch(et){Wt(m,m.return,et)}}u&&R&64&&pb(b),vl(b,b.return);break;case 27:xb(b);case 26:case 5:yi(y,b,u),u&&m===null&&R&4&&yb(b),vl(b,b.return);break;case 12:yi(y,b,u);break;case 31:yi(y,b,u),u&&R&4&&Ab(y,b);break;case 13:yi(y,b,u),u&&R&4&&Rb(y,b);break;case 22:b.memoizedState===null&&yi(y,b,u),vl(b,b.return);break;case 30:break;default:yi(y,b,u)}l=l.sibling}}function fm(r,l){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&il(u))}function hm(r,l){r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&il(r))}function bn(r,l,u,m){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)_b(r,l,u,m),l=l.sibling}function _b(r,l,u,m){var y=l.flags;switch(l.tag){case 0:case 11:case 15:bn(r,l,u,m),y&2048&&yl(9,l);break;case 1:bn(r,l,u,m);break;case 3:bn(r,l,u,m),y&2048&&(r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&il(r)));break;case 12:if(y&2048){bn(r,l,u,m),r=l.stateNode;try{var b=l.memoizedProps,R=b.id,k=b.onPostCommit;typeof k=="function"&&k(R,l.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(H){Wt(l,l.return,H)}}else bn(r,l,u,m);break;case 31:bn(r,l,u,m);break;case 13:bn(r,l,u,m);break;case 23:break;case 22:b=l.stateNode,R=l.alternate,l.memoizedState!==null?b._visibility&2?bn(r,l,u,m):xl(r,l):b._visibility&2?bn(r,l,u,m):(b._visibility|=2,qa(r,l,u,m,(l.subtreeFlags&10256)!==0||!1)),y&2048&&fm(R,l);break;case 24:bn(r,l,u,m),y&2048&&hm(l.alternate,l);break;default:bn(r,l,u,m)}}function qa(r,l,u,m,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var b=r,R=l,k=u,H=m,et=R.flags;switch(R.tag){case 0:case 11:case 15:qa(b,R,k,H,y),yl(8,R);break;case 23:break;case 22:var lt=R.stateNode;R.memoizedState!==null?lt._visibility&2?qa(b,R,k,H,y):xl(b,R):(lt._visibility|=2,qa(b,R,k,H,y)),y&&et&2048&&fm(R.alternate,R);break;case 24:qa(b,R,k,H,y),y&&et&2048&&hm(R.alternate,R);break;default:qa(b,R,k,H,y)}l=l.sibling}}function xl(r,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=r,m=l,y=m.flags;switch(m.tag){case 22:xl(u,m),y&2048&&fm(m.alternate,m);break;case 24:xl(u,m),y&2048&&hm(m.alternate,m);break;default:xl(u,m)}l=l.sibling}}var bl=8192;function Ya(r,l,u){if(r.subtreeFlags&bl)for(r=r.child;r!==null;)Cb(r,l,u),r=r.sibling}function Cb(r,l,u){switch(r.tag){case 26:Ya(r,l,u),r.flags&bl&&r.memoizedState!==null&&uO(u,xn,r.memoizedState,r.memoizedProps);break;case 5:Ya(r,l,u);break;case 3:case 4:var m=xn;xn=Mu(r.stateNode.containerInfo),Ya(r,l,u),xn=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=bl,bl=16777216,Ya(r,l,u),bl=m):Ya(r,l,u));break;default:Ya(r,l,u)}}function Db(r){var l=r.alternate;if(l!==null&&(r=l.child,r!==null)){l.child=null;do l=r.sibling,r.sibling=null,r=l;while(r!==null)}}function Sl(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];Ke=m,Ob(m,r)}Db(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ib(r),r=r.sibling}function Ib(r){switch(r.tag){case 0:case 11:case 15:Sl(r),r.flags&2048&&qi(9,r,r.return);break;case 3:Sl(r);break;case 12:Sl(r);break;case 22:var l=r.stateNode;r.memoizedState!==null&&l._visibility&2&&(r.return===null||r.return.tag!==13)?(l._visibility&=-3,Eu(r)):Sl(r);break;default:Sl(r)}}function Eu(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];Ke=m,Ob(m,r)}Db(r)}for(r=r.child;r!==null;){switch(l=r,l.tag){case 0:case 11:case 15:qi(8,l,l.return),Eu(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Eu(l));break;default:Eu(l)}r=r.sibling}}function Ob(r,l){for(;Ke!==null;){var u=Ke;switch(u.tag){case 0:case 11:case 15:qi(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:il(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,Ke=m;else t:for(u=r;Ke!==null;){m=Ke;var y=m.sibling,b=m.return;if(Eb(m),m===u){Ke=null;break t}if(y!==null){y.return=b,Ke=y;break t}Ke=b}}}var RI={getCacheForType:function(r){var l=Xe(Oe),u=l.data.get(r);return u===void 0&&(u=r(),l.data.set(r,u)),u},cacheSignal:function(){return Xe(Oe).controller.signal}},wI=typeof WeakMap=="function"?WeakMap:Map,qt=0,ne=null,Ut=null,$t=0,Yt=0,Ms=null,Yi=!1,Wa=!1,mm=!1,vi=0,be=0,Wi=0,qr=0,pm=0,Ns=0,Qa=0,El=null,Ts=null,gm=!1,Tu=0,kb=0,Au=1/0,Ru=null,Qi=null,Ue=0,Xi=null,Xa=null,xi=0,ym=0,vm=null,Pb=null,Tl=0,xm=null;function Bs(){return(qt&2)!==0&&$t!==0?$t&-$t:M.T!==null?Rm():Uf()}function Mb(){if(Ns===0)if(($t&536870912)===0||Gt){var r=xa;xa<<=1,(xa&3932160)===0&&(xa=262144),Ns=r}else Ns=536870912;return r=ks.current,r!==null&&(r.flags|=32),Ns}function As(r,l,u){(r===ne&&(Yt===2||Yt===9)||r.cancelPendingCommit!==null)&&(Za(r,0),Zi(r,$t,Ns,!1)),me(r,u),((qt&2)===0||r!==ne)&&(r===ne&&((qt&2)===0&&(qr|=u),be===4&&Zi(r,$t,Ns,!1)),Mn(r))}function Nb(r,l,u){if((qt&6)!==0)throw Error(n(327));var m=!u&&(l&127)===0&&(l&r.expiredLanes)===0||ce(r,l),y=m?CI(r,l):Sm(r,l,!0),b=m;do{if(y===0){Wa&&!m&&Zi(r,l,0,!1);break}else{if(u=r.current.alternate,b&&!LI(u)){y=Sm(r,l,!1),b=!1;continue}if(y===2){if(b=l,r.errorRecoveryDisabledLanes&b)var R=0;else R=r.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){l=R;t:{var k=r;y=El;var H=k.current.memoizedState.isDehydrated;if(H&&(Za(k,R).flags|=256),R=Sm(k,R,!1),R!==2){if(mm&&!H){k.errorRecoveryDisabledLanes|=b,qr|=b,y=4;break t}b=Ts,Ts=y,b!==null&&(Ts===null?Ts=b:Ts.push.apply(Ts,b))}y=R}if(b=!1,y!==2)continue}}if(y===1){Za(r,0),Zi(r,l,0,!0);break}t:{switch(m=r,b=y,b){case 0:case 1:throw Error(n(345));case 4:if((l&4194048)!==l)break;case 6:Zi(m,l,Ns,!Yi);break t;case 2:Ts=null;break;case 3:case 5:break;default:throw Error(n(329))}if((l&62914560)===l&&(y=Tu+300-Ie(),10<y)){if(Zi(m,l,Ns,!Yi),Ct(m,0,!0)!==0)break t;xi=l,m.timeoutHandle=hS(Bb.bind(null,m,u,Ts,Ru,gm,l,Ns,qr,Qa,Yi,b,"Throttled",-0,0),y);break t}Bb(m,u,Ts,Ru,gm,l,Ns,qr,Qa,Yi,b,null,-0,0)}}break}while(!0);Mn(r)}function Bb(r,l,u,m,y,b,R,k,H,et,lt,dt,st,at){if(r.timeoutHandle=-1,dt=l.subtreeFlags,dt&8192||(dt&16785408)===16785408){dt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ii},Cb(l,b,dt);var vt=(b&62914560)===b?Tu-Ie():(b&4194048)===b?kb-Ie():0;if(vt=dO(dt,vt),vt!==null){xi=b,r.cancelPendingCommit=vt(zb.bind(null,r,l,b,u,m,y,R,k,H,lt,dt,null,st,at)),Zi(r,b,R,!et);return}}zb(r,l,b,u,m,y,R,k,H)}function LI(r){for(var l=r;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var y=u[m],b=y.getSnapshot;y=y.value;try{if(!Is(b(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Zi(r,l,u,m){l&=~pm,l&=~qr,r.suspendedLanes|=l,r.pingedLanes&=~l,m&&(r.warmLanes|=l),m=r.expirationTimes;for(var y=l;0<y;){var b=31-is(y),R=1<<b;m[b]=-1,y&=~R}u!==0&&Dr(r,u,l)}function wu(){return(qt&6)===0?(Al(0),!1):!0}
vendor: 4,481 bytes, line 48
48function bm(){if(Ut!==null){if(Yt===0)var r=Ut.return;else r=Ut,li=Fr=null,Nh(r),Va=null,al=0,r=Ut;for(;r!==null;)mb(r.alternate,r),r=r.return;Ut=null}}function Za(r,l){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,qI(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),xi=0,bm(),ne=r,Ut=u=ai(r.current,null),$t=l,Yt=0,Ms=null,Yi=!1,Wa=ce(r,l),mm=!1,Qa=Ns=pm=qr=Wi=be=0,Ts=El=null,gm=!1,(l&8)!==0&&(l|=l&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=l;0<m;){var y=31-is(m),b=1<<y;l|=r[y],m&=~b}return vi=l,qc(),u}function Fb(r,l){Ot=null,M.H=ml,l===$a||l===eu?(l=tx(),Yt=3):l===Ah?(l=tx(),Yt=4):Yt=l===Zh?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ms=l,Ut===null&&(be=1,pu(r,Js(l,r.current)))}function Ub(){var r=ks.current;return r===null?!0:($t&4194048)===$t?nn===null:($t&62914560)===$t||($t&536870912)!==0?r===nn:!1}function jb(){var r=M.H;return M.H=ml,r===null?ml:r}function $b(){var r=M.A;return M.A=RI,r}function Lu(){be=4,Yi||($t&4194048)!==$t&&ks.current!==null||(Wa=!0),(Wi&134217727)===0&&(qr&134217727)===0||ne===null||Zi(ne,$t,Ns,!1)}function Sm(r,l,u){var m=qt;qt|=2;var y=jb(),b=$b();(ne!==r||$t!==l)&&(Ru=null,Za(r,l)),l=!1;var R=be;t:do try{if(Yt!==0&&Ut!==null){var k=Ut,H=Ms;switch(Yt){case 8:bm(),R=6;break t;case 3:case 2:case 9:case 6:ks.current===null&&(l=!0);var et=Yt;if(Yt=0,Ms=null,Ja(r,k,H,et),u&&Wa){R=0;break t}break;default:et=Yt,Yt=0,Ms=null,Ja(r,k,H,et)}}_I(),R=be;break}catch(lt){Fb(r,lt)}while(!0);return l&&r.shellSuspendCounter++,li=Fr=null,qt=m,M.H=y,M.A=b,Ut===null&&(ne=null,$t=0,qc()),R}function _I(){for(;Ut!==null;)Vb(Ut)}function CI(r,l){var u=qt;qt|=2;var m=jb(),y=$b();ne!==r||$t!==l?(Ru=null,Au=Ie()+500,Za(r,l)):Wa=ce(r,l);t:do try{if(Yt!==0&&Ut!==null){l=Ut;var b=Ms;e:switch(Yt){case 1:Yt=0,Ms=null,Ja(r,l,b,1);break;case 2:case 9:if(Zv(b)){Yt=0,Ms=null,Gb(l);break}l=function(){Yt!==2&&Yt!==9||ne!==r||(Yt=7),Mn(r)},b.then(l,l);break t;case 3:Yt=7;break t;case 4:Yt=5;break t;case 7:Zv(b)?(Yt=0,Ms=null,Gb(l)):(Yt=0,Ms=null,Ja(r,l,b,7));break;case 5:var R=null;switch(Ut.tag){case 26:R=Ut.memoizedState;case 5:case 27:var k=Ut;if(R?_S(R):k.stateNode.complete){Yt=0,Ms=null;var H=k.sibling;if(H!==null)Ut=H;else{var et=k.return;et!==null?(Ut=et,_u(et)):Ut=null}break e}}Yt=0,Ms=null,Ja(r,l,b,5);break;case 6:Yt=0,Ms=null,Ja(r,l,b,6);break;case 8:bm(),be=6;break t;default:throw Error(n(462))}}DI();break}catch(lt){Fb(r,lt)}while(!0);return li=Fr=null,M.H=m,M.A=y,qt=u,Ut!==null?0:(ne=null,$t=0,qc(),be)}function DI(){for(;Ut!==null&&!he();)Vb(Ut)}function Vb(r){var l=fb(r.alternate,r,vi);r.memoizedProps=r.pendingProps,l===null?_u(r):Ut=l}function Gb(r){var l=r,u=l.alternate;switch(l.tag){case 15:case 0:l=ab(u,l,l.pendingProps,l.type,void 0,$t);break;case 11:l=ab(u,l,l.pendingProps,l.type.render,l.ref,$t);break;case 5:Nh(l);default:mb(u,l),l=Ut=$v(l,vi),l=fb(u,l,vi)}r.memoizedProps=r.pendingProps,l===null?_u(r):Ut=l}function Ja(r,l,u,m){li=Fr=null,Nh(l),Va=null,al=0;var y=l.return;try{if(vI(r,y,l,u,$t)){be=1,pu(r,Js(u,r.current)),Ut=null;return}}catch(b){if(y!==null)throw Ut=y,b;be=1,pu(r,Js(u,r.current)),Ut=null;return}l.flags&32768?(Gt||m===1?r=!0:Wa||($t&536870912)!==0?r=!1:(Yi=r=!0,(m===2||m===9||m===3||m===6)&&(m=ks.current,m!==null&&m.tag===13&&(m.flags|=16384))),Hb(l,r)):_u(l)}function _u(r){var l=r;do{if((l.flags&32768)!==0){Hb(l,Yi);return}r=l.return;var u=SI(l.alternate,l,vi);if(u!==null){Ut=u;return}if(l=l.sibling,l!==null){Ut=l;return}Ut=l=r}while(l!==null);be===0&&(be=5)}function Hb(r,l){do{var u=EI(r.alternate,r);if(u!==null){u.flags&=32767,Ut=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(r=r.sibling,r!==null)){Ut=r;return}Ut=r=u}while(r!==null);be=6,Ut=null}function zb(r,l,u,m,y,b,R,k,H){r.cancelPendingCommit=null;do Cu();while(Ue!==0);if((qt&6)!==0)throw Error(n(327));if(l!==null){if(l===r.current)throw Error(n(177));if(b=l.lanes|l.childLanes,b|=ch,ps(r,u,b,R,k,H),r===ne&&(Ut=ne=null,$t=0),Xa=l,Xi=r,xi=u,ym=b,vm=y,Pb=m,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,PI(si,function(){return Qb(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||m){m=M.T,M.T=null,y=j.p,j.p=2,R=qt,qt|=4;try{TI(r,l,u)}finally{qt=R,j.p=y,M.T=m}}Ue=1,Kb(),qb(),Yb()}}function Kb(){if(Ue===1){Ue=0;var r=Xi,l=Xa,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=M.T,M.T=null;var m=j.p;j.p=2;var y=qt;qt|=4;
vendor: 17,712 bytes, lines 48-49
48try{wb(l,r);var b=km,R=Ov(r.containerInfo),k=b.focusedElem,H=b.selectionRange;if(R!==k&&k&&k.ownerDocument&&Iv(k.ownerDocument.documentElement,k)){if(H!==null&&ih(k)){var et=H.start,lt=H.end;if(lt===void 0&&(lt=et),"selectionStart"in k)k.selectionStart=et,k.selectionEnd=Math.min(lt,k.value.length);else{var dt=k.ownerDocument||document,st=dt&&dt.defaultView||window;if(st.getSelection){var at=st.getSelection(),vt=k.textContent.length,Rt=Math.min(H.start,vt),ee=H.end===void 0?Rt:Math.min(H.end,vt);!at.extend&&Rt>ee&&(R=ee,ee=Rt,Rt=R);var W=Dv(k,Rt),q=Dv(k,ee);if(W&&q&&(at.rangeCount!==1||at.anchorNode!==W.node||at.anchorOffset!==W.offset||at.focusNode!==q.node||at.focusOffset!==q.offset)){var tt=dt.createRange();tt.setStart(W.node,W.offset),at.removeAllRanges(),Rt>ee?(at.addRange(tt),at.extend(q.node,q.offset)):(tt.setEnd(q.node,q.offset),at.addRange(tt))}}}}for(dt=[],at=k;at=at.parentNode;)at.nodeType===1&&dt.push({element:at,left:at.scrollLeft,top:at.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<dt.length;k++){var ut=dt[k];ut.element.scrollLeft=ut.left,ut.element.scrollTop=ut.top}}$u=!!Om,km=Om=null}finally{qt=y,j.p=m,M.T=u}}r.current=l,Ue=2}}function qb(){if(Ue===2){Ue=0;var r=Xi,l=Xa,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=M.T,M.T=null;var m=j.p;j.p=2;var y=qt;qt|=4;try{Sb(r,l.alternate,l)}finally{qt=y,j.p=m,M.T=u}}Ue=3}}function Yb(){if(Ue===4||Ue===3){Ue=0,pn();var r=Xi,l=Xa,u=xi,m=Pb;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Ue=5:(Ue=0,Xa=Xi=null,Wb(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(Qi=null),yn(u),l=l.stateNode,us&&typeof us.onCommitFiberRoot=="function")try{us.onCommitFiberRoot(_r,l,void 0,(l.current.flags&128)===128)}catch{}if(m!==null){l=M.T,y=j.p,j.p=2,M.T=null;try{for(var b=r.onRecoverableError,R=0;R<m.length;R++){var k=m[R];b(k.value,{componentStack:k.stack})}}finally{M.T=l,j.p=y}}(xi&3)!==0&&Cu(),Mn(r),y=r.pendingLanes,(u&261930)!==0&&(y&42)!==0?r===xm?Tl++:(Tl=0,xm=r):Tl=0,Al(0)}}function Wb(r,l){(r.pooledCacheLanes&=l)===0&&(l=r.pooledCache,l!=null&&(r.pooledCache=null,il(l)))}function Cu(){return Kb(),qb(),Yb(),Qb()}function Qb(){if(Ue!==5)return!1;var r=Xi,l=ym;ym=0;var u=yn(xi),m=M.T,y=j.p;try{j.p=32>u?32:u,M.T=null,u=vm,vm=null;var b=Xi,R=xi;if(Ue=0,Xa=Xi=null,xi=0,(qt&6)!==0)throw Error(n(331));var k=qt;if(qt|=4,Ib(b.current),_b(b,b.current,R,u),qt=k,Al(0,!1),us&&typeof us.onPostCommitFiberRoot=="function")try{us.onPostCommitFiberRoot(_r,b)}catch{}return!0}finally{j.p=y,M.T=m,Wb(r,l)}}function Xb(r,l,u){l=Js(u,l),l=Xh(r.stateNode,l,2),r=Hi(r,l,2),r!==null&&(me(r,2),Mn(r))}function Wt(r,l,u){if(r.tag===3)Xb(r,r,u);else for(;l!==null;){if(l.tag===3){Xb(l,r,u);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Qi===null||!Qi.has(m))){r=Js(u,r),u=Zx(2),m=Hi(l,u,2),m!==null&&(Jx(u,m,l,r),me(m,2),Mn(m));break}}l=l.return}}function Em(r,l,u){var m=r.pingCache;if(m===null){m=r.pingCache=new wI;var y=new Set;m.set(l,y)}else y=m.get(l),y===void 0&&(y=new Set,m.set(l,y));y.has(u)||(mm=!0,y.add(u),r=II.bind(null,r,l,u),l.then(r,r))}function II(r,l,u){var m=r.pingCache;m!==null&&m.delete(l),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,ne===r&&($t&u)===u&&(be===4||be===3&&($t&62914560)===$t&&300>Ie()-Tu?(qt&2)===0&&Za(r,0):pm|=u,Qa===$t&&(Qa=0)),Mn(r)}function Zb(r,l){l===0&&(l=rs()),r=Mr(r,l),r!==null&&(me(r,l),Mn(r))}function OI(r){var l=r.memoizedState,u=0;l!==null&&(u=l.retryLane),Zb(r,u)}function kI(r,l){var u=0;switch(r.tag){case 31:case 13:var m=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:m=r.stateNode;break;case 22:m=r.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(l),Zb(r,u)}function PI(r,l){return Ye(r,l)}var Du=null,to=null,Tm=!1,Iu=!1,Am=!1,Ji=0;function Mn(r){r!==to&&r.next===null&&(to===null?Du=to=r:to=to.next=r),Iu=!0,Tm||(Tm=!0,NI())}function Al(r,l){if(!Am&&Iu){Am=!0;do for(var u=!1,m=Du;m!==null;){if(r!==0){var y=m.pendingLanes;if(y===0)var b=0;else{var R=m.suspendedLanes,k=m.pingedLanes;b=(1<<31-is(42|r)+1)-1,b&=y&~(R&~k),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,sS(m,b))}else b=$t,b=Ct(m,m===ne?b:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(b&3)===0||ce(m,b)||(u=!0,sS(m,b));m=m.next}while(u);Am=!1}}function MI(){Jb()}function Jb(){Iu=Tm=!1;var r=0;Ji!==0&&KI()&&(r=Ji);for(var l=Ie(),u=null,m=Du;m!==null;){var y=m.next,b=tS(m,l);b===0?(m.next=null,u===null?Du=y:u.next=y,y===null&&(to=u)):(u=m,(r!==0||(b&3)!==0)&&(Iu=!0)),m=y}Ue!==0&&Ue!==5||Al(r),Ji!==0&&(Ji=0)}function tS(r,l){for(var u=r.suspendedLanes,m=r.pingedLanes,y=r.expirationTimes,b=r.pendingLanes&-62914561;0<b;){var R=31-is(b),k=1<<R,H=y[R];H===-1?((k&u)===0||(k&m)!==0)&&(y[R]=He(k,l)):H<=l&&(r.expiredLanes|=k),b&=~k}if(l=ne,u=$t,u=Ct(r,r===l?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,u===0||r===l&&(Yt===2||Yt===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&Ys(m),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||ce(r,u)){if(l=u&-u,l===r.callbackPriority)return l;switch(m!==null&&Ys(m),yn(u)){case 2:case 8:u=Lr;break;case 32:u=si;break;case 268435456:u=Ws;break;default:u=si}return m=eS.bind(null,r),u=Ye(u,m),r.callbackPriority=l,r.callbackNode=u,l}return m!==null&&m!==null&&Ys(m),r.callbackPriority=2,r.callbackNode=null,2}function eS(r,l){if(Ue!==0&&Ue!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Cu()&&r.callbackNode!==u)return null;var m=$t;return m=Ct(r,r===ne?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(Nb(r,m,l),tS(r,Ie()),r.callbackNode!=null&&r.callbackNode===u?eS.bind(null,r):null)}function sS(r,l){if(Cu())return null;Nb(r,l,!0)}function NI(){YI(function(){(qt&6)!==0?Ye(Ds,MI):Jb()})}function Rm(){if(Ji===0){var r=Ua;r===0&&(r=va,va<<=1,(va&261888)===0&&(va=256)),Ji=r}return Ji}function nS(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Uc(""+r)}function iS(r,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,r.id&&u.setAttribute("form",r.id),l.parentNode.insertBefore(u,l),r=new FormData(r),u.parentNode.removeChild(u),r}function BI(r,l,u,m,y){if(l==="submit"&&u&&u.stateNode===y){var b=nS((y[vs]||null).action),R=m.submitter;R&&(l=(l=R[vs]||null)?nS(l.formAction):R.getAttribute("formAction"),l!==null&&(b=l,R=null));var k=new Gc("action","action",null,m,y);r.push({event:k,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ji!==0){var H=R?iS(y,R):new FormData(y);zh(u,{pending:!0,data:H,method:y.method,action:b},null,H)}}else typeof b=="function"&&(k.preventDefault(),H=R?iS(y,R):new FormData(y),zh(u,{pending:!0,data:H,method:y.method,action:b},b,H))},currentTarget:y}]})}}for(var wm=0;wm<lh.length;wm++){var Lm=lh[wm],FI=Lm.toLowerCase(),UI=Lm[0].toUpperCase()+Lm.slice(1);vn(FI,"on"+UI)}vn(Mv,"onAnimationEnd"),vn(Nv,"onAnimationIteration"),vn(Bv,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(eI,"onTransitionRun"),vn(sI,"onTransitionStart"),vn(nI,"onTransitionCancel"),vn(Fv,"onTransitionEnd"),Ra("onMouseEnter",["mouseout","mouseover"]),Ra("onMouseLeave",["mouseout","mouseover"]),Ra("onPointerEnter",["pointerout","pointerover"]),Ra("onPointerLeave",["pointerout","pointerover"]),Ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),jI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rl));function rS(r,l){l=(l&4)!==0;for(var u=0;u<r.length;u++){var m=r[u],y=m.event;m=m.listeners;t:{var b=void 0;if(l)for(var R=m.length-1;0<=R;R--){var k=m[R],H=k.instance,et=k.currentTarget;if(k=k.listener,H!==b&&y.isPropagationStopped())break t;b=k,y.currentTarget=et;try{b(y)}catch(lt){Kc(lt)}y.currentTarget=null,b=H}else for(R=0;R<m.length;R++){if(k=m[R],H=k.instance,et=k.currentTarget,k=k.listener,H!==b&&y.isPropagationStopped())break t;b=k,y.currentTarget=et;try{b(y)}catch(lt){Kc(lt)}y.currentTarget=null,b=H}}}}function jt(r,l){var u=l[jf];u===void 0&&(u=l[jf]=new Set);var m=r+"__bubble";u.has(m)||(aS(l,r,2,!1),u.add(m))}function _m(r,l,u){var m=0;l&&(m|=4),aS(u,r,m,l)}var Ou="_reactListening"+Math.random().toString(36).slice(2);function Cm(r){if(!r[Ou]){r[Ou]=!0,Jy.forEach(function(u){u!=="selectionchange"&&(jI.has(u)||_m(u,!1,r),_m(u,!0,r))});var l=r.nodeType===9?r:r.ownerDocument;l===null||l[Ou]||(l[Ou]=!0,_m("selectionchange",!1,l))}}function aS(r,l,u,m){switch(MS(l)){case 2:var y=mO;break;case 8:y=pO;break;default:y=Hm}u=y.bind(null,l,u,r),y=void 0,!Wf||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),m?y!==void 0?r.addEventListener(l,u,{capture:!0,passive:y}):r.addEventListener(l,u,!0):y!==void 0?r.addEventListener(l,u,{passive:y}):r.addEventListener(l,u,!1)}function Dm(r,l,u,m,y){var b=m;if((l&1)===0&&(l&2)===0&&m!==null)t:for(;;){if(m===null)return;var R=m.tag;if(R===3||R===4){var k=m.stateNode.containerInfo;if(k===y)break;if(R===4)for(R=m.return;R!==null;){var H=R.tag;if((H===3||H===4)&&R.stateNode.containerInfo===y)return;R=R.return}for(;k!==null;){if(R=Ea(k),R===null)return;if(H=R.tag,H===5||H===6||H===26||H===27){m=b=R;continue t}k=k.parentNode}}m=m.return}dv(function(){var et=b,lt=qf(u),dt=[];t:{var st=Uv.get(r);if(st!==void 0){var at=Gc,vt=r;switch(r){case"keypress":if($c(u)===0)break t;case"keydown":case"keyup":at=kD;break;case"focusin":vt="focus",at=Jf;break;case"focusout":vt="blur",at=Jf;break;case"beforeblur":case"afterblur":at=Jf;break;case"click":if(u.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":at=mv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":at=SD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":at=ND;break;case Mv:case Nv:case Bv:at=AD;break;case Fv:at=FD;break;case"scroll":case"scrollend":at=xD;break;case"wheel":at=jD;break;case"copy":case"cut":case"paste":at=wD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":at=gv;break;case"toggle":case"beforetoggle":at=VD}var Rt=(l&4)!==0,ee=!Rt&&(r==="scroll"||r==="scrollend"),W=Rt?st!==null?st+"Capture":null:st;Rt=[];for(var q=et,tt;q!==null;){var ut=q;if(tt=ut.stateNode,ut=ut.tag,ut!==5&&ut!==26&&ut!==27||tt===null||W===null||(ut=qo(q,W),ut!=null&&Rt.push(wl(q,ut,tt))),ee)break;q=q.return}0<Rt.length&&(st=new at(st,vt,null,u,lt),dt.push({event:st,listeners:Rt}))}}if((l&7)===0){t:{if(st=r==="mouseover"||r==="pointerover",at=r==="mouseout"||r==="pointerout",st&&u!==Kf&&(vt=u.relatedTarget||u.fromElement)&&(Ea(vt)||vt[Sa]))break t;if((at||st)&&(st=lt.window===lt?lt:(st=lt.ownerDocument)?st.defaultView||st.parentWindow:window,at?(vt=u.relatedTarget||u.toElement,at=et,vt=vt?Ea(vt):null,vt!==null&&(ee=a(vt),Rt=vt.tag,vt!==ee||Rt!==5&&Rt!==27&&Rt!==6)&&(vt=null)):(at=null,vt=et),at!==vt)){if(Rt=mv,ut="onMouseLeave",W="onMouseEnter",q="mouse",(r==="pointerout"||r==="pointerover")&&(Rt=gv,ut="onPointerLeave",W="onPointerEnter",q="pointer"),ee=at==null?st:Ko(at),tt=vt==null?st:Ko(vt),st=new Rt(ut,q+"leave",at,u,lt),st.target=ee,st.relatedTarget=tt,ut=null,Ea(lt)===et&&(Rt=new Rt(W,q+"enter",vt,u,lt),Rt.target=tt,Rt.relatedTarget=ee,ut=Rt),ee=ut,at&&vt)e:{for(Rt=$I,W=at,q=vt,tt=0,ut=W;ut;ut=Rt(ut))tt++;ut=0;for(var At=q;At;At=Rt(At))ut++;for(;0<tt-ut;)W=Rt(W),tt--;for(;0<ut-tt;)q=Rt(q),ut--;for(;tt--;){if(W===q||q!==null&&W===q.alternate){Rt=W;break e}W=Rt(W),q=Rt(q)}Rt=null}else Rt=null;at!==null&&oS(dt,st,at,Rt,!1),vt!==null&&ee!==null&&oS(dt,ee,vt,Rt,!0)}}t:{if(st=et?Ko(et):window,at=st.nodeName&&st.nodeName.toLowerCase(),at==="select"||at==="input"&&st.type==="file")var Ht=Av;else if(Ev(st))if(Rv)Ht=ZD;else{Ht=QD;var Et=WD}else at=st.nodeName,!at||at.toLowerCase()!=="input"||st.type!=="checkbox"&&st.type!=="radio"?et&&zf(et.elementType)&&(Ht=Av):Ht=XD;if(Ht&&(Ht=Ht(r,et))){Tv(dt,Ht,u,lt);break t}Et&&Et(r,st,et),r==="focusout"&&et&&st.type==="number"&&et.memoizedProps.value!=null&&Hf(st,"number",st.value)}switch(Et=et?Ko(et):window,r){case"focusin":(Ev(Et)||Et.contentEditable==="true")&&(Ia=Et,rh=et,el=null);break;case"focusout":el=rh=Ia=null;break;case"mousedown":ah=!0;break;case"contextmenu":case"mouseup":case"dragend":ah=!1,kv(dt,u,lt);break;case"selectionchange":if(tI)break;case"keydown":case"keyup":kv(dt,u,lt)}var kt;if(eh)t:{switch(r){case"compositionstart":var Vt="onCompositionStart";break t;case"compositionend":Vt="onCompositionEnd";break t;case"compositionupdate":Vt="onCompositionUpdate";break t}Vt=void 0}else Da?bv(r,u)&&(Vt="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(Vt="onCompositionStart");Vt&&(yv&&u.locale!=="ko"&&(Da||Vt!=="onCompositionStart"?Vt==="onCompositionEnd"&&Da&&(kt=fv()):(Bi=lt,Qf="value"in Bi?Bi.value:Bi.textContent,Da=!0)),Et=ku(et,Vt),0<Et.length&&(Vt=new pv(Vt,r,null,u,lt),dt.push({event:Vt,listeners:Et}),kt?Vt.data=kt:(kt=Sv(u),kt!==null&&(Vt.data=kt)))),(kt=HD?zD(r,u):KD(r,u))&&(Vt=ku(et,"onBeforeInput"),0<Vt.length&&(Et=new pv("onBeforeInput","beforeinput",null,u,lt),dt.push({event:Et,listeners:Vt}),Et.data=kt)),BI(dt,r,et,u,lt)}rS(dt,l)})}function wl(r,l,u){return{instance:r,listener:l,currentTarget:u}}function ku(r,l){for(var u=l+"Capture",m=[];r!==null;){var y=r,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=qo(r,u),y!=null&&m.unshift(wl(r,y,b)),y=qo(r,l),y!=null&&m.push(wl(r,y,b))),r.tag===3)return m;r=r.return}return[]}function $I(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function oS(r,l,u,m,y){for(var b=l._reactName,R=[];u!==null&&u!==m;){var k=u,H=k.alternate,et=k.stateNode;if(k=k.tag,H!==null&&H===m)break;k!==5&&k!==26&&k!==27||et===null||(H=et,y?(et=qo(u,b),et!=null&&R.unshift(wl(u,et,H))):y||(et=qo(u,b),et!=null&&R.push(wl(u,et,H)))),u=u.return}R.length!==0&&r.push({event:l,listeners:R})}var VI=/\r\n?/g,GI=/\u0000|\uFFFD/g;function lS(r){return(typeof r=="string"?r:""+r).replace(VI,` 49`).replace(GI,"")}function cS(r,l){return l=lS(l),lS(r)===l}function te(r,l,u,m,y,b){switch(u){case"children":typeof m=="string"?l==="body"||l==="textarea"&&m===""||La(r,m):(typeof m=="number"||typeof m=="bigint")&&l!=="body"&&La(r,""+m);break;case"className":Bc(r,"class",m);break;case"tabIndex":Bc(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Bc(r,u,m);break;case"style":cv(r,m,b);break;case"data":if(l!=="object"){Bc(r,"data",m);break}case"src":case"href":if(m===""&&(l!=="a"||u!=="href")){r.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(u);break}m=Uc(""+m),r.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(l!=="input"&&te(r,l,"name",y.name,y,null),te(r,l,"formEncType",y.formEncType,y,null),te(r,l,"formMethod",y.formMethod,y,null),te(r,l,"formTarget",y.formTarget,y,null)):(te(r,l,"encType",y.encType,y,null),te(r,l,"method",y.method,y,null),te(r,l,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(u);break}m=Uc(""+m),r.setAttribute(u,m);break;case"onClick":m!=null&&(r.onclick=ii);break;case"onScroll":m!=null&&jt("scroll",r);break;case"onScrollEnd":m!=null&&jt("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(u=m.__html,u!=null){if(y.children!=null)throw Error(n(60));r.innerHTML=u}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}u=Uc(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(u,""+m):r.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":m===!0?r.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(u,m):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(u,m):r.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(u):r.setAttribute(u,m);break;case"popover":jt("beforetoggle",r),jt("toggle",r),Nc(r,"popover",m);break;case"xlinkActuate":ni(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ni(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ni(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ni(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ni(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ni(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ni(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ni(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ni(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Nc(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=yD.get(u)||u,Nc(r,u,m))}}function Im(r,l,u,m,y,b){switch(u){case"style":cv(r,m,b);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(u=m.__html,u!=null){if(y.children!=null)throw Error(n(60));r.innerHTML=u}}break;case"children":typeof m=="string"?La(r,m):(typeof m=="number"||typeof m=="bigint")&&La(r,""+m);break;case"onScroll":m!=null&&jt("scroll",r);break;case"onScrollEnd":m!=null&&jt("scrollend",r);break;case"onClick":m!=null&&(r.onclick=ii);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tv.hasOwnProperty(u))t:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),b=r[vs]||null,b=b!=null?b[u]:null,typeof b=="function"&&r.removeEventListener(l,b,y),typeof m=="function")){typeof b!="function"&&b!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(l,m,y);break t}u in r?r[u]=m:m===!0?r.setAttribute(u,""):Nc(r,u,m)}}}function Je(r,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",r),jt("load",r);var m=!1,y=!1,b;for(b in u)if(u.hasOwnProperty(b)){var R=u[b];if(R!=null)switch(b){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:te(r,l,b,R,u,null)}}y&&te(r,l,"srcSet",u.srcSet,u,null),m&&te(r,l,"src",u.src,u,null);return;case"input":jt("invalid",r);var k=b=R=y=null,H=null,et=null;for(m in u)if(u.hasOwnProperty(m)){var lt=u[m];if(lt!=null)switch(m){case"name":y=lt;break;case"type":R=lt;break;case"checked":H=lt;break;case"defaultChecked":et=lt;break;case"value":b=lt;break;case"defaultValue":k=lt;break;case"children":case"dangerouslySetInnerHTML":if(lt!=null)throw Error(n(137,l));break;default:te(r,l,m,lt,u,null)}}rv(r,b,k,H,et,R,y,!1);return;case"select":jt("invalid",r),m=R=b=null;for(y in u)if(u.hasOwnProperty(y)&&(k=u[y],k!=null))switch(y){case"value":b=k;break;case"defaultValue":R=k;break;case"multiple":m=k;default:te(r,l,y,k,u,null)}l=b,u=R,r.multiple=!!m,l!=null?wa(r,!!m,l,!1):u!=null&&wa(r,!!m,u,!0);return;case"textarea":jt("invalid",r),b=y=m=null;for(R in u)if(u.hasOwnProperty(R)&&(k=u[R],k!=null))switch(R){case"value":m=k;break;case"defaultValue":y=k;break;case"children":b=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(n(91));break;default:te(r,l,R,k,u,null)}ov(r,m,y,b);return;case"option":for(H in u)if(u.hasOwnProperty(H)&&(m=u[H],m!=null))switch(H){case"selected":r.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:te(r,l,H,m,u,null)}return;case"dialog":jt("beforetoggle",r),jt("toggle",r),jt("cancel",r),jt("close",r);break;case"iframe":case"object":jt("load",r);break;case"video":case"audio":for(m=0;m<Rl.length;m++)jt(Rl[m],r);break;case"image":jt("error",r),jt("load",r);break;case"details":jt("toggle",r);break;case"embed":case"source":case"link":jt("error",r),jt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(et in u)if(u.hasOwnProperty(et)&&(m=u[et],m!=null))switch(et){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:te(r,l,et,m,u,null)}return;default:if(zf(l)){for(lt in u)u.hasOwnProperty(lt)&&(m=u[lt],m!==void 0&&Im(r,l,lt,m,u,void 0));return}}for(k in u)u.hasOwnProperty(k)&&(m=u[k],m!=null&&te(r,l,k,m,u,null))}function HI(r,l,u,m){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,R=null,k=null,H=null,et=null,lt=null;for(at in u){var dt=u[at];if(u.hasOwnProperty(at)&&dt!=null)switch(at){case"checked":break;case"value":break;case"defaultValue":H=dt;default:m.hasOwnProperty(at)||te(r,l,at,null,m,dt)}}for(var st in m){var at=m[st];if(dt=u[st],m.hasOwnProperty(st)&&(at!=null||dt!=null))switch(st){case"type":b=at;break;case"name":y=at;break;case"checked":et=at;break;case"defaultChecked":lt=at;break;case"value":R=at;break;case"defaultValue":k=at;break;case"children":case"dangerouslySetInnerHTML":if(at!=null)throw Error(n(137,l));break;default:at!==dt&&te(r,l,st,at,m,dt)}}Gf(r,R,k,H,et,lt,b,y);return;case"select":at=R=k=st=null;for(b in u)if(H=u[b],u.hasOwnProperty(b)&&H!=null)switch(b){case"value":break;case"multiple":at=H;default:m.hasOwnProperty(b)||te(r,l,b,null,m,H)}for(y in m)if(b=m[y],H=u[y],m.hasOwnProperty(y)&&(b!=null||H!=null))switch(y){case"value":st=b;break;case"defaultValue":k=b;break;case"multiple":R=b;default:b!==H&&te(r,l,y,b,m,H)}l=k,u=R,m=at,st!=null?wa(r,!!u,st,!1):!!m!=!!u&&(l!=null?wa(r,!!u,l,!0):wa(r,!!u,u?[]:"",!1));return;case"textarea":at=st=null;for(k in u)if(y=u[k],u.hasOwnProperty(k)&&y!=null&&!m.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:te(r,l,k,null,m,y)}for(R in m)if(y=m[R],b=u[R],m.hasOwnProperty(R)&&(y!=null||b!=null))switch(R){case"value":st=y;break;case"defaultValue":at=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(n(91));break;default:y!==b&&te(r,l,R,y,m,b)}av(r,st,at);return;case"option":for(var vt in u)if(st=u[vt],u.hasOwnProperty(vt)&&st!=null&&!m.hasOwnProperty(vt))switch(vt){case"selected":r.selected=!1;break;default:te(r,l,vt,null,m,st)}for(H in m)if(st=m[H],at=u[H],m.hasOwnProperty(H)&&st!==at&&(st!=null||at!=null))switch(H){case"selected":r.selected=st&&typeof st!="function"&&typeof st!="symbol";break;default:te(r,l,H,st,m,at)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Rt in u)st=u[Rt],u.hasOwnProperty(Rt)&&st!=null&&!m.hasOwnProperty(Rt)&&te(r,l,Rt,null,m,st);for(et in m)if(st=m[et],at=u[et],m.hasOwnProperty(et)&&st!==at&&(st!=null||at!=null))switch(et){case"children":case"dangerouslySetInnerHTML":if(st!=null)throw Error(n(137,l));break;default:te(r,l,et,st,m,at)}return;default:if(zf(l)){for(var ee in u)st=u[ee],u.hasOwnProperty(ee)&&st!==void 0&&!m.hasOwnProperty(ee)&&Im(r,l,ee,void 0,m,st);for(lt in m)st=m[lt],at=u[lt],!m.hasOwnProperty(lt)||st===at||st===void 0&&at===void 0||Im(r,l,lt,st,m,at);return}}for(var W in u)st=u[W],u.hasOwnProperty(W)&&st!=null&&!m.hasOwnProperty(W)&&te(r,l,W,null,m,st);for(dt in m)st=m[dt],at=u[dt],!m.hasOwnProperty(dt)||st===at||st==null&&at==null||te(r,l,dt,st,m,at)}function uS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zI(){if(typeof performance.getEntriesByType=="function"){for(var r=0,l=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var y=u[m],b=y.transferSize,R=y.initiatorType,k=y.duration;if(b&&k&&uS(R)){for(R=0,k=y.responseEnd,m+=1;m<u.length;m++){var H=u[m],et=H.startTime;if(et>k)break;var lt=H.transferSize,dt=H.initiatorType;lt&&uS(dt)&&(H=H.responseEnd,R+=lt*(H<k?1:(k-et)/(H-et)))}if(--m,l+=8*(b+R)/(y.duration/1e3),r++,10<r)break}}if(0<r)return l/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Om=null,km=null;function Pu(r){return r.nodeType===9?r:r.ownerDocument}function dS(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fS(r,l){if(r===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&l==="foreignObject"?0:r}function Pm(r,l){return r==="textarea"||r==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Mm=null;function KI(){var r=window.event;return r&&r.type==="popstate"?r===Mm?!1:(Mm=r,!0):(Mm=null,!1)}var hS=typeof setTimeout=="function"?setTimeout:void 0,qI=typeof clearTimeout=="function"?clearTimeout:void 0,mS=typeof Promise=="function"?Promise:void 0,YI=typeof queueMicrotask=="function"?queueMicrotask:typeof mS<"u"?function(r){return mS.resolve(null).then(r).catch(WI)}:hS;function WI(r){setTimeout(function(){throw r})}function tr(r){return r==="head"}function pS(r,l){var u=l,m=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(m===0){r.removeChild(y),io(l);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")Ll(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Ll(u);for(var b=u.firstChild;b;){var R=b.nextSibling,k=b.nodeName;b[zo]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=R}}else u==="body"&&Ll(r.ownerDocument.body);u=y}while(u);io(l)}function gS(r,l){var u=r;r=0;do{var m=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=m}while(u)}function Nm(r){var l=r.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Nm(u),$f(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function QI(r,l,u,m){for(;r.nodeType===1;){var y=u;if(r.nodeName.toLowerCase()!==l.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[zo])switch(l){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(b=r.getAttribute("rel"),b==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(b!==y.rel||r.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||r.getAttribute("title")!==(y.title==null?null:y.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(b=r.getAttribute("src"),(b!==(y.src==null?null:y.src)||r.getAttribute("type")!==(y.type==null?null:y.type)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(l==="input"&&r.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&r.getAttribute("name")===b)return r}else return r;
vendor: 1,396 bytes, line 49
49if(r=rn(r.nextSibling),r===null)break}return null}function XI(r,l,u){if(l==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=rn(r.nextSibling),r===null))return null;return r}function yS(r,l){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=rn(r.nextSibling),r===null))return null;return r}function Bm(r){return r.data==="$?"||r.data==="$~"}function Fm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function ZI(r,l){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=l;else if(r.data!=="$?"||u.readyState!=="loading")l();else{var m=function(){l(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function rn(r){for(;r!=null;r=r.nextSibling){var l=r.nodeType;if(l===1||l===3)break;if(l===8){if(l=r.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return r}var Um=null;function vS(r){r=r.nextSibling;for(var l=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(l===0)return rn(r.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}r=r.nextSibling}return null}function xS(r){r=r.previousSibling;for(var l=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return r;l--}
vendor: 11,594 bytes, line 49
49else u!=="/$"&&u!=="/&"||l++}r=r.previousSibling}return null}function bS(r,l,u){switch(l=Pu(u),r){case"html":if(r=l.documentElement,!r)throw Error(n(452));return r;case"head":if(r=l.head,!r)throw Error(n(453));return r;case"body":if(r=l.body,!r)throw Error(n(454));return r;default:throw Error(n(451))}}function Ll(r){for(var l=r.attributes;l.length;)r.removeAttributeNode(l[0]);$f(r)}var an=new Map,SS=new Set;function Mu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var bi=j.d;j.d={f:JI,r:tO,D:eO,C:sO,L:nO,m:iO,X:aO,S:rO,M:oO};function JI(){var r=bi.f(),l=wu();return r||l}function tO(r){var l=Ta(r);l!==null&&l.tag===5&&l.type==="form"?Fx(l):bi.r(r)}var eo=typeof document>"u"?null:document;function ES(r,l,u){var m=eo;if(m&&typeof l=="string"&&l){var y=Xs(l);y='link[rel="'+r+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),SS.has(y)||(SS.add(y),r={rel:r,crossOrigin:u,href:l},m.querySelector(y)===null&&(l=m.createElement("link"),Je(l,"link",r),ze(l),m.head.appendChild(l)))}}function eO(r){bi.D(r),ES("dns-prefetch",r,null)}function sO(r,l){bi.C(r,l),ES("preconnect",r,l)}function nO(r,l,u){bi.L(r,l,u);var m=eo;if(m&&r&&l){var y='link[rel="preload"][as="'+Xs(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Xs(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Xs(u.imageSizes)+'"]')):y+='[href="'+Xs(r)+'"]';var b=y;switch(l){case"style":b=so(r);break;case"script":b=no(r)}an.has(b)||(r=p({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:r,as:l},u),an.set(b,r),m.querySelector(y)!==null||l==="style"&&m.querySelector(_l(b))||l==="script"&&m.querySelector(Cl(b))||(l=m.createElement("link"),Je(l,"link",r),ze(l),m.head.appendChild(l)))}}function iO(r,l){bi.m(r,l);var u=eo;if(u&&r){var m=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+Xs(m)+'"][href="'+Xs(r)+'"]',b=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=no(r)}if(!an.has(b)&&(r=p({rel:"modulepreload",href:r},l),an.set(b,r),u.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Cl(b)))return}m=u.createElement("link"),Je(m,"link",r),ze(m),u.head.appendChild(m)}}}function rO(r,l,u){bi.S(r,l,u);var m=eo;if(m&&r){var y=Aa(m).hoistableStyles,b=so(r);l=l||"default";var R=y.get(b);if(!R){var k={loading:0,preload:null};if(R=m.querySelector(_l(b)))k.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":l},u),(u=an.get(b))&&jm(r,u);var H=R=m.createElement("link");ze(H),Je(H,"link",r),H._p=new Promise(function(et,lt){H.onload=et,H.onerror=lt}),H.addEventListener("load",function(){k.loading|=1}),H.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Nu(R,l,m)}R={type:"stylesheet",instance:R,count:1,state:k},y.set(b,R)}}}function aO(r,l){bi.X(r,l);var u=eo;if(u&&r){var m=Aa(u).hoistableScripts,y=no(r),b=m.get(y);b||(b=u.querySelector(Cl(y)),b||(r=p({src:r,async:!0},l),(l=an.get(y))&&$m(r,l),b=u.createElement("script"),ze(b),Je(b,"link",r),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},m.set(y,b))}}function oO(r,l){bi.M(r,l);var u=eo;if(u&&r){var m=Aa(u).hoistableScripts,y=no(r),b=m.get(y);b||(b=u.querySelector(Cl(y)),b||(r=p({src:r,async:!0,type:"module"},l),(l=an.get(y))&&$m(r,l),b=u.createElement("script"),ze(b),Je(b,"link",r),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},m.set(y,b))}}function TS(r,l,u,m){var y=(y=ft.current)?Mu(y):null;if(!y)throw Error(n(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=so(u.href),u=Aa(y).hoistableStyles,m=u.get(l),m||(m={type:"style",instance:null,count:0,state:null},u.set(l,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=so(u.href);var b=Aa(y).hoistableStyles,R=b.get(r);if(R||(y=y.ownerDocument||y,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(r,R),(b=y.querySelector(_l(r)))&&!b._p&&(R.instance=b,R.state.loading=5),an.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},an.set(r,u),b||lO(y,r,u,R.state))),l&&m===null)throw Error(n(528,""));return R}if(l&&m!==null)throw Error(n(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=no(u),u=Aa(y).hoistableScripts,m=u.get(l),m||(m={type:"script",instance:null,count:0,state:null},u.set(l,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,r))}}function so(r){return'href="'+Xs(r)+'"'}function _l(r){return'link[rel="stylesheet"]['+r+"]"}function AS(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function lO(r,l,u,m){r.querySelector('link[rel="preload"][as="style"]['+l+"]")?m.loading=1:(l=r.createElement("link"),m.preload=l,l.addEventListener("load",function(){return m.loading|=1}),l.addEventListener("error",function(){return m.loading|=2}),Je(l,"link",u),ze(l),r.head.appendChild(l))}function no(r){return'[src="'+Xs(r)+'"]'}function Cl(r){return"script[async]"+r}function RS(r,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var m=r.querySelector('style[data-href~="'+Xs(u.href)+'"]');if(m)return l.instance=m,ze(m),m;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),ze(m),Je(m,"style",y),Nu(m,u.precedence,r),l.instance=m;case"stylesheet":y=so(u.href);var b=r.querySelector(_l(y));if(b)return l.state.loading|=4,l.instance=b,ze(b),b;m=AS(u),(y=an.get(y))&&jm(m,y),b=(r.ownerDocument||r).createElement("link"),ze(b);var R=b;return R._p=new Promise(function(k,H){R.onload=k,R.onerror=H}),Je(b,"link",m),l.state.loading|=4,Nu(b,u.precedence,r),l.instance=b;case"script":return b=no(u.src),(y=r.querySelector(Cl(b)))?(l.instance=y,ze(y),y):(m=u,(y=an.get(b))&&(m=p({},u),$m(m,y)),r=r.ownerDocument||r,y=r.createElement("script"),ze(y),Je(y,"link",m),r.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(n(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(m=l.instance,l.state.loading|=4,Nu(m,u.precedence,r));return l.instance}function Nu(r,l,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,b=y,R=0;R<m.length;R++){var k=m[R];if(k.dataset.precedence===l)b=k;else if(b!==y)break}b?b.parentNode.insertBefore(r,b.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(r,l.firstChild))}function jm(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.title==null&&(r.title=l.title)}function $m(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.integrity==null&&(r.integrity=l.integrity)}var Bu=null;function wS(r,l,u){if(Bu===null){var m=new Map,y=Bu=new Map;y.set(u,m)}else y=Bu,m=y.get(u),m||(m=new Map,y.set(u,m));if(m.has(r))return m;for(m.set(r,null),u=u.getElementsByTagName(r),y=0;y<u.length;y++){var b=u[y];if(!(b[zo]||b[We]||r==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var R=b.getAttribute(l)||"";R=r+R;var k=m.get(R);k?k.push(b):m.set(R,[b])}}return m}function LS(r,l,u){r=r.ownerDocument||r,r.head.insertBefore(u,l==="title"?r.querySelector("head > title"):null)}function cO(r,l,u){if(u===1||l.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return r=l.disabled,typeof l.precedence=="string"&&r==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function _S(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function uO(r,l,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=so(m.href),b=l.querySelector(_l(y));if(b){l=b._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(r.count++,r=Fu.bind(r),l.then(r,r)),u.state.loading|=4,u.instance=b,ze(b);return}b=l.ownerDocument||l,m=AS(m),(y=an.get(y))&&jm(m,y),b=b.createElement("link"),ze(b);var R=b;R._p=new Promise(function(k,H){R.onload=k,R.onerror=H}),Je(b,"link",m),u.instance=b}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Fu.bind(r),l.addEventListener("load",u),l.addEventListener("error",u))}}var Vm=0;function dO(r,l){return r.stylesheets&&r.count===0&&ju(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var m=setTimeout(function(){if(r.stylesheets&&ju(r,r.stylesheets),r.unsuspend){var b=r.unsuspend;r.unsuspend=null,b()}},6e4+l);0<r.imgBytes&&Vm===0&&(Vm=62500*zI());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&ju(r,r.stylesheets),r.unsuspend)){var b=r.unsuspend;r.unsuspend=null,b()}},(r.imgBytes>Vm?50:800)+l);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function Fu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ju(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Uu=null;function ju(r,l){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Uu=new Map,l.forEach(fO,r),Uu=null,Fu.call(r))}function fO(r,l){if(!(l.state.loading&4)){var u=Uu.get(r);if(u)var m=u.get(null);else{u=new Map,Uu.set(r,u);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var R=y[b];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(u.set(R.dataset.precedence,R),m=R)}m&&u.set(null,m)}y=l.instance,R=y.getAttribute("data-precedence"),b=u.get(R)||m,b===m&&u.set(null,y),u.set(R,y),this.count++,m=Fu.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),b?b.parentNode.insertBefore(y,b.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),l.state.loading|=4}}var Dl={$$typeof:_,Provider:null,Consumer:null,_currentValue:N,_currentValue2:N,_threadCount:0};function hO(r,l,u,m,y,b,R,k,H){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mi(0),this.hiddenUpdates=Mi(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function CS(r,l,u,m,y,b,R,k,H,et,lt,dt){return r=new hO(r,l,u,R,H,et,lt,dt,k),l=1,b===!0&&(l|=24),b=Os(3,null,null,l),r.current=b,b.stateNode=r,l=Sh(),l.refCount++,r.pooledCache=l,l.refCount++,b.memoizedState={element:m,isDehydrated:u,cac
vendor: 10,387 bytes, line 49
49he:l},Rh(b),r}function DS(r){return r?(r=Pa,r):Pa}function IS(r,l,u,m,y,b){y=DS(y),m.context===null?m.context=y:m.pendingContext=y,m=Gi(l),m.payload={element:u},b=b===void 0?null:b,b!==null&&(m.callback=b),u=Hi(r,m,l),u!==null&&(As(u,r,l),ll(u,r,l))}function OS(r,l){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<l?u:l}}function Gm(r,l){OS(r,l),(r=r.alternate)&&OS(r,l)}function kS(r){if(r.tag===13||r.tag===31){var l=Mr(r,67108864);l!==null&&As(l,r,67108864),Gm(r,67108864)}}function PS(r){if(r.tag===13||r.tag===31){var l=Bs();l=ba(l);var u=Mr(r,l);u!==null&&As(u,r,l),Gm(r,l)}}var $u=!0;function mO(r,l,u,m){var y=M.T;M.T=null;var b=j.p;try{j.p=2,Hm(r,l,u,m)}finally{j.p=b,M.T=y}}function pO(r,l,u,m){var y=M.T;M.T=null;var b=j.p;try{j.p=8,Hm(r,l,u,m)}finally{j.p=b,M.T=y}}function Hm(r,l,u,m){if($u){var y=zm(m);if(y===null)Dm(r,l,m,Vu,u),NS(r,m);else if(yO(y,r,l,u,m))m.stopPropagation();else if(NS(r,m),l&4&&-1<gO.indexOf(r)){for(;y!==null;){var b=Ta(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var R=In(b.pendingLanes);if(R!==0){var k=b;for(k.pendingLanes|=2,k.entangledLanes|=2;R;){var H=1<<31-is(R);k.entanglements[1]|=H,R&=~H}Mn(b),(qt&6)===0&&(Au=Ie()+500,Al(0))}}break;case 31:case 13:k=Mr(b,2),k!==null&&As(k,b,2),wu(),Gm(b,2)}if(b=zm(m),b===null&&Dm(r,l,m,Vu,u),b===y)break;y=b}y!==null&&m.stopPropagation()}else Dm(r,l,m,null,u)}}function zm(r){return r=qf(r),Km(r)}var Vu=null;function Km(r){if(Vu=null,r=Ea(r),r!==null){var l=a(r);if(l===null)r=null;else{var u=l.tag;if(u===13){if(r=o(l),r!==null)return r;r=null}else if(u===31){if(r=c(l),r!==null)return r;r=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;r=null}else l!==r&&(r=null)}}return Vu=r,null}function MS(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ya()){case Ds:return 2;case Lr:return 8;case si:case ki:return 32;case Ws:return 268435456;default:return 32}default:return 32}}var qm=!1,er=null,sr=null,nr=null,Il=new Map,Ol=new Map,ir=[],gO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function NS(r,l){switch(r){case"focusin":case"focusout":er=null;break;case"dragenter":case"dragleave":sr=null;break;case"mouseover":case"mouseout":nr=null;break;case"pointerover":case"pointerout":Il.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ol.delete(l.pointerId)}}function kl(r,l,u,m,y,b){return r===null||r.nativeEvent!==b?(r={blockedOn:l,domEventName:u,eventSystemFlags:m,nativeEvent:b,targetContainers:[y]},l!==null&&(l=Ta(l),l!==null&&kS(l)),r):(r.eventSystemFlags|=m,l=r.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),r)}function yO(r,l,u,m,y){switch(l){case"focusin":return er=kl(er,r,l,u,m,y),!0;case"dragenter":return sr=kl(sr,r,l,u,m,y),!0;case"mouseover":return nr=kl(nr,r,l,u,m,y),!0;case"pointerover":var b=y.pointerId;return Il.set(b,kl(Il.get(b)||null,r,l,u,m,y)),!0;case"gotpointercapture":return b=y.pointerId,Ol.set(b,kl(Ol.get(b)||null,r,l,u,m,y)),!0}return!1}function BS(r){var l=Ea(r.target);if(l!==null){var u=a(l);if(u!==null){if(l=u.tag,l===13){if(l=o(u),l!==null){r.blockedOn=l,Xy(r.priority,function(){PS(u)});return}}else if(l===31){if(l=c(u),l!==null){r.blockedOn=l,Xy(r.priority,function(){PS(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Gu(r){if(r.blockedOn!==null)return!1;for(var l=r.targetContainers;0<l.length;){var u=zm(r.nativeEvent);if(u===null){u=r.nativeEvent;var m=new u.constructor(u.type,u);Kf=m,u.target.dispatchEvent(m),Kf=null}else return l=Ta(u),l!==null&&kS(l),r.blockedOn=u,!1;l.shift()}return!0}function FS(r,l,u){Gu(r)&&u.delete(l)}function vO(){qm=!1,er!==null&&Gu(er)&&(er=null),sr!==null&&Gu(sr)&&(sr=null),nr!==null&&Gu(nr)&&(nr=null),Il.forEach(FS),Ol.forEach(FS)}function Hu(r,l){r.blockedOn===l&&(r.blockedOn=null,qm||(qm=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,vO)))}var zu=null;function US(r){zu!==r&&(zu=r,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){zu===r&&(zu=null);for(var l=0;l<r.length;l+=3){var u=r[l],m=r[l+1],y=r[l+2];if(typeof m!="function"){if(Km(m||u)===null)continue;break}var b=Ta(u);b!==null&&(r.splice(l,3),l-=3,zh(b,{pending:!0,data:y,method:u.method,action:m},m,y))}}))}function io(r){function l(H){return Hu(H,r)}er!==null&&Hu(er,r),sr!==null&&Hu(sr,r),nr!==null&&Hu(nr,r),Il.forEach(l),Ol.forEach(l);for(var u=0;u<ir.length;u++){var m=ir[u];m.blockedOn===r&&(m.blockedOn=null)}for(;0<ir.length&&(u=ir[0],u.blockedOn===null);)BS(u),u.blockedOn===null&&ir.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var y=u[m],b=u[m+1],R=y[vs]||null;if(typeof b=="function")R||US(u);else if(R){var k=null;if(b&&b.hasAttribute("formAction")){if(y=b,R=b[vs]||null)k=R.formAction;else if(Km(y)!==null)continue}else k=R.action;typeof k=="function"?u[m+1]=k:(u.splice(m,3),m-=3),US(u)}}}function jS(){function r(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(R){return y=R})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function Ym(r){this._internalRoot=r}Ku.prototype.render=Ym.prototype.render=function(r){var l=this._internalRoot;if(l===null)throw Error(n(409));var u=l.current,m=Bs();IS(u,m,r,l,null,null)},Ku.prototype.unmount=Ym.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var l=r.containerInfo;IS(r.current,2,null,r,null,null),wu(),l[Sa]=null}};function Ku(r){this._internalRoot=r}Ku.prototype.unstable_scheduleHydration=function(r){if(r){var l=Uf();r={blockedOn:null,target:r,priority:l};for(var u=0;u<ir.length&&l!==0&&l<ir[u].priority;u++);ir.splice(u,0,r),u===0&&BS(r)}};var $S=t.version;if($S!=="19.2.1")throw Error(n(527,$S,"19.2.1"));j.findDOMNode=function(r){var l=r._reactInternals;if(l===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=f(l),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var xO={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qu.isDisabled&&qu.supportsFiber)try{_r=qu.inject(xO),us=qu}catch{}}return Nl.createRoot=function(r,l){if(!i(r))throw Error(n(299));var u=!1,m="",y=Yx,b=Wx,R=Qx;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),l=CS(r,1,!1,null,null,u,m,null,y,b,R,jS),r[Sa]=l.current,Cm(r),new Ym(l)},Nl.hydrateRoot=function(r,l,u){if(!i(r))throw Error(n(299));var m=!1,y="",b=Yx,R=Wx,k=Qx,H=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(k=u.onRecoverableError),u.formState!==void 0&&(H=u.formState)),l=CS(r,1,!0,l,u??null,m,y,H,b,R,k,jS),l.context=DS(null),u=l.current,m=Bs(),m=ba(m),y=Gi(m),y.callback=null,Hi(u,y,m),u=m,l.current.lanes=u,me(l,u),Mn(l),r[Sa]=l.current,Cm(r),new Ku(l)},Nl.version="19.2.1",Nl}var mE;function VP(){if(mE)return ep.exports;mE=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(t){console.error(t)}}return s(),ep.exports=$P(),ep.exports}var GP=VP(),HP=(function(){function s(){this.keyToValue=new Map,this.valueToKey=new Map}return s.prototype.set=function(t,e){this.keyToValue.set(t,e),this.valueToKey.set(e,t)},s.prototype.getByKey=function(t){return this.keyToValue.get(t)},s.prototype.getByValue=function(t){return this.valueToKey.get(t)},s.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},s})(),vR=(function(){function s(t){this.generateIdentifier=t,this.kv=new HP}return s.prototype.register=function(t,e){this.kv.getByValue(t)||(e||(e=this.generateIdentifier(t)),this.kv.set(e,t))},s.prototype.clear=function(){this.kv.clear()},s.prototype.getIdentifier=function(t){return this.kv.getByValue(t)},s.prototype.getValue=function(t){return this.kv.getByKey(t)},s}
49)(),zP=(function(){var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},s(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}})(),KP=(function(s){zP(t,s);function t(){var e=s.call(this,function(n){return n.name})||this;return e.classToAllowedProps=new Map,e}return t.prototype.register=function(e,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(e,n.allowProps),s.prototype.register.call(this,e,n.identifier)):s.prototype.register.call(this,e,n)},t.prototype.getAllowedProps=function(e){return this.classToAllowedProps.get(e)},t})(vR),qP=function(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a};function YP(s){if("values"in Object)return Object.values(s);var t=[];for(var e in s)s.hasOwnProperty(e)&&t.push(s[e]);return t}function WP(s,t){var e=YP(s);if("find"in e)return e.find(t);for(var n=e,i=0;i<n.length;i++){var a=n[i];if(t(a))return a}}function Co(s,t){Object.entries(s).forEach(function(e){var n=qP(e,2),i=n[0],a=n[1];return t(a,i)})}function Rd(s,t){return s.indexOf(t)!==-1}function pE(s,t){for(var e=0;e<s.length;e++){var n=s[e];if(t(n))return n}}var QP=(function(){function s(){this.transfomers={}}return s.prototype.register=function(t){this.transfomers[t.name]=t},s.prototype.findApplicable=function(t){return WP(this.transfomers,function(e){return e.isApplicable(t)})},s.prototype.findByName=function(t){return this.transfomers[t]},s})(),XP=function(s){return Object.prototype.toString.call(s).slice(8,-1)},xR=function(s){return typeof s>"u"},ZP=function(s){return s===null},oc=function(s){return typeof s!="object"||s===null||s===Object.prototype?!1:Object.getPrototypeOf(s)===null?!0:Object.getPrototypeOf(s)===Object.prototype},hg=function(s){return oc(s)&&Object.keys(s).length===0},vr=function(s){return Array.isArray(s)},JP=function(s){return typeof s=="string"},t2=function(s){return typeof s=="number"&&!isNaN(s)},e2=function(s){return typeof s=="boolean"},s2=function(s){return s instanceof RegExp},lc=function(s){return s instanceof Map},cc=function(s){return s instanceof Set},bR=function(s){return XP(s)==="Symbol"},n2=function(s){return s instanceof Date&&!isNaN(s.valueOf())},i2=function(s){return s instanceof Error},gE=function(s){return typeof s=="number"&&isNaN(s)},r2=function(s){return e2(s)||ZP(s)||xR(s)||t2(s)||JP(s)||bR(s)},a2=function(s){return typeof s=="bigint"},o2=function(s){return s===1/0||s===-1/0},l2=function(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)},c2=function(s){return s instanceof URL},SR=function(s){return s.replace(/\./g,"\\.")},rp=function(s){return s.map(String).map(SR).join(".")},ql=function(s){for(var t=[],e="",n=0;n<s.length;n++){var i=s.charAt(n),a=i==="\\"&&s.charAt(n+1)===".";if(a){e+=".",n++;continue}var o=i===".";if(o){t.push(e),e="";continue}e+=i}var c=e;return t.push(c),t},mg=function(){return mg=Object.assign||function(s){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},mg.apply(this,arguments)},pg=function(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a},gg=function(s,t){for(var e=0,n=t.length,i=s.length;e<n;e++,i++)s[i]=t[e];return s};function Nn(s,t,e,n){return{isApplicable:s,annotation:t,transform:e,untransform:n}}var ER=[Nn(xR,"undefined",function(){return null},function(){}),Nn(a2,"bigint",function(s){return s.toString()},function(s){return typeof BigInt<"u"?BigInt(s):(console.error("Please add a BigInt polyfill."),s)}),Nn(n2,"Date",function(s){return s.toISOString()},function(s){return new Date(s)}),Nn(i2,"Error",function(s,t){var e={name:s.name,message:s.message};return t.allowedErrorProps.forEach(function(n){e[n]=s[n]}),e},function(s,t){var e=new Error(s.message);return e.name=s.name,e.stack=s.stack,t.allowedErrorProps.forEach(function(n){e[n]=s[n]}),e}),Nn(s2,"regexp",function(s){return""+s},function(s){var t=s.slice(1,s.lastIndexOf("/")),e=s.slice(s.lastIndexOf("/")+1);return new RegExp(t,e)}
49),Nn(cc,"set",function(s){return gg([],pg(s.values()))},function(s){return new Set(s)}),Nn(lc,"map",function(s){return gg([],pg(s.entries()))},function(s){return new Map(s)}),Nn(function(s){return gE(s)||o2(s)},"number",function(s){return gE(s)?"NaN":s>0?"Infinity":"-Infinity"},Number),Nn(function(s){return s===0&&1/s===-1/0},"number",function(){return"-0"},Number),Nn(c2,"URL",function(s){return s.toString()},function(s){return new URL(s)})];function bf(s,t,e,n){return{isApplicable:s,annotation:t,transform:e,untransform:n}}var TR=bf(function(s,t){if(bR(s)){var e=!!t.symbolRegistry.getIdentifier(s);return e}return!1},function(s,t){var e=t.symbolRegistry.getIdentifier(s);return["symbol",e]},function(s){return s.description},function(s,t,e){var n=e.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),u2=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(s,t){return s[t.name]=t,s},{}),AR=bf(l2,function(s){return["typed-array",s.constructor.name]},function(s){return gg([],pg(s))},function(s,t){var e=u2[t[1]];if(!e)throw new Error("Trying to deserialize unknown typed array");return new e(s)});function RR(s,t){if(s?.constructor){var e=!!t.classRegistry.getIdentifier(s.constructor);return e}return!1}var wR=bf(RR,function(s,t){var e=t.classRegistry.getIdentifier(s.constructor);return["class",e]},function(s,t){var e=t.classRegistry.getAllowedProps(s.constructor);if(!e)return mg({},s);var n={};return e.forEach(function(i){n[i]=s[i]}),n},function(s,t,e){var n=e.classRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(n.prototype),s)}),LR=bf(function(s,t){return!!t.customTransformerRegistry.findApplicable(s)},function(s,t){var e=t.customTransformerRegistry.findApplicable(s);return["custom",e.name]},function(s,t){var e=t.customTransformerRegistry.findApplicable(s);return e.serialize(s)},function(s,t,e){var n=e.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(s)}),d2=[wR,TR,LR,AR],yE=function(s,t){var e=pE(d2,function(i){return i.isApplicable(s,t)});if(e)return{value:e.transform(s,t),type:e.annotation(s,t)};var n=pE(ER,function(i){return i.isApplicable(s,t)});if(n)return{value:n.transform(s,t),type:n.annotation}},_R={};ER.forEach(function(s){_R[s.annotation]=s});var f2=function(s,t,e){if(vr(t))switch(t[0]){case"symbol":return TR.untransform(s,t,e);case"class":return wR.untransform(s,t,e);case"custom":return LR.untransform(s,t,e);case"typed-array":return AR.untransform(s,t,e);default:throw new Error("Unknown transformation: "+t)}else{var n=_R[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(s,e)}},po=function(s,t){for(var e=s.keys();t>0;)e.next(),t--;return e.next().value};function CR(s){if(Rd(s,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Rd(s,"prototype"))throw new Error("prototype is not allowed as a property");if(Rd(s,"constructor"))throw new Error("constructor is not allowed as a property")}var h2=function(s,t){CR(t);for(var e=0;e<t.length;e++){var n=t[e];if(cc(s))s=po(s,+n);else if(lc(s)){var i=+n,a=+t[++e]==0?"key":"value",o=po(s,i);switch(a){case"key":s=o;break;case"value":s=s.get(o);break}}else s=s[n]}return s},yg=function(s,t,e){if(CR(t),t.length===0)return e(s);for(var n=s,i=0;i<t.length-1;i++){var a=t[i];if(vr(n)){var o=+a;n=n[o]}else if(oc(n))n=n[a];else if(cc(n)){var c=+a;n=po(n,c)}else if(lc(n)){var d=i===t.length-2;if(d)break;var c=+a,f=+t[++i]==0?"key":"value",h=po(n,c);switch(f){case"key":n=h;break;case"value":n=n.get(h);break}}}var p=t[t.length-1];if(vr(n)?n[+p]=e(n[+p]):oc(n)&&(n[p]=e(n[p])),cc(n)){var g=po(n,+p),v=e(g);g!==v&&(n.delete(g),n.add(v))}if(lc(n)){var c=+t[t.length-2],x=po(n,c),f=+p==0?"key":"value";switch(f){case"key":{var S=e(x);n.set(S,n.get(x)),S!==x&&n.delete(x);break}case"value":{n.set(x,e(n.get(x)));break}}}return s},Li=function(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a},hr=function(s,t){for(var e=0,n=t.length,i=s.length;e<n;e++,i++)s[i]=t[e];return s};function vg(s,t,e){if(e===void 0&&(e=[]),!!s){if(!vr(s)){Co(s,function(o,c){return vg(o,t,hr(hr([],Li(e)),Li(ql(c))))});return}var n=Li(s,2),i=n[0],a=n[1];a&&Co(a,function(o,c){vg(o,t,hr(hr([],Li(e)),Li(ql(c))))}),t(i,e)}}function m2(s,t,e){return vg(t,function(n,i){s=yg(s,i,function(a){return f2(a,n,e)})}),s}function p2(s,t){function e(o,c){var d=h2(s,ql(c));o.map(ql).forEach(function(f){s=yg(s,f,function(){return d})})}if(vr(t)){var n=Li(t,2),i=n[0],a=n[1];
49i.forEach(function(o){s=yg(s,ql(o),function(){return s})}),a&&Co(a,e)}else Co(t,e);return s}var g2=function(s,t){return oc(s)||vr(s)||lc(s)||cc(s)||RR(s,t)};function y2(s,t,e){var n=e.get(s);n?n.push(t):e.set(s,[t])}function v2(s,t){var e={},n=void 0;return s.forEach(function(i){if(!(i.length<=1)){t||(i=i.map(function(d){return d.map(String)}).sort(function(d,f){return d.length-f.length}));var a=Li(i),o=a[0],c=a.slice(1);o.length===0?n=c.map(rp):e[rp(o)]=c.map(rp)}}),n?hg(e)?[n]:[n,e]:hg(e)?void 0:e}var DR=function(s,t,e,n,i,a,o){var c;i===void 0&&(i=[]),a===void 0&&(a=[]),o===void 0&&(o=new Map);var d=r2(s);if(!d){y2(s,i,t);var f=o.get(s);if(f)return n?{transformedValue:null}:f}if(!g2(s,e)){var h=yE(s,e),p=h?{transformedValue:h.value,annotations:[h.type]}:{transformedValue:s};return d||o.set(s,p),p}if(Rd(a,s))return{transformedValue:null};var g=yE(s,e),v=(c=g?.value)!==null&&c!==void 0?c:s,x=vr(v)?[]:{},S={};Co(v,function(T,L){var _=DR(T,t,e,n,hr(hr([],Li(i)),[L]),hr(hr([],Li(a)),[s]),o);x[L]=_.transformedValue,vr(_.annotations)?S[L]=_.annotations:oc(_.annotations)&&Co(_.annotations,function(P,D){S[SR(L)+"."+D]=P})});var E=hg(S)?{transformedValue:x,annotations:g?[g.type]:void 0}:{transformedValue:x,annotations:g?[g.type,S]:S};return d||o.set(s,E),E};function IR(s){return Object.prototype.toString.call(s).slice(8,-1)}function vE(s){return IR(s)==="Array"}function x2(s){if(IR(s)!=="Object")return!1;const t=Object.getPrototypeOf(s);return!!t&&t.constructor===Object&&t===Object.prototype}function b2(s,t,e,n,i){const a={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";a==="enumerable"&&(s[t]=e),i&&a==="nonenumerable"&&Object.defineProperty(s,t,{value:e,enumerable:!1,writable:!0,configurable:!0})}function xg(s,t={}){if(vE(s))return s.map(i=>xg(i,t));if(!x2(s))return s;const e=Object.getOwnPropertyNames(s),n=Object.getOwnPropertySymbols(s);return[...e,...n].reduce((i,a)=>{if(vE(t.props)&&!t.props.includes(a))return i;const o=s[a],c=xg(o,t);return b2(i,a,c,s,t.nonenumerable),i},{})}var ta=function(){return ta=Object.assign||function(s){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},ta.apply(this,arguments)},S2=function(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a},E2=function(s,t){for(var e=0,n=t.length,i=s.length;e<n;e++,i++)s[i]=t[e];return s},Oi=(function(){function s(t){var e=t===void 0?{}:t,n=e.dedupe,i=n===void 0?!1:n;this.classRegistry=new KP,this.symbolRegistry=new vR(function(a){var o;return(o=a.description)!==null&&o!==void 0?o:""}),this.customTransformerRegistry=new QP,this.allowedErrorProps=[],this.dedupe=i}return s.prototype.serialize=function(t){var e=new Map,n=DR(t,e,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta=ta(ta({},i.meta),{values:n.annotations}));var a=v2(e,this.dedupe);return a&&(i.meta=ta(ta({},i.meta),{referentialEqualities:a})),i},s.prototype.deserialize=function(t){var e=t.json,n=t.meta,i=xg(e);return n?.values&&(i=m2(i,n.values,this)),n?.referentialEqualities&&(i=p2(i,n.referentialEqualities)),i},s.prototype.stringify=function(t){return JSON.stringify(this.serialize(t))},s.prototype.parse=function(t){return this.deserialize(JSON.parse(t))},s.prototype.registerClass=function(t,e){this.classRegistry.register(t,e)},s.prototype.registerSymbol=function(t,e){this.symbolRegistry.register(t,e)},s.prototype.registerCustom=function(t,e){this.customTransformerRegistry.register(ta({name:e},t))},s.prototype.allowErrorProps=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(t=this.allowedErrorProps).push.apply(t,E2([],S2(e)))},s.defaultInstance=new s,s.serialize=s.defaultInstance.serialize.bind(s.defaultInstance),s.deserialize=s.defaultInstance.deserialize.bind(s.defaultInstance),s.stringify=s.defaultInstance.stringify.bind(s.defaultInstance),s.parse=s.defaultInstance.parse.bind(s.defaultInstance),s.registerClass=s.defaultInstance.registerClass.bind(s.defaultInstance),s.registerSymbol=s.defaultInstance.registerSymbol.bind(s.defaultInstance),s.registerCustom=s.defaultInstance.registerCustom.bind(s.defaultInstance),s.allowErrorProps=s.defaultInstance.allowErrorProps.bind(s.defaultInstance),s})();Oi.serialize;Oi.deserialize;Oi.stringify;Oi.parse;Oi.registerClass;Oi.registerCustom;Oi.registerSymbol;Oi.allowErrorProps;var T2=(s,t,e,n,i,a,o,c)=>{let d=document.documentElement,f=["light","dark"];
vendor: 7,461 bytes, line 49
49function h(v){(Array.isArray(s)?s:[s]).forEach(x=>{let S=x==="class",E=S&&a?i.map(T=>a[T]||T):i;S?(d.classList.remove(...E),d.classList.add(a&&a[v]?a[v]:v)):d.setAttribute(x,v)}),p(v)}function p(v){c&&f.includes(v)&&(d.style.colorScheme=v)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)h(n);else try{let v=localStorage.getItem(t)||e,x=o&&v==="system"?g():v;h(x)}catch{}},A2=$.createContext(void 0),R2={setTheme:s=>{},themes:[]},w2=()=>{var s;return(s=$.useContext(A2))!=null?s:R2};$.memo(({forcedTheme:s,storageKey:t,attribute:e,enableSystem:n,enableColorScheme:i,defaultTheme:a,value:o,themes:c,nonce:d,scriptProps:f})=>{let h=JSON.stringify([e,t,a,s,c,o,n,i]).slice(1,-1);return $.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${T2.toString()})(${h})`}})});var I0=yR();const L2=D1(I0);function _2(s){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",t.appendChild(e),e.styleSheet?e.styleSheet.cssText=s:e.appendChild(document.createTextNode(s))}const C2=s=>{switch(s){case"success":return O2;case"info":return P2;case"warning":return k2;case"error":return M2;default:return null}},D2=Array(12).fill(0),I2=({visible:s,className:t})=>mt.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":s},mt.createElement("div",{className:"sonner-spinner"},D2.map((e,n)=>mt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),O2=mt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},mt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),k2=mt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},mt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),P2=mt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},mt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),M2=mt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},mt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),N2=mt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},mt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),mt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),B2=()=>{const[s,t]=mt.useState(document.hidden);return mt.useEffect(()=>{const e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),s};let bg=1;class F2{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;const{message:n,...i}=t,a=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:bg++,o=this.toasts.find(d=>d.id===a),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(d=>d.id===a?(this.publish({...d,...t,id:a,title:n}),{...d,...t,id:a,dismissible:c,title:n}):d):this.addToast({title:n,...i,dismissible:c,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,o;const c=i.then(async f=>{if(o=["resolve",f],mt.isValidElement(f))a=!1,this.create({id:n,type:"default",message:f});else if(j2(f)&&!f.ok){a=!1;const p=typeof e.error=="function"?await e.error(`HTTP error! status: ${f.status}`):e.error,g=typeof e.description=="function"?await e.description(`HTTP error! status: ${f.status}`):e.description,x=typeof p=="object"&&!mt.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:g,...x})}else if(f instanceof Error){a=!1;const p=typeof e.error=="function"?await e.error(f):e.error,g=typeof e.description=="function"?await e.description(f):e.description,x=typeof p=="object"&&!mt.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:g,...x})}else if(e.success!==void 0){a=!1;const p=typeof e.success=="function"?await e.success(f):e.success,g=typeof e.description=="function"?await e.description(f):e.description,x=typeof p=="object"&&!mt.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:g,...x})}}).catch(async f=>{if(o=["reject",f],e.error!==void 0){a=!1;const h=typeof e.error=="function"?await e.error(f):e.error,p=typeof e.description=="function"?await e.description(f):e.description,v=typeof h=="object"&&!mt.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:p,...v})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),e.finally==null||e.finally.call(e)}),d=()=>new Promise((f,h)=>c.then(()=>o[0]==="reject"?h(o[1]):f(o[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:d}:Object.assign(n,{unwrap:d})},this.custom=(t,e)=>{const n=e?.id||bg++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ws=new F2,U2=(s,t)=>{const e=t?.id||bg++;return ws.addToast({title:s,...t,id:e}),e},j2=s=>s&&typeof s=="object"&&"ok"in s&&typeof s.ok=="boolean"&&"status"in s&&typeof s.status=="number",$2=U2,V2=()=>ws.toasts,G2=()=>ws.getActiveToasts();Object.assign($2,{success:ws.success,info:ws.info,warning:ws.warning,error:ws.error,custom:ws.custom,message:ws.message,promise:ws.promise,dismiss:ws.dismiss,loading:ws.loading},{getHistory:V2,getToasts:G2});_2
vendor: 14,873 bytes, line 49
49("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family: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;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function
vendor: 943 bytes, line 49
49Zu(s){return s.label!==void 0}const H2=3,z2="24px",K2="16px",xE=4e3,q2=356,Y2=14,W2=45,Q2=200;function Bn(...s){return s.filter(Boolean).join(" ")}function X2(s){const[t,e]=s.split("-"),n=[];return t&&n.push(t),e&&n.push(e),n}const Z2=s=>{var t,e,n,i,a,o,c,d,f;const{invert:h,toast:p,unstyled:g,interacting:v,setHeights:x,visibleToasts:S,heights:E,index:T,toasts:L,expanded:_,removeToast:P,defaultRichColors:D,closeButton:B,style:C,cancelButtonStyle:I,actionButtonStyle:F,className:U="",descriptionClassName:z="",duration:Y,position:nt,gap:it,expandByDefault:rt,classNames:M,icons:j,closeButtonAriaLabel:N="Close toast"}=s,[V,X]=mt.useState(null),[O,G]=mt.useState(null),[K,J]=mt.useState(!1),[ot,ft]=mt.useState(!1),[ht,xt]=mt.useState(!1),[wt,Zt]=mt.useState(!1),[fe,Fe]=mt.useState(!1),[Cs,cs]=mt.useState(0),[ga,Mt]=mt.useState(0),le=mt.useRef(p.duration||Y||xE),Ge=mt.useRef(null),Ae=mt.useRef(null),Ye=T===0,Ys=T+1<=S,he=p.type,pn=p.dism
vendor: 13,468 bytes, line 49
49issible!==!1,Ie=p.className||"",ya=p.descriptionClassName||"",Ds=mt.useMemo(()=>E.findIndex(Ct=>Ct.toastId===p.id)||0,[E,p.id]),Lr=mt.useMemo(()=>{var Ct;return(Ct=p.closeButton)!=null?Ct:B},[p.closeButton,B]),si=mt.useMemo(()=>p.duration||Y||xE,[p.duration,Y]),ki=mt.useRef(0),Ws=mt.useRef(0),Cn=mt.useRef(0),Pi=mt.useRef(null),[_r,us]=nt.split("-"),gn=mt.useMemo(()=>E.reduce((Ct,ce,He)=>He>=Ds?Ct:Ct+ce.height,0),[E,Ds]),is=B2(),Ff=p.invert||h,Ho=he==="loading";Ws.current=mt.useMemo(()=>Ds*it+gn,[Ds,gn]),mt.useEffect(()=>{le.current=si},[si]),mt.useEffect(()=>{J(!0)},[]),mt.useEffect(()=>{const Ct=Ae.current;if(Ct){const ce=Ct.getBoundingClientRect().height;return Mt(ce),x(He=>[{toastId:p.id,height:ce,position:p.position},...He]),()=>x(He=>He.filter(rs=>rs.toastId!==p.id))}},[x,p.id]),mt.useLayoutEffect(()=>{if(!K)return;const Ct=Ae.current,ce=Ct.style.height;Ct.style.height="auto";const He=Ct.getBoundingClientRect().height;Ct.style.height=ce,Mt(He),x(rs=>rs.find(me=>me.toastId===p.id)?rs.map(me=>me.toastId===p.id?{...me,height:He}:me):[{toastId:p.id,height:He,position:p.position},...rs])},[K,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const Dn=mt.useCallback(()=>{ft(!0),cs(Ws.current),x(Ct=>Ct.filter(ce=>ce.toastId!==p.id)),setTimeout(()=>{P(p)},Q2)},[p,P,x,Ws]);mt.useEffect(()=>{if(p.promise&&he==="loading"||p.duration===1/0||p.type==="loading")return;let Ct;return _||v||is?(()=>{if(Cn.current<ki.current){const rs=new Date().getTime()-ki.current;le.current=le.current-rs}Cn.current=new Date().getTime()})():(()=>{le.current!==1/0&&(ki.current=new Date().getTime(),Ct=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Dn()},le.current))})(),()=>clearTimeout(Ct)},[_,v,p,he,is,Dn]),mt.useEffect(()=>{p.delete&&(Dn(),p.onDismiss==null||p.onDismiss.call(p,p))},[Dn,p.delete]);function va(){var Ct;if(j?.loading){var ce;return mt.createElement("div",{className:Bn(M?.loader,p==null||(ce=p.classNames)==null?void 0:ce.loader,"sonner-loader"),"data-visible":he==="loading"},j.loading)}return mt.createElement(I2,{className:Bn(M?.loader,p==null||(Ct=p.classNames)==null?void 0:Ct.loader),visible:he==="loading"})}const xa=p.icon||j?.[he]||C2(he);var Cr,In;return mt.createElement("li",{tabIndex:0,ref:Ae,className:Bn(U,Ie,M?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,M?.default,M?.[he],p==null||(e=p.classNames)==null?void 0:e[he]),"data-sonner-toast":"","data-rich-colors":(Cr=p.richColors)!=null?Cr:D,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":K,"data-promise":!!p.promise,"data-swiped":fe,"data-removed":ot,"data-visible":Ys,"data-y-position":_r,"data-x-position":us,"data-index":T,"data-front":Ye,"data-swiping":ht,"data-dismissible":pn,"data-type":he,"data-invert":Ff,"data-swipe-out":wt,"data-swipe-direction":O,"data-expanded":!!(_||rt&&K),"data-testid":p.testId,style:{"--index":T,"--toasts-before":T,"--z-index":L.length-T,"--offset":`${ot?Cs:Ws.current}px`,"--initial-height":rt?"auto":`${ga}px`,...C,...p.style},onDragEnd:()=>{xt(!1),X(null),Pi.current=null},onPointerDown:Ct=>{Ct.button!==2&&(Ho||!pn||(Ge.current=new Date,cs(Ws.current),Ct.target.setPointerCapture(Ct.pointerId),Ct.target.tagName!=="BUTTON"&&(xt(!0),Pi.current={x:Ct.clientX,y:Ct.clientY})))},onPointerUp:()=>{var Ct,ce,He;if(wt||!pn)return;Pi.current=null;const rs=Number(((Ct=Ae.current)==null?void 0:Ct.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Mi=Number(((ce=Ae.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),me=new Date().getTime()-((He=Ge.current)==null?void 0:He.getTime()),ps=V==="x"?rs:Mi,Dr=Math.abs(ps)/me;if(Math.abs(ps)>=W2||Dr>.11){cs(Ws.current),p.onDismiss==null||p.onDismiss.call(p,p),G(V==="x"?rs>0?"right":"left":Mi>0?"down":"up"),Dn(),Zt(!0);return}else{var gs,ys;(gs=Ae.current)==null||gs.style.setProperty("--swipe-amount-x","0px"),(ys=Ae.current)==null||ys.style.setProperty("--swipe-amount-y","0px")}Fe(!1),xt(!1),X(null)},onPointerMove:Ct=>{var ce,He,rs;if(!Pi.current||!pn||((ce=window.getSelection())==null?void 0:ce.toString().length)>0)return;const me=Ct.clientY-Pi.current.y,ps=Ct.clientX-Pi.current.x;var Dr;const gs=(Dr=s.swipeDirections)!=null?Dr:X2(nt);!V&&(Math.abs(ps)>1||Math.abs(me)>1)&&X(Math.abs(ps)>Math.abs(me)?"x":"y");let ys={x:0,y:0};const ba=yn=>1/(1.5+Math.abs(yn)/20);if(V==="y"){if(gs.includes("top")||gs.includes("bottom"))if(gs.includes("top")&&me<0||gs.includes("bottom")&&me>0)ys.y=me;else{const yn=me*ba(me);ys.y=Math.abs(yn)<Math.abs(me)?yn:me}}else if(V==="x"&&(gs.includes("left")||gs.includes("right")))if(gs.includes("left")&&ps<0||gs.includes("right")&&ps>0)ys.x=ps;else{const yn=ps*ba(ps);ys.x=Math.abs(yn)<Math.abs(ps)?yn:ps}(Math.abs(ys.x)>0||Math.abs(ys.y)>0)&&Fe(!0),(He=Ae.current)==null||He.style.setProperty("--swipe-amount-x",`${ys.x}px`),(rs=Ae.current)==null||rs.style.setProperty("--swipe-amount-y",`${ys.y}px`)}},Lr&&!p.jsx&&he!=="loading"?mt.createElement("button",{"aria-label":N,"data-disabled":Ho,"data-close-button":!0,onClick:Ho||!pn?()=>{}:()=>{Dn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Bn(M?.closeButton,p==null||(n=p.classNames)==null?void 0:n.closeButton)},(In=j?.close)!=null?In:N2):null,(he||p.icon||p.promise)&&p.icon!==null&&(j?.[he]!==null||p.icon)?mt.createElement("div",{"data-icon":"",className:Bn(M?.icon,p==null||(i=p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||va():null,p.type!=="loading"?xa:null):null,mt.createElement("div",{"data-content":"",className:Bn(M?.content,p==null||(a=p.classNames)==null?void 0:a.content)},mt.createElement("div",{"data-title":"",className:Bn(M?.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?mt.createElement("div",{"data-description":"",className:Bn(z,ya,M?.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),mt.isValidElement(p.cancel)?p.cancel:p.cancel&&Zu(p.cancel)?mt.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||I,onClick:Ct=>{Zu(p.cancel)&&pn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ct),Dn())},className:Bn(M?.cancelButton,p==null||(d=p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,mt.isValidElement(p.action)?p.action:p.action&&Zu(p.action)?mt.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||F,onClick:Ct=>{Zu(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ct),!Ct.defaultPrevented&&Dn())},className:Bn(M?.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function bE(){if(typeof window>"u"||typeof document>"u")return"ltr";const s=document.documentElement.getAttribute("dir");return s==="auto"||!s?window.getComputedStyle(document.documentElement).direction:s}function J2(s,t){const e={};return[s,t].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",c=a?K2:z2;function d(f){["top","right","bottom","left"].forEach(h=>{e[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof n=="number"||typeof n=="string"?d(n):typeof n=="object"?["top","right","bottom","left"].forEach(f=>{n[f]===void 0?e[`${o}-${f}`]=c:e[`${o}-${f}`]=typeof n[f]=="number"?`${n[f]}px`:n[f]}):d(c)}),e}const tM=mt.forwardRef(function(t,e){const{id:n,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:d,className:f,offset:h,mobileOffset:p,theme:g="light",richColors:v,duration:x,style:S,visibleToasts:E=H2,toastOptions:T,dir:L=bE(),gap:_=Y2,icons:P,containerAriaLabel:D="Notifications"}=t,[B,C]=mt.useState([]),I=mt.useMemo(()=>n?B.filter(K=>K.toasterId===n):B.filter(K=>!K.toasterId),[B,n]),F=mt.useMemo(()=>Array.from(new Set([a].concat(I.filter(K=>K.position).map(K=>K.position)))),[I,a]),[U,z]=mt.useState([]),[Y,nt]=mt.useState(!1),[it,rt]=mt.useState(!1),[M,j]=mt.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=mt.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=mt.useRef(null),O=mt.useRef(!1),G=mt.useCallback(K=>{C(J=>{var ot;return(ot=J.find(ft=>ft.id===K.id))!=null&&ot.delete||ws.dismiss(K.id),J.filter(({id:ft})=>ft!==K.id)})},[]);return mt.useEffect(()=>ws.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{C(J=>J.map(ot=>ot.id===K.id?{...ot,delete:!0}:ot))});return}setTimeout(()=>{L2.flushSync(()=>{C(J=>{const ot=J.findIndex(ft=>ft.id===K.id);return ot!==-1?[...J.slice(0,ot),{...J[ot],...K},...J.slice(ot+1)]:[K,...J]})})})}),[B]),mt.useEffect(()=>{if(g!=="system"){j(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:J})=>{j(J?"dark":"light")})}catch{K.addListener(({matches:ot})=>{try{j(ot?"dark":"light")}catch(ft){console.error(ft)}})}},[g]),mt.useEffect(()=>{B.length<=1&&nt(!1)},[B]),mt.useEffect(()=>{const K=J=>{var ot;if(o.every(xt=>J[xt]||J.code===xt)){var ht;nt(!0),(ht=N.current)==null||ht.focus()}J.code==="Escape"&&(document.activeElement===N.current||(ot=N.current)!=null&&ot.contains(document.activeElement))&&nt(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[o]),mt.useEffect(()=>{if(N.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,O.current=!1)}},[N.current]),mt.createElement("section",{ref:e,"aria-label":`${D} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((K,J)=>{var ot;const[ft,ht]=K.split("-");return I.length?mt.createElement("ol",{key:K,dir:L==="auto"?bE():L,tabIndex:-1,ref:N,className:f,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ft,"data-x-position":ht,style:{"--front-toast-height":`${((ot=U[0])==null?void 0:ot.height)||0}px`,"--width":`${q2}px`,"--gap":`${_}px`,...S,...J2(h,p)},onBlur:xt=>{O.current&&!xt.currentTarget.contains(xt.relatedTarget)&&(O.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:xt=>{xt.target instanceof HTMLElement&&xt.target.dataset.dismissible==="false"||O.current||(O.current=!0,X.current=xt.relatedTarget)},onMouseEnter:()=>nt(!0),onMouseMove:()=>nt(!0),onMouseLeave:()=>{it||nt(!1)},onDragEnd:()=>nt(!1),onPointerDown:xt=>{xt.target instanceof HTMLElement&&xt.target.dataset.dismissible==="false"||rt(!0)},onPointerUp:()=>rt(!1)},I.filter(xt=>!xt.position&&J===0||xt.position===K).map((xt,wt)=>{var Zt,fe;return mt.createElement(Z2,{key:xt.id,icons:P,index:wt,toast:xt,defaultRichColors:v,duration:(Zt=T?.duration)!=null?Zt:x,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:i,visibleToasts:E,closeButton:(fe=T?.closeButton)!=null?fe:d,interacting:it,position:K,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:G,toasts:I.filter(Fe=>Fe.position==xt.position),heights:U.filter(Fe=>Fe.position==xt.position),setHeights:z,expandByDefault:c,gap:_,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),eM=({...s})=>{const{theme:t="system"}=w2();return A.jsx(tM,{"data-loc":"client/src/components/ui/sonner.tsx:8",theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...s})};function wi(s,t,{checkForDefaultPrevented:e=!0}={}){return function(i){if(s?.(i),e===!1||!i.defaultPrevented)return t?.(i)}}function SE(s,t){if(typeof s=="function")return s(t);s!=null&&(s.current=t)}function OR(...s){return t=>{let e=!1;const n=s.map(i=>{const a=SE(i,t);return!e&&typeof a=="function"&&(e=!0),a});if(e)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():SE(s[i],null)}}}}function ma(...s){return $.useCallback(OR(...s),s)}function kR(s,t=[]){let e=[];function n(a,o){const c=$.createContext(o),d=e.length;e=[...e,o];const f=p=>{const{scope:g,children:v,...x}=p,S=g?.[s]?.[d]||c,E=$.useMemo(()=>x,Object.values(x));return A.jsx(S.Provider,{value:E,children:v})};f.displayName=a+"Provider";function h(p,g){const v=g?.[s]?.[d]||c,x=$.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[f,h]}const i=()=>{const a=e.map(o=>$.createContext(o));return function(c){const d=c?.[s]||a;return $.useMemo(()=>({[`__scope${s}`]:{...c,[s]:d}}),[c,d])}};return i.scopeName=s,[n,sM(i,...t)]}function sM(...s){const t=s[0];if(s.length===1)return t;const e=()=>{const n=s.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=n.reduce((c,{useScope:d,scopeName:f})=>{const p=d(a)[`__scope${f}`];return{...c,...p}},{});return $.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return e.scopeName=t.scopeName,e}function PR(s){const t=iM(s),e=$.forwardRef((n,i)=>{const{children:a,...o}=n,c=$.Children.toArray(a),d=c.find(aM);if(d){const f=d.props.children,h=c.map(p=>p===d?$.Children.count(f)>1?$.Children.only(null):$.isValidElement(f)?f.props.children:null:p);return A.jsx(t,{...o,ref:i,children:$.isValidElement(f)?$.cloneElement(f,void 0,h):null})}return A.jsx(t,{...o,ref:i,children:a})});return e.displayName=`${s}.Slot`,e}var nM=PR("Slot");
vendor: 5,316 bytes, line 49
49function iM(s){const t=$.forwardRef((e,n)=>{const{children:i,...a}=e;if($.isValidElement(i)){const o=lM(i),c=oM(a,i.props);return i.type!==$.Fragment&&(c.ref=n?OR(n,o):o),$.cloneElement(i,c)}return $.Children.count(i)>1?$.Children.only(null):null});return t.displayName=`${s}.SlotClone`,t}var MR=Symbol("radix.slottable");function rM(s){const t=({children:e})=>A.jsx(A.Fragment,{children:e});return t.displayName=`${s}.Slottable`,t.__radixId=MR,t}function aM(s){return $.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===MR}function oM(s,t){const e={...t};for(const n in t){const i=s[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?e[n]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(e[n]=i):n==="style"?e[n]={...i,...a}:n==="className"&&(e[n]=[i,a].filter(Boolean).join(" "))}return{...s,...e}}function lM(s){let t=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,e=t&&"isReactWarning"in t&&t.isReactWarning;return e?s.ref:(t=Object.getOwnPropertyDescriptor(s,"ref")?.get,e=t&&"isReactWarning"in t&&t.isReactWarning,e?s.props.ref:s.props.ref||s.ref)}var cM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pa=cM.reduce((s,t)=>{const e=PR(`Primitive.${t}`),n=$.forwardRef((i,a)=>{const{asChild:o,...c}=i,d=o?e:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(d,{...c,ref:a})});return n.displayName=`Primitive.${t}`,{...s,[t]:n}},{});function uM(s,t){s&&I0.flushSync(()=>s.dispatchEvent(t))}function Sf(s){const t=$.useRef(s);return $.useEffect(()=>{t.current=s}),$.useMemo(()=>(...e)=>t.current?.(...e),[])}function dM(s,t=globalThis?.document){const e=Sf(s);$.useEffect(()=>{const n=i=>{i.key==="Escape"&&e(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[e,t])}var fM="DismissableLayer",Sg="dismissableLayer.update",hM="dismissableLayer.pointerDownOutside",mM="dismissableLayer.focusOutside",EE,NR=$.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),BR=$.forwardRef((s,t)=>{const{disableOutsidePointerEvents:e=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...d}=s,f=$.useContext(NR),[h,p]=$.useState(null),g=h?.ownerDocument??globalThis?.document,[,v]=$.useState({}),x=ma(t,C=>p(C)),S=Array.from(f.layers),[E]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),T=S.indexOf(E),L=h?S.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,P=L>=T,D=yM(C=>{const I=C.target,F=[...f.branches].some(U=>U.contains(I));!P||F||(i?.(C),o?.(C),C.defaultPrevented||c?.())},g),B=vM(C=>{const I=C.target;[...f.branches].some(U=>U.contains(I))||(a?.(C),o?.(C),C.defaultPrevented||c?.())},g);return dM(C=>{L===f.layers.size-1&&(n?.(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},g),$.useEffect(()=>{if(h)return e&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(EE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),TE(),()=>{e&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=EE)}},[h,g,e,f]),$.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),TE())},[h,f]),$.useEffect(()=>{const C=()=>v({});return document.addEventListener(Sg,C),()=>document.removeEventListener(Sg,C)},[]),A.jsx(pa.div,{...d,ref:x,style:{pointerEvents:_?P?"auto":"none":void 0,...s.style},onFocusCapture:wi(s.onFocusCapture,B.onFocusCapture),onBlurCapture:wi(s.onBlurCapture,B.onBlurCapture),onPointerDownCapture:wi(s.onPointerDownCapture,D.onPointerDownCapture)})});BR.displayName=fM;var pM="DismissableLayerBranch",gM=$.forwardRef((s,t)=>{const e=$.useContext(NR),n=$.useRef(null),i=ma(t,n);return $.useEffect(()=>{const a=n.current;if(a)return e.branches.add(a),()=>{e.branches.delete(a)}},[e.branches]),A.jsx(pa.div,{...s,ref:i})});gM.displayName=pM;function yM(s,t=globalThis?.document){const e=Sf(s),n=$.useRef(!1),i=$.useRef(()=>{});return $.useEffect(()=>{const a=c=>{if(c.target&&!n.current){let d=function(){FR(hM,e,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,e]),{onPointerDownCapture:()=>n.current=!0}}function vM(s,t=globalThis?.document){const e=Sf(s),n=$.useRef(!1);return $.useEffect(()=>{const i=a=>{a.target&&!n.current&&FR(mM,e,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,e]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function TE(){const s=new CustomEvent(Sg);document.dispatchEvent(s)}function FR(s,t,e,{discrete:n}){const i=e.originalEvent.target,a=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:e});t&&i.addEventListener(s,t,{once:!0}),n?uM(i,a):i.dispatchEvent(a)}var uc=globalThis?.document?$.useLayoutEffect:()=>{};const xM=["top","right","bottom","left"],xr=Math.min,Gs=Math.max,Hd=Math.round,Ju=Math.floor,Kn=s=>({x:s,y:s}
vendor: 19,076 bytes, line 49
49),bM={left:"right",right:"left",bottom:"top",top:"bottom"},SM={start:"end",end:"start"};function Eg(s,t,e){return Gs(s,xr(t,e))}function _i(s,t){return typeof s=="function"?s(t):s}function Ci(s){return s.split("-")[0]}function No(s){return s.split("-")[1]}function O0(s){return s==="x"?"y":"x"}function k0(s){return s==="y"?"height":"width"}const EM=new Set(["top","bottom"]);function Gn(s){return EM.has(Ci(s))?"y":"x"}function P0(s){return O0(Gn(s))}function TM(s,t,e){e===void 0&&(e=!1);const n=No(s),i=P0(s),a=k0(i);let o=i==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=zd(o)),[o,zd(o)]}function AM(s){const t=zd(s);return[Tg(s),t,Tg(t)]}function Tg(s){return s.replace(/start|end/g,t=>SM[t])}const AE=["left","right"],RE=["right","left"],RM=["top","bottom"],wM=["bottom","top"];function LM(s,t,e){switch(s){case"top":case"bottom":return e?t?RE:AE:t?AE:RE;case"left":case"right":return t?RM:wM;default:return[]}}function _M(s,t,e,n){const i=No(s);let a=LM(Ci(s),e==="start",n);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Tg)))),a}function zd(s){return s.replace(/left|right|bottom|top/g,t=>bM[t])}function CM(s){return{top:0,right:0,bottom:0,left:0,...s}}function UR(s){return typeof s!="number"?CM(s):{top:s,right:s,bottom:s,left:s}}function Kd(s){const{x:t,y:e,width:n,height:i}=s;return{width:n,height:i,top:e,left:t,right:t+n,bottom:e+i,x:t,y:e}}function wE(s,t,e){let{reference:n,floating:i}=s;const a=Gn(t),o=P0(t),c=k0(o),d=Ci(t),f=a==="y",h=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,g=n[c]/2-i[c]/2;let v;switch(d){case"top":v={x:h,y:n.y-i.height};break;case"bottom":v={x:h,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-i.width,y:p};break;default:v={x:n.x,y:n.y}}switch(No(t)){case"start":v[o]-=g*(e&&f?-1:1);break;case"end":v[o]+=g*(e&&f?-1:1);break}return v}const DM=async(s,t,e)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=e,c=a.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:s,floating:t,strategy:i}),{x:h,y:p}=wE(f,n,d),g=n,v={},x=0;for(let S=0;S<c.length;S++){const{name:E,fn:T}=c[S],{x:L,y:_,data:P,reset:D}=await T({x:h,y:p,initialPlacement:n,placement:g,strategy:i,middlewareData:v,rects:f,platform:o,elements:{reference:s,floating:t}});h=L??h,p=_??p,v={...v,[E]:{...v[E],...P}},D&&x<=50&&(x++,typeof D=="object"&&(D.placement&&(g=D.placement),D.rects&&(f=D.rects===!0?await o.getElementRects({reference:s,floating:t,strategy:i}):D.rects),{x:h,y:p}=wE(f,g,d)),S=-1)}return{x:h,y:p,placement:g,strategy:i,middlewareData:v}};async function dc(s,t){var e;t===void 0&&(t={});const{x:n,y:i,platform:a,rects:o,elements:c,strategy:d}=s,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=_i(t,s),x=UR(v),E=c[g?p==="floating"?"reference":"floating":p],T=Kd(await a.getClippingRect({element:(e=await(a.isElement==null?void 0:a.isElement(E)))==null||e?E:E.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),L=p==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),P=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},D=Kd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:_,strategy:d}):L);return{top:(T.top-D.top+x.top)/P.y,bottom:(D.bottom-T.bottom+x.bottom)/P.y,left:(T.left-D.left+x.left)/P.x,right:(D.right-T.right+x.right)/P.x}}const IM=s=>({name:"arrow",options:s,async fn(t){const{x:e,y:n,placement:i,rects:a,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=_i(s,t)||{};if(f==null)return{};const p=UR(h),g={x:e,y:n},v=P0(i),x=k0(v),S=await o.getDimensions(f),E=v==="y",T=E?"top":"left",L=E?"bottom":"right",_=E?"clientHeight":"clientWidth",P=a.reference[x]+a.reference[v]-g[v]-a.floating[x],D=g[v]-a.reference[v],B=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let C=B?B[_]:0;(!C||!await(o.isElement==null?void 0:o.isElement(B)))&&(C=c.floating[_]||a.floating[x]);const I=P/2-D/2,F=C/2-S[x]/2-1,U=xr(p[T],F),z=xr(p[L],F),Y=U,nt=C-S[x]-z,it=C/2-S[x]/2+I,rt=Eg(Y,it,nt),M=!d.arrow&&No(i)!=null&&it!==rt&&a.reference[x]/2-(it<Y?U:z)-S[x]/2<0,j=M?it<Y?it-Y:it-nt:0;return{[v]:g[v]+j,data:{[v]:rt,centerOffset:it-rt-j,...M&&{alignmentOffset:j}},reset:M}}}),OM=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(t){var e,n;const{placement:i,middlewareData:a,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...E}=_i(s,t);if((e=a.arrow)!=null&&e.alignmentOffset)return{};const T=Ci(i),L=Gn(c),_=Ci(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),D=g||(_||!S?[zd(c)]:AM(c)),B=x!=="none";!g&&B&&D.push(..._M(c,S,x,P));const C=[c,...D],I=await dc(t,E),F=[];let U=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&F.push(I[T]),p){const it=TM(i,o,P);F.push(I[it[0]],I[it[1]])}if(U=[...U,{placement:i,overflows:F}],!F.every(it=>it<=0)){var z,Y;const it=(((z=a.flip)==null?void 0:z.index)||0)+1,rt=C[it];if(rt&&(!(p==="alignment"?L!==Gn(rt):!1)||U.every(N=>Gn(N.placement)===L?N.overflows[0]>0:!0)))return{data:{index:it,overflows:U},reset:{placement:rt}};let M=(Y=U.filter(j=>j.overflows[0]<=0).sort((j,N)=>j.overflows[1]-N.overflows[1])[0])==null?void 0:Y.placement;if(!M)switch(v){case"bestFit":{var nt;const j=(nt=U.filter(N=>{if(B){const V=Gn(N.placement);return V===L||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,X)=>V+X,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:nt[0];j&&(M=j);break}case"initialPlacement":M=c;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function LE(s,t){return{top:s.top-t.height,right:s.right-t.width,bottom:s.bottom-t.height,left:s.left-t.width}}function _E(s){return xM.some(t=>s[t]>=0)}const kM=function(s){return s===void 0&&(s={}),{name:"hide",options:s,async fn(t){const{rects:e}=t,{strategy:n="referenceHidden",...i}=_i(s,t);switch(n){case"referenceHidden":{const a=await dc(t,{...i,elementContext:"reference"}),o=LE(a,e.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:_E(o)}}}case"escaped":{const a=await dc(t,{...i,altBoundary:!0}),o=LE(a,e.floating);return{data:{escapedOffsets:o,escaped:_E(o)}}}default:return{}}}}},jR=new Set(["left","top"]);async function PM(s,t){const{placement:e,platform:n,elements:i}=s,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Ci(e),c=No(e),d=Gn(e)==="y",f=jR.has(o)?-1:1,h=a&&d?-1:1,p=_i(t,s);let{mainAxis:g,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(v=c==="end"?x*-1:x),d?{x:v*h,y:g*f}:{x:g*f,y:v*h}}const MM=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(t){var e,n;const{x:i,y:a,placement:o,middlewareData:c}=t,d=await PM(t,s);return o===((e=c.offset)==null?void 0:e.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:o}}}}},NM=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(t){const{x:e,y:n,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:c={fn:E=>{let{x:T,y:L}=E;return{x:T,y:L}}},...d}=_i(s,t),f={x:e,y:n},h=await dc(t,d),p=Gn(Ci(i)),g=O0(p);let v=f[g],x=f[p];if(a){const E=g==="y"?"top":"left",T=g==="y"?"bottom":"right",L=v+h[E],_=v-h[T];v=Eg(L,v,_)}if(o){const E=p==="y"?"top":"left",T=p==="y"?"bottom":"right",L=x+h[E],_=x-h[T];x=Eg(L,x,_)}const S=c.fn({...t,[g]:v,[p]:x});return{...S,data:{x:S.x-e,y:S.y-n,enabled:{[g]:a,[p]:o}}}}}},BM=function(s){return s===void 0&&(s={}),{options:s,fn(t){const{x:e,y:n,placement:i,rects:a,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=_i(s,t),h={x:e,y:n},p=Gn(i),g=O0(p);let v=h[g],x=h[p];const S=_i(c,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const _=g==="y"?"height":"width",P=a.reference[g]-a.floating[_]+E.mainAxis,D=a.reference[g]+a.reference[_]-E.mainAxis;v<P?v=P:v>D&&(v=D)}if(f){var T,L;const _=g==="y"?"width":"height",P=jR.has(Ci(i)),D=a.reference[p]-a.floating[_]+(P&&((T=o.offset)==null?void 0:T[p])||0)+(P?0:E.crossAxis),B=a.reference[p]+a.reference[_]+(P?0:((L=o.offset)==null?void 0:L[p])||0)-(P?E.crossAxis:0);x<D?x=D:x>B&&(x=B)}return{[g]:v,[p]:x}}}},FM=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(t){var e,n;const{placement:i,rects:a,platform:o,elements:c}=t,{apply:d=()=>{},...f}=_i(s,t),h=await dc(t,f),p=Ci(i),g=No(i),v=Gn(i)==="y",{width:x,height:S}=a.floating;let E,T;p==="top"||p==="bottom"?(E=p,T=g===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(T=p,E=g==="end"?"top":"bottom");const L=S-h.top-h.bottom,_=x-h.left-h.right,P=xr(S-h[E],L),D=xr(x-h[T],_),B=!t.middlewareData.shift;let C=P,I=D;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(I=_),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=L),B&&!g){const U=Gs(h.left,0),z=Gs(h.right,0),Y=Gs(h.top,0),nt=Gs(h.bottom,0);v?I=x-2*(U!==0||z!==0?U+z:Gs(h.left,h.right)):C=S-2*(Y!==0||nt!==0?Y+nt:Gs(h.top,h.bottom))}await d({...t,availableWidth:I,availableHeight:C});const F=await o.getDimensions(c.floating);return x!==F.width||S!==F.height?{reset:{rects:!0}}:{}}}};function Ef(){return typeof window<"u"}function Bo(s){return $R(s)?(s.nodeName||"").toLowerCase():"#document"}function Ks(s){var t;return(s==null||(t=s.ownerDocument)==null?void 0:t.defaultView)||window}function ei(s){var t;return(t=($R(s)?s.ownerDocument:s.document)||window.document)==null?void 0:t.documentElement}function $R(s){return Ef()?s instanceof Node||s instanceof Ks(s).Node:!1}function wn(s){return Ef()?s instanceof Element||s instanceof Ks(s).Element:!1}function Qn(s){return Ef()?s instanceof HTMLElement||s instanceof Ks(s).HTMLElement:!1}function CE(s){return!Ef()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof Ks(s).ShadowRoot}const UM=new Set(["inline","contents"]);function Dc(s){const{overflow:t,overflowX:e,overflowY:n,display:i}=Ln(s);return/auto|scroll|overlay|hidden|clip/.test(t+n+e)&&!UM.has(i)}const jM=new Set(["table","td","th"]);function $M(s){return jM.has(Bo(s))}const VM=[":popover-open",":modal"];function Tf(s){return VM.some(t=>{try{return s.matches(t)}catch{return!1}})}const GM=["transform","translate","scale","rotate","perspective"],HM=["transform","translate","scale","rotate","perspective","filter"],zM=["paint","layout","strict","content"];function M0(s){const t=N0(),e=wn(s)?Ln(s):s;return GM.some(n=>e[n]?e[n]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||HM.some(n=>(e.willChange||"").includes(n))||zM.some(n=>(e.contain||"").includes(n))}function KM(s){let t=br(s);for(;Qn(t)&&!Do(t);){if(M0(t))return t;if(Tf(t))return null;t=br(t)}return null}function N0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qM=new Set(["html","body","#document"]);function Do(s){return qM.has(Bo(s))}function Ln(s){return Ks(s).getComputedStyle(s)}function Af(s){return wn(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function br(s){if(Bo(s)==="html")return s;const t=s.assignedSlot||s.parentNode||CE(s)&&s.host||ei(s);return CE(t)?t.host:t}function VR(s){const t=br(s);return Do(t)?s.ownerDocument?s.ownerDocument.body:s.body:Qn(t)&&Dc(t)?t:VR(t)}function fc(s,t,e){var n;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=VR(s),a=i===((n=s.ownerDocument)==null?void 0:n.body),o=Ks(i);if(a){const c=Ag(o);return t.concat(o,o.visualViewport||[],Dc(i)?i:[],c&&e?fc(c):[])}return t.concat(i,fc(i,[],e))}function Ag(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function GR(s){const t=Ln(s);let e=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Qn(s),a=i?s.offsetWidth:e,o=i?s.offsetHeight:n,c=Hd(e)!==a||Hd(n)!==o;return c&&(e=a,n=o),{width:e,height:n,$:c}}function B0(s){return wn(s)?s:s.contextElement}function Eo(s){const t=B0(s);if(!Qn(t))return Kn(1);const e=t.getBoundingClientRect(),{width:n,height:i,$:a}=GR(t);let o=(a?Hd(e.width):e.width)/n,c=(a?Hd(e.height):e.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const YM=Kn(0);function HR(s){const t=Ks(s);return!N0()||!t.visualViewport?YM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WM(s,t,e){return t===void 0&&(t=!1),!e||t&&e!==Ks(s)?!1:t}function la(s,t,e,n){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=s.getBoundingClientRect(),a=B0(s);let o=Kn(1);t&&(n?wn(n)&&(o=Eo(n)):o=Eo(s));const c=WM(a,e,n)?HR(a):Kn(0);let d=(i.left+c.x)/o.x,f=(i.top+c.y)/o.y,h=i.width/o.x,p=i.height/o.y;if(a){const g=Ks(a),v=n&&wn(n)?Ks(n):n;let x=g,S=Ag(x);for(;S&&n&&v!==x;){const E=Eo(S),T=S.getBoundingClientRect(),L=Ln(S),_=T.left+(S.clientLeft+parseFloat(L.paddingLeft))*E.x,P=T.top+(S.clientTop+parseFloat(L.paddingTop))*E.y;d*=E.x,f*=E.y,h*=E.x,p*=E.y,d+=_,f+=P,x=Ks(S),S=Ag(x)}}return Kd({width:h,height:p,x:d,y:f})}function Rf(s,t){const e=Af(s).scrollLeft;return t?t.left+e:la(ei(s)).left+e}function zR(s,t){const e=s.getBoundingClientRect(),n=e.left+t.scrollLeft-Rf(s,e),i=e.top+t.scrollTop;return{x:n,y:i}}function QM(s){let{elements:t,rect:e,offsetParent:n,strategy:i}=s;const a=i==="fixed",o=ei(n),c=t?Tf(t.floating):!1;if(n===o||c&&a)return e;let d={scrollLeft:0,scrollTop:0},f=Kn(1);const h=Kn(0),p=Qn(n);if((p||!p&&!a)&&((Bo(n)!=="body"||Dc(o))&&(d=Af(n)),Qn(n))){const v=la(n);f=Eo(n),h.x=v.x+n.clientLeft,h.y=v.y+n.clientTop}const g=o&&!p&&!a?zR(o,d):Kn(0);return{width:e.width*f.x,height:e.height*f.y,x:e.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:e.y*f.y-d.scrollTop*f.y+h.y+g.y}}function XM(s){return Array.from(s.getClientRects())}function ZM(s){const t=ei(s),e=Af(s),n=s.ownerDocument.body,i=Gs(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Gs(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-e.scrollLeft+Rf(s);const c=-e.scrollTop;return Ln(n).direction==="rtl"&&(o+=Gs(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:c}}const DE=25;function JM(s,t){const e=Ks(s),n=ei(s),i=e.visualViewport;let a=n.clientWidth,o=n.clientHeight,c=0,d=0;if(i){a=i.width,o=i.height;const h=N0();(!h||h&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=Rf(n);if(f<=0){const h=n.ownerDocument,p=h.body,g=getComputedStyle(p),v=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(n.clientWidth-p.clientWidth-v);x<=DE&&(a-=x)}else f<=DE&&(a+=f);return{width:a,height:o,x:c,y:d}}const tN=new Set(["absolute","fixed"]);function eN(s,t){const e=la(s,!0,t==="fixed"),n=e.top+s.clientTop,i=e.left+s.clientLeft,a=Qn(s)?Eo(s):Kn(1),o=s.clientWidth*a.x,c=s.clientHeight*a.y,d=i*a.x,f=n*a.y;return{width:o,height:c,x:d,y:f}}function IE(s,t,e){let n;if(t==="viewport")n=JM(s,e);else if(t==="document")n=ZM(ei(s));else if(wn(t))n=eN(t,e);else{const i=HR(s);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kd(n)}function KR(s,t){const e=br(s);return e===t||!wn(e)||Do(e)?!1:Ln(e).position==="fixed"||KR(e,t)}function sN(s,t){const e=t.get(s);if(e)return e;let n=fc(s,[],!1).filter(c=>wn(c)&&Bo(c)!=="body"),i=null;const a=Ln(s).position==="fixed";let o=a?br(s):s;for(;wn(o)&&!Do(o);){const c=Ln(o),d=M0(o);!d&&c.position==="fixed"&&(i=null),(a?!d&&!i:!d&&c.position==="static"&&!!i&&tN.has(i.position)||Dc(o)&&!d&&KR(s,o))?n=n.filter(h=>h!==o):i=c,o=br(o)}return t.set(s,n),n}function nN(s){let{element:t,boundary:e,rootBoundary:n,strategy:i}=s;const o=[...e==="clippingAncestors"?Tf(t)?[]:sN(t,this._c):[].concat(e),n],c=o[0],d=o.reduce((f,h)=>{const p=IE(t,h,i);return f.top=Gs(p.top,f.top),f.right=xr(p.right,f.right),f.bottom=xr(p.bottom,f.bottom),f.left=Gs(p.left,f.left),f},IE(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function iN(s){const{width:t,height:e}=GR(s);return{width:t,height:e}}function rN(s,t,e){const n=Qn(t),i=ei(t),a=e==="fixed",o=la(s,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=Kn(0);function f(){d.x=Rf(i)}if(n||!n&&!a)if((Bo(t)!=="body"||Dc(i))&&(c=Af(t)),n){const v=la(t,!0,a,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else i&&f();a&&!n&&i&&f();const h=i&&!n&&!a?zR(i,c):Kn(0),p=o.left+c.scrollLeft-d.x-h.x,g=o.top+c.scrollTop-d.y-h.y;return{x:p,y:g,width:o.width,height:o.height}}function ap(s){return Ln(s).position==="static"}function OE(s,t){if(!Qn(s)||Ln(s).position==="fixed")return null;if(t)return t(s);let e=s.offsetParent;return ei(s)===e&&(e=e.ownerDocument.body),e}function qR(s,t){const e=Ks(s);if(Tf(s))return e;if(!Qn(s)){let i=br(s);for(;i&&!Do(i);){if(wn(i)&&!ap(i))return i;i=br(i)}return e}let n=OE(s,t);for(;n&&$M(n)&&ap(n);)n=OE(n,t);return n&&Do(n)&&ap(n)&&!M0(n)?e:n||KM(s)||e}const aN=async function(s){const t=this.getOffsetParent||qR,e=this.getDimensions,n=await e(s.floating);return{reference:rN(s.reference,await t(s.floating),s.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function oN(s){return Ln(s).direction==="rtl"}const lN={convertOffsetParentRelativeRectToViewportRelativeRect:QM,getDocumentElement:ei,getClippingRect:nN,getOffsetParent:qR,getElementRects:aN,getClientRects:XM,getDimensions:iN,getScale:Eo,isElement:wn,isRTL:oN};function YR(s,t){return s.x===t.x&&s.y===t.y&&s.width===t.width&&s.height===t.height}function cN(s,t){let e=null,n;const i=ei(s);function a(){var c;clearTimeout(n),(c=e)==null||c.disconnect(),e=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const f=s.getBoundingClientRect(),{left:h,top:p,width:g,height:v}=f;if(c||t(),!g||!v)return;const x=Ju(p),S=Ju(i.clientWidth-(h+g)),E=Ju(i.clientHeight-(p+v)),T=Ju(h),_={rootMargin:-x+"px "+-S+"px "+-E+"px "+-T+"px",threshold:Gs(0,xr(1,d))||1};let P=!0;function D(B){const C=B[0].intersectionRatio;if(C!==d){if(!P)return o();C?o(!1,C):n=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!YR(f,s.getBoundingClientRect())&&o(),P=!1}try{e=new IntersectionObserver(D,{..._,root:i.ownerDocument})}catch{e=new IntersectionObserver(D,_)}e.observe(s)}return o(!0),a}function uN(s,t,e,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,f=B0(s),h=i||a?[...f?fc(f):[],...fc(t)]:[];h.forEach(T=>{i&&T.addEventListener("scroll",e,{passive:!0}),a&&T.addEventListener("resize",e)});const p=f&&c?cN(f,e):null;let g=-1,v=null;o&&(v=new ResizeObserver(T=>{let[L]=T;L&&L.target===f&&v&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),e()}),f&&!d&&v.observe(f),v.observe(t));let x,S=d?la(s):null;d&&E();function E(){const T=la(s);
vendor: 14,943 bytes, line 49
49S&&!YR(S,T)&&e(),S=T,x=requestAnimationFrame(E)}return e(),()=>{var T;h.forEach(L=>{i&&L.removeEventListener("scroll",e),a&&L.removeEventListener("resize",e)}),p?.(),(T=v)==null||T.disconnect(),v=null,d&&cancelAnimationFrame(x)}}const dN=MM,fN=NM,hN=OM,mN=FM,pN=kM,kE=IM,gN=BM,yN=(s,t,e)=>{const n=new Map,i={platform:lN,...e},a={...i.platform,_c:n};return DM(s,t,{...i,platform:a})};var vN=typeof document<"u",xN=function(){},wd=vN?$.useLayoutEffect:xN;function qd(s,t){if(s===t)return!0;if(typeof s!=typeof t)return!1;if(typeof s=="function"&&s.toString()===t.toString())return!0;let e,n,i;if(s&&t&&typeof s=="object"){if(Array.isArray(s)){if(e=s.length,e!==t.length)return!1;for(n=e;n--!==0;)if(!qd(s[n],t[n]))return!1;return!0}if(i=Object.keys(s),e=i.length,e!==Object.keys(t).length)return!1;for(n=e;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=e;n--!==0;){const a=i[n];if(!(a==="_owner"&&s.$$typeof)&&!qd(s[a],t[a]))return!1}return!0}return s!==s&&t!==t}function WR(s){return typeof window>"u"?1:(s.ownerDocument.defaultView||window).devicePixelRatio||1}function PE(s,t){const e=WR(s);return Math.round(t*e)/e}function op(s){const t=$.useRef(s);return wd(()=>{t.current=s}),t}function bN(s){s===void 0&&(s={});const{placement:t="bottom",strategy:e="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=s,[h,p]=$.useState({x:0,y:0,strategy:e,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=$.useState(n);qd(g,n)||v(n);const[x,S]=$.useState(null),[E,T]=$.useState(null),L=$.useCallback(N=>{N!==B.current&&(B.current=N,S(N))},[]),_=$.useCallback(N=>{N!==C.current&&(C.current=N,T(N))},[]),P=a||x,D=o||E,B=$.useRef(null),C=$.useRef(null),I=$.useRef(h),F=d!=null,U=op(d),z=op(i),Y=op(f),nt=$.useCallback(()=>{if(!B.current||!C.current)return;const N={placement:t,strategy:e,middleware:g};z.current&&(N.platform=z.current),yN(B.current,C.current,N).then(V=>{const X={...V,isPositioned:Y.current!==!1};it.current&&!qd(I.current,X)&&(I.current=X,I0.flushSync(()=>{p(X)}))})},[g,t,e,z,Y]);wd(()=>{f===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(N=>({...N,isPositioned:!1})))},[f]);const it=$.useRef(!1);wd(()=>(it.current=!0,()=>{it.current=!1}),[]),wd(()=>{if(P&&(B.current=P),D&&(C.current=D),P&&D){if(U.current)return U.current(P,D,nt);nt()}},[P,D,nt,U,F]);const rt=$.useMemo(()=>({reference:B,floating:C,setReference:L,setFloating:_}),[L,_]),M=$.useMemo(()=>({reference:P,floating:D}),[P,D]),j=$.useMemo(()=>{const N={position:e,left:0,top:0};if(!M.floating)return N;const V=PE(M.floating,h.x),X=PE(M.floating,h.y);return c?{...N,transform:"translate("+V+"px, "+X+"px)",...WR(M.floating)>=1.5&&{willChange:"transform"}}:{position:e,left:V,top:X}},[e,c,M.floating,h.x,h.y]);return $.useMemo(()=>({...h,update:nt,refs:rt,elements:M,floatingStyles:j}),[h,nt,rt,M,j])}const SN=s=>{function t(e){return{}.hasOwnProperty.call(e,"current")}return{name:"arrow",options:s,fn(e){const{element:n,padding:i}=typeof s=="function"?s(e):s;return n&&t(n)?n.current!=null?kE({element:n.current,padding:i}).fn(e):{}:n?kE({element:n,padding:i}).fn(e):{}}}},EN=(s,t)=>({...dN(s),options:[s,t]}),TN=(s,t)=>({...fN(s),options:[s,t]}),AN=(s,t)=>({...gN(s),options:[s,t]}),RN=(s,t)=>({...hN(s),options:[s,t]}),wN=(s,t)=>({...mN(s),options:[s,t]}),LN=(s,t)=>({...pN(s),options:[s,t]}),_N=(s,t)=>({...SN(s),options:[s,t]});var CN="Arrow",QR=$.forwardRef((s,t)=>{const{children:e,width:n=10,height:i=5,...a}=s;return A.jsx(pa.svg,{...a,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:s.asChild?e:A.jsx("polygon",{points:"0,0 30,0 15,10"})})});QR.displayName=CN;var DN=QR;function IN(s){const[t,e]=$.useState(void 0);return uc(()=>{if(s){e({width:s.offsetWidth,height:s.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,c;if("borderBoxSize"in a){const d=a.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,c=f.blockSize}else o=s.offsetWidth,c=s.offsetHeight;e({width:o,height:c})});return n.observe(s,{box:"border-box"}),()=>n.unobserve(s)}else e(void 0)},[s]),t}var XR="Popper",[ZR,JR]=kR(XR),[GH,tw]=ZR(XR),ew="PopperAnchor",sw=$.forwardRef((s,t)=>{const{__scopePopper:e,virtualRef:n,...i}=s,a=tw(ew,e),o=$.useRef(null),c=ma(t,o),d=$.useRef(null);return $.useEffect(()=>{const f=d.current;d.current=n?.current||o.current,f!==d.current&&a.onAnchorChange(d.current)}),n?null:A.jsx(pa.div,{...i,ref:c})});sw.displayName=ew;var F0="PopperContent",[ON,kN]=ZR(F0),nw=$.forwardRef((s,t)=>{const{__scopePopper:e,side:n="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:v="optimized",onPlaced:x,...S}=s,E=tw(F0,e),[T,L]=$.useState(null),_=ma(t,ht=>L(ht)),[P,D]=$.useState(null),B=IN(P),C=B?.width??0,I=B?.height??0,F=n+(a!=="center"?"-"+a:""),U=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(f)?f:[f],Y=z.length>0,nt={padding:U,boundary:z.filter(MN),altBoundary:Y},{refs:it,floatingStyles:rt,placement:M,isPositioned:j,middlewareData:N}=bN({strategy:"fixed",placement:F,whileElementsMounted:(...ht)=>uN(...ht,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[EN({mainAxis:i+I,alignmentAxis:o}),d&&TN({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?AN():void 0,...nt}),d&&RN({...nt}),wN({...nt,apply:({elements:ht,rects:xt,availableWidth:wt,availableHeight:Zt})=>{const{width:fe,height:Fe}=xt.reference,Cs=ht.floating.style;Cs.setProperty("--radix-popper-available-width",`${wt}px`),Cs.setProperty("--radix-popper-available-height",`${Zt}px`),Cs.setProperty("--radix-popper-anchor-width",`${fe}px`),Cs.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),P&&_N({element:P,padding:c}),NN({arrowWidth:C,arrowHeight:I}),g&&LN({strategy:"referenceHidden",...nt})]}),[V,X]=aw(M),O=Sf(x);uc(()=>{j&&O?.()},[j,O]);const G=N.arrow?.x,K=N.arrow?.y,J=N.arrow?.centerOffset!==0,[ot,ft]=$.useState();return uc(()=>{T&&ft(window.getComputedStyle(T).zIndex)},[T]),A.jsx("div",{ref:it.setFloating,"data-radix-popper-content-wrapper":"",style:{...rt,transform:j?rt.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ot,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:s.dir,children:A.jsx(ON,{scope:e,placedSide:V,onArrowChange:D,arrowX:G,arrowY:K,shouldHideArrow:J,children:A.jsx(pa.div,{"data-side":V,"data-align":X,...S,ref:_,style:{...S.style,animation:j?void 0:"none"}})})})});nw.displayName=F0;var iw="PopperArrow",PN={top:"bottom",right:"left",bottom:"top",left:"right"},rw=$.forwardRef(function(t,e){const{__scopePopper:n,...i}=t,a=kN(iw,n),o=PN[a.placedSide];return A.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:A.jsx(DN,{...i,ref:e,style:{...i.style,display:"block"}})})});rw.displayName=iw;function MN(s){return s!==null}var NN=s=>({name:"transformOrigin",options:s,fn(t){const{placement:e,rects:n,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,c=o?0:s.arrowWidth,d=o?0:s.arrowHeight,[f,h]=aw(e),p={start:"0%",center:"50%",end:"100%"}[h],g=(i.arrow?.x??0)+c/2,v=(i.arrow?.y??0)+d/2;let x="",S="";return f==="bottom"?(x=o?p:`${g}px`,S=`${-d}px`):f==="top"?(x=o?p:`${g}px`,S=`${n.floating.height+d}px`):f==="right"?(x=`${-d}px`,S=o?p:`${v}px`):f==="left"&&(x=`${n.floating.width+d}px`,S=o?p:`${v}px`),{data:{x,y:S}}}});function aw(s){const[t,e="center"]=s.split("-");return[t,e]}var BN=sw,FN=nw,UN=rw;function jN(s,t){return $.useReducer((e,n)=>t[e][n]??e,s)}var ow=s=>{const{present:t,children:e}=s,n=$N(t),i=typeof e=="function"?e({present:n.isPresent}):$.Children.only(e),a=ma(n.ref,VN(i));return typeof e=="function"||n.isPresent?$.cloneElement(i,{ref:a}):null};ow.displayName="Presence";function $N(s){const[t,e]=$.useState(),n=$.useRef(null),i=$.useRef(s),a=$.useRef("none"),o=s?"mounted":"unmounted",[c,d]=jN(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect(()=>{const f=td(n.current);a.current=c==="mounted"?f:"none"},[c]),uc(()=>{const f=n.current,h=i.current;if(h!==s){const g=a.current,v=td(f);s?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=s}},[s,d]),uc(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=v=>{const S=td(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(d("ANIMATION_END"),!i.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},g=v=>{v.target===t&&(a.current=td(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:$.useCallback(f=>{n.current=f?getComputedStyle(f):null,e(f)},[])}}function td(s){return s?.animationName||"none"}function VN(s){let t=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,e=t&&"isReactWarning"in t&&t.isReactWarning;return e?s.ref:(t=Object.getOwnPropertyDescriptor(s,"ref")?.get,e=t&&"isReactWarning"in t&&t.isReactWarning,e?s.props.ref:s.props.ref||s.ref)}var GN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),HN="VisuallyHidden",lw=$.forwardRef((s,t)=>A.jsx(pa.span,{...s,ref:t,style:{...GN,...s.style}}));lw.displayName=HN;var zN=lw,[wf]=kR("Tooltip",[JR]),U0=JR(),cw="TooltipProvider",KN=700,ME="tooltip.open",[qN,uw]=wf(cw),dw=s=>{const{__scopeTooltip:t,delayDuration:e=KN,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:a}=s,o=$.useRef(!0),c=$.useRef(!1),d=$.useRef(0);return $.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),A.jsx(qN,{scope:t,isOpenDelayedRef:o,delayDuration:e,onOpen:$.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:$.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:$.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:a})};dw.displayName=cw;var fw="Tooltip",[HH,Lf]=wf(fw),Rg="TooltipTrigger",YN=$.forwardRef((s,t)=>{const{__scopeTooltip:e,...n}=s,i=Lf(Rg,e),a=uw(Rg,e),o=U0(e),c=$.useRef(null),d=ma(t,c,i.onTriggerChange),f=$.useRef(!1),h=$.useRef(!1),p=$.useCallback(()=>f.current=!1,[]);return $.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),A.jsx(BN,{asChild:!0,...o,children:A.jsx(pa.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:d,onPointerMove:wi(s.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:wi(s.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:wi(s.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:wi(s.onFocus,()=>{f.current||i.onOpen()}),onBlur:wi(s.onBlur,i.onClose),onClick:wi(s.onClick,i.onClose)})})});YN.displayName=Rg;var WN="TooltipPortal",[zH,QN]=wf(WN,{forceMount:void 0}),Io="TooltipContent",XN=$.forwardRef((s,t)=>{const e=QN(Io,s.__scopeTooltip),{forceMount:n=e.forceMount,side:i="top",...a}=s,o=Lf(Io,s.__scopeTooltip);return A.jsx(ow,{present:n||o.open,children:o.disableHoverableContent?A.jsx(hw,{side:i,...a,ref:t}):A.jsx(ZN,{side:i,...a,ref:t})})}),ZN=$.forwardRef((s,t)=>{const e=Lf(Io,s.__scopeTooltip),n=uw(Io,s.__scopeTooltip),i=$.useRef(null),a=ma(t,i),[o,c]=$.useState(null),{trigger:d,onClose:f}=e,h=i.current,{onPointerInTransitChange:p}=n,g=$.useCallback(()=>{c(null),p(!1)},[p]),v=$.useCallback((x,S)=>{const E=x.currentTarget,T={x:x.clientX,y:x.clientY},L=nB(T,E.getBoundingClientRect()),_=iB(T,L),P=rB(S.getBoundingClientRect()),D=oB([..._,...P]);c(D),p(!0)},[p]);return $.useEffect(()=>()=>g(),[g]),$.useEffect(()=>{if(d&&h){const x=E=>v(E,h),S=E=>v(E,d);return d.addEventListener("pointerleave",x),h.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",S)}}},[d,h,v,g]),$.useEffect(()=>{if(o){const x=S=>{const E=S.target,T={x:S.clientX,y:S.clientY},L=d?.contains(E)||h?.contains(E),_=!aB(T,o);L?g():_&&(g(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,h,o,f,g]),A.jsx(hw,{...s,ref:a})}),[JN,tB]=wf(fw,{isInside:!1}),eB=rM("TooltipContent"),hw=$.forwardRef((s,t)=>{const{__scopeTooltip:e,children:n,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...c}=s,d=Lf(Io,e),f=U0(e),{onClose:h}=d;return $.useEffect(()=>(document.addEventListener(ME,h),()=>document.removeEventListener(ME,h)),[h]),$.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),A.jsx(BR,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:A.jsxs(FN,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[A.jsx(eB,{children:n}),A.jsx(JN,{scope:e,isInside:!0,children:A.jsx(zN,{id:d.contentId,role:"tooltip",children:i||n})})]})})});XN.displayName=Io;var mw="TooltipArrow",sB=$.forwardRef((s,t)=>{const{__scopeTooltip:e,...n}=s,i=U0(e);return tB(mw,e).isInside?null:A.jsx(UN,{...i,...n,ref:t})});sB.displayName=mw;function nB(s,t){const e=Math.abs(t.top-s.y),n=Math.abs(t.bottom-s.y),i=Math.abs(t.right-s.x),a=Math.abs(t.left-s.x);switch(Math.min(e,n,i,a)){case a:return"left";case i:return"right";case e:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function iB(s,t,e=5){const n=[];
vendor: 6,311 bytes, line 49
49switch(t){case"top":n.push({x:s.x-e,y:s.y+e},{x:s.x+e,y:s.y+e});break;case"bottom":n.push({x:s.x-e,y:s.y-e},{x:s.x+e,y:s.y-e});break;case"left":n.push({x:s.x+e,y:s.y-e},{x:s.x+e,y:s.y+e});break;case"right":n.push({x:s.x-e,y:s.y-e},{x:s.x-e,y:s.y+e});break}return n}function rB(s){const{top:t,right:e,bottom:n,left:i}=s;return[{x:i,y:t},{x:e,y:t},{x:e,y:n},{x:i,y:n}]}function aB(s,t){const{x:e,y:n}=s;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const c=t[a],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>n!=g>n&&e<(p-f)*(n-h)/(g-h)+f&&(i=!i)}return i}function oB(s){const t=s.slice();return t.sort((e,n)=>e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0),lB(t)}function lB(s){if(s.length<=1)return s.slice();const t=[];for(let n=0;n<s.length;n++){const i=s[n];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const e=[];for(let n=s.length-1;n>=0;n--){const i=s[n];for(;e.length>=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}return e.pop(),t.length===1&&e.length===1&&t[0].x===e[0].x&&t[0].y===e[0].y?t:t.concat(e)}var cB=dw;function pw(s){var t,e,n="";if(typeof s=="string"||typeof s=="number")n+=s;else if(typeof s=="object")if(Array.isArray(s)){var i=s.length;for(t=0;t<i;t++)s[t]&&(e=pw(s[t]))&&(n&&(n+=" "),n+=e)}else for(e in s)s[e]&&(n&&(n+=" "),n+=e);return n}function gw(){for(var s,t,e=0,n="",i=arguments.length;e<i;e++)(s=arguments[e])&&(t=pw(s))&&(n&&(n+=" "),n+=t);return n}const j0="-",uB=s=>{const t=fB(s),{conflictingClassGroups:e,conflictingClassGroupModifiers:n}=s;return{getClassGroupId:o=>{const c=o.split(j0);return c[0]===""&&c.length!==1&&c.shift(),yw(c,t)||dB(o)},getConflictingClassGroupIds:(o,c)=>{const d=e[o]||[];return c&&n[o]?[...d,...n[o]]:d}}},yw=(s,t)=>{if(s.length===0)return t.classGroupId;const e=s[0],n=t.nextPart.get(e),i=n?yw(s.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const a=s.join(j0);return t.validators.find(({validator:o})=>o(a))?.classGroupId},NE=/^\[(.+)\]$/,dB=s=>{if(NE.test(s)){const t=NE.exec(s)[1],e=t?.substring(0,t.indexOf(":"));if(e)return"arbitrary.."+e}},fB=s=>{const{theme:t,classGroups:e}=s,n={nextPart:new Map,validators:[]};for(const i in e)wg(e[i],n,i,t);return n},wg=(s,t,e,n)=>{s.forEach(i=>{if(typeof i=="string"){const a=i===""?t:BE(t,i);a.classGroupId=e;return}if(typeof i=="function"){if(hB(i)){wg(i(n),t,e,n);return}t.validators.push({validator:i,classGroupId:e});return}Object.entries(i).forEach(([a,o])=>{wg(o,BE(t,a),e,n)})})},BE=(s,t)=>{let e=s;return t.split(j0).forEach(n=>{e.nextPart.has(n)||e.nextPart.set(n,{nextPart:new Map,validators:[]}),e=e.nextPart.get(n)}),e},hB=s=>s.isThemeGetter,mB=s=>{if(s<1)return{get:()=>{},set:()=>{}};let t=0,e=new Map,n=new Map;const i=(a,o)=>{e.set(a,o),t++,t>s&&(t=0,n=e,e=new Map)};return{get(a){let o=e.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){e.has(a)?e.set(a,o):i(a,o)}}},Lg="!",_g=":",pB=_g.length,gB=s=>{const{prefix:t,experimentalParseClassName:e}=s;let n=i=>{const a=[];let o=0,c=0,d=0,f;for(let x=0;x<i.length;x++){let S=i[x];if(o===0&&c===0){if(S===_g){a.push(i.slice(d,x)),d=x+pB;continue}if(S==="/"){f=x;continue}}S==="["?o++:S==="]"?o--:S==="("?c++:S===")"&&c--}const h=a.length===0?i:i.substring(d),p=yB(h),g=p!==h,v=f&&f>d?f-d:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}};if(t){const i=t+_g,a=n;n=o=>o.startsWith(i)?a(o.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(e){const i=n;n=a=>e({className:a,parseClassName:i})}return n},yB=s=>s.endsWith(Lg)?s.substring(0,s.length-1):s.startsWith(Lg)?s.substring(1):s,vB=s=>{const t=Object.fromEntries(s.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const i=[];let a=[];return n.forEach(o=>{o[0]==="["||t[o]?(i.push(...a.sort(),o),a=[]):a.push(o)}),i.push(...a.sort()),i}},xB=s=>({cache:mB(s.cacheSize),parseClassName:gB(s),sortModifiers:vB(s),...uB(s)}),bB=/\s+/,SB=(s,t)=>{const{parseClassName:e,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],c=s.trim().split(bB);let d="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{isExternal:p,modifiers:g,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:S}=e(h);if(p){d=h+(d.length>0?" "+d:d);continue}let E=!!S,T=n(E?x.substring(0,S):x);if(!T){if(!E){d=h+(d.length>0?" "+d:d);continue}if(T=n(x),!T){d=h+(d.length>0?" "+d:d);continue}E=!1}const L=a(g).join(":"),_=v?L+Lg:L,P=_+T;if(o.includes(P))continue;o.push(P);const D=i(T,E);for(let B=0;B<D.length;++B){const C=D[B];o.push(_+C)}d=h+(d.length>0?" "+d:d)}return d};function EB(){let s=0,t,e,n="";for(;s<arguments.length;)(t=arguments[s++])&&(e=vw(t))&&(n&&(n+=" "),n+=e);return n}const vw=s=>{if(typeof s=="string")return s;let t,e="";for(let n=0;n<s.length;n++)s[n]&&(t=vw(s[n]))&&(e&&(e+=" "),e+=t);return e};function TB(s,...t){let e,n,i,a=o;function o(d){const f=t.reduce((h,p)=>p(h),s());return e=xB(f),n=e.cache.get,i=e.cache.set,a=c,c(d)}function c(d){const f=n(d);if(f)return f;const h=SB(d,e);return i(d,h),h}return function(){return a(EB.apply(null,arguments))}}const je=s=>{const t=e=>e[s]||[];return t.isThemeGetter=!0,t},xw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,AB=/^\d+\/\d+$/,RB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,LB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ao=s=>AB.test(s),Nt=s=>!!s&&!Number.isNaN(Number(s)),ar=s=>!!s&&Number.isInteger(Number(s)),lp=s=>s.endsWith("%")&&Nt(s.slice(0,-1)),Si=s=>RB.test(s),DB=()=>!0,IB=s=>wB.test(s)&&!LB.test(s),Sw=()=>!1,OB=s=>_B.test(s),kB=s=>CB.test(s),PB=s=>!bt(s)&&!St(s),MB=s=>Fo(s,Aw,Sw),bt=s=>xw.test(s),Yr=s=>Fo(s,Rw,IB),cp=s=>Fo(s,jB,Nt),FE=s=>Fo(s,Ew,Sw),NB=s=>Fo(s,Tw,kB),ed=s=>Fo(s,ww,OB),St=s=>bw.test(s),Bl=s=>Uo(s,Rw),BB=s=>Uo(s,$B),UE=s=>Uo(s,Ew),FB=s=>Uo(s,Aw),UB=s=>Uo(s,Tw),sd=s=>Uo(s,ww,!0),Fo=(s,t,e)=>{const n=xw.exec(s);
vendor: 4,474 bytes, line 49
49return n?n[1]?t(n[1]):e(n[2]):!1},Uo=(s,t,e=!1)=>{const n=bw.exec(s);return n?n[1]?t(n[1]):e:!1},Ew=s=>s==="position"||s==="percentage",Tw=s=>s==="image"||s==="url",Aw=s=>s==="length"||s==="size"||s==="bg-size",Rw=s=>s==="length",jB=s=>s==="number",$B=s=>s==="family-name",ww=s=>s==="shadow",VB=()=>{const s=je("color"),t=je("font"),e=je("text"),n=je("font-weight"),i=je("tracking"),a=je("leading"),o=je("breakpoint"),c=je("container"),d=je("spacing"),f=je("radius"),h=je("shadow"),p=je("inset-shadow"),g=je("text-shadow"),v=je("drop-shadow"),x=je("blur"),S=je("perspective"),E=je("aspect"),T=je("ease"),L=je("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...P(),St,bt],B=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],I=()=>[St,bt,d],F=()=>[ao,"full","auto",...I()],U=()=>[ar,"none","subgrid",St,bt],z=()=>["auto",{span:["full",ar,St,bt]},ar,St,bt],Y=()=>[ar,"auto",St,bt],nt=()=>["auto","min","max","fr",St,bt],it=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],rt=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...I()],j=()=>[ao,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],N=()=>[s,St,bt],V=()=>[...P(),UE,FE,{position:[St,bt]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",FB,MB,{size:[St,bt]}],G=()=>[lp,Bl,Yr],K=()=>["","none","full",f,St,bt],J=()=>["",Nt,Bl,Yr],ot=()=>["solid","dashed","dotted","double"],ft=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ht=()=>[Nt,lp,UE,FE],xt=()=>["","none",x,St,bt],wt=()=>["none",Nt,St,bt],Zt=()=>["none",Nt,St,bt],fe=()=>[Nt,St,bt],Fe=()=>[ao,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Si],breakpoint:[Si],color:[DB],container:[Si],"drop-shadow":[Si],ease:["in","out","in-out"],font:[PB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Si],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Si],shadow:[Si],spacing:["px",Nt],text:[Si],"text-shadow":[Si],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ao,bt,St,E]}],container:["container"],columns:[{columns:[Nt,bt,St,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[ar,"auto",St,bt]}],basis:[{basis:[ao,"full","auto",c,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Nt,ao,"auto","initial","none",bt]}],grow:[{grow:["",Nt,St,bt]}],shrink:[{shrink:["",Nt,St,bt]}],order:[{order:[ar,"first","last","none",St,bt]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":Y()}
vendor: 11,046 bytes, line 49
49],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":nt()}],"auto-rows":[{"auto-rows":nt()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...it(),"normal"]}],"justify-items":[{"justify-items":[...rt(),"normal"]}],"justify-self":[{"justify-self":["auto",...rt()]}],"align-content":[{content:["normal",...it()]}],"align-items":[{items:[...rt(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...rt(),{baseline:["","last"]}]}],"place-content":[{"place-content":it()}],"place-items":[{"place-items":[...rt(),"baseline"]}],"place-self":[{"place-self":["auto",...rt()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[c,"screen",...j()]}],"min-w":[{"min-w":[c,"screen","none",...j()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",e,Bl,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,St,cp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lp,bt]}],"font-family":[{font:[BB,bt,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,St,bt]}],"line-clamp":[{"line-clamp":[Nt,"none",St,cp]}],leading:[{leading:[a,...I()]}],"list-image":[{"list-image":["none",St,bt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",St,bt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ot(),"wavy"]}],"text-decoration-thickness":[{decoration:[Nt,"from-font","auto",St,Yr]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Nt,"auto",St,bt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",St,bt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",St,bt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ar,St,bt],radial:["",St,bt],conic:[ar,St,bt]},UB,NB]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ot(),"hidden","none"]}],"divide-style":[{divide:[...ot(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...ot(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Nt,St,bt]}],"outline-w":[{outline:["",Nt,Bl,Yr]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",h,sd,ed]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",p,sd,ed]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Nt,Yr]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",g,sd,ed]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Nt,St,bt]}],"mix-blend":[{"mix-blend":[...ft(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ft()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ht()}],"mask-image-linear-to-pos":[{"mask-linear-to":ht()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ht()}],"mask-image-t-to-pos":[{"mask-t-to":ht()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ht()}],"mask-image-r-to-pos":[{"mask-r-to":ht()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ht()}],"mask-image-b-to-pos":[{"mask-b-to":ht()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ht()}],"mask-image-l-to-pos":[{"mask-l-to":ht()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ht()}],"mask-image-x-to-pos":[{"mask-x-to":ht()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ht()}],"mask-image-y-to-pos":[{"mask-y-to":ht()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[St,bt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ht()}],"mask-image-radial-to-pos":[{"mask-radial-to":ht()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ht()}],"mask-image-conic-to-pos":[{"mask-conic-to":ht()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",St,bt]}],filter:[{filter:["","none",St,bt]}],blur:[{blur:xt()}],brightness:[{brightness:[Nt,St,bt]}],contrast:[{contrast:[Nt,St,bt]}],"drop-shadow":[{"drop-shadow":["","none",v,sd,ed]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Nt,St,bt]}],"hue-rotate":[{"hue-rotate":[Nt,St,bt]}],invert:[{invert:["",Nt,St,bt]}],saturate:[{saturate:[Nt,St,bt]}],sepia:[{sepia:["",Nt,St,bt]}],"backdrop-filter":[{"backdrop-filter":["","none",St,bt]}],"backdrop-blur":[{"backdrop-blur":xt()}],"backdrop-brightness":[{"backdrop-brightness":[Nt,St,bt]}],"backdrop-contrast":[{"backdrop-contrast":[Nt,St,bt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Nt,St,bt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nt,St,bt]}],"backdrop-invert":[{"backdrop-invert":["",Nt,St,bt]}],"backdrop-opacity":[{"backdrop-opacity":[Nt,St,bt]}],"backdrop-saturate":[{"backdrop-saturate":[Nt,St,bt]}],"backdrop-sepia":[{"backdrop-sepia":["",Nt,St,bt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",St,bt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Nt,"initial",St,bt]}],ease:[{ease:["linear","initial",T,St,bt]}],delay:[{delay:[Nt,St,bt]}],animate:[{animate:["none",L,St,bt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,St,bt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:wt()}],"rotate-x":[{"rotate-x":wt()}],"rotate-y":[{"rotate-y":wt()}],"rotate-z":[{"rotate-z":wt()}],scale:[{scale:Zt()}],"scale-x":[{"scale-x":Zt()}],"scale-y":[{"scale-y":Zt()}],"scale-z":[{"scale-z":Zt()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[St,bt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}
vendor: 10,068 bytes, lines 49-93
49],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",St,bt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",St,bt]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Nt,Bl,Yr,cp]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},GB=TB(VB);function _f(...s){return GB(gw(s))}function HB({delayDuration:s=0,...t}){return A.jsx(cB,{"data-loc":"client/src/components/ui/tooltip.tsx:11","data-slot":"tooltip-provider",delayDuration:s,...t})}const jE=s=>typeof s=="boolean"?`${s}`:s===0?"0":s,$E=gw,zB=(s,t)=>e=>{var n;if(t?.variants==null)return $E(s,e?.class,e?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const h=e?.[f],p=a?.[f];if(h===null)return null;const g=jE(h)||jE(p);return i[f][g]}),c=e&&Object.entries(e).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((f,h)=>{let{class:p,className:g,...v}=h;return Object.entries(v).every(x=>{let[S,E]=x;return Array.isArray(E)?E.includes({...a,...c}[S]):{...a,...c}[S]===E})?[...f,p,g]:f},[]);return $E(s,o,d,e?.class,e?.className)},KB=zB("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-transparent shadow-xs hover:bg-accent dark:bg-transparent dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function qB({className:s,variant:t,size:e,asChild:n=!1,...i}){const a=n?nM:"button";return A.jsx(a,{"data-loc":"client/src/components/ui/button.tsx:52","data-slot":"button",className:_f(KB({variant:t,size:e,className:s})),...i})}function YB({className:s,...t}){return A.jsx("div",{"data-loc":"client/src/components/ui/card.tsx:7","data-slot":"card",className:_f("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",s),...t})}function WB({className:s,...t}){return A.jsx("div",{"data-loc":"client/src/components/ui/card.tsx:66","data-slot":"card-content",className:_f("px-6",s),...t})}/** 50 * @license lucide-react v0.453.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */const QB=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lw=(...s)=>s.filter((t,e,n)=>!!t&&n.indexOf(t)===e).join(" ");/** 55 * @license lucide-react v0.453.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */var XB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 60 * @license lucide-react v0.453.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const ZB=$.forwardRef(({color:s="currentColor",size:t=24,strokeWidth:e=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...c},d)=>$.createElement("svg",{ref:d,...XB,width:t,height:t,stroke:s,strokeWidth:n?Number(e)*24/Number(t):e,className:Lw("lucide",i),...c},[...o.map(([f,h])=>$.createElement(f,h)),...Array.isArray(a)?a:[a]]));/** 65 * @license lucide-react v0.453.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const De=(s,t)=>{const e=$.forwardRef(({className:n,...i},a)=>$.createElement(ZB,{ref:a,iconNode:t,className:Lw(`lucide-${QB(s)}`,n),...i}));return e.displayName=`${s}`,e};/** 70 * @license lucide-react v0.453.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const JB=De("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 75 * @license lucide-react v0.453.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const tF=De("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 80 * @license lucide-react v0.453.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const eF=De("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 85 * @license lucide-react v0.453.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const sF=De("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 90 * @license lucide-react v0.453.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree.
94 */const nF=De("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 95 * @license lucide-react v0.453.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const _w=De("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 100 * @license lucide-react v0.453.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const iF=De("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 105 * @license lucide-react v0.453.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const rF=De("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 110 * @license lucide-react v0.453.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const VE=De("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 115 * @license lucide-react v0.453.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const Cw=De("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/** 120 * @license lucide-react v0.453.0 - ISC 121 * 122 * This source code is licensed under the ISC license. 123 * See the LICENSE file in the root directory of this source tree. 124 */const aF=De("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 125 * @license lucide-react v0.453.0 - ISC 126 * 127 * This source code is licensed under the ISC license. 128 * See the LICENSE file in the root directory of this source tree. 129 */const oF=De("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 130 * @license lucide-react v0.453.0 - ISC 131 * 132 * This source code is licensed under the ISC license. 133 * See the LICENSE file in the root directory of this source tree. 134 */const lF=De("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 135 * @license lucide-react v0.453.0 - ISC 136 * 137 * This source code is licensed under the ISC license. 138 * See the LICENSE file in the root directory of this source tree. 139 */const cF=De("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 140 * @license lucide-react v0.453.0 - ISC 141 * 142 * This source code is licensed under the ISC license. 143 * See the LICENSE file in the root directory of this source tree. 144 */const uF=De("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 145 * @license lucide-react v0.453.0 - ISC 146 * 147 * This source code is licensed under the ISC license. 148 * See the LICENSE file in the root directory of this source tree. 149 */const dF=De("TvMinimal",[["path",{d:"M7 21h10",key:"1b0cd5"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}]]);/** 150 * @license lucide-react v0.453.0 - ISC 151 * 152 * This source code is licensed under the ISC license. 153 * See the LICENSE file in the root directory of this source tree. 154 */const fF=De("Tv",[["rect",{width:"20",height:"15",x:"2",y:"7",rx:"2",ry:"2",key:"10ag99"}],["polyline",{points:"17 2 12 7 7 2",key:"11pgbg"}]]);/** 155 * @license lucide-react v0.453.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const hF=De("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 160 * @license lucide-react v0.453.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const mF=De("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}
164],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 165 * @license lucide-react v0.453.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const pF=De("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/** 170 * @license lucide-react v0.453.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const Cg=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function gF(s,t){if(s instanceof RegExp)return{keys:!1,pattern:s};var e,n,i,a,o=[],c="",d=s.split("/");for(d[0]||d.shift();i=d.shift();)e=i[0],e==="*"?(o.push(e),c+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):e===":"?(n=i.indexOf("?",1),a=i.indexOf(".",1),o.push(i.substring(1,~n?n:~a?a:i.length)),c+=~n&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(c+=(~n?"?":"")+"\\"+i.substring(a))):c+="/"+i;return{keys:o,pattern:new RegExp("^"+c+(t?"(?=$|/)":"/?$"),"i")}}var up={exports:{}},dp={};/** 175 * @license React 176 * use-sync-external-store-shim.production.js 177 * 178 * Copyright (c) Meta Platforms, Inc. and affiliates. 179 * 180 * This source code is licensed under the MIT license found in the 181 * LICENSE file in the root directory of this source tree. 182 */var GE;function yF(){if(GE)return dp;GE=1;var s=mf();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var e=typeof Object.is=="function"?Object.is:t,n=s.useState,i=s.useEffect,a=s.useLayoutEffect,o=s.useDebugValue;function c(p,g){var v=g(),x=n({inst:{value:v,getSnapshot:g}}),S=x[0].inst,E=x[1];return a(function(){S.value=v,S.getSnapshot=g,d(S)&&E({inst:S})},[p,v,g]),i(function(){return d(S)&&E({inst:S}),p(function(){d(S)&&E({inst:S})})},[p]),o(v),v}function d(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!e(p,v)}catch{return!0}}function f(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return dp.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:h,dp}var HE;function vF(){return HE||(HE=1,up.exports=yF()),up.exports}var xF=vF();const bF=j1.useInsertionEffect,SF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",EF=SF?$.useLayoutEffect:$.useEffect,TF=bF||EF,Dw=s=>{const t=$.useRef([s,(...e)=>t[0](...e)]).current;return TF(()=>{t[0]=s}),t[1]},AF="popstate",$0="pushState",V0="replaceState",RF="hashchange",zE=[AF,$0,V0,RF],wF=s=>{for(const t of zE)addEventListener(t,s);return()=>{for(const t of zE)removeEventListener(t,s)}},Iw=(s,t)=>xF.useSyncExternalStore(wF,s,t),LF=()=>location.search,_F=({ssrSearch:s=""}={})=>Iw(LF,()=>s),KE=()=>location.pathname,CF=({ssrPath:s}={})=>Iw(KE,s?()=>s:KE),DF=(s,{replace:t=!1,state:e=null}={})=>history[t?V0:$0](e,"",s),IF=(s={})=>[CF(s),DF],qE=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[qE]>"u"){for(const s of[$0,V0]){const t=history[s];history[s]=function(){const e=t.apply(this,arguments),n=new Event(s);return n.arguments=arguments,dispatchEvent(n),e}}Object.defineProperty(window,qE,{value:!0})}const OF=(s,t)=>t.toLowerCase().indexOf(s.toLowerCase())?"~"+t:t.slice(s.length)||"/",Ow=(s="")=>s==="/"?"":s,kF=(s,t)=>s[0]==="~"?s.slice(1):Ow(t)+s,PF=(s="",t)=>OF(YE(Ow(s)),YE(t)),YE=s=>{try{return decodeURI(s)}catch{return s}},kw={hook:IF,searchHook:_F,parser:gF,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:s=>s},Pw=$.createContext(kw),Ic=()=>$.useContext(Pw),Mw={},Nw=$.createContext(Mw),MF=()=>$.useContext(Nw),Cf=s=>{const[t,e]=s.hook(s);return[PF(s.base,t),Dw((n,i)=>e(kF(n,s.base),i))]},Bw=()=>Cf(Ic()),Fw=(s,t,e,n)=>{const{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:s(t||"*",n),o=i.exec(e)||[],[c,...d]=o;return c!==void 0?[!0,(()=>{const f=a!==!1?Object.fromEntries(a.map((p,g)=>[p,d[g]])):o.groups;let h={...d};return f&&Object.assign(h,f),h})(),...n?[c]:[]]:[!1,null]},NF=({children:s,...t})=>{const e=Ic(),n=t.hook?kw:e;let i=n;const[a,o]=t.ssrPath?.split("?")??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let c=$.useRef({}),d=c.current,f=d;for(let h in n){const p=h==="base"?n[h]+(t[h]||""):t[h]||n[h];d===f&&p!==f[h]&&(c.current=f={...f}),f[h]=p,(p!==n[h]||p!==i[h])&&(i=f)}return $.createElement(Pw.Provider,{value:i,children:s})},WE=({children:s,component:t},e)=>t?$.createElement(t,{params:e}):typeof s=="function"?s(e):s,BF=s=>{let t=$.useRef(Mw);const e=t.current;return t.current=Object.keys(s).length!==Object.keys(e).length||Object.entries(s).some(([n,i])=>i!==e[n])?s:e},on=({path:s,nest:t,match:e,...n})=>{const i=Ic(),[a]=Cf(i),[o,c,d]=e??Fw(i.parser,s,a,t),f=BF({...MF(),...c});if(!o)return null;const h=d?$.createElement(NF,{base:d},WE(n,f)):WE(n,f);return $.createElement(Nw.Provider,{value:f,children:h})},ca=$.forwardRef((s,t)=>{const e=Ic(),[n,i]=Cf(e),{to:a="",href:o=a,onClick:c,asChild:d,children:f,className:h,replace:p,state:g,...v}=s,x=Dw(E=>{E.ctrlKey||E.metaKey||E.altKey||E.shiftKey||E.button!==0||(c?.(E),E.defaultPrevented||(E.preventDefault(),i(o,s)
182))}),S=e.hrefs(o[0]==="~"?o.slice(1):e.base+o,e);return d&&$.isValidElement(f)?$.cloneElement(f,{onClick:x,href:S}):$.createElement("a",{...v,onClick:x,href:S,className:h?.call?h(n===o):h,children:f,ref:t})}),Dg=s=>Array.isArray(s)?s.flatMap(t=>Dg(t&&t.type===$.Fragment?t.props.children:t)):[s],QE=({children:s,location:t})=>{const e=Ic(),[n]=Cf(e);typeof window<"u"&&(window.__WOUTER_ROUTES__||(window.__WOUTER_ROUTES__=[]),Dg(s).forEach(a=>{if($.isValidElement(a)&&a.props.path){const o=a.props.path;window.__WOUTER_ROUTES__.includes(o)||window.__WOUTER_ROUTES__.push(o)}}));for(const i of Dg(s)){let a=0;if($.isValidElement(i)&&(a=Fw(e.parser,i.props.path,t||n,i.props.nest))[0])return $.cloneElement(i,{match:a})}return null};function XE(){const[,s]=Bw(),t=()=>{s("/")};return A.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:14",className:"min-h-screen w-full flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100",children:A.jsx(YB,{"data-loc":"client/src/pages/NotFound.tsx:15",className:"w-full max-w-lg mx-4 shadow-lg border-0 bg-white/80 backdrop-blur-sm",children:A.jsxs(WB,{"data-loc":"client/src/pages/NotFound.tsx:16",className:"pt-8 pb-8 text-center",children:[A.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:17",className:"flex justify-center mb-6",children:A.jsxs("div",{"data-loc":"client/src/pages/NotFound.tsx:18",className:"relative",children:[A.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:19",className:"absolute inset-0 bg-red-100 rounded-full animate-pulse"}),A.jsx(sF,{"data-loc":"client/src/pages/NotFound.tsx:20",className:"relative h-16 w-16 text-red-500"})]})}),A.jsx("h1",{"data-loc":"client/src/pages/NotFound.tsx:24",className:"text-4xl font-bold text-slate-900 mb-2",children:"404"}),A.jsx("h2",{"data-loc":"client/src/pages/NotFound.tsx:26",className:"text-xl font-semibold text-slate-700 mb-4",children:"Page Not Found"}),A.jsxs("p",{"data-loc":"client/src/pages/NotFound.tsx:30",className:"text-slate-600 mb-8 leading-relaxed",children:["Sorry, the page you are looking for doesn't exist.",A.jsx("br",{"data-loc":"client/src/pages/NotFound.tsx:32"}),"It may have been moved or deleted."]}),A.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:36",id:"not-found-button-group",className:"flex flex-col sm:flex-row gap-3 justify-center",children:A.jsxs(qB,{"data-loc":"client/src/pages/NotFound.tsx:40",onClick:t,className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-2.5 rounded-lg transition-all duration-200 shadow-md hover:shadow-lg",children:[A.jsx(_w,{"data-loc":"client/src/pages/NotFound.tsx:44",className:"w-4 h-4 mr-2"}),"Go Home"]})})]})})})}class FF extends $.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){return this.state.hasError?A.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:27",className:"flex items-center justify-center min-h-screen p-8 bg-background",children:A.jsxs("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:28",className:"flex flex-col items-center w-full max-w-2xl p-8",children:[A.jsx(cF,{"data-loc":"client/src/components/ErrorBoundary.tsx:29",size:48,className:"text-destructive mb-6 flex-shrink-0"}),A.jsx("h2",{"data-loc":"client/src/components/ErrorBoundary.tsx:34",className:"text-xl mb-4",children:"An unexpected error occurred."}),A.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:36",className:"p-4 w-full rounded bg-muted overflow-auto mb-6",children:A.jsx("pre",{"data-loc":"client/src/components/ErrorBoundary.tsx:37",className:"text-sm text-muted-foreground whitespace-break-spaces",children:this.state.error?.stack})}),A.jsxs("button",{"data-loc":"client/src/components/ErrorBoundary.tsx:42",onClick:()=>window.location.reload(),className:_f("flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground","hover:opacity-90 cursor-pointer"),children:[A.jsx(aF,{"data-loc":"client/src/components/ErrorBoundary.tsx:50",size:16}),"Reload Page"]})]})}):this.props.children}}const UF=$.createContext(void 0);function jF({children:s,defaultTheme:t="light",switchable:e=!1}){const[n,i]=$.useState(()=>e&&localStorage.getItem("theme")||t);$.useEffect(()=>{const o=document.documentElement;n==="dark"?o.classList.add("dark"):o.classList.remove("dark"),e&&localStorage.setItem("theme",n)},[n,e]);const a=e?()=>{i(o=>o==="light"?"dark":"light")}:void 0;return A.jsx(UF.Provider,{"data-loc":"client/src/contexts/ThemeContext.tsx:52",value:{theme:n,toggleTheme:a,switchable:e},children:s})}const Uw=$.createContext({});function $F(s){const t=$.useRef(null);return t.current===null&&(t.current=s()),t.current}const G0=typeof window<"u",VF=G0?$.useLayoutEffect:$.useEffect,H0=$.createContext(null);function z0(s,t){s.indexOf(t)===-1&&s.push(t)}function K0(s,t){const e=s.indexOf(t);e>-1&&s.splice(e,1)}const Di=(s,t,e)=>e>t?t:e<s?s:e;let q0=()=>{};const Ii={},jw=s=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(s);function $w(s){return typeof s=="object"&&s!==null}const Vw=s=>/^0[^.\s]+$/u.test(s);function Y0(s){let t;return()=>(t===void 0&&(t=s()),t)}const fn=s=>s,GF=(s,t)=>e=>t(s(e)),Oc=(...s)=>s.reduce(GF),hc=(s,t,e)=>{const n=t-s;return n===0?1:(e-s)/n};class W0{constructor(){this.subscriptions=[]}add(t){return z0(this.subscriptions,t),()=>K0(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,e,n);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=s=>s*1e3,dn=s=>s/1e3;function Gw(s,t){return t?s*(1e3/t):0}const Hw=(s,t,e)=>(((1-3*e+3*t)*s+(3*e-6*t))*s+3*t)*s,HF=1e-7,zF=12;function KF(s,t,e,n,i){let a,o,c=0;do o=t+(e-t)/2,a=Hw(o,n,i)-s,a>0?e=o:t=o;while(Math.abs(a)>HF&&++c<zF);return o}function kc(s,t,e,n){if(s===t&&e===n)return fn;const i=a=>KF(a,0,1,s,e);return a=>a===0||a===1?a:Hw(i(a),t,n)}const zw=s=>t=>t<=.5?s(2*t)/2:(2-s(2*(1-t)))/2,Kw=s=>
vendor: 36,392 bytes, line 182
182t=>1-s(1-t),qw=kc(.33,1.53,.69,.99),Q0=Kw(qw),Yw=zw(Q0),Ww=s=>(s*=2)<1?.5*Q0(s):.5*(2-Math.pow(2,-10*(s-1))),X0=s=>1-Math.sin(Math.acos(s)),Qw=Kw(X0),Xw=zw(X0),qF=kc(.42,0,1,1),YF=kc(0,0,.58,1),Zw=kc(.42,0,.58,1),WF=s=>Array.isArray(s)&&typeof s[0]!="number",Jw=s=>Array.isArray(s)&&typeof s[0]=="number",QF={linear:fn,easeIn:qF,easeInOut:Zw,easeOut:YF,circIn:X0,circInOut:Xw,circOut:Qw,backIn:Q0,backInOut:Yw,backOut:qw,anticipate:Ww},XF=s=>typeof s=="string",ZE=s=>{if(Jw(s)){q0(s.length===4);const[t,e,n,i]=s;return kc(t,e,n,i)}else if(XF(s))return QF[s];return s},nd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ZF(s,t){let e=new Set,n=new Set,i=!1,a=!1;const o=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(h){o.has(h)&&(f.schedule(h),s()),h(c)}const f={schedule:(h,p=!1,g=!1)=>{const x=g&&i?e:n;return p&&o.add(h),x.has(h)||x.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(c=h,i){a=!0;return}i=!0,[e,n]=[n,e],e.forEach(d),e.clear(),i=!1,a&&(a=!1,f.process(h))}};return f}const JF=40;function tL(s,t){let e=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>e=!0,o=nd.reduce((_,P)=>(_[P]=ZF(a),_),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:h,update:p,preRender:g,render:v,postRender:x}=o,S=()=>{const _=Ii.useManualTiming?i.timestamp:performance.now();e=!1,Ii.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(_-i.timestamp,JF),1)),i.timestamp=_,i.isProcessing=!0,c.process(i),d.process(i),f.process(i),h.process(i),p.process(i),g.process(i),v.process(i),x.process(i),i.isProcessing=!1,e&&t&&(n=!1,s(S))},E=()=>{e=!0,n=!0,i.isProcessing||s(S)};return{schedule:nd.reduce((_,P)=>{const D=o[P];return _[P]=(B,C=!1,I=!1)=>(e||E(),D.schedule(B,C,I)),_},{}),cancel:_=>{for(let P=0;P<nd.length;P++)o[nd[P]].cancel(_)},state:i,steps:o}}const{schedule:de,cancel:Sr,state:ts,steps:fp}=tL(typeof requestAnimationFrame<"u"?requestAnimationFrame:fn,!0);let Ld;function tU(){Ld=void 0}const Ls={now:()=>(Ld===void 0&&Ls.set(ts.isProcessing||Ii.useManualTiming?ts.timestamp:performance.now()),Ld),set:s=>{Ld=s,queueMicrotask(tU)}},eL=s=>t=>typeof t=="string"&&t.startsWith(s),Z0=eL("--"),eU=eL("var(--"),J0=s=>eU(s)?sU.test(s.split("/*")[0].trim()):!1,sU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,jo={test:s=>typeof s=="number",parse:parseFloat,transform:s=>s},mc={...jo,transform:s=>Di(0,1,s)},id={...jo,default:1},Yl=s=>Math.round(s*1e5)/1e5,ty=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function nU(s){return s==null}const iU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ey=(s,t)=>e=>!!(typeof e=="string"&&iU.test(e)&&e.startsWith(s)||t&&!nU(e)&&Object.prototype.hasOwnProperty.call(e,t)),sL=(s,t,e)=>n=>{if(typeof n!="string")return n;const[i,a,o,c]=n.match(ty);return{[s]:parseFloat(i),[t]:parseFloat(a),[e]:parseFloat(o),alpha:c!==void 0?parseFloat(c):1}},rU=s=>Di(0,255,s),hp={...jo,transform:s=>Math.round(rU(s))},sa={test:ey("rgb","red"),parse:sL("red","green","blue"),transform:({red:s,green:t,blue:e,alpha:n=1})=>"rgba("+hp.transform(s)+", "+hp.transform(t)+", "+hp.transform(e)+", "+Yl(mc.transform(n))+")"};function aU(s){let t="",e="",n="",i="";return s.length>5?(t=s.substring(1,3),e=s.substring(3,5),n=s.substring(5,7),i=s.substring(7,9)):(t=s.substring(1,2),e=s.substring(2,3),n=s.substring(3,4),i=s.substring(4,5),t+=t,e+=e,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Ig={test:ey("#"),parse:aU,transform:sa.transform},Pc=s=>({test:t=>typeof t=="string"&&t.endsWith(s)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${s}`}),ur=Pc("deg"),Yn=Pc("%"),Lt=Pc("px"),oU=Pc("vh"),lU=Pc("vw"),JE={...Yn,parse:s=>Yn.parse(s)/100,transform:s=>Yn.transform(s*100)},go={test:ey("hsl","hue"),parse:sL("hue","saturation","lightness"),transform:({hue:s,saturation:t,lightness:e,alpha:n=1})=>"hsla("+Math.round(s)+", "+Yn.transform(Yl(t))+", "+Yn.transform(Yl(e))+", "+Yl(mc.transform(n))+")"},Ne={test:s=>sa.test(s)||Ig.test(s)||go.test(s),parse:s=>sa.test(s)?sa.parse(s):go.test(s)?go.parse(s):Ig.parse(s),transform:s=>typeof s=="string"?s:s.hasOwnProperty("red")?sa.transform(s):go.transform(s),getAnimatableNone:s=>{const t=Ne.parse(s);return t.alpha=0,Ne.transform(t)}},cU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uU(s){return isNaN(s)&&typeof s=="string"&&(s.match(ty)?.length||0)+(s.match(cU)?.length||0)>0}const nL="number",iL="color",dU="var",fU="var(",tT="${}",hU=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pc(s){const t=s.toString(),e=[],n={color:[],number:[],var:[]},i=[];let a=0;const c=t.replace(hU,d=>(Ne.test(d)?(n.color.push(a),i.push(iL),e.push(Ne.parse(d))):d.startsWith(fU)?(n.var.push(a),i.push(dU),e.push(d)):(n.number.push(a),i.push(nL),e.push(parseFloat(d))),++a,tT)).split(tT);return{values:e,split:c,indexes:n,types:i}}function rL(s){return pc(s).values}function aL(s){const{split:t,types:e}=pc(s),n=t.length;return i=>{let a="";for(let o=0;o<n;o++)if(a+=t[o],i[o]!==void 0){const c=e[o];c===nL?a+=Yl(i[o]):c===iL?a+=Ne.transform(i[o]):a+=i[o]}return a}}const mU=s=>typeof s=="number"?0:Ne.test(s)?Ne.getAnimatableNone(s):s;function pU(s){const t=rL(s);return aL(s)(t.map(mU))}const Er={test:uU,parse:rL,createTransformer:aL,getAnimatableNone:pU};function mp(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?s+(t-s)*6*e:e<1/2?t:e<2/3?s+(t-s)*(2/3-e)*6:s}function gU({hue:s,saturation:t,lightness:e,alpha:n}){s/=360,t/=100,e/=100;let i=0,a=0,o=0;if(!t)i=a=o=e;else{const c=e<.5?e*(1+t):e+t-e*t,d=2*e-c;i=mp(d,c,s+1/3),a=mp(d,c,s),o=mp(d,c,s-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function Yd(s,t){return e=>e>0?t:s}const ve=(s,t,e)=>s+(t-s)*e,pp=(s,t,e)=>{const n=s*s,i=e*(t*t-n)+n;return i<0?0:Math.sqrt(i)},yU=[Ig,sa,go],vU=s=>yU.find(t=>t.test(s));function eT(s){const t=vU(s);if(!t)return!1;let e=t.parse(s);return t===go&&(e=gU(e)),e}const sT=(s,t)=>{const e=eT(s),n=eT(t);if(!e||!n)return Yd(s,t);const i={...e};return a=>(i.red=pp(e.red,n.red,a),i.green=pp(e.green,n.green,a),i.blue=pp(e.blue,n.blue,a),i.alpha=ve(e.alpha,n.alpha,a),sa.transform(i))},Og=new Set(["none","hidden"]);function xU(s,t){return Og.has(s)?e=>e<=0?s:t:e=>e>=1?t:s}function bU(s,t){return e=>ve(s,t,e)}function sy(s){return typeof s=="number"?bU:typeof s=="string"?J0(s)?Yd:Ne.test(s)?sT:TU:Array.isArray(s)?oL:typeof s=="object"?Ne.test(s)?sT:SU:Yd}function oL(s,t){const e=[...s],n=e.length,i=s.map((a,o)=>sy(a)(a,t[o]));return a=>{for(let o=0;o<n;o++)e[o]=i[o](a);return e}}function SU(s,t){const e={...s,...t},n={};for(const i in e)s[i]!==void 0&&t[i]!==void 0&&(n[i]=sy(s[i])(s[i],t[i]));return i=>{for(const a in n)e[a]=n[a](i);return e}}function EU(s,t){const e=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=s.indexes[a][n[a]],c=s.values[o]??0;e[i]=c,n[a]++}return e}const TU=(s,t)=>{const e=Er.createTransformer(t),n=pc(s),i=pc(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Og.has(s)&&!i.values.length||Og.has(t)&&!n.values.length?xU(s,t):Oc(oL(EU(n,i),i.values),e):Yd(s,t)};function lL(s,t,e){return typeof s=="number"&&typeof t=="number"&&typeof e=="number"?ve(s,t,e):sy(s)(s,t)}const AU=s=>{const t=({timestamp:e})=>s(e);return{start:(e=!0)=>de.update(t,e),stop:()=>Sr(t),now:()=>ts.isProcessing?ts.timestamp:Ls.now()}},cL=(s,t,e=10)=>{let n="";const i=Math.max(Math.round(t/e),2);for(let a=0;a<i;a++)n+=Math.round(s(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Wd=2e4;function ny(s){let t=0;const e=50;let n=s.next(t);for(;!n.done&&t<Wd;)t+=e,n=s.next(t);return t>=Wd?1/0:t}function RU(s,t=100,e){const n=e({...s,keyframes:[0,t]}),i=Math.min(ny(n),Wd);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:dn(i)}}const wU=5;function uL(s,t,e){const n=Math.max(t-wU,0);return Gw(e-s(n),t-n)}const Ee={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},gp=.001;function LU({duration:s=Ee.duration,bounce:t=Ee.bounce,velocity:e=Ee.velocity,mass:n=Ee.mass}){let i,a,o=1-t;o=Di(Ee.minDamping,Ee.maxDamping,o),s=Di(Ee.minDuration,Ee.maxDuration,dn(s)),o<1?(i=f=>{const h=f*o,p=h*s,g=h-e,v=kg(f,o),x=Math.exp(-p);return gp-g/v*x},a=f=>{const p=f*o*s,g=p*e+e,v=Math.pow(o,2)*Math.pow(f,2)*s,x=Math.exp(-p),S=kg(Math.pow(f,2),o);return(-i(f)+gp>0?-1:1)*((g-v)*x)/S}):(i=f=>{const h=Math.exp(-f*s),p=(f-e)*s+1;return-gp+h*p},a=f=>{const h=Math.exp(-f*s),p=(e-f)*(s*s);return h*p});const c=5/s,d=CU(i,a,c);if(s=qn(s),isNaN(d))return{stiffness:Ee.stiffness,damping:Ee.damping,duration:s};{const f=Math.pow(d,2)*n;return{stiffness:f,damping:o*2*Math.sqrt(n*f),duration:s}}}const _U=12;function CU(s,t,e){let n=e;for(let i=1;i<_U;i++)n=n-s(n)/t(n);return n}function kg(s,t){return s*Math.sqrt(1-t*t)}const DU=["duration","bounce"],IU=["stiffness","damping","mass"];function nT(s,t){return t.some(e=>s[e]!==void 0)}function OU(s){let t={velocity:Ee.velocity,stiffness:Ee.stiffness,damping:Ee.damping,mass:Ee.mass,isResolvedFromDuration:!1,...s};if(!nT(s,IU)&&nT(s,DU))if(s.visualDuration){const e=s.visualDuration,n=2*Math.PI/(e*1.2),i=n*n,a=2*Di(.05,1,1-(s.bounce||0))*Math.sqrt(i);t={...t,mass:Ee.mass,stiffness:i,damping:a}}else{const e=LU(s);t={...t,...e,mass:Ee.mass},t.isResolvedFromDuration=!0}return t}function Qd(s=Ee.visualDuration,t=Ee.bounce){const e=typeof s!="object"?{visualDuration:s,keyframes:[0,1],bounce:t}:s;let{restSpeed:n,restDelta:i}=e;const a=e.keyframes[0],o=e.keyframes[e.keyframes.length-1],c={done:!1,value:a},{stiffness:d,damping:f,mass:h,duration:p,velocity:g,isResolvedFromDuration:v}=OU({...e,velocity:-dn(e.velocity||0)}),x=g||0,S=f/(2*Math.sqrt(d*h)),E=o-a,T=dn(Math.sqrt(d/h)),L=Math.abs(E)<5;n||(n=L?Ee.restSpeed.granular:Ee.restSpeed.default),i||(i=L?Ee.restDelta.granular:Ee.restDelta.default);let _;if(S<1){const D=kg(T,S);_=B=>{const C=Math.exp(-S*T*B);return o-C*((x+S*T*E)/D*Math.sin(D*B)+E*Math.cos(D*B))}}else if(S===1)_=D=>o-Math.exp(-T*D)*(E+(x+T*E)*D);else{const D=T*Math.sqrt(S*S-1);_=B=>{const C=Math.exp(-S*T*B),I=Math.min(D*B,300);return o-C*((x+S*T*E)*Math.sinh(I)+D*E*Math.cosh(I))/D}}const P={calculatedDuration:v&&p||null,next:D=>{const B=_(D);if(v)c.done=D>=p;else{let C=D===0?x:0;S<1&&(C=D===0?qn(x):uL(_,D,B));const I=Math.abs(C)<=n,F=Math.abs(o-B)<=i;c.done=I&&F}return c.value=c.done?o:B,c},toString:()=>{const D=Math.min(ny(P),Wd),B=cL(C=>P.next(D*C).value,D,30);return D+"ms "+B},toTransition:()=>{}};return P}Qd.applyToOptions=s=>{const t=RU(s,100,Qd);return s.ease=t.ease,s.duration=qn(t.duration),s.type="keyframes",s};function Pg({keyframes:s,velocity:t=0,power:e=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:c,max:d,restDelta:f=.5,restSpeed:h}){const p=s[0],g={done:!1,value:p},v=I=>c!==void 0&&I<c||d!==void 0&&I>d,x=I=>c===void 0?d:d===void 0||Math.abs(c-I)<Math.abs(d-I)?c:d;let S=e*t;const E=p+S,T=o===void 0?E:o(E);T!==E&&(S=T-p);const L=I=>-S*Math.exp(-I/n),_=I=>T+L(I),P=I=>{const F=L(I),U=_(I);g.done=Math.abs(F)<=f,g.value=g.done?T:U};let D,B;const C=I=>{v(g.value)&&(D=I,B=Qd({keyframes:[g.value,x(g.value)],velocity:uL(_,I,g.value),damping:i,stiffness:a,restDelta:f,restSpeed:h}))};return C(0),{calculatedDuration:null,next:I=>{let F=!1;return!B&&D===void 0&&(F=!0,P(I),C(I)),D!==void 0&&I>=D?B.next(I-D):(!F&&P(I),g)}}}function kU(s,t,e){const n=[],i=e||Ii.mix||lL,a=s.length-1;for(let o=0;o<a;o++){let c=i(s[o],s[o+1]);if(t){const d=Array.isArray(t)?t[o]||fn:t;c=Oc(d,c)}n.push(c)}return n}function PU(s,t,{clamp:e=!0,ease:n,mixer:i}={}){const a=s.length;if(q0(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=s[0]===s[1];s[0]>s[a-1]&&(s=[...s].reverse(),t=[...t].reverse());const c=kU(t,n,i),d=c.length,f=h=>{if(o&&h<s[0])return t[0];let p=0;if(d>1)for(;p<s.length-2&&!(h<s[p+1]);p++);const g=hc(s[p],s[p+1],h);return c[p](g)};return e?h=>f(Di(s[0],s[a-1],h)):f}function MU(s,t){const e=s[s.length-1];for(let n=1;n<=t;n++){const i=hc(0,t,n);s.push(ve(e,1,i))}}function NU(s){const t=[0];return MU(t,s.length-1),t}function BU(s,t){return s.map(e=>e*t)}function FU(s,t){return s.map(()=>t||Zw).splice(0,s.length-1)}function Wl({duration:s=300,keyframes:t,times:e,ease:n="easeInOut"}){const i=WF(n)?n.map(ZE):ZE(n),a={done:!1,value:t[0]},o=BU(e&&e.length===t.length?e:NU(t),s),c=PU(o,t,{ease:Array.isArray(i)?i:FU(t,i)});return{calculatedDuration:s,next:d=>(a.value=c(d),a.done=d>=s,a)}}const UU=s=>s!==null;function iy(s,{repeat:t,repeatType:e="loop"},n,i=1){const a=s.filter(UU),c=i<0||t&&e!=="loop"&&t%2===1?0:a.length-1;return!c||n===void 0?a[c]:n}const jU={decay:Pg,inertia:Pg,tween:Wl,keyframes:Wl,spring:Qd};function dL(s){typeof s.type=="string"&&(s.type=jU[s.type])}class ry{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const $U=s=>s/100;class ay extends ry{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Ls.now()&&this.tick(Ls.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;dL(t);const{type:e=Wl,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:c}=t;const d=e||Wl;d!==Wl&&typeof c[0]!="number"&&(this.mixKeyframes=Oc($U,lL(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});a==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=ny(f));const{calculatedDuration:h}=f;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=f}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return n.next(0);const{delay:f=0,keyframes:h,repeat:p,repeatType:g,repeatDelay:v,type:x,onUpdate:S,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const T=this.currentTime-f*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?T<0:T>i;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let _=this.currentTime,P=n;if(p){const I=Math.min(this.currentTime,i)/c;let F=Math.floor(I),U=I%1;!U&&I>=1&&(U=1),U===1&&F--,F=Math.min(F,p+1),!!(F%2)&&(g==="reverse"?(U=1-U,v&&(U-=v/c)):g==="mirror"&&(P=o)),_=Di(0,1,U)*c}const D=L?{done:!1,value:h[0]}:P.next(_);a&&(D.value=a(D.value));let{done:B}=D;!L&&d!==null&&(B=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&B);return C&&x!==Pg&&(D.value=iy(h,this.options,E,this.speed)),S&&S(D.value),C&&this.finish(),D}then(t,e){return this.finished.then(t,e)}get duration(){return dn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dn(t)}get time(){return dn(this.currentTime)}set time(t){t=qn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ls.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=dn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=AU,startTime:e}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ls.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function VU(s){for(let t=1;t<s.length;t++)s[t]??(s[t]=s[t-1])}const na=s=>s*180/Math.PI,Mg=s=>{const t=na(Math.atan2(s[1],s[0]));return Ng(t)},GU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:s=>(Math.abs(s[0])+Math.abs(s[3]))/2,rotate:Mg,rotateZ:Mg,skewX:s=>na(Math.atan(s[1])),skewY:s=>na(Math.atan(s[2])),skew:s=>(Math.abs(s[1])+Math.abs(s[2]))/2},Ng=s=>(s=s%360,s<0&&(s+=360),s),iT=Mg,rT=s=>Math.sqrt(s[0]*s[0]+s[1]*s[1]),aT=s=>Math.sqrt(s[4]*s[4]+s[5]*s[5]),HU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:rT,scaleY:aT,scale:s=>(rT(s)+aT(s))/2,rotateX:s=>Ng(na(Math.atan2(s[6],s[5]))),rotateY:s=>Ng(na(Math.atan2(-s[2],s[0]))),rotateZ:iT,rotate:iT,skewX:s=>na(Math.atan(s[4])),skewY:s=>na(Math.atan(s[1])),skew:s=>(Math.abs(s[1])+Math.abs(s[4]))/2};function Bg(s){return s.includes("scale")?1:0}function Fg(s,t){if(!s||s==="none")return Bg(t);const e=s.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(e)n=HU,i=e;else{const c=s.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=GU,i=c}if(!i)return Bg(t);const a=n[t],o=i[1].split(",").map(KU);return typeof a=="function"?a(o):o[a]}const zU=(s,t)=>{const{transform:e="none"}=getComputedStyle(s);return Fg(e,t)};function KU(s){return parseFloat(s.trim())}const $o=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vo=new Set($o),oT=s=>s===jo||s===Lt,qU=new Set(["x","y","z"]),YU=$o.filter(s=>!qU.has(s));function WU(s){const t=[];return YU.forEach(e=>{const n=s.getValue(e);n!==void 0&&(t.push([e,n.get()]),n.set(e.startsWith("scale")?1:0))}),t}const ia={width:({x:s},{paddingLeft:t="0",paddingRight:e="0"})=>s.max-s.min-parseFloat(t)-parseFloat(e),height:({y:s},{paddingTop:t="0",paddingBottom:e="0"})=>s.max-s.min-parseFloat(t)-parseFloat(e),top:(s,{top:t})=>parseFloat(t),left:(s,{left:t})=>parseFloat(t),bottom:({y:s},{top:t})=>parseFloat(t)+(s.max-s.min),right:({x:s},{left:t})=>parseFloat(t)+(s.max-s.min),x:(s,{transform:t})=>Fg(t,"x"),y:(s,{transform:t})=>Fg(t,"y")};ia.translateX=ia.x;ia.translateY=ia.y;const ra=new Set;let Ug=!1,jg=!1,$g=!1;function fL(){if(jg){const s=Array.from(ra).filter(n=>n.needsMeasurement),t=new Set(s.map(n=>n.element)),e=new Map;t.forEach(n=>{const i=WU(n);i.length&&(e.set(n,i),n.render())}),s.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=e.get(n);i&&i.forEach(([a,o])=>{n.getValue(a)?.set(o)})}),s.forEach(n=>n.measureEndState()),s.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}jg=!1,Ug=!1,ra.forEach(s=>s.complete($g)),ra.clear()}function hL(){ra.forEach(s=>{s.readKeyframes(),s.needsMeasurement&&(jg=!0)})}function QU(){$g=!0,hL(),fL(),$g=!1}class oy{constructor(t,e,n,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ra.add(this),Ug||(Ug=!0,de.read(hL),de.resolveKeyframes(fL))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(t[0]===null){const a=i?.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&e){const c=n.readValue(e,o);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}VU(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ra.delete(this)}cancel(){this.state==="scheduled"&&(ra.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const XU=s=>s.startsWith("--");function ZU(s,t,e){XU(t)?s.style.setProperty(t,e):s.style[t]=e}const JU=Y0(()=>window.ScrollTimeline!==void 0),t3={};function e3(s,t){const e=Y0(s);return()=>t3[t]??e()}const mL=e3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Gl=([s,t,e,n])=>`cubic-bezier(${s}, ${t}, ${e}, ${n})`,lT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gl([0,.65,.55,1]),circOut:Gl([.55,0,1,.45]),backIn:Gl([.31,.01,.66,-.59]),backOut:Gl([.33,1.53,.69,.99])};function pL(s,t){if(s)return typeof s=="function"?mL()?cL(s,t):"ease-out":Jw(s)?Gl(s):Array.isArray(s)?s.map(e=>pL(e,t)||lT.easeOut):lT[s]}function s3(s,t,e,{delay:n=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:c="easeOut",times:d}={},f=void 0){const h={[t]:e};d&&(h.offset=d);const p=pL(c,i);Array.isArray(p)&&(h.easing=p);const g={delay:n,duration:i,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return f&&(g.pseudoElement=f),s.animate(h,g)}function gL(s){return typeof s=="function"&&"applyToOptions"in s}function n3({type:s,...t}){return gL(s)&&mL()?s.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class i3 extends ry{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,q0(typeof t.type!="string");const f=n3(t);this.animation=s3(e,n,i,f,a),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const h=iy(i,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(h):ZU(e,n,h),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return dn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dn(t)}get time(){return dn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=qn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&JU()?(this.animation.timeline=t,fn):e(this)}}const yL={anticipate:Ww,backInOut:Yw,circInOut:Xw};function r3(s){return s in yL}function a3(s){typeof s.ease=="string"&&r3(s.ease)&&(s.ease=yL[s.ease])}const cT=10;class o3 extends i3{constructor(t){a3(t),dL(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:a,...o}=this.options;if(!e)return;if(t!==void 0){e.set(t);return}const c=new ay({...o,autoplay:!1}),d=qn(this.finishedTime??this.time);e.setWithVelocity(c.sample(d-cT).value,c.sample(d).value,cT),c.stop()}}const uT=(s,t)=>t==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&(Er.test(s)||s==="0")&&!s.startsWith("url("));function l3(s){const t=s[0];if(s.length===1)return!0;for(let e=0;e<s.length;e++)if(s[e]!==t)return!0}function c3(s,t,e,n){const i=s[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=s[s.length-1],o=uT(i,t),c=uT(a,t);return!o||!c?!1:l3(s)||(e==="spring"||gL(e))&&n}function Vg(s){s.duration=0,s.type="keyframes"}const u3=new Set(["opacity","clipPath","filter","transform"]),d3=Y0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function f3(s){const{motionValue:t,name:e,repeatDelay:n,repeatType:i,damping:a,type:o}=s;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:f}=t.owner.getProps();return d3()&&e&&u3.has(e)&&(e!=="transform"||!f)&&!d&&!n&&i!=="mirror"&&a!==0&&o!=="inertia"}const h3=40;class m3 extends ry{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:c,name:d,motionValue:f,element:h,...p}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ls.now();const g={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:a,repeatType:o,name:d,motionValue:f,element:h,...p},v=h?.KeyframeResolver||oy;this.keyframeResolver=new v(c,(x,S,E)=>this.onKeyframesResolved(x,S,g,!E),d,f,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:c,delay:d,isHandoff:f,onUpdate:h}=n;this.resolvedAt=Ls.now(),c3(t,a,o,c)||((Ii.instantAnimations||!d)&&h?.(iy(t,n,e)),t[0]=t[t.length-1],Vg(n),n.repeat=0);const g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>h3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},v=!f&&f3(g)?new o3({...g,element:g.motionValue.owner.current}):new ay(g);v.finished.then(()=>this.notifyFinished()).catch(fn),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),QU()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const p3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function g3(s){const t=p3.exec(s);if(!t)return[,];const[,e,n,i]=t;return[`--${e??n}`,i]}function vL(s,t,e=1){const[n,i]=g3(s);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const o=a.trim();return jw(o)?parseFloat(o):o}return J0(i)?vL(i,t,e+1):i}function ly(s,t){return s?.[t]??s?.default??s}const xL=new Set(["width","height","top","left","right","bottom",...$o]),y3={test:s=>s==="auto",parse:s=>s},bL=s=>t=>t.test(s),SL=[jo,Lt,Yn,ur,lU,oU,y3],dT=s=>SL.find(bL(s));function v3(s){return typeof s=="number"?s===0:s!==null?s==="none"||s==="0"||Vw(s):!0}const x3=new Set(["brightness","contrast","saturate","opacity"]);function b3(s){const[t,e]=s.slice(0,-1).split("(");if(t==="drop-shadow")return s;const[n]=e.match(ty)||[];if(!n)return s;const i=e.replace(n,"");let a=x3.has(t)?1:0;return n!==e&&(a*=100),t+"("+a+i+")"}const S3=/\b([a-z-]*)\(.*?\)/gu,Gg={...Er,getAnimatableNone:s=>{const t=s.match(S3);return t?t.map(b3).join(" "):s}},fT={...jo,transform:Math.round},E3={rotate:ur,rotateX:ur,rotateY:ur,rotateZ:ur,scale:id,scaleX:id,scaleY:id,scaleZ:id,skew:ur,skewX:ur,skewY:ur,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:mc,originX:JE,originY:JE,originZ:Lt},cy={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...E3,zIndex:fT,fillOpacity:mc,strokeOpacity:mc,numOctaves:fT},T3={...cy,color:Ne,backgroundColor:Ne,outlineColor:Ne,fill:Ne,stroke:Ne,borderColor:Ne,borderTopColor:Ne,borderRightColor:Ne,borderBottomColor:Ne,borderLeftColor:Ne,filter:Gg,WebkitFilter:Gg},EL=s=>T3[s];function TL(s,t){let e=EL(s);return e!==Gg&&(e=Er),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const A3=new Set(["auto","none","0"]);function R3(s,t,e){let n=0,i;for(;n<s.length&&!i;){const a=s[n];typeof a=="string"&&!A3.has(a)&&pc(a).values.length&&(i=s[n]),n++}if(i&&e)for(const a of t)s[a]=TL(e,i)}class w3 extends oy{constructor(t,e,n,i,a){super(t,e,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),J0(f))){const h=vL(f,e.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!xL.has(n)||t.length!==2)return;const[i,a]=t,o=dT(i),c=dT(a);if(o!==c)if(oT(o)&&oT(c))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else ia[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||v3(t[i]))&&n.push(i);n.length&&R3(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ia[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,o=n[a];n[a]=ia[e](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,d])=>{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function L3(s,t,e){if(s instanceof EventTarget)return[s];if(typeof s=="string"){let n=document;const i=e?.[s]??n.querySelectorAll(s);return i?Array.from(i):[]}return Array.from(s)}const AL=(s,t)=>t&&typeof s=="number"?t.transform(s):s;function _3(s){return $w(s)&&"offsetHeight"in s}const hT=30,C3=s=>!isNaN(parseFloat(s));class D3{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const i=Ls.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=Ls.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=C3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new W0);const n=this.events[t].add(e);return t==="change"?()=>{n(),de.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ls.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hT)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,hT);return Gw(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Oo(s,t){return new D3(s,t)}const{schedule:uy}=tL(queueMicrotask,!1),En={x:!1,y:!1};function RL(){return En.x||En.y}function I3(s){return s==="x"||s==="y"?En[s]?null:(En[s]=!0,()=>{En[s]=!1}):En.x||En.y?null:(En.x=En.y=!0,()=>{En.x=En.y=!1})}function wL(s,t){const e=L3(s),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[e,i,()=>n.abort()]}function mT(s){return!(s.pointerType==="touch"||RL())}function O3(s,t,e={}){const[n,i,a]=wL(s,e),o=c=>{if(!mT(c))return;const{target:d}=c,f=t(d,c);if(typeof f!="function"||!d)return;const h=p=>{mT(p)&&(f(p),d.removeEventListener("pointerleave",h))};d.addEventListener("pointerleave",h,i)};return n.forEach(c=>{c.addEventListener("pointerenter",o,i)}),a}const LL=(s,t)=>t?s===t?!0:LL(s,t.parentElement):!1,dy=s=>s.pointerType==="mouse"?typeof s.button!="number"||s.button<=0:s.isPrimary!==!1,k3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function P3(s){return k3.has(s.tagName)||s.tabIndex!==-1}const _d=new WeakSet;function pT(s){return t=>{t.key==="Enter"&&s(t)}}function yp(s,t){s.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const M3=(s,t)=>{const e=s.currentTarget;if(!e)return;const n=pT(()=>{if(_d.has(e))return;yp(e,"down");const i=pT(()=>{yp(e,"up")}),a=()=>yp(e,"cancel");e.addEventListener("keyup",i,t),e.addEventListener("blur",a,t)});e.addEventListener("keydown",n,t),e.addEventListener("blur",()=>e.removeEventListener("keydown",n),t)};function gT(s){return dy(s)&&!RL()}function N3(s,t,e={}){const[n,i,a]=wL(s,e),o=c=>{const d=c.currentTarget;if(!gT(c))return;_d.add(d);const f=t(d,c),h=(v,x)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",g),_d.has(d)&&_d.delete(
vendor: 5,214 bytes, line 182
182d),gT(v)&&typeof f=="function"&&f(v,{success:x})},p=v=>{h(v,d===window||d===document||e.useGlobalTarget||LL(d,v.target))},g=v=>{h(v,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",g,i)};return n.forEach(c=>{(e.useGlobalTarget?window:c).addEventListener("pointerdown",o,i),_3(c)&&(c.addEventListener("focus",f=>M3(f,i)),!P3(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),a}function _L(s){return $w(s)&&"ownerSVGElement"in s}function B3(s){return _L(s)&&s.tagName==="svg"}const ls=s=>!!(s&&s.getVelocity),F3=[...SL,Ne,Er],U3=s=>F3.find(bL(s)),CL=$.createContext({transformPagePoint:s=>s,isStatic:!1,reducedMotion:"never"});function j3(s=!0){const t=$.useContext(H0);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:i}=t,a=$.useId();$.useEffect(()=>{if(s)return i(a)},[s]);const o=$.useCallback(()=>s&&n&&n(a),[a,n,s]);return!e&&n?[!1,o]:[!0]}const DL=$.createContext({strict:!1}),yT={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ko={};for(const s in yT)ko[s]={isEnabled:t=>yT[s].some(e=>!!t[e])};function $3(s){for(const t in s)ko[t]={...ko[t],...s[t]}}const V3=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Xd(s){return s.startsWith("while")||s.startsWith("drag")&&s!=="draggable"||s.startsWith("layout")||s.startsWith("onTap")||s.startsWith("onPan")||s.startsWith("onLayout")||V3.has(s)}let IL=s=>!Xd(s);function G3(s){typeof s=="function"&&(IL=t=>t.startsWith("on")?!Xd(t):s(t))}try{G3(require("@emotion/is-prop-valid").default)}catch{}function H3(s,t,e){const n={};for(const i in s)i==="values"&&typeof s.values=="object"||(IL(i)||e===!0&&Xd(i)||!t&&!Xd(i)||s.draggable&&i.startsWith("onDrag"))&&(n[i]=s[i]);return n}const Df=$.createContext({});function If(s){return s!==null&&typeof s=="object"&&typeof s.start=="function"}function gc(s){return typeof s=="string"||Array.isArray(s)}const fy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],hy=["initial",...fy];function Of(s){return If(s.animate)||hy.some(t=>gc(s[t]))}function OL(s){return!!(Of(s)||s.variants)}function z3(s,t){if(Of(s)){const{initial:e,animate:n}=s;return{initial:e===!1||gc(e)?e:void 0,animate:gc(n)?n:void 0}}return s.inherit!==!1?t:{}}function K3(s){const{initial:t,animate:e}=z3(s,$.useContext(Df));return $.useMemo(()=>({initial:t,animate:e}),[vT(t),vT(e)])}function vT(s){return Array.isArray(s)?s.join(" "):s}const yc={};function q3(s){for(const t in s)yc[t]=s[t],Z0(t)&&(yc[t].isCSSVariable=!0)}function kL(s,{layout:t,layoutId:e}){return Vo.has(s)||s.startsWith("origin")||(t||e!==void 0)&&(!!yc[s]||s==="opacity")}const Y3={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},W3=$o.length;function Q3(s,t,e){let n="",i=!0;for(let a=0;a<W3;a++){const o=$o[a],c=s[o];if(c===void 0)continue;let d=!0;if(typeof c=="number"?d=c===(o.startsWith("scale")?1:0):d=parseFloat(c)===0,!d||e){const f=AL(c,cy[o]);if(!d){i=!1;const h=Y3[o]||o;n+=`${h}(${f}) `}e&&(t[o]=f)}}return n=n.trim(),e?n=e(t,i?"":n):i&&(n="none"),n}function my(s,t,e){const{style:n,vars:i,transformOrigin:a}=s;let o=!1,c=!1;for(const d in t){const f=t[d];if(Vo.has(d)){o=!0;continue}else if(Z0(d)){i[d]=f;continue}else{const h=AL(f,cy[d]);d.startsWith("origin")?(c=!0,a[d]=h):n[d]=h}}if(t.transform||(o||e?n.transform=Q3(t,s.transform,e):n.transform&&(n.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:h=0}=a;n.transformOrigin=`${d} ${f} ${h}`}}const py=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function PL(s,t,e){for(const n in t)!ls(t[n])&&!kL(n,e)&&(s[n]=t[n])}function X3({transformTemplate:s},t){return $.useMemo(()=>{const e=py();return my(e,t,s),Object.assign({},e.vars,e.style)},[t])}function Z3(s,t){const e=s.style||{},n={};return PL(n,e,s),Object.assign(n,X3(s,t)),n}function J3(s,t){const e={},n=Z3(s,t);return s.drag&&s.dragListener!==!1&&(e.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=s.drag===!0?"none":`pan-${s.drag==="x"?"y":"x"}`),s.tabIndex===void 0&&(s.onTap||s.onTapStart||s.whileTap)&&(e.tabIndex=0),e.style=n,e}const t5={offset:"stroke-dashoffset",array:"stroke-dasharray"},e5={offset:"strokeDashoffset",array:"strokeDasharray"};function s5(s,t,e=1,n=0,i=!0){s.pathLength=1;const a=i?t5:e5;s[a.offset]=Lt.transform(-n);const o=Lt.transform(t),c=Lt.transform(e);s[a.array]=`${o} ${c}`}function ML(s,{attrX:t,attrY:e,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...c}
vendor: 4,670 bytes, line 182
182,d,f,h){if(my(s,c,f),d){s.style.viewBox&&(s.attrs.viewBox=s.style.viewBox);return}s.attrs=s.style,s.style={};const{attrs:p,style:g}=s;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=h?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),e!==void 0&&(p.y=e),n!==void 0&&(p.scale=n),i!==void 0&&s5(p,i,a,o,!1)}const NL=()=>({...py(),attrs:{}}),BL=s=>typeof s=="string"&&s.toLowerCase()==="svg";function n5(s,t,e,n){const i=$.useMemo(()=>{const a=NL();return ML(a,t,BL(n),s.transformTemplate,s.style),{...a.attrs,style:{...a.style}}},[t]);if(s.style){const a={};PL(a,s.style,s),i.style={...a,...i.style}}return i}const i5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function gy(s){return typeof s!="string"||s.includes("-")?!1:!!(i5.indexOf(s)>-1||/[A-Z]/u.test(s))}function r5(s,t,e,{latestValues:n},i,a=!1){const c=(gy(s)?n5:J3)(t,n,i,s),d=H3(t,typeof s=="string",a),f=s!==$.Fragment?{...d,...c,ref:e}:{},{children:h}=t,p=$.useMemo(()=>ls(h)?h.get():h,[h]);return $.createElement(s,{...f,children:p})}function xT(s){const t=[{},{}];return s?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function yy(s,t,e,n){if(typeof t=="function"){const[i,a]=xT(n);t=t(e!==void 0?e:s.custom,i,a)}if(typeof t=="string"&&(t=s.variants&&s.variants[t]),typeof t=="function"){const[i,a]=xT(n);t=t(e!==void 0?e:s.custom,i,a)}return t}function Cd(s){return ls(s)?s.get():s}function a5({scrapeMotionValuesFromProps:s,createRenderState:t},e,n,i){return{latestValues:o5(e,n,i,s),renderState:t()}}function o5(s,t,e,n){const i={},a=n(s,{});for(const g in a)i[g]=Cd(a[g]);let{initial:o,animate:c}=s;const d=Of(s),f=OL(s);t&&f&&!d&&s.inherit!==!1&&(o===void 0&&(o=t.initial),c===void 0&&(c=t.animate));let h=e?e.initial===!1:!1;h=h||o===!1;const p=h?c:o;if(p&&typeof p!="boolean"&&!If(p)){const g=Array.isArray(p)?p:[p];for(let v=0;v<g.length;v++){const x=yy(s,g[v]);if(x){const{transitionEnd:S,transition:E,...T}=x;for(const L in T){let _=T[L];if(Array.isArray(_)){const P=h?_.length-1:0;_=_[P]}_!==null&&(i[L]=_)}for(const L in S)i[L]=S[L]}}}return i}const FL=s=>(t,e)=>{const n=$.useContext(Df),i=$.useContext(H0),a=()=>a5(s,t,n,i);return e?a():$F(a)};function vy(s,t,e){const{style:n}=s,i={};for(const a in n)(ls(n[a])||t.style&&ls(t.style[a])||kL(a,s)||e?.getValue(a)?.liveStyle!==void 0)&&(i[a]=n[a]);return i}const l5=FL({scrapeMotionValuesFromProps:vy,createRenderState:py});function UL(s,t,e){const n=vy(s,t,e);for(const i in s)if(ls(s[i])||ls(t[i])){const a=$o.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=s[i]}return n}const c5=FL({scrapeMotionValuesFromProps:UL,createRenderState:NL}),u5=Symbol.for("motionComponentSymbol");function yo(s){return s&&typeof s=="object"&&Object.prototype.hasOwnProperty.call(s,"current")}function d5(s,t,e){return $.useCallback(n=>{n&&s.onMount&&s.onMount(n),t&&(n?t.mount(n):t.unmount()),e&&(typeof e=="function"?e(n):yo(e)&&(e.current=n))},[t])}const xy=s=>s.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),f5="framerAppearId",jL="data-"+xy(f5),$L=$.createContext({});function h5(s,t,e,n,i){const{visualElement:a}=$.useContext(Df),o=$.useContext(DL),c=$.useContext(H0),d=$.useContext(CL).reducedMotion,f=$.useRef(null);n=n||o.renderer,!f.current&&n&&(f.current=n(s,{visualState:t,parent:a,props:e,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=$.useContext($L);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&m5(f.current,e,i,p);const g=$.useRef(!1);$.useInsertionEffect(()=>{h&&g.current&&h.update(e,c)});const v=e[jL],x=$.useRef(!!v&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return VF(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),x.current&&h.animationState&&h.animationState.animateChanges())}),$.useEffect(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),x.current=!1),h.enteringChildren=void 0)}),h}function m5(s,t,e,n){const{layoutId:i,layout:a,drag:o,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutCrossfade:h}=t;s.projection=new e(s.latestValues,t["data-framer-portal-id"]?void 0:VL(s.parent)),s.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||c&&yo(c),visualElement:s,animationType:typeof a=="str
182ing"?a:"both",initialPromotionConfig:n,crossfade:h,layoutScroll:d,layoutRoot:f})}function VL(s){if(s)return s.options.allowProjection!==!1?s.projection:VL(s.parent)}function vp(s,{forwardMotionProps:t=!1}={},e,n){e&&$3(e);const i=gy(s)?c5:l5;function a(c,d){let f;const h={...$.useContext(CL),...c,layoutId:p5(c)},{isStatic:p}=h,g=K3(c),v=i(c,p);if(!p&&G0){g5();const x=y5(h);f=x.MeasureLayout,g.visualElement=h5(s,v,h,n,x.ProjectionNode)}return A.jsxs(Df.Provider,{value:g,children:[f&&g.visualElement?A.jsx(f,{visualElement:g.visualElement,...h}):null,r5(s,c,d5(v,g.visualElement,d),v,p,t)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${s.displayName??s.name??""})`}`;const o=$.forwardRef(a);return o[u5]=s,o}function p5({layoutId:s}){const t=$.useContext(Uw).id;return t&&s!==void 0?t+"-"+s:s}function g5(s,t){$.useContext(DL).strict}function y5(s){const{drag:t,layout:e}=ko;if(!t&&!e)return{};const n={...t,...e};return{MeasureLayout:t?.isEnabled(s)||e?.isEnabled(s)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function v5(s,t){if(typeof Proxy>"u")return vp;const e=new Map,n=(a,o)=>vp(a,o,s,t),i=(a,o)=>n(a,o);return new Proxy(i,{get:(a,o)=>o==="create"?n:(e.has(o)||e.set(o,vp(o,void 0,s,t)),e.get(o))})}function GL({top:s,left:t,right:e,bottom:n}){return{x:{min:t,max:e},y:{min:s,max:n}}}function x5({x:s,y:t}){return{top:t.min,right:s.max,bottom:t.max,left:s.min}}function b5(s,t){if(!t)return s;const e=t({x:s.left,y:s.top}),n=t({x:s.right,y:s.bottom});return{top:e.y,left:e.x,bottom:n.y,right:n.x}}function xp(s){return s===void 0||s===1}function Hg({scale:s,scaleX:t,scaleY:e}){return!xp(s)||!xp(t)||!xp(e)}function Zr(s){return Hg(s)||HL(s)||s.z||s.rotate||s.rotateX||s.rotateY||s.skewX||s.skewY}function HL(s){return bT(s.x)||bT(s.y)}function bT(s){return s&&s!=="0%"}function Zd(s,t,e){const n=s-e,i=t*n;return e+i}function ST(s,t,e,n,i){return i!==void 0&&(s=Zd(s,i,n)),Zd(s,e,n)+t}function zg(s,t=0,e=1,n,i){s.min=ST(s.min,t,e,n,i),s.max=ST(s.max,t,e,n,i)}function zL(s,{x:t,y:e}){zg(s.x,t.translate,t.scale,t.originPoint),zg(s.y,e.translate,e.scale,e.originPoint)}const ET=.999999999999,TT=1.0000000000001;function S5(s,t,e,n=!1){const i=e.length;if(!i)return;t.x=t.y=1;let a,o;for(let c=0;c<i;c++){a=e[c],o=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&xo(s,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,zL(s,o)),n&&Zr(a.latestValues)&&xo(s,a.latestValues))}t.x<TT&&t.x>ET&&(t.x=1),t.y<TT&&t.y>ET&&(t.y=1)}function vo(s,t){s.min=s.min+t,s.max=s.max+t}function AT(s,t,e,n,i=.5){const a=ve(s.min,s.max,i);zg(s,t,e,a,n)}function xo(s,t){AT(s.x,t.x,t.scaleX,t.scale,t.originX),AT(s.y,t.y,t.scaleY,t.scale,t.originY)}function KL(s,t){return GL(b5(s.getBoundingClientRect(),t))}function E5(s,t,e){const n=KL(s,e),{scroll:i}=t;return i&&(vo(n.x,i.offset.x),vo(n.y,i.offset.y)),n}const RT=()=>({translate:0,scale:1,origin:0,originPoint:0}),bo=()=>({x:RT(),y:RT()}),wT=()=>({min:0,max:0}),Le=()=>({x:wT(),y:wT()}),Jd={current:null},by={current:!1};function qL(){if(by.current=!0,!!G0)if(window.matchMedia){const s=window.matchMedia("(prefers-reduced-motion)"),t=()=>Jd.current=s.matches;s.addEventListener("change",t),t()}else Jd.current=!1}const T5=new WeakMap;function A5(s,t,e){for(const n in t){const i=t[n],a=e[n];if(ls(i))s.addValue(n,i);else if(ls(a))s.addValue(n,Oo(i,{owner:s}));else if(a!==i)if(s.hasValue(n)){const o=s.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=s.getStaticValue(n);s.addValue(n,Oo(o!==void 0?o:i,{owner:s}))}}for(const n in e)t[n]===void 0&&s.removeValue(n);return t}const LT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class R5{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=oy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=Ls.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,de.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=o;this.latestValues=d,this.baseTarget={...d},this.initialValues=e.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=Of(e),this.isVariantNode=OL(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...p}=this.scrapeMotionValuesFromProps(e,{},this);for(const g in p){const v=p[g];d[g]!==void 0&&ls(v)&&v.set(d[g])}}mount(t){this.current=t,T5.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
vendor: 30,175 bytes, line 182
182h((e,n)=>this.bindToMotionValue(n,e)),by.current||qL(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Jd.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Sr(this.notifyUpdate),Sr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Vo.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&de.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),e.owner&&e.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ko){const e=ko[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Le()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let n=0;n<LT.length;n++){const i=LT[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=A5(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&e!==void 0&&(n=Oo(e===null?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(jw(n)||Vw(n))?n=parseFloat(n):!U3(n)&&Er.test(e)&&(n=TL(t,e)),this.setBaseTarget(t,ls(n)?n.get():n)),ls(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if(typeof e=="string"||typeof e=="object"){const a=yy(this.props,e,this.presenceContext?.custom);a&&(n=a[t])}if(e&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ls(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new W0),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){uy.render(this.render)}}class YL extends R5{constructor(){super(...arguments),this.KeyframeResolver=w3}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ls(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function WL(s,{style:t,vars:e},n,i){const a=s.style;let o;for(o in t)a[o]=t[o];i?.applyProjectionStyles(a,n);for(o in e)a.setProperty(o,e[o])}function w5(s){return window.getComputedStyle(s)}class L5 extends YL{constructor(){super(...arguments),this.type="html",this.renderInstance=WL}readValueFromInstance(t,e){if(Vo.has(e))return this.projection?.isProjecting?Bg(e):zU(t,e);{const n=w5(t),i=(Z0(e)?n.getPropertyValue(e):n[e])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:e}){return KL(t,e)}build(t,e,n){my(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return vy(t,e,n)}}const QL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function _5(s,t,e,n){WL(s,t,void 0,n);for(const i in t.attrs)s.setAttribute(QL.has(i)?i:xy(i),t.attrs[i])}class C5 extends YL{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Le}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Vo.has(e)){const n=EL(e);return n&&n.default||0}return e=QL.has(e)?e:xy(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return UL(t,e,n)}build(t,e,n){ML(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){_5(t,e,n,i)}mount(t){this.isSVGTag=BL(t.tagName),super.mount(t)}}const D5=(s,t)=>gy(s)?new C5(t):new L5(t,{allowProjection:s!==$.Fragment});function To(s,t,e){const n=s.getProps();return yy(n,t,e!==void 0?e:n.custom,s)}const Kg=s=>Array.isArray(s);function I5(s,t,e){s.hasValue(t)?s.getValue(t).set(e):s.addValue(t,Oo(e))}function O5(s){return Kg(s)?s[s.length-1]||0:s}function k5(s,t){const e=To(s,t);let{transitionEnd:n={},transition:i={},...a}=e||{};a={...a,...n};for(const o in a){const c=O5(a[o]);I5(s,o,c)}}function P5(s){return!!(ls(s)&&s.add)}function qg(s,t){const e=s.getValue("willChange");if(P5(e))return e.add(t);if(!e&&Ii.WillChange){const n=new Ii.WillChange("auto");s.addValue("willChange",n),n.add(t)}}function XL(s){return s.props[jL]}const M5=s=>s!==null;function N5(s,{repeat:t,repeatType:e="loop"},n){const i=s.filter(M5),a=t&&e!=="loop"&&t%2===1?0:i.length-1;return i[a]}const B5={type:"spring",stiffness:500,damping:25,restSpeed:10},F5=s=>({type:"spring",stiffness:550,damping:s===0?2*Math.sqrt(550):30,restSpeed:10}),U5={type:"keyframes",duration:.8},j5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$5=(s,{keyframes:t})=>t.length>2?U5:Vo.has(s)?s.startsWith("scale")?F5(t[1]):B5:j5;function V5({when:s,delay:t,delayChildren:e,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:c,from:d,elapsed:f,...h}){return!!Object.keys(h).length}const Sy=(s,t,e,n={},i,a)=>o=>{const c=ly(n,s)||{},d=c.delay||n.delay||0;let{elapsed:f=0}=n;f=f-qn(d);const h={keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:g=>{t.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{o(),c.onComplete&&c.onComplete()},name:s,motionValue:t,element:a?void 0:i};V5(c)||Object.assign(h,$5(s,h)),h.duration&&(h.duration=qn(h.duration)),h.repeatDelay&&(h.repeatDelay=qn(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(Vg(h),h.delay===0&&(p=!0)),(Ii.instantAnimations||Ii.skipAnimations)&&(p=!0,Vg(h),h.delay=0),h.allowFlatten=!c.type&&!c.ease,p&&!a&&t.get()!==void 0){const g=N5(h.keyframes,c);if(g!==void 0){de.update(()=>{h.onUpdate(g),h.onComplete()});return}}return c.isSync?new ay(h):new m3(h)};function G5({protectedKeys:s,needsAnimating:t},e){const n=s.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,n}function ZL(s,t,{delay:e=0,transitionOverride:n,type:i}={}){let{transition:a=s.getDefaultTransition(),transitionEnd:o,...c}=t;n&&(a=n);const d=[],f=i&&s.animationState&&s.animationState.getState()[i];for(const h in c){const p=s.getValue(h,s.latestValues[h]??null),g=c[h];if(g===void 0||f&&G5(f,h))continue;const v={delay:e,...ly(a||{},h)},x=p.get();if(x!==void 0&&!p.isAnimating&&!Array.isArray(g)&&g===x&&!v.velocity)continue;let S=!1;if(window.MotionHandoffAnimation){const T=XL(s);if(T){const L=window.MotionHandoffAnimation(T,h,de);L!==null&&(v.startTime=L,S=!0)}}qg(s,h),p.start(Sy(h,p,g,s.shouldReduceMotion&&xL.has(h)?{type:!1}:v,s,S));const E=p.animation;E&&d.push(E)}return o&&Promise.all(d).then(()=>{de.update(()=>{o&&k5(s,o)})}),d}function JL(s,t,e,n=0,i=1){const a=Array.from(s).sort((f,h)=>f.sortNodePosition(h)).indexOf(t),o=s.size,c=(o-1)*n;return typeof e=="function"?e(a,o):i===1?a*n:c-a*n}function Yg(s,t,e={}){const n=To(s,t,e.type==="exit"?s.presenceContext?.custom:void 0);let{transition:i=s.getDefaultTransition()||{}}=n||{};e.transitionOverride&&(i=e.transitionOverride);const a=n?()=>Promise.all(ZL(s,n,e)):()=>Promise.resolve(),o=s.variantChildren&&s.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:p}=i;return H5(s,t,d,f,h,p,e)}:()=>Promise.resolve(),{when:c}=i;if(c){const[d,f]=c==="beforeChildren"?[a,o]:[o,a];return d().then(()=>f())}else return Promise.all([a(),o(e.delay)])}function H5(s,t,e=0,n=0,i=0,a=1,o){const c=[];for(const d of s.variantChildren)d.notify("AnimationStart",t),c.push(Yg(d,t,{...o,delay:e+(typeof n=="function"?0:n)+JL(s.variantChildren,d,n,i,a)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function z5(s,t,e={}){s.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(a=>Yg(s,a,e));n=Promise.all(i)}else if(typeof t=="string")n=Yg(s,t,e);else{const i=typeof t=="function"?To(s,t,e.custom):t;n=Promise.all(ZL(s,i,e))}return n.then(()=>{s.notify("AnimationComplete",t)})}function t_(s,t){if(!Array.isArray(t))return!1;const e=t.length;if(e!==s.length)return!1;for(let n=0;n<e;n++)if(t[n]!==s[n])return!1;return!0}const K5=hy.length;function e_(s){if(!s)return;if(!s.isControllingVariants){const e=s.parent?e_(s.parent)||{}:{};return s.props.initial!==void 0&&(e.initial=s.props.initial),e}const t={};for(let e=0;e<K5;e++){const n=hy[e],i=s.props[n];(gc(i)||i===!1)&&(t[n]=i)}return t}const q5=[...fy].reverse(),Y5=fy.length;function W5(s){return t=>Promise.all(t.map(({animation:e,options:n})=>z5(s,e,n)))}function Q5(s){let t=W5(s),e=_T(),n=!0;const i=d=>(f,h)=>{const p=To(s,h,d==="exit"?s.presenceContext?.custom:void 0);if(p){const{transition:g,transitionEnd:v,...x}=p;f={...f,...x,...v}}return f};function a(d){t=d(s)}function o(d){const{props:f}=s,h=e_(s.parent)||{},p=[],g=new Set;let v={},x=1/0;for(let E=0;E<Y5;E++){const T=q5[E],L=e[T],_=f[T]!==void 0?f[T]:h[T],P=gc(_),D=T===d?L.isActive:null;D===!1&&(x=E);let B=_===h[T]&&_!==f[T]&&P;if(B&&n&&s.manuallyAnimateOnMount&&(B=!1),L.protectedKeys={...v},!L.isActive&&D===null||!_&&!L.prevProp||If(_)||typeof _=="boolean")continue;const C=X5(L.prevProp,_);let I=C||T===d&&L.isActive&&!B&&P||E>x&&P,F=!1;const U=Array.isArray(_)?_:[_];let z=U.reduce(i(T),{});D===!1&&(z={});const{prevResolvedValues:Y={}}=L,nt={...Y,...z},it=j=>{I=!0,g.has(j)&&(F=!0,g.delete(j)),L.needsAnimating[j]=!0;const N=s.getValue(j);N&&(N.liveStyle=!1)};for(const j in nt){const N=z[j],V=Y[j];if(v.hasOwnProperty(j))continue;let X=!1;Kg(N)&&Kg(V)?X=!t_(N,V):X=N!==V,X?N!=null?it(j):g.add(j):N!==void 0&&g.has(j)?it(j):L.protectedKeys[j]=!0}L.prevProp=_,L.prevResolvedValues=z,L.isActive&&(v={...v,...z}),n&&s.blockInitialAnimation&&(I=!1);const rt=B&&C;I&&(!rt||F)&&p.push(...U.map(j=>{const N={type:T};if(typeof j=="string"&&n&&!rt&&s.manuallyAnimateOnMount&&s.parent){const{parent:V}=s,X=To(V,j);if(V.enteringChildren&&X){const{delayChildren:O}=X.transition||{};N.delay=JL(V.enteringChildren,s,O)}}return{animation:j,options:N}}))}if(g.size){const E={};if(typeof f.initial!="boolean"){const T=To(s,Array.isArray(f.initial)?f.initial[0]:f.initial);T&&T.transition&&(E.transition=T.transition)}g.forEach(T=>{const L=s.getBaseTarget(T),_=s.getValue(T);_&&(_.liveStyle=!0),E[T]=L??null}),p.push({animation:E})}let S=!!p.length;return n&&(f.initial===!1||f.initial===f.animate)&&!s.manuallyAnimateOnMount&&(S=!1),n=!1,S?t(p):Promise.resolve()}function c(d,f){if(e[d].isActive===f)return Promise.resolve();s.variantChildren?.forEach(p=>p.animationState?.setActive(d,f)),e[d].isActive=f;const h=o(d);for(const p in e)e[p].protectedKeys={};return h}return{animateChanges:o,setActive:c,setAnimateFunction:a,getState:()=>e,reset:()=>{e=_T(),n=!0}}}function X5(s,t){return typeof t=="string"?t!==s:Array.isArray(t)?!t_(t,s):!1}function Wr(s=!1){return{isActive:s,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _T(){return{animate:Wr(!0),whileInView:Wr(),whileHover:Wr(),whileTap:Wr(),whileDrag:Wr(),whileFocus:Wr(),exit:Wr()}}class wr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Z5 extends wr{constructor(t){super(t),t.animationState||(t.animationState=Q5(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();If(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let J5=0;class t4 extends wr{constructor(){super(...arguments),this.id=J5++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const e4={animation:{Feature:Z5},exit:{Feature:t4}};function vc(s,t,e,n={passive:!0}){return s.addEventListener(t,e,n),()=>s.removeEventListener(t,e)}function Mc(s){return{point:{x:s.pageX,y:s.pageY}}}const s4=s=>t=>dy(t)&&s(t,Mc(t));function Ql(s,t,e,n){return vc(s,t,s4(e),n)}const s_=1e-4,n4=1-s_,i4=1+s_,n_=.01,r4=0-n_,a4=0+n_;function hs(s){return s.max-s.min}function o4(s,t,e){return Math.abs(s-t)<=e}function CT(s,t,e,n=.5){s.origin=n,s.originPoint=ve(t.min,t.max,s.origin),s.scale=hs(e)/hs(t),s.translate=ve(e.min,e.max,s.origin)-s.originPoint,(s.scale>=n4&&s.scale<=i4||isNaN(s.scale))&&(s.scale=1),(s.translate>=r4&&s.translate<=a4||isNaN(s.translate))&&(s.translate=0)}function Xl(s,t,e,n){CT(s.x,t.x,e.x,n?n.originX:void 0),CT(s.y,t.y,e.y,n?n.originY:void 0)}function DT(s,t,e){s.min=e.min+t.min,s.max=s.min+hs(t)}function l4(s,t,e){DT(s.x,t.x,e.x),DT(s.y,t.y,e.y)}function IT(s,t,e){s.min=t.min-e.min,s.max=s.min+hs(t)}function Zl(s,t,e){IT(s.x,t.x,e.x),IT(s.y,t.y,e.y)}function cn(s){return[s("x"),s("y")]}const i_=({current:s})=>s?s.ownerDocument.defaultView:null,OT=(s,t)=>Math.abs(s-t);function c4(s,t){const e=OT(s.x,t.x),n=OT(s.y,t.y);return Math.sqrt(e**2+n**2)}class r_{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=Sp(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,x=c4(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!x)return;const{point:S}=g,{timestamp:E}=ts;this.history.push({...S,timestamp:E});const{onStart:T,onMove:L}=this.handlers;v||(T&&T(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,g)},this.handlePointerMove=(g,v)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=bp(v,this.transformPagePoint),de.update(this.updatePoint,!0)},this.handlePointerUp=(g,v)=>{this.end();const{onEnd:x,onSessionEnd:S,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=Sp(g.type==="pointercancel"?this.lastMoveEventInfo:bp(v,this.transformPagePoint),this.history);this.startEvent&&x&&x(g,T),S&&S(g,T)},!dy(t))return;this.dragSnapToOrigin=a,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const c=Mc(t),d=bp(c,this.transformPagePoint),{point:f}=d,{timestamp:h}=ts;this.history=[{...f,timestamp:h}];const{onSessionStart:p}=e;p&&p(t,Sp(d,this.history)),this.removeListeners=Oc(Ql(this.contextWindow,"pointermove",this.handlePointerMove),Ql(this.contextWindow,"pointerup",this.handlePointerUp),Ql(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Sr(this.updatePoint)}}function bp(s,t){return t?{point:t(s.point)}:s}function kT(s,t){return{x:s.x-t.x,y:s.y-t.y}}function Sp({point:s},t){return{point:s,delta:kT(s,a_(t)),offset:kT(s,u4(t)),velocity:d4(t,.1)}}function u4(s){return s[0]}function a_(s){return s[s.length-1]}function d4(s,t){if(s.length<2)return{x:0,y:0};let e=s.length-1,n=null;const i=a_(s);for(;e>=0&&(n=s[e],!(i.timestamp-n.timestamp>qn(t)));)e--;if(!n)return{x:0,y:0};const a=dn(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function f4(s,{min:t,max:e},n){return t!==void 0&&s<t?s=n?ve(t,s,n.min):Math.max(s,t):e!==void 0&&s>e&&(s=n?ve(e,s,n.max):Math.min(s,e)),s}function PT(s,t,e){return{min:t!==void 0?s.min+t:void 0,max:e!==void 0?s.max+e-(s.max-s.min):void 0}}function h4(s,{top:t,left:e,bottom:n,right:i}){return{x:PT(s.x,e,i),y:PT(s.y,t,n)}}function MT(s,t){let e=t.min-s.min,n=t.max-s.max;return t.max-t.min<s.max-s.min&&([e,n]=[n,e]),{min:e,max:n}}function m4(s,t){return{x:MT(s.x,t.x),y:MT(s.y,t.y)}}function p4(s,t){let e=.5;const n=hs(s),i=hs(t);return i>n?e=hc(t.min,t.max-n,s.min):n>i&&(e=hc(s.min,s.max-i,t.min)),Di(0,1,e)}function g4(s,t){const e={};return t.min!==void 0&&(e.min=t.min-s.min),t.max!==void 0&&(e.max=t.max-s.min),e}const Wg=.35;function y4(s=Wg){return s===!1?s=0:s===!0&&(s=Wg),{x:NT(s,"left","right"),y:NT(s,"top","bottom")}}function NT(s,t,e){return{min:BT(s,t),max:BT(s,e)}}function BT(s,t){return typeof s=="number"?s:s[t]||0}const v4=new WeakMap;class x4{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Le(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=p=>{const{dragSnapToOrigin:g}=this.getProps();g?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(Mc(p).point)},o=(p,g)=>{const{drag:v,dragPropagation:x,onDragStart:S}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=I3(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cn(T=>{let L=this.getAxisMotionValue(T).get()||0;if(Yn.test(L)){const{projection:_}=this.visualElement;if(_&&_.layout){const P=_.layout.layoutBox[T];P&&(L=hs(P)*(parseFloat(L)/100))}}this.originPoint[T]=L}),S&&de.postRender(()=>S(p,g)),qg(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:S,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:T}=g;if(x&&this.currentDirection===null){this.currentDirection=b4(T),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",g.point,T),this.updateAxis("y",g.point,T),this.visualElement.render(),E&&E(p,g)},d=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>cn(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:h}=this.getProps();this.panSession=new r_(t,{onSessionStart:a,onStart:o,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:n,contextWindow:i_(this.visualElement)})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:c}=this.getProps();c&&de.postRender(()=>c(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!rd(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=f4(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&yo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=h4(n.layoutBox,t):this.constraints=!1,this.elastic=y4(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&cn(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=g4(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!yo(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=E5(n,i.root,this.visualElement.getTransformPagePoint());let o=m4(i.layout.layoutBox,a);if(e){const c=e(x5(o));this.hasMutatedConstraints=!!c,c&&(o=GL(c))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=cn(h=>{if(!rd(h,e,this.currentDirection))return;let p=d&&d[h]||{};o&&(p={min:0,max:0});const g=i?200:1e6,v=i?40:1e7,x={type:"inertia",velocity:n?t[h]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...a,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(f).then(c)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return qg(this.visualElement,t),n.start(Sy(t,n,0,e,this.visualElement,!1))}stopAnimation(){cn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){cn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){cn(e=>{const{drag:n}=this.getProps();if(!rd(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(e);if(i&&i.layout){const{min:o,max:c}=i.layout.layoutBox[e];a.set(t[e]-ve(o,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!yo(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};cn(o=>{const c=this.getAxisMotionValue(o);if(c&&this.constraints!==!1){const d=c.get();i[o]=p4({min:d,max:d},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),cn(o=>{if(!rd(o,t,null))return;const c=this.getAxisMotionValue(o),{min:d,max:f}=this.constraints[o];c.set(ve(d,f,i[o]))})}addListeners(){if(!this.visualElement.current)return;v4.set(this.visualElement,this);const t=this.visualElement.current,e=Ql(t,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps();f&&h&&this.start(d)}),n=()=>{const{dragConstraints:d}=this.getProps();yo(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),de.read(n);const o=vc(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(cn(h=>{const p=this.getAxisMotionValue(h);p&&(this.originPoint[h]+=d[h].translate,p.set(p.get()+d[h].translate))}),this.visualElement.render())}));return()=>{o(),e(),a(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=Wg,dragMomentum:c=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:c}}}function rd(s,t,e){return(t===!0||t===s)&&(e===null||e===s)}function b4(s,t=10){let e=null;return Math.abs(s.y)>t?e="y":Math.abs(s.x)>t&&(e="x"),e}class S4 extends wr{constructor(t){super(t),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new x4(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const FT=s=>(t,e)=>{s&&de.postRender(()=>s(t,e))};class E4 extends wr{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(t){this.session=new r_(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:i_(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:FT(t),onStart:FT(e),onMove:n,onEnd:(a,o)=>{delete this.session,i&&de.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=Ql(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Dd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function UT(s,t){return t.max===t.min?0:s/(t.max-t.min)*100}const Fl={correct:(s,t)=>{if(!t.target)return s;if(typeof s=="string")if(Lt.test(s))s=parseFloat(s);else return s;const e=UT(s,t.target.x),n=UT(s,t.target.y);return`${e}% ${n}%`}},T4={correct:(s,{treeScale:t,projectionDelta:e})=>{const n=s,i=Er.parse(s);if(i.length>5)return n;const a=Er.createTransformer(s),o=typeof i[0]!="number"?1:0,c=e.x.scale*t.x,d=e.y.scale*t.y;i[0+o]/=c,i[1+o]/=d;const f=ve(c,d,.5);return typeof i[2+o]=="number"&&(i[2+o]/=f),typeof i[3+o]=="number"&&(i[3+o]/=f),a(i)}};let Ep=!1;class A4 extends $.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=t;q3(R4),a&&(e.group&&e.group.add(a),n&&n.register&&i&&n.register(a),Ep&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Dd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:a}=this.props,{projection:o}=n;return o&&(o.isPresent=a,Ep=!0,i||t.layoutDependency!==e||e===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||de.postRender(()=>{const c=o.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),uy.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Ep=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function o_(s){const[t,e]=j3(),n=$.useContext(Uw);return A.jsx(A4,{...s,layoutGroup:n,switchLayoutGroup:$.useContext($L),isPresent:t,safeToRemove:e})}const R4={borderRadius:{...Fl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fl,borderTopRightRadius:Fl,borderBottomLeftRadius:Fl,borderBottomRightRadius:Fl,boxShadow:T4};function w4(s,t,e){const n=ls(s)?s:Oo(s);return n.start(Sy("",n,t,e)),n.animation}const L4=(s,t)=>s.depth-t.depth;class _4{constructor(){this.children=[],this.isDirty=!1}add(t){z0(this.children,t),this.isDirty=!0}remove(t){K0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(L4),this.isDirty=!1,this.children.forEac
vendor: 5,073 bytes, line 182
182h(t)}}function C4(s,t){const e=Ls.now(),n=({timestamp:i})=>{const a=i-e;a>=t&&(Sr(n),s(a-t))};return de.setup(n,!0),()=>Sr(n)}const l_=["TopLeft","TopRight","BottomLeft","BottomRight"],D4=l_.length,jT=s=>typeof s=="string"?parseFloat(s):s,$T=s=>typeof s=="number"||Lt.test(s);function I4(s,t,e,n,i,a){i?(s.opacity=ve(0,e.opacity??1,O4(n)),s.opacityExit=ve(t.opacity??1,0,k4(n))):a&&(s.opacity=ve(t.opacity??1,e.opacity??1,n));for(let o=0;o<D4;o++){const c=`border${l_[o]}Radius`;let d=VT(t,c),f=VT(e,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||$T(d)===$T(f)?(s[c]=Math.max(ve(jT(d),jT(f),n),0),(Yn.test(f)||Yn.test(d))&&(s[c]+="%")):s[c]=f}(t.rotate||e.rotate)&&(s.rotate=ve(t.rotate||0,e.rotate||0,n))}function VT(s,t){return s[t]!==void 0?s[t]:s.borderRadius}const O4=c_(0,.5,Qw),k4=c_(.5,.95,fn);function c_(s,t,e){return n=>n<s?0:n>t?1:e(hc(s,t,n))}function GT(s,t){s.min=t.min,s.max=t.max}function ln(s,t){GT(s.x,t.x),GT(s.y,t.y)}function HT(s,t){s.translate=t.translate,s.scale=t.scale,s.originPoint=t.originPoint,s.origin=t.origin}function zT(s,t,e,n,i){return s-=t,s=Zd(s,1/e,n),i!==void 0&&(s=Zd(s,1/i,n)),s}function P4(s,t=0,e=1,n=.5,i,a=s,o=s){if(Yn.test(t)&&(t=parseFloat(t),t=ve(o.min,o.max,t/100)-o.min),typeof t!="number")return;let c=ve(a.min,a.max,n);s===a&&(c-=t),s.min=zT(s.min,t,e,c,i),s.max=zT(s.max,t,e,c,i)}function KT(s,t,[e,n,i],a,o){P4(s,t[e],t[n],t[i],t.scale,a,o)}const M4=["x","scaleX","originX"],N4=["y","scaleY","originY"];function qT(s,t,e,n){KT(s.x,t,M4,e?e.x:void 0,n?n.x:void 0),KT(s.y,t,N4,e?e.y:void 0,n?n.y:void 0)}function YT(s){return s.translate===0&&s.scale===1}function u_(s){return YT(s.x)&&YT(s.y)}function WT(s,t){return s.min===t.min&&s.max===t.max}function B4(s,t){return WT(s.x,t.x)&&WT(s.y,t.y)}function QT(s,t){return Math.round(s.min)===Math.round(t.min)&&Math.round(s.max)===Math.round(t.max)}function d_(s,t){return QT(s.x,t.x)&&QT(s.y,t.y)}function XT(s){return hs(s.x)/hs(s.y)}function ZT(s,t){return s.translate===t.translate&&s.scale===t.scale&&s.originPoint===t.originPoint}class F4{constructor(){this.members=[]}add(t){z0(this.members,t),t.scheduleRender()}remove(t){if(K0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(t){const e=this.members.findIndex(i=>t===i);if(e===0)return!1;let n;for(let i=e;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function U4(s,t,e){let n="";const i=s.x.translate/t.x,a=s.y.translate/t.y,o=e?.z||0;if((i||a||o)&&(n=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),e){const{transformPerspective:f,rotate:h,rotateX:p,rotateY:g,skewX:v,skewY:x}=e;f&&(n=`perspective(${f}px) ${n}`),h&&(n+=`rotate(${h}deg) `),p&&(n+=`rotateX(${p}deg) `),g&&(n+=`rotateY(${g}deg) `),v&&(n+=`skewX(${v}deg) `),x&&(n+=`skewY(${x}deg) `)}const c=s.x.scale*t.x,d=s.y.scale*t.y;return(c!==1||d!==1)&&(n+=`scale(${c}, ${d})`),n||"none"}const Tp=["","X","Y","Z"],j4=1e3;let $4=0;function Ap(s,t,e,n){const{latestValues:i}=t;i[s]&&(e[s]=i[s],t.setStaticValue(s,0),n&&(n[s]=0))}function f_(s){if(s.hasCheckedOptimisedAppear=!0,s.root===s)return;const{visualElement:t}=s.options;if(!t)return;const e=XL(t);if(window.MotionHasOptimisedAnimation(e,"transform")){const{layout:i,layoutId:a}=s.options;window.MotionCancelOptimisedAnimation(e,"transform",de,!(i||a))}const{parent:n}=s;n&&!n.hasCheckedOptimisedAppear&&f_(n)}function h_({attachResizeListener:s,defaultParent:t,measureScroll:e,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},c=t?.()){this.id=$4++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>
vendor: 4,304 bytes, line 182
182{this.projectionUpdateScheduled=!1,this.nodes.forEach(H4),this.nodes.forEach(Y4),this.nodes.forEach(W4),this.nodes.forEach(z4)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new _4)}addEventListener(o,c){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new W0),this.eventHandlers.get(o).add(c)}notifyListeners(o,...c){const d=this.eventHandlers.get(o);d&&d.notify(...c)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=_L(o)&&!B3(o),this.instance=o;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),s){let h,p=0;const g=()=>this.root.updateBlockedByResize=!1;de.read(()=>{p=window.innerWidth}),s(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,h&&h(),h=C4(g,250),Dd.hasAnimatedSinceResize&&(Dd.hasAnimatedSinceResize=!1,this.nodes.forEach(eA)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||tj,{onLayoutAnimationStart:S,onLayoutAnimationComplete:E}=f.getProps(),T=!this.targetLayout||!d_(this.targetLayout,v),L=!p&&g;if(this.options.layoutRoot||this.resumeFrom||L||p&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...ly(x,"layout"),onPlay:S,onComplete:E};(f.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(h,L)}else p||eA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Sr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Q4),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&f_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(JT);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(tA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(q4),this.nodes.forEach(V4),this.nodes.forEach(G4)):this.nodes.forEach(tA),this.clearAllSnapshots();const c=Ls.now();ts.delta=Di(0,1e3/60,c-ts.timestamp),ts.timestamp=c,ts.isProcessing=!0,fp.update.process(ts),fp.preRender.process(ts),fp.render.process(ts),ts.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uy.read(this.scheduleUpdate))}
vendor: 6,064 bytes, line 182
182clearAllSnapshots(){this.nodes.forEach(K4),this.sharedNodes.forEach(X4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,de.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){de.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hs(this.snapshot.measuredBox.x)&&!hs(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Le(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(c=!1),c&&this.instance){const d=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:d,offset:e(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!u_(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;o&&this.instance&&(c||Zr(this.latestValues)||h)&&(i(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return o&&(d=this.removeTransform(d)),ej(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Le();const c=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(sj))){const{scroll:f}=this.root;f&&(vo(c.x,f.offset.x),vo(c.y,f.offset.y))}return c}removeElementScroll(o){const c=Le();if(ln(c,o),this.scroll?.wasRoot)return c;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:h,options:p}=f;f!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&ln(c,o),vo(c.x,h.offset.x),vo(c.y,h.offset.y))}return c}applyTransform(o,c=!1){const d=Le();ln(d,o);for(let f=0;f<this.path.length;f++){const h=this.path[f];!c&&h.options.layoutScroll&&h.scroll&&h!==h.root&&xo(d,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Zr(h.latestValues)&&xo(d,h.latestValues)}return Zr(this.latestValues)&&xo(d,this.latestValues),d}removeTransform(o){const c=Le();ln(c,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!Zr(f.latestValues))continue;Hg(f.latestValues)&&f.updateSnapshot();const h=Le(),p=f.measurePageBox();ln(h,p),qT(c,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,h)}return Zr(this.latestValues)&&qT(c,this.latestValues),c}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ts.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(o||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!(!this.layout||!(h||p))){if(this.resolvedRelativeTargetAt=ts.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Le(),this.relativeTargetOrigin=Le(),Zl(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Le(),this.targetWithTransforms=Le()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),l4(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ln(this.target,this.layout.layoutBox),zL(this.target,this.targetDelta)):ln(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Le(),this.relativeTargetOrigin=Le(),Zl(this.relativeTargetOrigin,this.target,g.target),ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Hg(this.parent.latestValues)||HL(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const o=this.getLead(),c=!!this.resumingFrom||this!==o;let d=!0;
vendor: 8,821 bytes, line 182
182if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===ts.timestamp&&(d=!1),d)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;ln(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;S5(this.layoutCorrected,this.treeScale,this.path,c),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Le());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(HT(this.prevProjectionDelta.x,this.projectionDelta.x),HT(this.prevProjectionDelta.y,this.projectionDelta.y)),Xl(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!ZT(this.projectionDelta.x,this.prevProjectionDelta.x)||!ZT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bo(),this.projectionDelta=bo(),this.projectionDeltaWithTransform=bo()}setAnimationOrigin(o,c=!1){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},p=bo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const g=Le(),v=d?d.source:void 0,x=this.layout?this.layout.source:void 0,S=v!==x,E=this.getStack(),T=!E||E.members.length<=1,L=!!(S&&!T&&this.options.crossfade===!0&&!this.path.some(J4));this.animationProgress=0;let _;this.mixTargetDelta=P=>{const D=P/1e3;sA(p.x,o.x,D),sA(p.y,o.y,D),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zl(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Z4(this.relativeTarget,this.relativeTargetOrigin,g,D),_&&B4(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=Le()),ln(_,this.relativeTarget)),S&&(this.animationValues=h,I4(h,f,this.latestValues,D,L,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Sr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=de.update(()=>{Dd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Oo(0)),this.currentAnimation=w4(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(j4),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:h}=o;if(!(!c||!d||!f)){if(this!==o&&this.layout&&f&&m_(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||Le();const p=hs(this.layout.layoutBox.x);d.x.min=o.target.x.min,d.x.max=d.x.min+p;const g=hs(this.layout.layoutBox.y);d.y.min=o.target.y.min,d.y.max=d.y.min+g}ln(c,d),xo(c,h),Xl(this.projectionDeltaWithTransform,this.layoutCorrected,c,h)}}registerSharedNode(o,c){this.sharedNodes.has(o)||this.sharedNodes.set(o,new F4),this.sharedNodes.get(o).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),o&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let c=!1;const{latestValues:d}=o;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&Ap("z",o,f,this.animationValues);for(let h=0;h<Tp.length;h++)Ap(`rotate${Tp[h]}`,o,f,this.animationValues),Ap(`skew${Tp[h]}`,o,f,this.animationValues);o.render();for(const h in f)o.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);o.scheduleRender()}applyProjectionStyles(o,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Cd(c?.pointerEvents)||"",o.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Cd(c?.pointerEvents)||""),this.hasProjected&&!Zr(this.latestValues)&&(o.transform=d?d({},""):"none",this.hasProjected=!1);return}o.visibility="";const h=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=U4(this.projectionDeltaWithTransform,this.treeScale,h);d&&(p=d(h,p)),o.transform=p;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,f.animationValues?o.opacity=f===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:o.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in yc){if(h[x]===void 0)continue;const{correct:S,applyTo:E,isCSSVariable:T}=yc[x],L=p==="none"?h[x]:S(h[x],f);if(E){const _=E.length;for(let P=0;P<_;P++)o[E[P]]=L}else T?this.options.visualElement.renderState.vars[x]=L:o[x]=L}this.options.layoutId&&(o.pointerEvents=f===this?Cd(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(JT),this.root.sharedNodes.clear()}}}function V4(s){s.updateLayout()}function G4(s){const t=s.resumeFrom?.snapshot||s.snapshot;if(s.isLead()&&s.layout&&t&&s.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=s.layout,{animationType:i}=s.options,a=t.source!==s.layout.source;i==="size"?cn(h=>{const p=a?t.measuredBox[h]:t.layoutBox[h],g=hs(p);p.min=e[h].min,p.max=p.min+g}):m_(i,t.layoutBox,e)&&cn(h=>{const p=a?t.measuredBox[h]:t.layoutBox[h],g=hs(e[h]);p.max=p.min+g,s.relativeTarget&&!s.currentAnimation&&(s.isProjectionDirty=!0,s.relativeTarget[h].max=s.relativeTarget[h].min+g)});const o=bo();Xl(o,e,t.layoutBox);const c=bo();a?Xl(c,s.applyTransform(n,!0),t.measuredBox):Xl(c,e,t.layoutBox);const d=!u_(o);let f=!1;if(!s.resumeFrom){const h=s.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:g}=h;if(p&&g){const v=Le();Zl(v,t.layoutBox,p.layoutBox);const x=Le();Zl(x,e,g.layoutBox),d_(v,x)||(f=!0),h.options.layoutRoot&&(s.relativeTarget=x,s.relativeTargetOrigin=v,s.relativeParent=h)}}}s.notifyListeners("didUpdate",{layout:e,snapshot:t,delta:c,layoutDelta:o,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(s.isLead()){const{onExitComplete:e}=s.options;e&&e()}s.options.transition=void 0}function H4(s){s.parent&&(s.isProjecting()||(s.isProjectionDirty=s.parent.isProjectionDirty),s.isSharedProjectionDirty||(s.isSharedProjectionDirty=!!(s.isProjectionDirty||s.parent.isProjectionDirty||s.parent.isSharedProjectionDirty)),s.isTransformDirty||(s.isTransformDirty=s.parent.isTransformDirty))}
vendor: 6,719 bytes, line 182
182function z4(s){s.isProjectionDirty=s.isSharedProjectionDirty=s.isTransformDirty=!1}function K4(s){s.clearSnapshot()}function JT(s){s.clearMeasurements()}function tA(s){s.isLayoutDirty=!1}function q4(s){const{visualElement:t}=s.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),s.resetTransform()}function eA(s){s.finishAnimation(),s.targetDelta=s.relativeTarget=s.target=void 0,s.isProjectionDirty=!0}function Y4(s){s.resolveTargetDelta()}function W4(s){s.calcProjection()}function Q4(s){s.resetSkewAndRotation()}function X4(s){s.removeLeadSnapshot()}function sA(s,t,e){s.translate=ve(t.translate,0,e),s.scale=ve(t.scale,1,e),s.origin=t.origin,s.originPoint=t.originPoint}function nA(s,t,e,n){s.min=ve(t.min,e.min,n),s.max=ve(t.max,e.max,n)}function Z4(s,t,e,n){nA(s.x,t.x,e.x,n),nA(s.y,t.y,e.y,n)}function J4(s){return s.animationValues&&s.animationValues.opacityExit!==void 0}const tj={duration:.45,ease:[.4,0,.1,1]},iA=s=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(s),rA=iA("applewebkit/")&&!iA("chrome/")?Math.round:fn;function aA(s){s.min=rA(s.min),s.max=rA(s.max)}function ej(s){aA(s.x),aA(s.y)}function m_(s,t,e){return s==="position"||s==="preserve-aspect"&&!o4(XT(t),XT(e),.2)}function sj(s){return s!==s.root&&s.scroll?.wasRoot}const nj=h_({attachResizeListener:(s,t)=>vc(s,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rp={current:void 0},p_=h_({measureScroll:s=>({x:s.scrollLeft,y:s.scrollTop}),defaultParent:()=>{if(!Rp.current){const s=new nj({});s.mount(window),s.setOptions({layoutScroll:!0}),Rp.current=s}return Rp.current},resetTransform:(s,t)=>{s.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:s=>window.getComputedStyle(s).position==="fixed"}),ij={pan:{Feature:E4},drag:{Feature:S4,ProjectionNode:p_,MeasureLayout:o_}};function oA(s,t,e){const{props:n}=s;s.animationState&&n.whileHover&&s.animationState.setActive("whileHover",e==="Start");const i="onHover"+e,a=n[i];a&&de.postRender(()=>a(t,Mc(t)))}class rj extends wr{mount(){const{current:t}=this.node;t&&(this.unmount=O3(t,(e,n)=>(oA(this.node,n,"Start"),i=>oA(this.node,i,"End"))))}unmount(){}}class aj extends wr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Oc(vc(this.node.current,"focus",()=>this.onFocus()),vc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lA(s,t,e){const{props:n}=s;if(s.current instanceof HTMLButtonElement&&s.current.disabled)return;s.animationState&&n.whileTap&&s.animationState.setActive("whileTap",e==="Start");const i="onTap"+(e==="End"?"":e),a=n[i];a&&de.postRender(()=>a(t,Mc(t)))}class oj extends wr{mount(){const{current:t}=this.node;t&&(this.unmount=N3(t,(e,n)=>(lA(this.node,n,"Start"),(i,{success:a})=>lA(this.node,i,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Qg=new WeakMap,wp=new WeakMap,lj=s=>{const t=Qg.get(s.target);t&&t(s)},cj=s=>{s.forEach(lj)};function uj({root:s,...t}){const e=s||document;wp.has(e)||wp.set(e,{});const n=wp.get(e),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(cj,{root:s,...t})),n[i]}function dj(s,t,e){const n=uj(t);return Qg.set(s,e),n.observe(s),()=>{Qg.delete(s),n.unobserve(s)}}const fj={some:0,all:1};class hj extends wr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:a}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:fj[i]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,a&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),g=f?h:p;g&&g(d)};return dj(this.node.current,o,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(mj(t,e))&&this.startObserver()}unmount(){}}function mj({viewport:s={}},{viewport:t={}}={}){return e=>s[e]!==t[e]}const pj={inView:{Feature:hj},tap:{Feature:oj},focus:{Feature:aj},hover:{Feature:rj}},gj={layout:{ProjectionNode:p_,MeasureLayout:o_}},yj={...e4,...pj,...ij,...gj},ge=v5(yj,D5);function vj(){!by.current&&qL();const[s]=$.useState(Jd.current);return s}const xj={officialSponsor:"ÙØ§ØµØ± Ø§ÙØ°ÙÙØ¨"},Vs={name:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯",flag:"ð¡â«",title:"Ø¨Ø·Ù Ø§ÙØ¯Ùر٠2026",finalScore:"7 â 0",opponent:"Ø¨ÙØ¬Ùادش",summary:"تÙÙÙØ¬ ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ Ø¨Ø·ÙØ§Ù ÙÙØ¯Ùر٠بعد ÙÙØ²Ù ساØÙ Ù٠اÙÙ
باراة اÙÙÙØ§Ø¦ÙØ©."},Jl={hero:"/manus-storage/77857_bd1a9446.jpg",teamWithCup:"/manus-storage/77851_53a00ff0.jpg",celebration:"/manus-storage/77848_0fa08078.jpg"},bj="/manus-storage/ittihad-celebration_edd94497.mp4",Sj=[{id:1,matchNumber:1,label:"اÙÙ
باراة اÙÙÙØ§Ø¦ÙØ©",homeTeam:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯",homeFlag:"ð¡â«",awayTeam:"Ø¨ÙØ¬Ùادش",awayFlag:"ð§ð©",time:"Ø§ÙØªÙت",date:"ختاÙ
Ø§ÙØ¨Ø·ÙÙØ© 2026",commentator:"ÙØØ¯Ø¯ ÙØ§ØÙاÙ",referee:"ثابت Ø¹ÙØ§Ø´",group:"اÙÙÙØ§Ø¦Ù",homeScore:7,awayScore:0,status:"finished",winner:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯"}],Ej=["ÙØ³ÙÙ
رائد اÙÙØ®ÙاÙÙ","Ø£ØÙ
د Ø§ÙØØ¯Ø§Ø¯Ù","عبد Ø§ÙØ±ØÙ
Ù Ø¬Ø¹ÙØ±","ثابت Ø¹ÙØ§Ø´","إبراÙÙÙ
ÙØªÙÙÙ","Ø®Ø§ÙØ¯ اÙÙÙ
اÙ
","Ù
ØÙ
د سÙÙ
اÙ","عبداÙÙÙ ÙÙØ¯Ù","Ù
ØÙ
د Ù
ÙØ¯Ù"],Tj=[{left:"7%",color:"#fbbf24",delay:.1,drift:-14,rotation:140},{left:"16%",color:"#38bdf8",delay:1.1,drift:22,rotation:-120},{left:"27%",color:"#fde68a",delay:.45,drift:-20,rotation:150},{left:"38%",color:"#fb7185",delay:1.55,drift:17,rotation:-135},{left:"49%",color:"#facc15",delay:.7,drift:-8,rotation:180},{left:"60%",color:"#22d3ee",delay:1.75,drift:20,rotation:-160},{left:"71%",color:"#fbbf24",delay:.25,drift:-23,rotation:125},{left:"82%",color:"#fda4af",delay:1.35,drift:16,rotation:-145},{left:"92%",color:"#fde68a",delay:.9,drift:-11,rotation:175}];function Aj(){const s=vj();return A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:21",className:"p-4 sm:p-6 space-y-6",children:[A.jsx(ge.section,{"data-loc":"client/src/pages/Home.tsx:22",initial:{opacity:0,y:16}
182,animate:{opacity:1,y:0},transition:{duration:.45},className:"rounded-xl overflow-hidden",style:{background:"linear-gradient(90deg, oklch(0.18 0.06 60), oklch(0.12 0.04 60))",border:"1px solid oklch(0.55 0.15 60 / 0.5)"},children:A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:29",className:"px-5 py-3 flex items-center justify-between gap-3 flex-wrap",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:30",children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:31",className:"text-xs text-muted-foreground font-semibold tracking-widest",children:"Ø§ÙØ±Ø§Ø¹Ù Ø§ÙØ±Ø³Ù
Ù ÙÙØ¨Ø·ÙÙØ©"}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:32",className:"text-lg font-black text-accent",children:xj.officialSponsor})]}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:34",className:"text-xs text-muted-foreground",children:"بطÙÙØ© Ø´Ø±ÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ© 2026"})]})}),A.jsxs(ge.section,{"data-loc":"client/src/pages/Home.tsx:38",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.5,delay:.08},className:"relative overflow-hidden rounded-3xl text-center px-5 py-12 sm:py-16",style:{background:"radial-gradient(circle at 50% 0%, oklch(0.35 0.15 85 / 0.45), transparent 43%), linear-gradient(135deg, oklch(0.11 0.04 230), oklch(0.06 0.02 240))",border:"1px solid oklch(0.65 0.15 85 / 0.55)"},children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:45",className:"absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-transparent via-amber-300 to-transparent"}),!s&&Tj.map((t,e)=>A.jsx(ge.span,{"data-loc":"client/src/pages/Home.tsx:47","aria-hidden":"true",className:"absolute top-0 h-2.5 w-1.5 rounded-sm",style:{left:t.left,backgroundColor:t.color},initial:{opacity:0,y:-14,x:0,rotate:0},animate:{opacity:[0,1,1,0],y:[-14,54,150,260],x:[0,t.drift,t.drift*.5,t.drift],rotate:[0,t.rotation,t.rotation*1.6]},transition:{duration:3.8,delay:t.delay,repeat:1/0,repeatDelay:1.7,ease:"easeOut"}},e)),A.jsx(ge.div,{"data-loc":"client/src/pages/Home.tsx:57",initial:s?!1:{opacity:0,y:20,scale:.82},animate:s?void 0:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:260,damping:18,delay:.12},className:"text-5xl sm:text-7xl mb-4",children:"ð"}),A.jsx(ge.div,{"data-loc":"client/src/pages/Home.tsx:63",initial:s?!1:{opacity:0,y:12},animate:s?void 0:{opacity:1,y:0},transition:{duration:.36,delay:.28,ease:[.23,1,.32,1]},className:"text-xs sm:text-sm tracking-[0.22em] text-amber-300 font-black mb-3",children:"Ø¨Ø·Ù Ø§ÙØ¯ÙرÙ"}),A.jsx(ge.h1,{"data-loc":"client/src/pages/Home.tsx:69",initial:s?!1:{opacity:0,y:18},animate:s?void 0:{opacity:1,y:0},transition:{duration:.48,delay:.36,ease:[.23,1,.32,1]},className:"text-4xl sm:text-6xl font-black text-white mb-3",children:Vs.name}),A.jsx(ge.div,{"data-loc":"client/src/pages/Home.tsx:75",initial:s?!1:{opacity:0,y:14},animate:s?void 0:{opacity:1,y:0},transition:{duration:.42,delay:.48,ease:[.23,1,.32,1]},className:"text-2xl sm:text-3xl font-black text-amber-300",children:Vs.title}),A.jsx(ge.p,{"data-loc":"client/src/pages/Home.tsx:81",initial:s?!1:{opacity:0,y:12},animate:s?void 0:{opacity:1,y:0},transition:{duration:.42,delay:.58,ease:[.23,1,.32,1]},className:"mt-5 text-sm sm:text-base text-muted-foreground max-w-lg mx-auto",children:Vs.summary}),A.jsxs(ge.div,{"data-loc":"client/src/pages/Home.tsx:87",initial:s?!1:{opacity:0,y:22,scale:.97},animate:s?void 0:{opacity:1,y:0,scale:1},transition:{duration:.55,delay:.7,ease:[.23,1,.32,1]},whileHover:s?void 0:{scale:1.012},className:"relative mt-7 mx-auto max-w-3xl overflow-hidden rounded-2xl border border-amber-300/35 shadow-2xl",children:[s?A.jsx("img",{"data-loc":"client/src/pages/Home.tsx:95",src:Jl.hero,alt:"ÙØ§Ø¹Ø¨Ù ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ ÙØØªÙÙÙÙ Ø¨ÙØ£Ø³ Ø§ÙØ¨Ø·ÙÙØ©",className:"w-full h-56 sm:h-80 object-cover"}):A.jsx("video",{"data-loc":"client/src/pages/Home.tsx:101",src:bj,poster:Jl.hero,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"metadata","aria-label":"ÙÙØ¯ÙÙ Ø§ØØªÙاÙÙ Ù
ØªØØ±Ù ÙÙØ§Ø¹Ø¨Ù ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ Ù
ع ÙØ£Ø³ Ø§ÙØ¨Ø·ÙÙØ©",className:"w-full h-56 sm:h-80 object-cover transition-transform duration-700 hover:scale-[1.035]",children:A.jsx("img",{"data-loc":"client/src/pages/Home.tsx:112",src:Jl.hero,alt:"ÙØ§Ø¹Ø¨Ù ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ ÙØØªÙÙÙÙ Ø¨ÙØ£Ø³ Ø§ÙØ¨Ø·ÙÙØ©",className:"w-full h-56 sm:h-80 object-cover"})}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:115",className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 to-transparent px-4 py-5 text-right",children:A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:116",className:"text-xs sm:text-sm font-black text-amber-300",children:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ â Ø£Ø¨Ø·Ø§Ù Ø§ÙØ¯ÙرÙ"})})]})]}),A.jsxs(ge.section,{"data-loc":"client/src/pages/Home.tsx:121",initial:{opacity:0,y:16}
182,animate:{opacity:1,y:0},transition:{duration:.45,delay:.16},className:"bein-card rounded-2xl p-5 sm:p-7",style:{border:"1px solid oklch(0.55 0.15 85 / 0.4)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:128",className:"flex items-center justify-between gap-3 mb-5",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:129",children:[A.jsx("p",{"data-loc":"client/src/pages/Home.tsx:130",className:"text-xs text-accent font-black",children:"اÙÙØªÙجة اÙÙÙØ§Ø¦ÙØ©"}),A.jsx("h2",{"data-loc":"client/src/pages/Home.tsx:131",className:"text-xl font-black text-foreground",children:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ ÙØªÙÙØ¬ باÙÙÙØ¨"})]}),A.jsx("span",{"data-loc":"client/src/pages/Home.tsx:133",className:"text-xs px-2.5 py-1 rounded-full bg-green-500/15 text-green-400 font-bold border border-green-500/30",children:"Ø§ÙØªÙت Ø§ÙØ¨Ø·ÙÙØ©"})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:135",className:"grid grid-cols-[1fr_auto_1fr] items-center gap-3 text-center",children:[A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:136",children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:137",className:"text-4xl mb-2",children:Vs.flag}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:138",className:"font-black text-foreground",children:Vs.name})]}),A.jsx(ge.div,{"data-loc":"client/src/pages/Home.tsx:140",initial:s?!1:{opacity:0,scale:.78},animate:s?void 0:{opacity:1,scale:1},transition:{type:"spring",stiffness:240,damping:17,delay:.5},className:"text-4xl sm:text-5xl font-black text-amber-300 whitespace-nowrap",children:Vs.finalScore}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:146",children:[A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:147",className:"text-4xl mb-2",children:"ð§ð©"}),A.jsx("div",{"data-loc":"client/src/pages/Home.tsx:148",className:"font-black text-foreground",children:Vs.opponent})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:151",className:"mt-6 flex flex-wrap justify-center gap-3",children:[A.jsx(ca,{"data-loc":"client/src/pages/Home.tsx:152",href:"/matches",className:"px-4 py-2 rounded-xl bg-primary text-primary-foreground font-bold text-sm",children:"ØªÙØ§ØµÙ٠اÙÙÙØ§Ø¦Ù"}),A.jsx(ca,{"data-loc":"client/src/pages/Home.tsx:153",href:"/live",className:"px-4 py-2 rounded-xl border border-primary/40 text-primary font-bold text-sm",children:"Ø´Ø§ÙØ¯ Ø§ÙØ¨Ø« اÙÙ
باشر"})]})]})]})}function Rj(){return A.jsxs("div",{"data-loc":"client/src/pages/Scorers.tsx:6",className:"p-4 sm:p-6 space-y-6",children:[A.jsxs(ge.div,{"data-loc":"client/src/pages/Scorers.tsx:7",initial:{opacity:0,y:16},animate:{opacity:1,y:0},children:[A.jsxs("h1",{"data-loc":"client/src/pages/Scorers.tsx:8",className:"text-2xl font-black text-foreground mb-1 flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/Scorers.tsx:8",className:"w-1 h-7 bg-accent rounded-full"}),"اÙÙØ¯Ø§ÙÙÙ"]}),A.jsx("p",{"data-loc":"client/src/pages/Scorers.tsx:9",className:"text-muted-foreground text-sm",children:"Ø£ÙØ²ÙÙØª ÙØ§Ø¦Ù
Ø© اÙÙØ¯Ø§ÙÙÙ Ø§ÙØ³Ø§Ø¨ÙØ© بعد ختاÙ
Ø§ÙØ¨Ø·ÙÙØ©."})]}),A.jsxs(ge.div,{"data-loc":"client/src/pages/Scorers.tsx:11",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{delay:.1},className:"bein-card rounded-2xl p-10 text-center",children:[A.jsx("div",{"data-loc":"client/src/pages/Scorers.tsx:12",className:"text-6xl mb-4",children:"ð"}),A.jsxs("h2",{"data-loc":"client/src/pages/Scorers.tsx:13",className:"text-xl font-black text-foreground",children:["Ø§Ø®ØªÙØªÙ
Ø§ÙØ¯Ùر٠بتتÙÙØ¬ ",Vs.name]}),A.jsx("p",{"data-loc":"client/src/pages/Scorers.tsx:14",className:"text-muted-foreground text-sm mt-2",children:"ÙÙ
ÙÙ Ø¥Ø¶Ø§ÙØ© ÙØ§Ø¦Ù
Ø© ÙØ¯Ø§ÙÙÙ Ø¬Ø¯ÙØ¯Ø© Ø¹ÙØ¯ Ø§ÙØ·Ùا٠بطÙÙØ© Ø¬Ø¯ÙØ¯Ø©."})]})]})}function wj(){return A.jsxs("div",{"data-loc":"client/src/pages/Standings.tsx:6",className:"p-4 sm:p-6 space-y-6",children:[A.jsxs(ge.div,{"data-loc":"client/src/pages/Standings.tsx:7",initial:{opacity:0,y:16},animate:{opacity:1,y:0},children:[A.jsxs("h1",{"data-loc":"client/src/pages/Standings.tsx:8",className:"text-2xl font-black text-foreground mb-1 flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/Standings.tsx:8",className:"w-1 h-7 bg-accent rounded-full"}),"ختاÙ
Ø§ÙØ¯ÙرÙ"]}),A.jsx("h2",{"data-loc":"client/src/pages/Standings.tsx:9",className:"text-base font-semibold text-muted-foreground mt-2",children:"Ø§ÙØªÙت Ø§ÙØ¨Ø·ÙÙØ© ÙØªÙ
ØØ°Ù ØªØ±ØªÙØ¨ اÙÙ
جÙ
ÙØ¹Ø§Øª Ø§ÙØ³Ø§Ø¨Ù."})]}),A.jsxs(ge.div,{"data-loc":"client/src/pages/Standings.tsx:11",initial:{opacity:0,y:16}
182,animate:{opacity:1,y:0},transition:{delay:.1},className:"bein-card rounded-2xl p-8 text-center",style:{border:"1px solid oklch(0.62 0.16 85 / 0.55)"},children:[A.jsx("div",{"data-loc":"client/src/pages/Standings.tsx:12",className:"text-6xl mb-4",children:"ð"}),A.jsx("div",{"data-loc":"client/src/pages/Standings.tsx:13",className:"text-xs text-accent font-black tracking-widest",children:"Ø¨Ø·Ù Ø§ÙØ¯ÙرÙ"}),A.jsx("div",{"data-loc":"client/src/pages/Standings.tsx:14",className:"text-3xl font-black text-foreground mt-2",children:Vs.name}),A.jsxs("p",{"data-loc":"client/src/pages/Standings.tsx:15",className:"text-muted-foreground mt-3",children:["اÙÙØªÙجة اÙÙÙØ§Ø¦ÙØ©: ",A.jsx("strong",{"data-loc":"client/src/pages/Standings.tsx:15",className:"text-accent",children:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ 7 â 0 Ø¨ÙØ¬Ùادش"})]})]})]})}function Lj(){const s=Sj[0];return A.jsxs("div",{"data-loc":"client/src/pages/Matches.tsx:7",className:"p-4 sm:p-6 space-y-6",children:[A.jsxs(ge.div,{"data-loc":"client/src/pages/Matches.tsx:8",initial:{opacity:0,y:16},animate:{opacity:1,y:0},children:[A.jsxs("h1",{"data-loc":"client/src/pages/Matches.tsx:9",className:"text-2xl font-black text-foreground mb-1 flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/Matches.tsx:9",className:"w-1 h-7 bg-accent rounded-full"}),"ÙØªØ§Ø¦Ø¬ Ø§ÙØ¨Ø·ÙÙØ©"]}),A.jsx("p",{"data-loc":"client/src/pages/Matches.tsx:10",className:"text-muted-foreground text-sm",children:"Ø§Ø®ØªÙØªÙ
ت بطÙÙØ© Ø´Ø±ÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ©"})]}),A.jsxs(ge.article,{"data-loc":"client/src/pages/Matches.tsx:12",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:.1},className:"bein-card rounded-2xl overflow-hidden",style:{border:"1px solid oklch(0.62 0.16 85 / 0.55)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/Matches.tsx:13",className:"px-5 py-3 bg-accent/10 flex justify-between items-center gap-3",children:[A.jsxs("span",{"data-loc":"client/src/pages/Matches.tsx:13",className:"font-black text-accent",children:["ð ",s.label]}),A.jsx("span",{"data-loc":"client/src/pages/Matches.tsx:13",className:"text-xs text-green-400 font-bold",children:"Ø§ÙØªÙت"})]}),A.jsxs("div",{"data-loc":"client/src/pages/Matches.tsx:14",className:"p-6 sm:p-8 grid grid-cols-[1fr_auto_1fr] gap-3 items-center text-center",children:[A.jsxs("div",{"data-loc":"client/src/pages/Matches.tsx:15",children:[A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:15",className:"text-5xl mb-2",children:"ð¡â«"}),A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:15",className:"font-black text-foreground text-lg",children:Vs.name}),A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:15",className:"text-xs text-accent mt-1",children:"Ø¨Ø·Ù Ø§ÙØ¯ÙرÙ"})]}),A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:16",className:"text-5xl sm:text-6xl text-accent font-black",children:"7 â 0"}),A.jsxs("div",{"data-loc":"client/src/pages/Matches.tsx:17",children:[A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:17",className:"text-5xl mb-2",children:"ð§ð©"}),A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:17",className:"font-black text-foreground text-lg",children:"Ø¨ÙØ¬Ùادش"})]})]}),A.jsx("div",{"data-loc":"client/src/pages/Matches.tsx:19",className:"border-t border-border px-5 py-3 text-center text-xs text-muted-foreground",children:"ختاÙ
Ø§ÙØ¨Ø·ÙÙØ© 2026 · Ø§ÙØÙÙ
: ثابت Ø¹ÙØ§Ø´ · اÙÙ
عÙÙ: ÙØØ¯Ø¯ ÙØ§ØÙاÙ"})]}),A.jsx("p",{"data-loc":"client/src/pages/Matches.tsx:21",className:"text-center text-muted-foreground text-sm",children:"Ø£ÙØ²ÙÙØª ÙØªØ§Ø¦Ø¬ Ù
راØÙ Ø§ÙØ¨Ø·ÙÙØ© Ø§ÙØ³Ø§Ø¨ÙØ© Ù
Ù Ø§ÙØ³Ø¬Ù اÙÙ
Ø¹Ø±ÙØ¶."})]})}function _j(){return A.jsxs("div",{"data-loc":"client/src/pages/Teams.tsx:6",className:"p-4 sm:p-6 space-y-6",children:[A.jsxs(ge.div,{"data-loc":"client/src/pages/Teams.tsx:7",initial:{opacity:0,y:16},animate:{opacity:1,y:0},children:[A.jsxs("h1",{"data-loc":"client/src/pages/Teams.tsx:8",className:"text-2xl font-black text-foreground mb-1 flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/Teams.tsx:8",className:"w-1 h-7 bg-accent rounded-full"}),"Ø¨Ø·Ù Ø§ÙØ¯ÙرÙ"]}),A.jsx("p",{"data-loc":"client/src/pages/Teams.tsx:9",className:"text-muted-foreground text-sm",children:"تÙ
ت Ø¥Ø²Ø§ÙØ© ÙÙØ§Ø¦Ù
اÙÙØ±Ù Ø§ÙØ³Ø§Ø¨ÙØ© بعد ختاÙ
Ø§ÙØ¨Ø·ÙÙØ©."})]}),A.jsxs(ge.section,{"data-loc":"client/src/pages/Teams.tsx:11",initial:{opacity:0,scale:.98}
182,animate:{opacity:1,scale:1},transition:{delay:.1},className:"max-w-xl bein-card rounded-3xl p-8 text-center mx-auto",style:{border:"1px solid oklch(0.62 0.16 85 / 0.55)"},children:[A.jsx("div",{"data-loc":"client/src/pages/Teams.tsx:12",className:"text-6xl mb-4",children:"ð"}),A.jsx("div",{"data-loc":"client/src/pages/Teams.tsx:12",className:"text-5xl mb-3",children:Vs.flag}),A.jsx("h2",{"data-loc":"client/src/pages/Teams.tsx:13",className:"text-3xl font-black text-foreground",children:Vs.name}),A.jsx("p",{"data-loc":"client/src/pages/Teams.tsx:14",className:"text-accent font-bold mt-2",children:Vs.title}),A.jsxs("div",{"data-loc":"client/src/pages/Teams.tsx:15",className:"mt-6 py-4 border-y border-border text-sm text-muted-foreground",children:["ÙØ§Ø² Ù٠اÙÙÙØ§Ø¦Ù عÙÙ Ø¨ÙØ¬Ùادش Ø¨ÙØªÙجة ",A.jsx("strong",{"data-loc":"client/src/pages/Teams.tsx:15",className:"text-accent",children:"7 â 0"})]})]}),A.jsxs(ge.section,{"data-loc":"client/src/pages/Teams.tsx:18",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:.2},className:"max-w-5xl mx-auto",children:[A.jsxs("h2",{"data-loc":"client/src/pages/Teams.tsx:19",className:"text-lg font-black text-foreground mb-4 flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/Teams.tsx:19",className:"w-1 h-5 bg-accent rounded-full"}),"ÙØØ¸Ø§Øª Ø§ÙØªØªÙÙØ¬"]}),A.jsxs("div",{"data-loc":"client/src/pages/Teams.tsx:20",className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[A.jsxs("figure",{"data-loc":"client/src/pages/Teams.tsx:21",className:"relative overflow-hidden rounded-2xl border border-amber-300/30 bg-black aspect-[4/3]",children:[A.jsx("img",{"data-loc":"client/src/pages/Teams.tsx:22",src:Jl.teamWithCup,alt:"ÙØ±ÙÙ ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ Ù
ع ÙØ£Ø³ Ø§ÙØ¨Ø·ÙÙØ©",className:"w-full h-full object-cover"}),A.jsx("figcaption",{"data-loc":"client/src/pages/Teams.tsx:23",className:"absolute inset-x-0 bottom-0 px-4 py-3 bg-gradient-to-t from-black/85 to-transparent text-sm font-black text-white",children:"ÙØ±ØØ© Ø§ÙØªØªÙÙØ¬ باÙÙØ£Ø³"})]}),A.jsxs("figure",{"data-loc":"client/src/pages/Teams.tsx:25",className:"relative overflow-hidden rounded-2xl border border-amber-300/30 bg-black aspect-[4/3]",children:[A.jsx("img",{"data-loc":"client/src/pages/Teams.tsx:26",src:Jl.celebration,alt:"ÙØ§Ø¹Ø¨Ù ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ ÙØØªÙÙÙ٠بعد اÙÙÙØ²",className:"w-full h-full object-cover"}),A.jsx("figcaption",{"data-loc":"client/src/pages/Teams.tsx:27",className:"absolute inset-x-0 bottom-0 px-4 py-3 bg-gradient-to-t from-black/85 to-transparent text-sm font-black text-white",children:"Ø£Ø¨Ø·Ø§Ù ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯"})]})]})]})]})}function Cj(){return A.jsxs("div",{"data-loc":"client/src/pages/Members.tsx:7",className:"p-4 sm:p-6 space-y-6",children:[A.jsxs(ge.div,{"data-loc":"client/src/pages/Members.tsx:8",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[A.jsxs("h1",{"data-loc":"client/src/pages/Members.tsx:13",className:"text-2xl font-black text-foreground mb-1 flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/Members.tsx:14",className:"w-1 h-7 bg-accent rounded-full inline-block"}),"Ù
ÙØ¶Ù
Ù Ø§ÙØ¨Ø·ÙÙØ©"]}),A.jsx("p",{"data-loc":"client/src/pages/Members.tsx:17",className:"text-muted-foreground text-sm",children:"Ø§ÙØ£Ø¹Ø¶Ø§Ø¡ Ø§ÙØ±Ø³Ù
ÙÙÙ Ù٠بطÙÙØ© Ø´Ø±ÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ©"})]}),A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:20",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Ej.map((s,t)=>A.jsxs(ge.div,{"data-loc":"client/src/pages/Members.tsx:22",initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{delay:.08*t,duration:.4},className:`bein-card rounded-xl p-5 flex items-center gap-4 hover:bein-glow transition-all duration-300 ${t===0?"border-accent/50 bg-gradient-to-r from-accent/10 to-transparent":""}`,children:[A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:31",className:`w-12 h-12 rounded-full flex items-center justify-center font-black text-lg flex-shrink-0 ${t===0?"bg-accent text-accent-foreground bein-glow-gold":"bg-primary/20 text-primary border border-primary/30"}`,children:t+1}),A.jsxs("div",{"data-loc":"client/src/pages/Members.tsx:38",children:[A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:39",className:`font-black text-base ${t===0?"text-accent":"text-foreground"}`,children:s}),t===0&&A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:43",className:"text-xs text-muted-foreground mt-0.5",children:"اÙÙ
ÙØ¸Ù
Ø§ÙØ±Ø¦ÙسÙ"})]}),t===0&&A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:47",className:"mr-auto text-xl",children:"ð"})]},t))}),A.jsxs(ge.div,{"data-loc":"client/src/pages/Members.tsx:54",initial:{opacity:0,y:20}
182,animate:{opacity:1,y:0},transition:{duration:.5,delay:.5},className:"bein-card rounded-2xl p-6 text-center border-accent/30",style:{background:"linear-gradient(135deg, oklch(0.14 0.03 240), oklch(0.12 0.04 75 / 0.3))"},children:[A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:61",className:"text-sm text-muted-foreground mb-2",children:"Ø§ÙØ±Ø§Ø¹Ù Ø§ÙØ±Ø³Ù
Ù ÙÙØ¨Ø·ÙÙØ©"}),A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:62",className:"text-3xl font-black text-accent bein-glow-gold mb-2",children:"ÙØ§ØµØ± Ø§ÙØ°ÙÙØ¨"}),A.jsx("div",{"data-loc":"client/src/pages/Members.tsx:63",className:"text-xs text-muted-foreground",children:"بطÙÙØ© Ø´Ø±ÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ©"})]})]})}const Dj=[{path:"/",label:"ختاÙ
Ø§ÙØ¨Ø·ÙÙØ©",icon:_w},{path:"/matches",label:"ÙØªÙجة اÙÙÙØ§Ø¦Ù",icon:tF},{path:"/teams",label:"Ø¨Ø·Ù Ø§ÙØ¯ÙرÙ",icon:uF},{path:"/members",label:"Ù
ÙØ¶Ù
Ù Ø§ÙØ¨Ø·ÙÙØ©",icon:hF},{path:"/live",label:"Ø§ÙØ¨Ø« اÙÙ
باشر",icon:Cw,isLive:!0},{path:"/channels",label:"ÙÙÙØ§Øª Ø§ÙØ¨Ø«",icon:dF}];function Ij(){const[s]=Bw(),[t,e]=$.useState(!1),n=()=>A.jsxs("div",{"data-loc":"client/src/components/Sidebar.tsx:20",className:"flex flex-col h-full",children:[A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:22",className:"p-4 border-b border-border",children:A.jsxs("div",{"data-loc":"client/src/components/Sidebar.tsx:23",className:"flex items-center gap-3 mb-3",children:[A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:24",className:"w-12 h-12 rounded-xl flex items-center justify-center overflow-hidden bg-black border border-primary/30",children:A.jsxs("svg",{"data-loc":"client/src/components/Sidebar.tsx:25",viewBox:"0 0 100 100",className:"w-full h-full",children:[A.jsx("rect",{"data-loc":"client/src/components/Sidebar.tsx:26",width:"100",height:"100",fill:"#000"}),A.jsx("text",{"data-loc":"client/src/components/Sidebar.tsx:27",x:"50",y:"38",textAnchor:"middle",fill:"#00a0e3",fontSize:"12",fontWeight:"900",fontFamily:"Arial",children:"TADWEER"}),A.jsx("text",{"data-loc":"client/src/components/Sidebar.tsx:28",x:"50",y:"58",textAnchor:"middle",fill:"#ffffff",fontSize:"11",fontWeight:"700",fontFamily:"Arial",children:"SPORTS"}),A.jsx("rect",{"data-loc":"client/src/components/Sidebar.tsx:29",x:"15",y:"63",width:"70",height:"3",fill:"#00a0e3"})]})}),A.jsxs("div",{"data-loc":"client/src/components/Sidebar.tsx:32",children:[A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:33",className:"text-xs text-muted-foreground",children:"بطÙÙØ© Ø´Ø±ÙØ© تدÙÙØ±"}),A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:34",className:"text-sm font-bold text-foreground leading-tight",children:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯"}),A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:35",className:"text-xs text-accent font-semibold",children:"Ø¨Ø·Ù Ø§ÙØ¯Ùر٠2026"})]})]})}),A.jsx("nav",{"data-loc":"client/src/components/Sidebar.tsx:41",className:"flex-1 p-3 space-y-1 overflow-y-auto",children:Dj.map(i=>{const a=i.icon,o=s===i.path;return A.jsx(ca,{"data-loc":"client/src/components/Sidebar.tsx:46",href:i.path,children:A.jsxs("div",{"data-loc":"client/src/components/Sidebar.tsx:47",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 cursor-pointer group ${o?"sidebar-item-active bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,onClick:()=>e(!1),children:[A.jsx(a,{"data-loc":"client/src/components/Sidebar.tsx:55",size:18,className:o?"text-primary":"group-hover:text-primary transition-colors"}),A.jsx("span",{"data-loc":"client/src/components/Sidebar.tsx:56",className:`font-semibold text-sm ${i.isLive?"text-red-400 font-black":""}`,children:i.label}),i.isLive&&A.jsxs("span",{"data-loc":"client/src/components/Sidebar.tsx:58",className:"mr-auto flex items-center gap-1 bg-red-600/20 text-red-400 border border-red-500/40 px-2 py-0.5 rounded-full text-xs font-bold",children:[A.jsx("span",{"data-loc":"client/src/components/Sidebar.tsx:59",className:"w-1.5 h-1.5 rounded-full bg-red-500 animate-pulse inline-block"}),"LIVE"]}),o&&A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:64",className:"mr-auto w-2 h-2 rounded-full bg-primary bein-glow"})]})},i.path)})}),A.jsxs("div",{"data-loc":"client/src/components/Sidebar.tsx:73",className:"p-4 border-t border-border",children:[A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:74",className:"text-xs text-muted-foreground text-center mb-1",children:"Ø§ÙØ±Ø§Ø¹Ù Ø§ÙØ±Ø³Ù
Ù"}),A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:75",className:"text-center font-bold text-accent text-sm bein-glow-gold px-3 py-2 rounded-lg bg-accent/10 border border-accent/20",children:"ÙØ§ØµØ± Ø§ÙØ°ÙÙØ¨"})]})]});return A.jsxs(A.Fragment,{children:[A.jsx("aside",{"data-loc":"client/src/components/Sidebar.tsx:85",className:"hidden lg:flex flex-col w-64 bg-sidebar border-l border-sidebar-border h-screen sticky top-0 overflow-hidden",children:A.jsx(n,{"data-loc":"client/src/components/Sidebar.tsx:86"})}),A.jsx("button",{"data-loc":"client/src/components/Sidebar.tsx:90",className:"lg:hidden fixed top-4 right-4 z-50 p-2 bg-card border border-border rounded-lg text-foreground",onClick:()=>e(!t),children:t?A.jsx(Cg,{"data-loc":"client/src/components/Sidebar.tsx:94",size:20}):A.jsx(rF,{"data-loc":"client/src/components/Sidebar.tsx:94",size:20})}),t&&A.jsxs("div",{"data-loc":"client/src/components/Sidebar.tsx:99",className:"lg:hidden fixed inset-0 z-40 flex",children:[A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:100",className:"w-72 bg-sidebar border-l border-sidebar-border h-full overflow-y-auto",children:A.jsx(n,{"data-loc":"client/src/components/Sidebar.tsx:101"})}),A.jsx("div",{"data-loc":"client/src/components/Sidebar.tsx:103",className:"flex-1 bg-black/50",onClick:()=>e(!1)})]})]})}function Oj(){return A.jsxs("header",{"data-loc":"client/src/components/TopBar.tsx:7",className:"bg-[oklch(0.06_0.02_240)] border-b border-border sticky top-0 z-30",children:[A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:9",className:"bg-primary px-4 py-1 flex items-center justify-between text-xs text-primary-foreground",children:[A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:10",className:"flex items-center gap-4",children:[A.jsx("span",{"data-loc":"client/src/components/TopBar.tsx:11",className:"font-bold",children:"ð Ø¨Ø·ÙÙØ© Ø´Ø±ÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ©"}),A.jsx("span",{"data-loc":"client/src/components/TopBar.tsx:12",className:"hidden sm:inline opacity-80",children:"Ø§Ø®ØªÙØªÙ
ت Ø§ÙØ¨Ø·ÙÙØ© · ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ Ø¨Ø·Ù Ø§ÙØ¯ÙرÙ"})]}),A.jsx("div",{"data-loc":"client/src/components/TopBar.tsx:14",className:"flex items-center gap-2",children:A.jsxs("span",{"data-loc":"client/src/components/TopBar.tsx:15",className:"live-badge inline-flex items-center gap-1 bg-red-600 text-white px-2 py-0.5 rounded text-xs font-bold",children:[A.jsx("span",{"data-loc":"client/src/components/TopBar.tsx:16",className:"w-1.5 h-1.5 bg-white rounded-full inline-block"}),"LIVE"]})})]}),A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:23",className:"px-4 py-3 flex items-center justify-between",children:[A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:24",className:"flex items-center gap-3",children:[A.jsx("div",{"data-loc":"client/src/components/TopBar.tsx:25",className:"flex items-center gap-2 bg-black border border-primary/40 rounded-xl px-3 py-2 bein-glow",children:A.jsxs("svg",{"data-loc":"client/src/components/TopBar.tsx:26",viewBox:"0 0 120 40",className:"h-8 w-auto",children:[A.jsx("rect",{"data-loc":"client/src/components/TopBar.tsx:27",width:"120",height:"40",fill:"#000",rx:"4"}),A.jsx("text",{"data-loc":"client/src/components/TopBar.tsx:28",x:"60",y:"16",textAnchor:"middle",fill:"#00a0e3",fontSize:"12",fontWeight:"900",fontFamily:"Arial, sans-serif",children:"TADWEER"}),A.jsx("text",{"data-loc":"client/src/components/TopBar.tsx:29",x:"60",y:"30",textAnchor:"middle",fill:"#ffffff",fontSize:"10",fontWeight:"700",fontFamily:"Arial, sans-serif",children:"SPORTS"}),A.jsx("rect",{"data-loc":"client/src/components/TopBar.tsx:30",x:"10",y:"33",width:"100",height:"2",fill:"#00a0e3"})]})}),A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:33",className:"hidden sm:block",children:[A.jsx("div",{"data-loc":"client/src/components/TopBar.tsx:34",className:"text-xs text-muted-foreground",children:"اÙÙÙØ§Ø© Ø§ÙØ±Ø³Ù
ÙØ©"}),A.jsxs(ca,{"data-loc":"client/src/components/TopBar.tsx:35",href:"/channels",className:"flex items-center gap-1 text-primary hover:text-accent transition-colors font-bold text-sm",children:[A.jsx(fF,{"data-loc":"client/src/components/TopBar.tsx:36",size:14}),"Tadweer Sports",A.jsx("span",{"data-loc":"client/src/components/TopBar.tsx:38",className:"live-badge text-xs bg-red-600 text-white px-1.5 py-0.5 rounded font-bold mr-1",children:"LIVE"})]})]})]}),A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:44",className:"text-center flex-1 px-4",children:[A.jsx("h1",{"data-loc":"client/src/components/TopBar.tsx:45",className:"text-sm sm:text-base font-black bein-gradient-text leading-tight",children:"بطÙÙØ© Ø´Ø±ÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ©"}),A.jsx("p",{"data-loc":"client/src/components/TopBar.tsx:48",className:"text-xs text-muted-foreground hidden sm:block",children:"ÙØ§Ø¯Ù Ø§ÙØ§ØªØØ§Ø¯ Ø¨Ø·Ù Ø§ÙØ¯Ùر٠2026"})]}),A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:52",className:"flex items-center gap-2",children:[A.jsx(ca,{"data-loc":"client/src/components/TopBar.tsx:54",href:"/live",children:A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:55",className:"flex items-center gap-2 bg-red-600/20 border border-red-500/50 rounded-xl px-3 py-2 cursor-pointer hover:bg-red-600/30 transition-colors",style:{boxShadow:"0 0 12px rgba(220,38,38,0.3)"},children:[A.jsx("span",{"data-loc":"client/src/components/TopBar.tsx:57",className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),A.jsx("span",{"data-loc":"client/src/components/TopBar.tsx:58",className:"text-red-400 font-black text-sm",children:"Ø§ÙØ¨Ø« اÙÙ
باشر"})]})}),A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:61",className:"hidden sm:flex items-center gap-2 bg-secondary border border-border rounded-lg px-3 py-2",children:[A.jsx(Cw,{"data-loc":"client/src/components/TopBar.tsx:62",size:14,className:"text-primary"}),A.jsxs("div",{"data-loc":"client/src/components/TopBar.tsx:63",children:[A.jsx("div",{"data-loc":"client/src/components/TopBar.tsx:64",className:"text-xs text-muted-foreground",children:"Ø§ÙØ±Ø§Ø¹Ù Ø§ÙØ±Ø³Ù
Ù"}),A.jsx("div",{"data-loc":"client/src/components/TopBar.tsx:65",className:"text-xs font-bold text-accent",children:"ÙØ§ØµØ± Ø§ÙØ°ÙÙØ¨"})]})]})]})]})]})}const Xn=Object.create(null);Xn.open="0";Xn.close="1";Xn.ping="2";Xn.pong="3";Xn.message="4";Xn.upgrade="5";Xn.noop="6";
vendor: 6,018 bytes, line 182
182const Id=Object.create(null);Object.keys(Xn).forEach(s=>{Id[Xn[s]]=s});const Xg={type:"error",data:"parser error"},g_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",y_=typeof ArrayBuffer=="function",v_=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Ey=({type:s,data:t},e,n)=>g_&&t instanceof Blob?e?n(t):cA(t,n):y_&&(t instanceof ArrayBuffer||v_(t))?e?n(t):cA(new Blob([t]),n):n(Xn[s]+(t||"")),cA=(s,t)=>{const e=new FileReader;return e.onload=function(){const n=e.result.split(",")[1];t("b"+(n||""))},e.readAsDataURL(s)};function uA(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let Lp;function kj(s,t){if(g_&&s.data instanceof Blob)return s.data.arrayBuffer().then(uA).then(t);if(y_&&(s.data instanceof ArrayBuffer||v_(s.data)))return t(uA(s.data));Ey(s,!1,e=>{Lp||(Lp=new TextEncoder),t(Lp.encode(e))})}const dA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<dA.length;s++)Hl[dA.charCodeAt(s)]=s;const Pj=s=>{let t=s.length*.75,e=s.length,n,i=0,a,o,c,d;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);const f=new ArrayBuffer(t),h=new Uint8Array(f);for(n=0;n<e;n+=4)a=Hl[s.charCodeAt(n)],o=Hl[s.charCodeAt(n+1)],c=Hl[s.charCodeAt(n+2)],d=Hl[s.charCodeAt(n+3)],h[i++]=a<<2|o>>4,h[i++]=(o&15)<<4|c>>2,h[i++]=(c&3)<<6|d&63;return f},Mj=typeof ArrayBuffer=="function",Ty=(s,t)=>{if(typeof s!="string")return{type:"message",data:x_(s,t)};const e=s.charAt(0);return e==="b"?{type:"message",data:Nj(s.substring(1),t)}:Id[e]?s.length>1?{type:Id[e],data:s.substring(1)}:{type:Id[e]}:Xg},Nj=(s,t)=>{if(Mj){const e=Pj(s);return x_(e,t)}else return{base64:!0,data:s}},x_=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},b_="�",Bj=(s,t)=>{const e=s.length,n=new Array(e);let i=0;s.forEach((a,o)=>{Ey(a,!1,c=>{n[o]=c,++i===e&&t(n.join(b_))})})},Fj=(s,t)=>{const e=s.split(b_),n=[];for(let i=0;i<e.length;i++){const a=Ty(e[i],t);if(n.push(a),a.type==="error")break}return n};function Uj(){return new TransformStream({transform(s,t){kj(s,e=>{const n=e.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,n)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(e)})}})}let _p;function ad(s){return s.reduce((t,e)=>t+e.length,0)}function od(s,t){if(s[0].length===t)return s.shift();const e=new Uint8Array(t);let n=0;for(let i=0;i<t;i++)e[i]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),e}function jj(s,t){_p||(_p=new TextDecoder);const e=[];let n=0,i=-1,a=!1;return new TransformStream({transform(o,c){for(e.push(o);;){if(n===0){if(ad(e)<1)break;const d=od(e,1);a=(d[0]&128)===128,i=d[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(ad(e)<2)break;const d=od(e,2);i=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),n=3}else if(n===2){if(ad(e)<8)break;const d=od(e,8),f=new DataView(d.buffer,d.byteOffset,d.length),h=f.getUint32(0);if(h>Math.pow(2,21)-1){c.enqueue(Xg);break}i=h*Math.pow(2,32)+f.getUint32(4),n=3}else{if(ad(e)<i)break;const d=od(e,i);c.enqueue(Ty(a?d:_p.decode(d),t)),n=0}if(i===0||i>s){c.enqueue(Xg);break}}}})}const S_=4;function Be(s){if(s)return $j(s)}function $j(s){for(var t in Be.prototype)s[t]=Be.prototype[t];return s}Be.prototype.on=Be.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};Be.prototype.once=function(s,t){function e(){this.off(s,e),t.apply(this,arguments)}return e.fn=t,this.on(s,e),this};Be.prototype.off=Be.prototype.removeListener=Be.prototype.removeAllListeners=Be.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+s];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,i=0;i<e.length;i++)if(n=e[i],n===t||n.fn===t){e.splice(i,1);break}return e.length===0&&delete this._callbacks["$"+s],this};Be.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),e=this._callbacks["$"+s],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(e){e=e.slice(0);for(var n=0,i=e.length;n<i;++n)e[n].apply(this,t)}return this};Be.prototype.emitReserved=Be.prototype.emit;Be.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};Be.prototype.hasListeners=function(s){return!!this.listeners(s).length};const kf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,e)=>e(t,0),un=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Vj="arraybuffer";function E_(s,...t){return t.reduce((e,n)=>(s.hasOwnProperty(n)&&(e[n]=s[n]),e),{})}const Gj=un.setTimeout,Hj=un.clearTimeout;function Pf(s,t){t.useNativeTimers?(s.setTimeoutFn=Gj.bind(un),s.clearTimeoutFn=Hj.bind(un)):(s.setTimeoutFn=un.setTimeout.bind(un),s.clearTimeoutFn=un.clearTimeout.bind(un))}const zj=1.33;function Kj(s){return typeof s=="string"?qj(s):Math.ceil((s.byteLength||s.size)*zj)}function qj(s){let t=0,e=0;for(let n=0,i=s.length;n<i;n++)t=s.charCodeAt(n),t<128?e+=1:t<2048?e+=2:t<55296||t>=57344?e+=3:(n++,e+=4);return e}function T_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Yj(s){let t="";for(let e in s)s.hasOwnProperty(e)&&(t.length&&(t+="&"),t+=encodeURIComponent(e)+"="+encodeURIComponent(s[e]));return t}function Wj(s){let t={},e=s.split("&");for(let n=0,i=e.length;n<i;n++){let a=e[n].split("=");
vendor: 6,261 bytes, line 182
182t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Qj extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class Ay extends Be{constructor(t){super(),this.writable=!1,Pf(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,e,n){return super.emitReserved("error",new Qj(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=Ty(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const e=Yj(t);return e.length?"?"+e:""}}class Xj extends Ay{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||e()})),this.writable||(n++,this.once("drain",function(){--n||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const e=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};Fj(t,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Bj(t,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=T_()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(t,e)}}let A_=!1;try{A_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Zj=A_;function Jj(){}class t8 extends Xj{constructor(t){if(super(t),typeof location<"u"){const e=location.protocol==="https:";let n=location.port;n||(n=e?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(e,n)=>{this.onError("xhr poll error",e,n)}),this.pollXhr=t}}class Wn extends Be{constructor(t,e,n){super(),this.createRequest=t,Pf(this,n),this._opts=n,this._method=n.method||"GET",this._uri=e,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const e=E_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(e);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Wn.requestsCount++,Wn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Jj,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Wn.requestsCount=0;Wn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fA);else if(typeof addEventListener=="function"){const s="onpagehide"in un?"pagehide":"unload";addEventListener(s,fA,!1)}}function fA(){for(let s in Wn.requests)Wn.requests.hasOwnProperty(s)&&Wn.requests[s].abort()}const e8=(function(){const s=R_({xdomain:!1});return s&&s.responseType!==null})();class s8 extends t8{constructor(t){super(t);const e=t&&t.forceBase64;this.supportsBinary=e8&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Wn(R_,this.uri(),t)}}function R_(s){const t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Zj))return new XMLHttpRequest}catch{}if(!t)try{return new un[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const w_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class n8 extends Ay{get name(){return"websocket"}doOpen(){const t=this.uri(),e=this.opts.protocols,n=w_?{}:E_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,e,n)}catch(i){return this.emitReserved("error",i)}
vendor: 10,324 bytes, line 182
182this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],i=e===t.length-1;Ey(n,this.supportsBinary,a=>{try{this.doWrite(n,a)}catch{}i&&kf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=T_()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}}const Cp=un.WebSocket||un.MozWebSocket;class i8 extends n8{createSocket(t,e,n){return w_?new Cp(t,e,n):e?new Cp(t,e):new Cp(t)}doWrite(t,e){this.ws.send(e)}}class r8 extends Ay{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const e=jj(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),i=Uj();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{n.read().then(({done:c,value:d})=>{c||(this.onPacket(d),a())}).catch(c=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],i=e===t.length-1;this._writer.write(n).then(()=>{i&&kf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const a8={websocket:i8,webtransport:r8,polling:s8},o8=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,l8=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Zg(s){if(s.length>8e3)throw"URI too long";const t=s,e=s.indexOf("["),n=s.indexOf("]");e!=-1&&n!=-1&&(s=s.substring(0,e)+s.substring(e,n).replace(/:/g,";")+s.substring(n,s.length));let i=o8.exec(s||""),a={},o=14;for(;o--;)a[l8[o]]=i[o]||"";return e!=-1&&n!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=c8(a,a.path),a.queryKey=u8(a,a.query),a}function c8(s,t){const e=/\/{2,9}/g,n=t.replace(e,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function u8(s,t){const e={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,a){i&&(e[i]=a)}),e}const Jg=typeof addEventListener=="function"&&typeof removeEventListener=="function",Od=[];Jg&&addEventListener("offline",()=>{Od.forEach(s=>s())},!1);class pr extends Be{constructor(t,e){if(super(),this.binaryType=Vj,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(e=t,t=null),t){const n=Zg(t);e.hostname=n.host,e.secure=n.protocol==="https"||n.protocol==="wss",e.port=n.port,n.query&&(e.query=n.query)}else e.host&&(e.hostname=Zg(e.host).host);Pf(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Wj(this.opts.query)),Jg&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Od.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const e=Object.assign({},this.opts.query);e.EIO=S_,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&pr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const e=this.createTransport(t);e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",pr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const e=new Error("server error");e.code=t.data,this._onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(e+=Kj(i)),n>0&&e>this._maxPayload)return this.writeBuffer.slice(0,n);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,kf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,e,n){return this._sendPacket("message",t,e,n),this}send(t,e,n){return this._sendPacket("message",t,e,n),this}_sendPacket(t,e,n,i){if(typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const a={type:t,data:e,options:n};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(pr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Jg&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Od.indexOf(this._offlineEventListener);n!==-1&&Od.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this._prevBufferLen=0}}}pr.protocol=S_;class d8 extends pr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let e=this.createTransport(t),n=!1;pr.priorWebsocketSuccess=!1;const i=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;pr.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(h(),this.setTransport(e),e.send([{type:"upgrade"}
vendor: 10,481 bytes, line 182
182]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=e.name,this.emitReserved("upgradeError",g)}}))};function a(){n||(n=!0,h(),e.close(),e=null)}const o=p=>{const g=new Error("probe error: "+p);g.transport=e.name,a(),this.emitReserved("upgradeError",g)};function c(){o("transport closed")}function d(){o("socket closed")}function f(p){e&&p.name!==e.name&&a()}const h=()=>{e.removeListener("open",i),e.removeListener("error",o),e.removeListener("close",c),this.off("close",d),this.off("upgrading",f)};e.once("open",i),e.once("error",o),e.once("close",c),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const e=[];for(let n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}let f8=class extends d8{constructor(t,e={}){const n=typeof t=="object",i=n?{...t}:{...e};(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(a=>a8[a]).filter(a=>!!a)),super(n?i:t,i)}};function h8(s,t="",e){let n=s;e=e||typeof location<"u"&&location,s==null&&(s=e.protocol+"//"+e.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=e.protocol+s:s=e.host+s),/^(https?|wss?):\/\//.test(s)||(typeof e<"u"?s=e.protocol+"//"+s:s="https://"+s),n=Zg(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+t,n.href=n.protocol+"://"+a+(e&&e.port===n.port?"":":"+n.port),n}const m8=typeof ArrayBuffer=="function",p8=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,L_=Object.prototype.toString,g8=typeof Blob=="function"||typeof Blob<"u"&&L_.call(Blob)==="[object BlobConstructor]",y8=typeof File=="function"||typeof File<"u"&&L_.call(File)==="[object FileConstructor]";function Ry(s){return m8&&(s instanceof ArrayBuffer||p8(s))||g8&&s instanceof Blob||y8&&s instanceof File}function kd(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let e=0,n=s.length;e<n;e++)if(kd(s[e]))return!0;return!1}if(Ry(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return kd(s.toJSON(),!0);for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&kd(s[e]))return!0;return!1}function v8(s){const t=[],e=s.data,n=s;return n.data=Pd(e,t),n.attachments=t.length,{packet:n,buffers:t}}function Pd(s,t,e){if(!s)return s;if(Ry(s)){const n={_placeholder:!0,num:t.length};return t.push(s),n}else if(Array.isArray(s)){const n=new Array(s.length);for(let i=0;i<s.length;i++)n[i]=Pd(s[i],t);return n}else if(typeof s=="object"&&!(s instanceof Date)){if(s.toJSON&&typeof s.toJSON=="function"&&!e)return Pd(s.toJSON(),t,!0);const n={};for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=Pd(s[i],t));return n}return s}function x8(s,t){return s.data=t0(s.data,t),delete s.attachments,s}function t0(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let e=0;e<s.length;e++)s[e]=t0(s[e],t);else if(typeof s=="object")for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&(s[e]=t0(s[e],t));return s}const __=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],b8=5;var Pt;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(Pt||(Pt={}));class S8{constructor(t){this.replacer=t}encode(t){return(t.type===Pt.EVENT||t.type===Pt.ACK)&&kd(t)?this.encodeAsBinary({type:t.type===Pt.EVENT?Pt.BINARY_EVENT:Pt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===Pt.BINARY_EVENT||t.type===Pt.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(e+=t.nsp+","),t.id!=null&&(e+=t.id),t.data!=null&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=v8(t),n=this.encodeAsString(e.packet),i=e.buffers;return i.unshift(n),i}}class wy extends Be{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let e;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===Pt.BINARY_EVENT;n||e.type===Pt.BINARY_ACK?(e.type=n?Pt.EVENT:Pt.ACK,this.reconstructor=new E8(e)):super.emitReserved("decoded",e)}else if(Ry(t)||t.base64)if(this.reconstructor)e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(Pt[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===Pt.BINARY_EVENT||n.type===Pt.BINARY_ACK){const a=e+1;for(;t.charAt(++e)!=="-"&&e!=t.length;);const o=t.substring(a,e);if(o!=Number(o)||t.charAt(e)!=="-")throw new Error("Illegal attachments");const c=Number(o);if(!C_(c)||c<1)throw new Error("Illegal attachments");if(c>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=c}if(t.charAt(e+1)==="/"){const a=e+1;for(;++e&&!(t.charAt(e)===","||e===t.length););n.nsp=t.substring(a,e)}else n.nsp="/";const i=t.charAt(e+1);if(i!==""&&Number(i)==i){const a=e+1;for(;++e;){const o=t.charAt(e);if(o==null||Number(o)!=o){--e;break}if(e===t.length)break}n.id=Number(t.substring(a,e+1))}if(t.charAt(++e)){const a=this.tryParse(t.substr(e));if(wy.isPayloadValid(n.type,a))n.data=a;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,e){switch(t){case Pt.CONNECT:return tf(e);case Pt.DISCONNECT:return e===void 0;case Pt.CONNECT_ERROR:return typeof e=="string"||tf(e);case Pt.EVENT:case Pt.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&__.indexOf(e[0])===-1);case Pt.ACK:case Pt.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class E8{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const e=x8(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function T8(s){return typeof s=="string"}const C_=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function A8(s){return s===void 0||C_(s)}function tf(s){return Object.prototype.toString.call(s)==="[object Object]"}function R8(s,t){switch(s){case Pt.CONNECT:return t===void 0||tf(t);case Pt.DISCONNECT:return t===void 0;case Pt.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&__.indexOf(t[0])===-1);case Pt.ACK:return Array.isArray(t);case Pt.CONNECT_ERROR:return typeof t=="string"||tf(t);default:return!1}}function w8(s){return T8(s.nsp)&&A8(s.id)&&R8(s.type,s.data)}const L8=Object.freeze(Object.defineProperty({__proto__:null,Decoder:wy,Encoder:S8,get PacketType(){return Pt},isPacketValid:w8,protocol:b8},Symbol.toStringTag,{value:"Module"}));function An(s,t,e){return s.on(t,e),function(){s.off(t,e)}}const _8=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class D_ extends Be{constructor(t,e,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[An(t,"open",this.onopen.bind(this)),An(t,"packet",this.onpacket.bind(this)),An(t,"error",this.onerror.bind(this)),An(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var n,i,a;if(_8.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const o={type:Pt.EVENT,data:e};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){const h=this.ids++,p=e.pop();this._registerAckCallback(h,p),o.id=h}const c=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,d=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!c||(d?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,e){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[t]=e;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);e.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(a),e.apply(this,c)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((n,i)=>{const a=(o,c)=>o?i(o):n(c);a.withError=!0,e.push(a),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(i)):(this._queue.shift(),e&&e(null,...a)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];
vendor: 7,629 bytes, line 182
182e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Pt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Pt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Pt.EVENT:case Pt.BINARY_EVENT:this.onevent(t);break;case Pt.ACK:case Pt.BINARY_ACK:this.onack(t);break;case Pt.DISCONNECT:this.ondisconnect();break;case Pt.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...i){n||(n=!0,e.packet({type:Pt.ACK,id:t,data:i}))}}onack(t){const e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Pt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}function Go(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}Go.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-e:s+e}return Math.min(s,this.max)|0};Go.prototype.reset=function(){this.attempts=0};Go.prototype.setMin=function(s){this.ms=s};Go.prototype.setMax=function(s){this.max=s};Go.prototype.setJitter=function(s){this.jitter=s};class e0 extends Be{constructor(t,e){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,Pf(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((n=e.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Go({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;const i=e.parser||L8;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new f8(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=An(e,"open",function(){n.onopen(),t&&t()}),a=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},o=An(e,"error",a);if(this._timeout!==!1){const c=this._timeout,d=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),e.close()},c);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(An(t,"ping",this.onping.bind(this)),An(t,"data",this.ondata.bind(this)),An(t,"error",this.onerror.bind(this)),An(t,"close",this.onclose.bind(this)),An(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){kf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new D_(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const n of e)if(this.nsps[n].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}
182cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ul={};function tc(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};const e=h8(s,t.path||"/socket.io"),n=e.source,i=e.id,a=e.path,o=Ul[i]&&a in Ul[i].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let d;return c?d=new e0(n,t):(Ul[i]||(Ul[i]=new e0(n,t)),d=Ul[i]),e.query&&!t.query&&(t.query=e.queryKey),d.socket(e.path,t)}Object.assign(tc,{Manager:e0,Socket:D_,io:tc,connect:tc});const C8=[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun1.l.google.com:19302"},{urls:"stun:stun2.l.google.com:19302"},{urls:"turn:openrelay.metered.ca:80",username:"openrelayproject",credential:"openrelayproject"},{urls:"turn:openrelay.metered.ca:443",username:"openrelayproject",credential:"openrelayproject"},{urls:"turns:openrelay.metered.ca:443",username:"openrelayproject",credential:"openrelayproject"},{urls:"turn:openrelay.metered.ca:80?transport=tcp",username:"openrelayproject",credential:"openrelayproject"}],I_={iceServers:C8,iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"},jl={FHD:{label:"FHD",desc:"1080p",width:1920,height:1080,frameRate:30},HD:{label:"HD",desc:"720p",width:1280,height:720,frameRate:30},"480p":{label:"480p",desc:"480p",width:854,height:480,frameRate:25}};function D8(){const[s,t]=$.useState(""),[e,n]=$.useState(!1),[i,a]=$.useState(""),[o,c]=$.useState(!1),[d,f]=$.useState(0),[h,p]=$.useState([]),[g,v]=$.useState(!1),[x,S]=$.useState(""),[E,T]=$.useState(!1),[L,_]=$.useState("HD"),[P,D]=$.useState(!1),B=$.useRef(null),C=$.useRef(null),I=$.useRef(null),F=$.useRef(new Map),U=$.useRef(j=>{const N=F.current.get(j);N&&(N.close(),F.current.delete(j));const V=new RTCPeerConnection(I_);return V.onicecandidate=X=>{X.candidate&&B.current&&B.current.emit("webrtc:ice-candidate",{candidate:X.candidate,targetId:j})},V.onconnectionstatechange=()=>{console.log(`[Admin WebRTC] Peer ${j} state: ${V.connectionState}`)},V.onicegatheringstatechange=()=>{console.log(`[Admin WebRTC] ICE gathering: ${V.iceGatheringState}`)},V.oniceconnectionstatechange=()=>{console.log(`[Admin WebRTC] ICE connection: ${V.iceConnectionState}`)},F.current.set(j,V),V}),z=async j=>{try{const N=j.getSenders().find(O=>O.track?.kind==="video");if(!N)return;const V=N.getParameters();(!V.encodings||V.encodings.length===0)&&(V.encodings=[{}]),V.encodings[0].maxBitrate=4e6,V.encodings[0].maxFramerate=30,await N.setParameters(V);const X=j.getSenders().find(O=>O.track?.kind==="audio");if(X){const O=X.getParameters();(!O.encodings||O.encodings.length===0)&&(O.encodings=[{}]),O.encodings[0].maxBitrate=128e3,await X.setParameters(O)}}catch{}};$.useEffect(()=>{const j=tc({path:"/api/socket.io",transports:["websocket","polling"]});return B.current=j,j.on("connect",()=>{console.log("[Admin] Socket connected:",j.id)}),j.on("admin:login:success",({isLive:N,viewerCount:V})=>{n(!0),c(N),f(V)}),j.on("admin:login:error",({message:N})=>{a(N)}),j.on("admin:stream-status",({isLive:N})=>{c(N)}),j.on("admin:viewer-joined",({name:N,viewerCount:V})=>{f(V),p(X=>[`â
${N} Ø§ÙØ¶Ù
ÙÙÙ
Ø´Ø§ÙØ¯Ø©`,...X.slice(0,19)])}),j.on("admin:viewer-left",({name:N,viewerCount:V})=>{f(V),p(X=>[`â ${N||"Ù
Ø´Ø§ÙØ¯"} غادر`,...X.slice(0,19)])}),j.on("admin:new-viewer-request",async({viewerId:N,viewerName:V})=>{if(console.log(`[Admin WebRTC] New viewer request: ${V} (${N})`),!I.current){console.warn("[Admin WebRTC] No local stream - cannot create offer");return}const X=I.current,O=U.current(N);
182X.getTracks().forEach(G=>{O.addTrack(G,X),console.log(`[Admin WebRTC] Added track: ${G.kind}`)});try{const G=await O.createOffer({offerToReceiveVideo:!1,offerToReceiveAudio:!1});await O.setLocalDescription(G),j.emit("webrtc:offer",{offer:G,targetId:N}),console.log(`[Admin WebRTC] Offer sent to ${N}`)}catch(G){console.error("[Admin WebRTC] Failed to create offer:",G)}}),j.on("webrtc:answer",async({answer:N,fromId:V})=>{const X=F.current.get(V);if(X)try{await X.setRemoteDescription(new RTCSessionDescription(N)),console.log(`[Admin WebRTC] Answer set for ${V}`),setTimeout(()=>z(X),500)}catch(O){console.error("[Admin WebRTC] Failed to set answer:",O)}}),j.on("webrtc:ice-candidate",async({candidate:N,fromId:V})=>{const X=F.current.get(V);if(X)try{await X.addIceCandidate(new RTCIceCandidate(N))}catch{}}),()=>{j.disconnect()}},[]);const Y=()=>{a(""),B.current?.emit("admin:login",{password:s})},nt=async()=>{S(""),T(!0);try{const j=jl[L],N=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment",width:{ideal:j.width},height:{ideal:j.height},frameRate:{ideal:j.frameRate}},audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,sampleRate:48e3,channelCount:2}});I.current=N,C.current&&(C.current.srcObject=N),v(!0),B.current?.emit("admin:start-stream"),console.log("[Admin] Stream started, tracks:",N.getTracks().length)}catch(j){console.error("[Admin] Camera error:",j),S("ØªØ¹Ø°ÙØ± اÙÙØµÙÙ ÙÙÙØ§Ù
ÙØ±Ø§. ØªØ£ÙØ¯ Ù
Ù Ù
ÙØ إذ٠اÙÙØ§Ù
ÙØ±Ø§ Ù٠اÙÙ
ØªØµÙØ.")}finally{T(!1)}},it=async()=>{if(!I.current)return;const V=I.current.getVideoTracks()[0]?.getSettings().facingMode==="user"?"environment":"user";try{const X=jl[L],O=await navigator.mediaDevices.getUserMedia({video:{facingMode:V,width:{ideal:X.width},height:{ideal:X.height},frameRate:{ideal:X.frameRate}},audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,sampleRate:48e3,channelCount:2}});I.current.getTracks().forEach(G=>G.stop()),I.current=O,C.current&&(C.current.srcObject=O),F.current.forEach(G=>{const K=G.getSenders();O.getTracks().forEach(J=>{const ot=K.find(ft=>ft.track?.kind===J.kind);ot&&ot.replaceTrack(J)})})}catch{}},rt=async j=>{if(!(!I.current||P)){D(!0);try{const N=jl[j],X=I.current.getVideoTracks()[0]?.getSettings().facingMode||"environment",O=await navigator.mediaDevices.getUserMedia({video:{facingMode:X,width:{ideal:N.width},height:{ideal:N.height},frameRate:{ideal:N.frameRate}},audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,sampleRate:48e3,channelCount:2}});I.current.getTracks().forEach(G=>G.stop()),I.current=O,C.current&&(C.current.srcObject=O),F.current.forEach(G=>{const K=G.getSenders();O.getTracks().forEach(J=>{const ot=K.find(ft=>ft.track?.kind===J.kind);ot&&ot.replaceTrack(J)})}),_(j)}catch{}finally{D(!1)}}},M=()=>{B.current?.emit("admin:stop-stream"),I.current?.getTracks().forEach(j=>j.stop()),I.current=null,C.current&&(C.current.srcObject=null),v(!1),F.current.forEach(j=>j.close()),F.current.clear()};return e?A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:347",className:"min-h-screen p-4 space-y-4",style:{background:"radial-gradient(ellipse at 50% 20%, oklch(0.12 0.05 230) 0%, oklch(0.05 0.02 240) 100%)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:349",className:"flex items-center justify-between",children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:350",children:[A.jsx("h1",{"data-loc":"client/src/pages/AdminStream.tsx:351",className:"text-xl font-black text-white",children:"ð¬ ÙÙØØ© تØÙÙ
Ø§ÙØ¨Ø«"}),A.jsx("p",{"data-loc":"client/src/pages/AdminStream.tsx:352",className:"text-xs text-muted-foreground",children:"Tadweer Sports 1"})]}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:354",className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-bold border ${o?"bg-red-600/20 text-red-400 border-red-500/40":"bg-secondary text-muted-foreground border-border"}`,children:[A.jsx("span",{"data-loc":"client/src/pages/AdminStream.tsx:355",className:`w-2 h-2 rounded-full ${o?"bg-red-500 animate-pulse":"bg-muted-foreground"}`}),o?"â Ø¨Ø« Ù
باشر":"Ù
تÙÙÙ"]})]}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:359",className:"grid grid-cols-2 gap-3",children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:360",className:"rounded-xl p-4 text-center",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:361",className:"text-4xl font-black text-primary",children:d}),A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:362",className:"text-xs text-muted-foreground mt-1",children:"Ù
Ø´Ø§ÙØ¯ Ø§ÙØ¢Ù"})]}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:364",className:"rounded-xl p-4 text-center",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:365",className:"text-4xl",children:o?"ð´":"â«"}),A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:366",className:"text-xs text-muted-foreground mt-1",children:o?"Ø§ÙØ¨Ø« Ø´ØºÙØ§Ù":"Ø§ÙØ¨Ø« Ù
تÙÙÙ"})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:369",className:"rounded-xl overflow-hidden",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:370",className:"relative bg-black",style:{aspectRatio:"16/9"},children:[A.jsx("video",{"data-loc":"client/src/pages/AdminStream.tsx:371",ref:C,autoPlay:!0,muted:!0,playsInl
182ine:!0,className:"w-full h-full object-cover"}),!g&&A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:373",className:"absolute inset-0 flex items-center justify-center bg-black",children:A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:374",className:"text-center",children:[A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:375",className:"text-6xl mb-3",children:"ð·"}),A.jsx("p",{"data-loc":"client/src/pages/AdminStream.tsx:376",className:"text-muted-foreground text-sm",children:'اضغط "ابدأ Ø§ÙØ¨Ø«" ÙØªØ´ØºÙ٠اÙÙØ§Ù
ÙØ±Ø§'})]})}),o&&A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:381",className:"absolute top-3 right-3 bg-red-600 text-white text-xs font-black px-3 py-1 rounded-full animate-pulse",children:"â LIVE"}),g&&o&&A.jsx("button",{"data-loc":"client/src/pages/AdminStream.tsx:384",onClick:it,className:"absolute bottom-3 left-3 bg-black/60 text-white text-xs font-bold px-3 py-1.5 rounded-full border border-white/20",children:"ð ØªØ¨Ø¯Ù٠اÙÙØ§Ù
ÙØ±Ø§"})]}),x&&A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:391",className:"px-4 py-3 text-red-400 text-sm font-bold bg-red-500/10 border-t border-red-500/30 text-center",children:["â ï¸ ",x]})]}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:395",className:"rounded-xl p-4",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:396",className:"text-xs font-black text-muted-foreground mb-3 flex items-center gap-2",children:["ð¡ Ø¬Ùدة Ø§ÙØ¨Ø«",o&&A.jsx("span",{"data-loc":"client/src/pages/AdminStream.tsx:398",className:"text-primary text-xs",children:"(Ø§ÙØªØºÙÙØ± ÙÙØ·Ø¨ÙÙÙ ÙÙØ±Ø§Ù)"})]}),A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:400",className:"grid grid-cols-3 gap-2",children:Object.keys(jl).map(j=>{const N=jl[j],V=L===j;return A.jsxs("button",{"data-loc":"client/src/pages/AdminStream.tsx:405",onClick:()=>o?rt(j):_(j),disabled:P,className:"flex flex-col items-center py-3 rounded-xl font-black text-sm transition-all active:scale-95 disabled:opacity-50",style:{background:V?"linear-gradient(135deg, oklch(0.45 0.15 220), oklch(0.35 0.12 240))":"oklch(0.14 0.05 230)",border:V?"2px solid oklch(0.58 0.18 220)":"1px solid oklch(0.25 0.06 220)",color:V?"#fff":"oklch(0.65 0.08 220)",boxShadow:V?"0 0 15px oklch(0.58 0.18 220 / 0.4)":"none"},children:[A.jsx("span",{"data-loc":"client/src/pages/AdminStream.tsx:417",className:"text-base font-black",children:N.label}),A.jsx("span",{"data-loc":"client/src/pages/AdminStream.tsx:418",className:"text-xs opacity-70",children:N.desc})]},j)})}),P&&A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:424",className:"text-center text-xs text-primary mt-2 animate-pulse",children:"Ⳡجار٠تغÙÙØ± Ø§ÙØ¬Ùدة..."})]}),o?A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:437",className:"space-y-3",children:[A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:438",className:"w-full py-4 rounded-2xl text-center font-black text-lg text-white animate-pulse",style:{background:"linear-gradient(135deg, #dc2626 0%, #991b1b 100%)",border:"1px solid rgba(220,38,38,0.4)"},children:"ð´ Ø§Ùبث Ù
باشر Ø§ÙØ¢Ù"}),A.jsx("button",{"data-loc":"client/src/pages/AdminStream.tsx:442",onClick:M,className:"w-full py-3 rounded-xl font-bold text-red-400 border border-red-500/40 hover:bg-red-500/10 text-base",style:{background:"oklch(0.1 0.04 230)"},children:"⹠إÙÙØ§Ù Ø§ÙØ¨Ø«"})]}):A.jsx("button",{"data-loc":"client/src/pages/AdminStream.tsx:429",onClick:nt,disabled:E,className:"w-full font-black py-5 rounded-2xl text-xl text-white flex items-center justify-center gap-3 disabled:opacity-60",style:{background:"linear-gradient(135deg, #dc2626 0%, #991b1b 100%)",boxShadow:"0 0 40px rgba(220,38,38,0.5)",border:"1px solid rgba(220,38,38,0.4)"},children:E?A.jsxs(A.Fragment,{children:[A.jsx("span",{"data-loc":"client/src/pages/AdminStream.tsx:433",className:"w-5 h-5 border-2 border-white/40 border-t-white rounded-full animate-spin"}),"Ø¬Ø§Ø±Ù Ø§ÙØªØ´ØºÙÙ..."]}):A.jsx(A.Fragment,{children:"ð´ Ø§Ø¨Ø¯Ø£ Ø§ÙØ¨Ø« اÙÙ
باشر"})}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:449",className:"rounded-xl p-4 text-center",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsx("p",{"data-loc":"client/src/pages/AdminStream.tsx:450",className:"text-xs text-muted-foreground mb-1",children:"رابط اÙÙ
Ø´Ø§ÙØ¯Ø© ÙÙØ¬Ù
ÙÙØ±"}),A.jsxs("p",{"data-loc":"client/src/pages/AdminStream.tsx:451",className:"text-sm font-bold text-primary",children:[window.location.origin,"/live"]})]}),h.length>0&&A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:454",className:"rounded-xl p-4",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsx("h3",{"data-loc":"client/src/pages/AdminStream.tsx:455",className:"text-sm font-black text-foreground mb-3",children:"ð Ø³Ø¬Ù Ø§ÙÙ
Ø´Ø§ÙØ¯ÙÙ"}),A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:456",className:"space-y-1 max-h-40 overflow-y-auto",children:h.map((j,N)=>A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:458",className:"text-xs text-muted-foreground py-1.5 border-b border-border/50 last:border-0",children:j},N))})]})]}):A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:300",className:"min-h-screen flex items-center justify-center p-4",style:{background:"radial-gradient(ellipse at 50% 40%, oklch(0.12 0.05 230) 0%, oklch(0.05 0.02 240) 100%)"},children:A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:302",className:"w-full max-w-sm",children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:303",className:"text-center mb-8",children:[A.jsx("div",{"data-loc":"client/src/pages/AdminStream.tsx:304",className:"inline-flex items-center justify-center w-24 h-24 rounded-2xl bg-black border-2 border-primary mx-auto mb-4",style:{boxShadow:"0 0 40px oklch(0.58 0.18 220 / 0.5)"},children:A.jsxs("svg",{"data-loc":"client/src/pages/AdminStream.tsx:306",viewBox:"0 0 100 100",className:"w-16 h-16",children:[A.jsx("rect",{"data-loc":"client/src/pages/AdminStream.tsx:307",width:"100",height:"100",fill:"#000",rx:"8"}),A.jsx("text",{"data-loc":"client/src/pages/AdminStream.tsx:308",x:"50",y:"30",textAnchor:"middle",fill:"#00a0e3",fontSize:"14",fontWeight:"900",fontFamily:"Arial",children:"TADWEER"}),A.jsx("text",{"data-loc":"client/src/pages/AdminStream.tsx:309",x:"50",y:"50",textAnchor:"middle",fill:"#ffffff",fontSize:"12",fontWeight:"700",fontFamily:"Arial",children:"SPORTS"}),A.jsx("text",{"data-loc":"client/src/pages/AdminStream.tsx:310",x:"50",y:"72",textAnchor:"middle",fill:"#00a0e3",fontSize:"20",fontWeight:"900",fontFamily:"Arial",children:"1"}),A.jsx("rect",{"data-loc":"client/src/pages/AdminStream.tsx:311",x:"8",y:"78",width:"84",height:"2.5",fill:"#00a0e3",rx:"1"})]})}),A.jsx("h1",{"data-loc":"client/src/pages/AdminStream.tsx:314",className:"text-2xl font-black text-white mb-1",children:"ÙÙØØ© تØÙÙ
Ø§ÙØ¨Ø«"}),A.jsx("p",{"data-loc":"client/src/pages/AdminStream.tsx:315",className:"text-sm text-muted-foreground",children:"Tadweer Sports 1 ⢠ÙÙÙ
Ø¯ÙØ± ÙÙØ·"})]}),A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:317",className:"rounded-2xl p-6 space-y-4",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.25 0.06 220)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:319",children:[A.jsx("label",{"data-loc":"client/src/pages/AdminStream.tsx:320",className:"text-sm font-bold text-foreground block mb-2 text-right",children:"ð ÙÙÙ
Ø© Ø§ÙØ³Ø±"}),A.jsx("input",{"data-loc":"client/src/pages/AdminStream.tsx:321",type:"password",value:s,onChange:j=>t(j.target.value),onKeyDown:j=>j.key==="Enter"&&Y(),placeholder:"أدخ٠ÙÙÙ
Ø© Ø§ÙØ³Ø±",className:"w-full rounded-xl px-4 py-4 text-foreground text-center text-2xl tracking-widest font-black focus:outline-none",style:{background:"oklch(0.15 0.04 230)",border:"1px solid oklch(0.35 0.08 220)"},autoFocus:!0})]}),i&&A.jsxs("div",{"data-loc":"client/src/pages/AdminStream.tsx:333",className:"text-red-400 text-sm text-center font-bold bg-red-500/10 border border-red-500/30 rounded-lg p-3",children:["â ",i]}),A.jsx("button",{"data-loc":"client/src/pages/AdminStream.tsx:335",onClick:Y,className:"w-full font-black py-4 rounded-xl text-lg text-white",style:{background:"linear-gradient(135deg, oklch(0.58 0.18 220) 0%, oklch(0.45 0.15 240) 100%)",boxShadow:"0 0 30px oklch(0.58 0.18 220 / 0.4)"},children:"دخÙÙ â"})]})]})})}function ld({size:s=40}){return A.jsxs("svg",{"data-loc":"client/src/pages/LiveWatch.tsx:17",viewBox:"0 0 100 100",width:s,height:s,children:[A.jsx("rect",{"data-loc":"client/src/pages/LiveWatch.tsx:18",width:"100",height:"100",fill:"#000",rx:"10"}),A.jsx("text",{"data-loc":"client/src/pages/LiveWatch.tsx:19",x:"50",y:"28",textAnchor:"middle",fill:"#00a0e3",fontSize:"14",fontWeight:"900",fontFamily:"Arial, sans-serif",letterSpacing:"1",children:"TADWEER"}),A.jsx("text",{"data-loc":"client/src/pages/LiveWatch.tsx:20",x:"50",y:"48",textAnchor:"middle",fill:"#ffffff",fontSize:"12",fontWeight:"700",fontFamily:"Arial, sans-serif",letterSpacing:"2",children:"SPORTS"}),A.jsx("text",{"data-loc":"client/src/pages/LiveWatch.tsx:21",x:"50",y:"72",textAnchor:"middle",fill:"#00a0e3",fontSize:"24",fontWeight:"900",fontFamily:"Arial, sans-serif",children:"1"}),A.jsx("rect",{"data-loc":"client/src/pages/LiveWatch.tsx:22",x:"8",y:"78",width:"84",height:"3",fill:"#00a0e3",rx:"1.5"})]})}function I8(){const[s,t]=$.useState(""),[e,n]=$.useState(!1),[i,a]=$.useState(!1),[o,c]=$.useState(0),[d,f]=$.useState(!1),[h,p]=$.useState([]),[g,v]=$.useState(""),[x,S]=$.useState(!1),[E,T]=$.useState(0),L=$.useRef(null),[_,P]=$.useState(!1),[D,B]=$.useState(!1),C=$.useRef(null),I=$.useRef(null),F=$.useRef(null),U=$.useRef(!1),z=$.useRef(""),Y=typeof window<"u"?`${window.location.origin}/live`:"",nt=V=>{U.current&&V.emit("viewer:request-stream")},it=V=>{F.current&&(F.current.close(),F.current=null);const X=new RTCPeerConnection(I_);return F.current=X,X.ontrack=O=>{I.current&&O.streams[0]&&(I.current.srcObject=O.streams[0],f(!0),I.current.play().catch(()=>{}))},X.onicecandidate=O=>{O.candidate&&V.emit("webrtc:ice-candidate",{candidate:O.candidate})},X.oniceconnectionstatechange=()=>{(X.iceConnectionState==="failed"||X.iceConnectionState==="disconnected")&&setTimeout(()=>nt(V),1500)},X};$.useEffect(()=>{const V=tc({path:"/api/socket.io",transports:["websocket","polling"]});return C.current=V,V.on("connect",()=>
182V.emit("stream:get-status")),V.on("stream:status",({isLive:X,viewerCount:O})=>{a(X),c(O),X&&U.current&&nt(V)}),V.on("viewer:joined",({isLive:X,viewerCount:O})=>{a(X),c(O),U.current=!0,X&&V.emit("viewer:request-stream")}),V.on("stream:started",()=>{a(!0),U.current&&V.emit("viewer:request-stream")}),V.on("stream:stopped",()=>{a(!1),f(!1),I.current&&(I.current.srcObject=null),F.current?.close(),F.current=null}),V.on("stream:not-live",()=>{}),V.on("webrtc:offer",async({offer:X,fromId:O})=>{const G=it(V);try{await G.setRemoteDescription(new RTCSessionDescription(X));const K=await G.createAnswer();await G.setLocalDescription(K),V.emit("webrtc:answer",{answer:K,targetId:O})}catch(K){console.error("[Viewer] Offer error:",K)}}),V.on("webrtc:ice-candidate",async({candidate:X})=>{if(F.current)try{await F.current.addIceCandidate(new RTCIceCandidate(X))}catch{}}),V.on("chat:message",X=>{p(O=>[...O.slice(-99),X]),T(O=>O+1)}),()=>{V.disconnect(),F.current?.close()}},[]),$.useEffect(()=>{x&&(T(0),L.current?.scrollIntoView({behavior:"smooth"}))},[h,x]);const rt=()=>{const V=s.trim();V&&(z.current=V,n(!0),C.current?.emit("viewer:join",{name:V}))},M=()=>{const V=g.trim();!V||!C.current||(C.current.emit("chat:message",{text:V}),v(""))},j=()=>{navigator.clipboard.writeText(Y).then(()=>{P(!0),setTimeout(()=>P(!1),2e3)})},N=[{name:"ÙØ§ØªØ³Ø§Ø¨",color:"#25D366",icon:"ð¬",url:`https://wa.me/?text=${encodeURIComponent(`ð´ Ø´Ø§Ùد Ø§ÙØ¨Ø« اÙ٠باشر - Tadweer Sports 1 183${Y}`)}`},{name:"تÙÙØªØ±",color:"#1DA1F2",icon:"ð¦",url:`https://twitter.com/intent/tweet?text=${encodeURIComponent("ð´ Ø´Ø§Ùد Ø§ÙØ¨Ø« اÙ٠باشر - Tadweer Sports 1")}&url=${encodeURIComponent(Y)}`},{name:"تÙÙÙØ¬Ø±Ø§Ù ",color:"#0088cc",icon:"âï¸",url:`https://t.me/share/url?url=${encodeURIComponent(Y)}&text=${encodeURIComponent("ð´ Ø´Ø§Ùد Ø§ÙØ¨Ø« اÙ٠باشر - Tadweer Sports 1")}`},{name:"ÙÙØ³Ø¨ÙÙ",color:"#1877F2",icon:"ð",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(Y)}`}];return e?A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:217",className:"fixed inset-0 bg-black flex flex-col",children:A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:220",className:"relative flex-1 bg-black overflow-hidden",children:[A.jsx("video",{"data-loc":"client/src/pages/LiveWatch.tsx:221",ref:I,autoPlay:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover",style:{display:d?"block":"none"}}),!d&&A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:231",className:"absolute inset-0 flex flex-col items-center justify-center gap-4",style:{background:"radial-gradient(ellipse at 50% 40%, oklch(0.1 0.05 230) 0%, oklch(0.04 0.02 240) 80%)"},children:i?A.jsxs(A.Fragment,{children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:235",className:"text-6xl animate-pulse",children:"ð¡"}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:236",className:"text-white font-black text-xl",children:"Ø¬Ø§Ø±Ù Ø§ÙØ§ØªØµØ§Ù..."}),A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:237",className:"flex gap-1.5 mt-2",children:[0,1,2].map(V=>A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:239",className:"w-2 h-2 rounded-full bg-primary animate-bounce",style:{animationDelay:`${V*.15}s`}},V))})]}):A.jsxs(A.Fragment,{children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:245",className:"opacity-60",children:A.jsx(ld,{"data-loc":"client/src/pages/LiveWatch.tsx:245",size:80})}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:246",className:"text-white font-black text-xl mt-2",children:"Tadweer Sports 1"}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:247",className:"text-muted-foreground text-sm",children:"Ø§ÙØ¨Ø« ØºÙØ± Ù ØªØ§Ø ØØ§ÙÙØ§Ù"}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:248",className:"text-xs text-muted-foreground/50",children:"Ø³ÙØ¸Ùر Ø§ÙØ¨Ø« تÙÙØ§Ø¦ÙØ§Ù Ø¹ÙØ¯ بدئÙ"})]})}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:255",className:"absolute top-0 left-0 right-0 flex items-center justify-between px-4 py-3 z-10",style:{background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:260",className:"flex items-center gap-2",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:261",className:"w-10 h-10 rounded-xl bg-black/80 border border-primary/50 flex items-center justify-center overflow-hidden",children:A.jsx(ld,{"data-loc":"client/src/pages/LiveWatch.tsx:262",size:36})}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:264",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:265",className:"text-white text-sm font-black leading-none",children:"Tadweer Sports 1"}),o>0&&A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:266",className:"text-white/60 text-xs",children:["ð¥ ",o," Ù Ø´Ø§ÙØ¯"]})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:271",className:"flex items-center gap-2",children:[A.jsxs("button",{"data-loc":"client/src/pages/LiveWatch.tsx:272",onClick:()=>B(!D),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-bold text-white transition-all active:scale-95",style:{background:"rgba(255,255,255,0.15)",backdropFilter:"blur(10px)",border:"1px solid rgba(255,255,255,0.2)"},children:[A.jsx(lF,{"data-loc":"client/src/pages/LiveWatch.tsx:277",size:13}),"Ù Ø´Ø§Ø±ÙØ©"]}),d&&A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:281",className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-black text-white",style:{background:"rgba(220,38,38,0.85)",backdropFilter:"blur(10px)"},children:[A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:283",className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),"LIVE"]})]})]}),d&&A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:292",className:"absolute bottom-16 left-4 z-10 flex items-center gap-2 px-3 py-1.5 rounded-xl",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)",border:"1px solid rgba(0,160,227,0.4)"},children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:296",className:"w-7 h-7 rounded-lg overflow-hidden bg-black flex-shrink-0",children:A.jsx(ld,{"data-loc":"client/src/pages/LiveWatch.tsx:297",size:28})}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:299",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:300",className:"text-white text-xs font-black leading-none",children:"Tadweer Sports"}),A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:301",className:"text-primary text-xs font-black leading-none",children:"1"})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:307",className:"absolute bottom-0 left-0 right-0 flex items-center justify-between px-4 py-3 z-10",style:{background:"linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:311",className:"flex items-center gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:312",className:"w-2 h-2 rounded-full bg-green-400 animate-pulse"}),A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:313",className:"text-white/80 text-sm font-bold",children:z.current})]}),A.jsxs("button",{"data-loc":"client/src/pages/LiveWatch.tsx:316",onClick:()=>{S(!x),T(0)},className:"relative flex items-center gap-1.5 px-3 py-2 rounded-xl text-sm font-bold text-white transition-all active:scale-95",style:{background:"rgba(255,255,255,0.15)",backdropFilter:"blur(10px)",border:"1px solid rgba(255,255,255,0.2)"},children:[A.jsx(VE,{"data-loc":"client/src/pages/LiveWatch.tsx:321",size:16}),"دردشة",E>0&&!x&&A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:324",className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-red-500 text-white text-xs flex items-center justify-center font-black",children:E>9?"9+":E})]})]}),D&&A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:333",className:"absolute top-14 right-4 left-4 sm:left-auto sm:w-80 rounded-2xl p-4 space-y-3 z-20",style:{background:"rgba(10,15,30,0.97)",border:"1px solid oklch(0.3 0.07 220)",backdropFilter:"blur(20px)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:337",className:"flex items-center justify-between",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:338",className:"text-sm font-black text-white",children:"شار٠رابط Ø§ÙØ¨Ø«"}),A.jsx("button",{"data-loc":"client/src/pages/LiveWatch.tsx:339",onClick:()=>B(!1),className:"text-muted-foreground hover:text-white",children:A.jsx(Cg,{"data-loc":"client/src/pages/LiveWatch.tsx:340",size:16})})]}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:343",className:"flex gap-2",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:344",className:"flex-1 text-xs text-muted-foreground px-3 py-2 rounded-xl truncate",style:{background:"oklch(0.07 0.03 230)",border:"1px solid oklch(0.2 0.05 220)"},children:Y}),A.jsxs("button",{"data-loc":"client/src/pages/LiveWatch.tsx:348",onClick:j,className:"flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-bold transition-all active:scale-95",style:{background:_?"oklch(0.35 0.12 145)":"oklch(0.2 0.06 220)",color:_?"#fff":"oklch(0.75 0.12 220)"},children:[_?A.jsx(eF,{"data-loc":"client/src/pages/LiveWatch.tsx:351",
183size:13}):A.jsx(nF,{"data-loc":"client/src/pages/LiveWatch.tsx:351",size:13}),_?"تÙ
!":"ÙØ³Ø®"]})]}),A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:355",className:"grid grid-cols-4 gap-2",children:N.map(V=>A.jsxs("a",{"data-loc":"client/src/pages/LiveWatch.tsx:357",href:V.url,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col items-center gap-1.5 py-2.5 rounded-xl text-xs font-bold text-white transition-opacity hover:opacity-80 active:scale-95",style:{background:V.color+"33",border:`1px solid ${V.color}66`},children:[A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:360",className:"text-xl",children:V.icon}),A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:361",style:{color:V.color},children:V.name})]},V.name))})]}),x&&A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:370",className:"absolute bottom-14 left-0 right-0 sm:left-auto sm:right-4 sm:w-80 flex flex-col z-20",style:{maxHeight:"50vh"},children:A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:374",className:"flex flex-col rounded-2xl overflow-hidden mx-3 sm:mx-0",style:{background:"rgba(8,12,25,0.95)",border:"1px solid oklch(0.25 0.06 220)",backdropFilter:"blur(20px)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:378",className:"flex items-center justify-between px-4 py-2.5 border-b border-white/10 flex-shrink-0",children:[A.jsxs("span",{"data-loc":"client/src/pages/LiveWatch.tsx:379",className:"text-sm font-black text-white flex items-center gap-2",children:[A.jsx(VE,{"data-loc":"client/src/pages/LiveWatch.tsx:380",size:14,className:"text-primary"}),"Ø§ÙØ¯Ø±Ø¯Ø´Ø© اÙÙ
باشرة"]}),A.jsx("button",{"data-loc":"client/src/pages/LiveWatch.tsx:383",onClick:()=>S(!1),className:"text-muted-foreground hover:text-white",children:A.jsx(Cg,{"data-loc":"client/src/pages/LiveWatch.tsx:384",size:14})})]}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:388",className:"overflow-y-auto p-3 space-y-2",style:{maxHeight:"30vh"},children:[h.length===0?A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:390",className:"flex flex-col items-center justify-center py-6 gap-2",children:[A.jsx("span",{"data-loc":"client/src/pages/LiveWatch.tsx:391",className:"text-2xl opacity-40",children:"ð¬"}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:392",className:"text-xs text-muted-foreground/60",children:"ÙØ§ ØªÙØ¬Ø¯ رسائ٠بعد"})]}):h.map(V=>A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:396",className:`flex gap-2 ${V.isAdmin?"flex-row-reverse":""}`,children:A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:397",className:"max-w-[85%] px-3 py-2 rounded-2xl text-sm",style:{background:V.isAdmin?"linear-gradient(135deg, oklch(0.45 0.15 220), oklch(0.35 0.12 240))":"oklch(0.14 0.05 230)",border:V.isAdmin?"none":"1px solid oklch(0.25 0.06 220)"},children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:406",className:`text-xs font-black mb-0.5 ${V.isAdmin?"text-blue-200":"text-primary"}`,children:V.name}),A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:409",className:"text-white leading-snug break-words",children:V.text})]})},V.id)),A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:414",ref:L})]}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:417",className:"flex gap-2 p-2 border-t border-white/10 flex-shrink-0",children:[A.jsx("input",{"data-loc":"client/src/pages/LiveWatch.tsx:418",type:"text",value:g,onChange:V=>v(V.target.value),onKeyDown:V=>V.key==="Enter"&&M(),placeholder:"Ø§ÙØªØ¨ Ø±Ø³Ø§ÙØ©...",maxLength:200,className:"flex-1 rounded-xl px-3 py-2.5 text-sm text-white focus:outline-none",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.28 0.07 220)"}}),A.jsx("button",{"data-loc":"client/src/pages/LiveWatch.tsx:428",onClick:M,disabled:!g.trim(),className:"w-10 h-10 rounded-xl flex items-center justify-center disabled:opacity-40 active:scale-95 transition-transform flex-shrink-0",style:{background:"linear-gradient(135deg, oklch(0.58 0.18 220), oklch(0.45 0.15 240))"},children:A.jsx(oF,{"data-loc":"client/src/pages/LiveWatch.tsx:434",size:15,className:"text-white",style:{transform:"scaleX(-1)"}})})]})]})})]})}):A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:164",className:"fixed inset-0 flex flex-col items-center justify-center",style:{background:"radial-gradient(ellipse at 50% 30%, oklch(0.14 0.06 230) 0%, oklch(0.04 0.02 240) 80%)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:168",className:"mb-8 flex flex-col items-center gap-3",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:169",className:"w-24 h-24 rounded-2xl bg-black border-2 border-primary/60 flex items-center justify-center",style:{boxShadow:"0 0 40px oklch(0.58 0.18 220 / 0.5)"},children:A.jsx(ld,{"data-loc":"client/src/pages/LiveWatch.tsx:171",size:72})}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:173",className:"text-center",children:[A.jsx("h1",{"data-loc":"client/src/pages/LiveWatch.tsx:174",className:"text-2xl font-black text-white",children:"Tadweer Sports 1"}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:175",className:"text-sm text-muted-foreground",children:"بطÙÙØ© تدÙÙØ± Ø§ÙØ¨Ùئة Ø§ÙØ£ÙÙÙØ©"})]})]}),A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:179",className:"w-full max-w-sm mx-4 rounded-3xl p-6 space-y-5",style:{background:"oklch(0.1 0.04 230 / 0.95)",border:"1px solid oklch(0.3 0.07 220)",backdropFilter:"blur(20px)"},children:[A.jsxs("div",{"data-loc":"client/src/pages/LiveWatch.tsx:183",className:"text-center",children:[A.jsx("div",{"data-loc":"client/src/pages/LiveWatch.tsx:184",className:"text-4xl mb-3",children:"ð"}),A.jsx("h2",{"data-loc":"client/src/pages/LiveWatch.tsx:185",className:"text-xl font-black text-white",children:"أدخ٠اسÙ
Ù"}),A.jsx("p",{"data-loc":"client/src/pages/LiveWatch.tsx:186",className:"text-xs text-muted-foreground mt-1",children:"ÙÙ
Ø´Ø§ÙØ¯Ø© Ø§ÙØ¨Ø« ÙØ§ÙÙ
Ø´Ø§Ø±ÙØ© ÙÙ Ø§ÙØ¯Ø±Ø¯Ø´Ø©"})]}),A.jsx("input",{"data-loc":"client/src/pages/LiveWatch.tsx:188",type:"text",value:s,onChange:V=>t(V.target.value),onKeyDown:V=>V.key==="Enter"&&rt(),placeholder:"اسÙ
Ù ÙÙØ§...",maxLength:30,className:"w-full rounded-2xl px-5 py-4 text-foreground text-center text-xl font-bold focus:outline-none",style:{background:"oklch(0.15 0.04 230)",border:"2px s
183olid oklch(0.35 0.08 220)"},autoFocus:!0}),A.jsx("button",{"data-loc":"client/src/pages/LiveWatch.tsx:199",onClick:rt,disabled:!s.trim(),className:"w-full text-white font-black py-4 rounded-2xl text-lg disabled:opacity-40 active:scale-[0.97] transition-transform",style:{background:"linear-gradient(135deg, oklch(0.58 0.18 220) 0%, oklch(0.45 0.15 240) 100%)",boxShadow:"0 0 40px oklch(0.58 0.18 220 / 0.5)"},children:"ðº Ø´Ø§Ùد Ø§ÙØ¨Ø« Ø§ÙØ¢Ù"})]})]})}const pt=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},O8=Number.isSafeInteger||function(s){return typeof s=="number"&&Math.abs(s)<=k8},k8=Number.MAX_SAFE_INTEGER||9007199254740991;let Tt=(function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s})({}),Z=(function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",s.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",s.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.ASSET_LIST_LOAD_ERROR="assetListLoadError",s.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",s.ASSET_LIST_PARSING_ERROR="assetListParsingError",s.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.ATTACH_MEDIA_ERROR="attachMediaError",s.UNKNOWN="unknown",s})({}),w=(function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.MEDIA_ENDED="hlsMediaEnded",s.STALL_RESOLVED="hlsStallResolved",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFERED_TO_END="hlsBufferedToEnd",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUp
183dated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",s.ASSET_LIST_LOADING="hlsAssetListLoading",s.ASSET_LIST_LOADED="hlsAssetListLoaded",s.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",s.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",s.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",s.INTERSTITIAL_STARTED="hlsInterstitialStarted",s.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",s.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",s.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",s.INTERSTITIAL_ENDED="hlsInterstitialEnded",s.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",s.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",s.EVENT_CUE_ENTER="hlsEventCueEnter",s})({});var Ft={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},yt={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class oo{constructor(t,e=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=n}sample(t,e){const n=Math.pow(this.alpha_,t);this.estimate_=e*(1-n)+n*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class P8{constructor(t,e,n,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_
vendor: 6,572 bytes, line 183
183=new oo(t),this.fast_=new oo(e),this.defaultTTFB_=i,this.ttfb_=new oo(t)}update(t,e){const{slow_:n,fast_:i,ttfb_:a}=this;n.halfLife!==t&&(this.slow_=new oo(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.fast_=new oo(e,i.getEstimate(),i.getTotalWeight())),a.halfLife!==t&&(this.ttfb_=new oo(t,a.getEstimate(),a.getTotalWeight()))}sample(t,e){t=Math.max(t,this.minDelayMs_);const n=8*e,i=t/1e3,a=n/i;this.fast_.sample(i,a),this.slow_.sample(i,a)}sampleTTFB(t){const e=t/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(n,Math.max(t,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function M8(s,t,e){return(t=B8(t))in s?Object.defineProperty(s,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):s[t]=e,s}function se(){return se=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(s[n]=e[n])}return s},se.apply(null,arguments)}function hA(s,t){var e=Object.keys(s);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(s);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),e.push.apply(e,n)}return e}function Qt(s){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?hA(Object(e),!0).forEach(function(n){M8(s,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(e)):hA(Object(e)).forEach(function(n){Object.defineProperty(s,n,Object.getOwnPropertyDescriptor(e,n))})}return s}function N8(s,t){if(typeof s!="object"||!s)return s;var e=s[Symbol.toPrimitive];if(e!==void 0){var n=e.call(s,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function B8(s){var t=N8(s,"string");return typeof t=="symbol"?t:t+""}class mn{constructor(t,e){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${t}]:`;this.trace=dr,this.debug=e.debug.bind(null,n),this.log=e.log.bind(null,n),this.warn=e.warn.bind(null,n),this.info=e.info.bind(null,n),this.error=e.error.bind(null,n)}}const dr=function(){},F8={trace:dr,debug:dr,log:dr,warn:dr,info:dr,error:dr};function s0(){return se({},F8)}function U8(s,t){const e=self.console[s];return e?e.bind(self.console,`${t?"["+t+"] ":""}[${s}] >`):dr}function mA(s,t,e){return t[s]?t[s].bind(t):U8(s,e)}const n0=s0();function j8(s,t,e){const n=s0();if(typeof console=="object"&&s===!0||typeof s=="object"){const i=["debug","log","info","warn","error"];i.forEach(a=>{n[a]=mA(a,s,e)});try{n.log(`Debug logs enabled for "${t}" in hls.js version 1.6.17`)}catch{return s0()}i.forEach(a=>{n0[a]=mA(a,s)})}else se(n0,n);return n}const Xt=n0;function Tr(s=!0){return typeof self>"u"?void 0:(s||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function $8(s){return typeof self<"u"&&s===self.ManagedMediaSource}function O_(s,t){const e=Object.keys(s),n=Object.keys(t),i=e.length,a=n.length;return!i||!a||i===a&&!e.some(o=>n.indexOf(o)===-1)}function qs(s,t=!1){if(typeof TextDecoder<"u"){const f=new TextDecoder("utf-8").decode(s);if(t){const h=f.indexOf("\0");return h!==-1?f.substring(0,h):f}return f.replace(/\0/g,"")}const e=s.length;let n,i,a,o="",c=0;for(;c<e;){if(n=s[c++],n===0&&t)return o;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(n);break;case 12:case 13:i=s[c++],o+=String.fromCharCode((n&31)<<6|i&63);break;case 14:i=s[c++],a=s[c++],o+=String.fromCharCode((n&15)<<12|(i&63)<<6|(a&63)<<0);break}}return o}function ss(s){let t="";for(let e=0;e<s.length;e++){let n=s[e].toString(16);n.length<2&&(n="0"+n),t+=n}return t}function k_(s){return Uint8Array.from(s.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function V8(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Dp={exports:{}},pA;function G8(){return pA||(pA=1,(function(s,t){(function(e){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(d,f,h){if(h=h||{},d=d.trim(),f=f.trim(),!f){if(!h.alwaysNormalize)return d;var p=c.parseURL(d);if(!p)throw new Error("Error trying to parse base URL.");return p.path=c.normalizePath(p.path),c.buildURLFromParts(p)}var g=c.parseURL(f);if(!g)throw new Error("Error trying to parse relative URL.");if(g.scheme)return h.alwaysNormalize?(g.path=c.normalizePath(g.path),c.buildURLFromParts(g)):f;var v=c.parseURL(d);if(!v)throw new Error("Error trying to parse base URL.");if(!v.netLoc&&v.path&&v.path[0]!=="/"){var x=i.exec(v.path);v.netLoc=x[1],v.path=x[2]}v.netLoc&&!v.path&&(v.path="/");var S={scheme:v.scheme,netLoc:g.netLoc,path:null,params:g.params,query:g.query,fragment:g.fragment};if(!g.netLoc&&(S.netLoc=v.netLoc,g.path[0]!=="/"))if(!g.path)S.path=v.path,g.params||(S.params=v.params,g.query||(S.query=v.query));else{var E=v.path,T=E.substring(0,E.lastIndexOf("/")+1)+g.path;S.path=c.normalizePath(T)}return S.path===null&&(S.path=h.alwaysNormalize?c.normalizePath(g.path):g.path),c.buildURLFromParts(S)},parseURL:function(d){var f=n.exec(d);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(d){for(d=d.split("").reverse().join("").replace(a,"");d.length!==(d=d.replace(o,"")).length;);return d.split("").reverse().join("")},buildURLFromParts:function(d){return d.scheme+d.netLoc+d.path+d.params+d.query+d.fragment}};s.exports=c})()})(Dp)),Dp.exports}var Ly=G8();class _y{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ie={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class P_{constructor(t){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof t=="string"&&(t={url:t}),this.base=t,z8(this,"stats")}
vendor: 16,810 bytes, line 183
183setByteRange(t,e){const n=t.split("@",2);let i;n.length===1?i=e?.byteRangeEndOffset||0:i=parseInt(n[1]),this._byteRange=[i,parseInt(n[0])+i]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[ie.AUDIO]:null,[ie.VIDEO]:null,[ie.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new _y),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Ly.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[ie.AUDIO]=null,t[ie.VIDEO]=null,t[ie.AUDIOVIDEO]=null}}function _e(s){return s.sn!=="initSegment"}class Ip extends P_{constructor(t,e){super(e),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=t}get byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange.length){const t=this.byteRange[0],e=this.byteRange[1];if(pt(t)&&pt(e))return e-t}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=t}get decryptdata(){var t;const{levelkeys:e}=this;if(!e||e.NONE)return null;if(e.identity)this._decryptdata||(this._decryptdata=e.identity.getDecryptData(this.sn));else if(!((t=this._decryptdata)!=null&&t.keyId)){const n=Object.keys(e);if(n.length===1){const i=this._decryptdata=e[n[0]]||null;i&&(this._decryptdata=i.getDecryptData(this.sn,e))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const t=pt(this.duration)?this.duration:0;return this.programDateTime+t*1e3}get encrypted(){var t;if((t=this._decryptdata)!=null&&t.encrypted)return!0;if(this.levelkeys){var e;const n=Object.keys(this.levelkeys),i=n.length;if(i>1||i===1&&(e=this.levelkeys[n[0]])!=null&&e.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){if(!pt(t)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=t}get ref(){return _e(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}setKeyFormat(t){const e=this.levelkeys;if(e){var n;const i=e[t];i&&!((n=this._decryptdata)!=null&&n.keyId)&&(this._decryptdata=i.getDecryptData(this.sn,e))}}abortRequests(){var t,e;(t=this.loader)==null||t.abort(),(e=this.keyLoader)==null||e.abort()}setElementaryStreamInfo(t,e,n,i,a,o=!1){const{elementaryStreams:c}=this,d=c[t];if(!d){c[t]={startPTS:e,endPTS:n,startDTS:i,endDTS:a,partial:o};return}d.startPTS=Math.min(d.startPTS,e),d.endPTS=Math.max(d.endPTS,n),d.startDTS=Math.min(d.startDTS,i),d.endDTS=Math.max(d.endDTS,a)}}class H8 extends P_{constructor(t,e,n,i,a){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=i;const o=t.enumeratedString("BYTERANGE");o&&this.setByteRange(o,a),a&&(this.fragOffset=a.fragOffset+a.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}function M_(s,t){const e=Object.getPrototypeOf(s);if(e){const n=Object.getOwnPropertyDescriptor(e,t);return n||M_(e,t)}}function z8(s,t){const e=M_(s,t);e&&(e.enumerable=!0,Object.defineProperty(s,t,e))}const gA=Math.pow(2,32)-1,K8=[].push,N_={video:1,audio:2,id3:3,text:4};function $e(s){return String.fromCharCode.apply(null,s)}function B_(s,t){const e=s[t]<<8|s[t+1];return e<0?65536+e:e}function _t(s,t){const e=F_(s,t);return e<0?4294967296+e:e}function yA(s,t){let e=_t(s,t);return e*=Math.pow(2,32),e+=_t(s,t+4),e}function F_(s,t){return s[t]<<24|s[t+1]<<16|s[t+2]<<8|s[t+3]}function q8(s){const t=s.byteLength;for(let e=0;e<t;){const n=_t(s,e);if(n>8&&s[e+4]===109&&s[e+5]===111&&s[e+6]===111&&s[e+7]===102)return!0;e=n>1?e+n:t}return!1}function Bt(s,t){const e=[];if(!t.length)return e;const n=s.byteLength;for(let i=0;i<n;){const a=_t(s,i),o=$e(s.subarray(i+4,i+8)),c=a>1?i+a:n;if(o===t[0])if(t.length===1)e.push(s.subarray(i+8,c));else{const d=Bt(s.subarray(i+8,c),t.slice(1));d.length&&K8.apply(e,d)}i=c}return e}function Y8(s){const t=[],e=s[0];let n=8;const i=_t(s,n);n+=4;let a=0,o=0;e===0?(a=_t(s,n),o=_t(s,n+4),n+=8):(a=yA(s,n),o=yA(s,n+8),n+=16),n+=2;let c=s.length+o;const d=B_(s,n);n+=2;for(let f=0;f<d;f++){let h=n;const p=_t(s,h);h+=4;const g=p&2147483647;if((p&2147483648)>>>31===1)return Xt.warn("SIDX has hierarchical references (not supported)"),null;const x=_t(s,h);h+=4,t.push({referenceSize:g,subsegmentDuration:x,info:{duration:x/i,start:c,end:c+g-1}}),c+=g,h+=4,n=h}return{earliestPresentationTime:a,timescale:i,version:e,referencesCount:d,references:t}}function U_(s){const t=[],e=Bt(s,["moov","trak"]);for(let i=0;i<e.length;i++){const a=e[i],o=Bt(a,["tkhd"])[0];if(o){let c=o[0];const d=_t(o,c===0?12:20),f=Bt(a,["mdia","mdhd"])[0];if(f){c=f[0];const h=_t(f,c===0?12:20),p=Bt(a,["mdia","hdlr"])[0];if(p){const g=$e(p.subarray(8,12)),v={soun:ie.AUDIO,vide:ie.VIDEO}[g],x=Bt(a,["mdia","minf","stbl","stsd"])[0],S=W8(x);v?(t[d]={timescale:h,type:v,stsd:S},t[v]=Qt({timescale:h,id:d},S)):t[d]={timescale:h,type:g,stsd:S}}}}}return Bt(s,["moov","mvex","trex"]).forEach(i=>{const a=_t(i,4),o=t[a];o&&(o.default={duration:_t(i,12),flags:_t(i,20)})}),t}function W8(s){const t=s.subarray(8),e=t.subarray(86),n=$e(t.subarray(4,8));let i=n,a;const o=n==="enca"||n==="encv";if(o){const f=Bt(t,[n])[0].subarray(n==="enca"?28:78);Bt(f,["sinf"]).forEach(p=>{const g=Bt(p,["schm"])[0];if(g){const v=$e(g.subarray(4,8));if(v==="cbcs"||v==="cenc"){const x=Bt(p,["frma"])[0];x&&(i=$e(x))}}})}const c=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const d=Bt(e,["avcC"])[0];d&&d.length>3&&(i+="."+ud(d[1])+ud(d[2])+ud(d[3]),a=cd(c==="avc1"?"dva1":"dvav",e));break}case"mp4a":{const d=Bt(t,[n])[0],f=Bt(d.subarray(28),["esds"])[0];if(f&&f.length>7){let h=4;if(f[h++]!==3)break;h=Op(f,h),h+=2;const p=f[h++];if(p&128&&(h+=2),p&64&&(h+=f[h++]),f[h++]!==4)break;h=Op(f,h);const g=f[h++];if(g===64)i+="."+ud(g);else break;if(h+=12,f[h++]!==5)break;h=Op(f,h);const v=f[h++];let x=(v&248)>>3;x===31&&(x+=1+((v&7)<<3)+((f[h]&224)>>5)),i+="."+x}break}case"hvc1":case"hev1":{const d=Bt(e,["hvcC"])[0];if(d&&d.length>12){const f=d[1],h=["","A","B","C"][f>>6],p=f&31,g=_t(d,2),v=(f&32)>>5?"H":"L",x=d[12],S=d.subarray(6,12);i+="."+h+p,i+="."+Q8(g).toString(16).toUpperCase(),i+="."+v+x;let E="";for(let T=S.length;T--;){const L=S[T];(L||E)&&(E="."+L.toString(16).toUpperCase()+E)}i+=E}a=cd(c=="hev1"?"dvhe":"dvh1",e);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=cd(i,e)||i;break}case"vp09":{const d=Bt(e,["vpcC"])[0];if(d&&d.length>6){const f=d[4],h=d[5],p=d[6]>>4&15;i+="."+jn(f)+"."+jn(h)+"."+jn(p)}break}case"av01":{const d=Bt(e,["av1C"])[0];if(d&&d.length>2){const f=d[1]>>>5,h=d[1]&31,p=d[2]>>>7?"H":"M",g=(d[2]&64)>>6,v=(d[2]&32)>>5,x=f===2&&g?v?12:10:g?10:8,S=(d[2]&16)>>4,E=(d[2]&8)>>3,T=(d[2]&4)>>2,L=d[2]&3;i+="."+f+"."+jn(h)+p+"."+jn(x)+"."+S+"."+E+T+L+"."+jn(1)+"."+jn(1)+"."+jn(1)+"."+0,a=cd("dav1",e)}break}}return{codec:i,encrypted:o,supplemental:a}}function cd(s,t){const e=Bt(t,["dvvC"]),n=e.length?e[0]:Bt(t,["dvcC"])[0];if(n){const i=n[2]>>1&127,a=n[2]<<5&32|n[3]>>3&31;return s+"."+jn(i)+"."+jn(a)}}function Q8(s){let t=0;for(let e=0;e<32;e++)t|=(s>>e&1)<<31-e;return t>>>0}function Op(s,t){const e=t+5;for(;s[t++]&128&&t<e;);return t}function ud(s){return("0"+s.toString(16).toUpperCase()).slice(-2)}function jn(s){return(s<10?"0":"")+s}function X8(s,t){if(!s||!t)return;const e=t.keyId;e&&t.isCommonEncryption&&j_(s,(n,i)=>{const a=n.subarray(8,24);a.some(o=>o!==0)||(Xt.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${ss(a)} -> ${ss(e)}`),n.set(e,8))})}function Z8(s){const t=[];return j_(s,e=>t.push(e.subarray(8,24))),t}function j_(s,t){Bt(s,["moov","trak"]).forEach(n=>{const i=Bt(n,["mdia","minf","stbl","stsd"])[0];if(!i)return;const a=i.subarray(8);let o=Bt(a,["enca"]);const c=o.length>0;c||(o=Bt(a,["encv"])),o.forEach(d=>{const f=c?d.subarray(28):d.subarray(78);Bt(f,["sinf"]).forEach(p=>{const g=$_(p);g&&t(g,c)})})})}function $_(s){const t=Bt(s,["schm"])[0];if(t){const e=$e(t.subarray(4,8));if(e==="cbcs"||e==="cenc"){const n=Bt(s,["schi","tenc"])[0];if(n)return n}}}function J8(s,t,e){const n={},i=Bt(s,["moof","traf"]);for(let a=0;a<i.length;a++){const o=i[a],c=Bt(o,["tfhd"])[0],d=_t(c,4),f=t[d];if(!f)continue;n[d]||(n[d]={start:NaN,duration:0,sampleCount:0,timescale:f.timescale,type:f.type});const h=n[d],p=Bt(o,["tfdt"])[0];if(p){const _=p[0];let P=_t(p,4);_===1&&(P===gA?e.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(P*=gA+1,P+=_t(p,8))),pt(P)&&(!pt(h.start)||P<h.start)&&(h.start=P)}const g=f.default,v=_t(c,0)|g?.flags;let x=g?.duration||0;v&8&&(v&2?x=_t(c,12):x=_t(c,8));const S=Bt(o,["trun"]);let E=h.start||0,T=0,L=x;for(let _=0;_<S.length;_++){const P=S[_],D=_t(P,4),B=h.sampleCount;h.sampleCount+=D;const C=P[3]&1,I=P[3]&4,F=P[2]&1,U=P[2]&2,z=P[2]&4,Y=P[2]&8;let nt=8,it=D;for(C&&(nt+=4),I&&D&&(!(P[nt+1]&1)&&h.keyFrameIndex===void 0&&(h.keyFrameIndex=B),nt+=4,F?(L=_t(P,nt),nt+=4):L=x,U&&(nt+=4),Y&&(nt+=4),E+=L,T+=L,it--);it--;)F?(L=_t(P,nt),nt+=4):L=x,U&&(nt+=4),z&&(P[nt+1]&1||h.keyFrameIndex===void 0&&(h.keyFrameIndex=h.sampleCount-(it+1),h.keyFrameStart=E),nt+=4),Y&&(nt+=4),E+=L,T+=L;!T&&x&&(T+=x*D)}h.duration+=T}if(!Object.keys(n).some(a=>n[a].duration)){let a=1/0,o=0;const c=Bt(s,["sidx"]);for(let d=0;d<c.length;d++){const f=Y8(c[d]);if(f!=null&&f.references){a=Math.min(a,f.earliestPresentationTime/f.timescale);const h=f.references.reduce((p,g)=>p+g.info.duration||0,0);o=Math.max(o,h+f.earliestPresentationTime/f.timescale)}}o&&pt(o)&&Object.keys(n).forEach(d=>{n[d].duration||(n[d].duration=o*n[d].timescale-n[d].start)})}return n}function t$(s){const t={valid:null,remainder:null},e=Bt(s,["moof"]);if(e.length<2)return t.remainder=s,t;const n=e[e.length-1];return t.valid=s.slice(0,n.byteOffset-8),t.remainder=s.slice(n.byteOffset-8),t}function hn(s,t){const e=new Uint8Array(s.length+t.length);return e.set(s),e.set(t,s.length),e}function vA(s,t){const e=[],n=t.samples,i=t.timescale,a=t.id;let o=!1;return Bt(n,["moof"]).map(d=>{const f=d.byteOffset-8;Bt(d,["traf"]).map(p=>{const g=Bt(p,["tfdt"]).map(v=>{const x=v[0];let S=_t(v,4);return x===1&&(S*=Math.pow(2,32),S+=_t(v,8)),S/i})[0];return g!==void 0&&(s=g),Bt(p,["tfhd"]).map(v=>{const x=_t(v,4),S=_t(v,0)&16777215,E=(S&1)!==0,T=(S&2)!==0,L=(S&8)!==0;let _=0;const P=(S&16)!==0;let D=0;const B=(S&32)!==0;let C=8;x===a&&(E&&(C+=8),T&&(C+=4),L&&(_=_t(v,C),C+=4),P&&(D=_t(v,C),C+=4),B&&(C+=4),t.type==="video"&&(o=Mf(t.codec)),Bt(p,["trun"]).map(I=>{const F=I[0],U=_t(I,0)&16777215,z=(U&1)!==0;let Y=0;const nt=(U&4)!==0,it=(U&256)!==0;let rt=0;const M=(U&512)!==0;let j=0;const N=(U&1024)!==0,V=(U&2048)!==0;let X=0;const O=_t(I,4);let G=8;z&&(Y=_t(I,G),G+=4),nt&&(G+=4);let K=Y+f;for(let J=0;J<O;J++){if(it?(rt=_t(I,G),G+=4):rt=_,M?(j=_t(I,G),G+=4):j=D,N&&(G+=4),V&&(F===0?X=_t(I,G):X=F_(I,G),G+=4),t.type===ie.VIDEO){let ot=0;for(;ot<j;){const ft=_t(n,K);if(K+=4,e$(o,n[K])){const ht=n.subarray(K,K+ft);Cy(ht,o?2:1,s+X/i,e)}K+=ft,ot+=ft+4}}s+=rt/i}}))})})}),e}function Mf(s){if(!s)return!1;const t=s.substring(0,4);return t==="hvc1"||t==="hev1"||t==="dvh1"||t==="dvhe"}function e$(s,t){if(s){const e=t>>1&63;return e===39||e===40}else return(t&31)===6}function Cy(s,t,e,n){const i=V_(s);let a=0;a+=t;let o=0,c=0,d=0;for(;a<i.length;){o=0;do{if(a>=i.length)break;d=i[a++],o+=d}while(d===255);c=0;do{if(a>=i.length)break;d=i[a++],c+=d}while(d===255);const f=i.length-a;let h=a;if(c<f)a+=c;else if(c>f){Xt.error(`Malformed SEI payload. ${c} is too small, only ${f} bytes left to parse.`);break}if(o===4){if(i[h++]===181){const g=B_(i,h);if(h+=2,g===49){const v=_t(i,h);if(h+=4,v===1195456820){const x=i[h++];if(x===3){const S=i[h++],E=31&S,T=64&S,L=T?2+E*3:0,_=new Uint8Array(L);if(T){_[0]=S;for(let P=1;P<L;P++)_[P]=i[h++]}n.push({type:x,payloadType:o,pts:e,bytes:_})}}}}}else if(o===5&&c>16){const p=[];for(let x=0;x<16;x++){const S=i[h++].toString(16);p.push(S.length==1?"0"+S:S),(x===3||x===5||x===7||x===9)&&p.push("-")}const g=c-16,v=new Uint8Array(g);for(let x=0;x<g;x++)v[x]=i[h++];n.push({payloadType:o,pts:e,uuid:p.join(""),userData:qs(v),userDataBytes:v})}}}function V_(s){const t=s.byteLength,e=[];let n=1;for(;n<t-2;)s[n]===0&&s[n+1]===0&&s[n+2]===3?(e.push(n+2),n+=2):n++;if(e.length===0)return s;const i=t-e.length,a=new Uint8Array(i);let o=0;for(n=0;n<i;o++,n++)o===e[0]&&(o++,e.shift()),a[n]=s[o];return a}function s$(s){const t=s[0];let e="",n="",i=0,a=0,o=0,c=0,d=0,f=0;if(t===0){for(;$e(s.subarray(f,f+1))!=="\0";)e+=$e(s.subarray(f,f+1)),f+=1;for(e+=$e(s.subarray(f,f+1)),f+=1;$e(s.subarray(f,f+1))!=="\0";)n+=$e(s.subarray(f,f+1)),f+=1;n+=$e(s.subarray(f,f+1)),f+=1,i=_t(s,12),a=_t(s,16),c=_t(s,20),d=_t(s,24),f=28}else if(t===1){f+=4,i=_t(s,f),f+=4;const p=_t(s,f);f+=4;const g=_t(s,f);for(f+=4,o=2**32*p+g,O8(o)||(o=Number.MAX_SAFE_INTEGER,Xt.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),c=_t(s,f),f+=4,d=_t(s,f),f+=4;$e(s.subarray(f,f+1))!=="\0";)e+=$e(s.subarray(f,f+1)),f+=1;for(e+=$e(s.subarray(f,f+1)),f+=1;$e(s.subarray(f,f+1))!=="\0";)n+=$e(s.subarray(f,f+1)),f+=1;n+=$e(s.subarray(f,f+1)),f+=1}const h=s.subarray(f,s.byteLength);return{schemeIdUri:e,value:n,timeScale:i,presentationTime:o,presentationTimeDelta:a,eventDuration:c,id:d,payload:h}}function n$(s,...t){const e=t.length;let n=8,i=e;for(;i--;)n+=t[i].byteLength;const a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=n&255,a.set(s,4),i=0,n=8;i<e;i++)a.set(t[i],n),n+=t[i].byteLength;return a}function i$(s,t,e){if(s.byteLength!==16)throw new RangeError("Invalid system id");let n,i;n=0,i=new Uint8Array;let a;n>0?(a=new Uint8Array(4),t.length>0&&new DataView(a.buffer).setUint32(0,t.length,!1)):a=new Uint8Array;const o=new Uint8Array(4);return e.byteLength>0&&new DataView(o.buffer).setUint32(0,e.byteLength,!1),n$([112,115,115,104],new Uint8Array([n,0,0,0]),s,a,i,o,e)}function r$(s){const t=[];if(s instanceof ArrayBuffer){const e=s.byteLength;let n=0;for(;n+32<e;){const i=new DataView(s,n),a=a$(i);t.push(a),n+=a.size}}return t}function a$(s){const t=s.getUint32(0),e=s.byteOffset,n=s.byteLength;if(n<t)return{offset:e,size:n};if(s.getUint32(4)!==1886614376)return{offset:e,size:t};const a=s.getUint32(8)>>>24;if(a!==0&&a!==1)return{offset:e,size:t};const o=s.buffer,c=ss(new Uint8Array(o,e+12,16));let d=null,f=null,h=0;if(a===0)h=28;else{const g=s.getUint32(28);if(!g||n<32+g*16)return{offset:e,size:t};d=[];for(let v=0;v<g;v++)d.push(new Uint8Array(o,e+32+v*16,16));h=32+g*16}if(!h)return{offset:e,size:t};const p=s.getUint32(h);return t-32<p?{offset:e,size:t}:(f=new Uint8Array(o,e+h+4,p),{version:a,systemId:c,kids:d,data:f,offset:e,size:t})}const G_=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Po={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv
vendor: 4,347 bytes, line 183
18360:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Dy(s,t){const e=Po[t];return!!e&&!!e[s.slice(0,4)]}function xc(s,t,e=!0){return!s.split(",").some(n=>!Iy(n,t,e))}function Iy(s,t,e=!0){var n;const i=Tr(e);return(n=i?.isTypeSupported(bc(s,t)))!=null?n:!1}function bc(s,t){return`${t}/mp4;codecs=${s}`}function xA(s){if(s){const t=s.substring(0,4);return Po.video[t]}return 2}function ef(s){const t=G_();return s.split(",").reduce((e,n)=>{const a=t&&Mf(n)?9:Po.video[n];return a?(a*2+e)/(e?3:2):(Po.audio[n]+e)/(e?2:1)},0)}const kp={};function o$(s,t=!0){if(kp[s])return kp[s];const e={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[s];for(let i=0;i<e.length;i++){var n;if(Iy(e[i],"audio",t))return kp[s]=e[i],e[i];if(e[i]==="mp3"&&(n=Tr(t))!=null&&n.isTypeSupported("audio/mpeg"))return""}return s}const l$=/flac|opus|mp4a\.40\.34/i;function sf(s,t=!0){return s.replace(l$,e=>o$(e.toLowerCase(),t))}function c$(s,t){const e=[];if(s){const n=s.split(",");for(let i=0;i<n.length;i++)Dy(n[i],"video")||e.push(n[i])}return t&&e.push(t),e.join(",")}function Md(s,t){if(s&&(s.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(s)!==-1)&&(bA(s,"audio")||bA(s,"video")))return s;if(t){const e=t.split(",");if(e.length>1){if(s){for(let n=e.length;n--;)if(e[n].substring(0,4)===s.substring(0,4))return e[n]}return e[0]}}return t||s}function bA(s,t){return Dy(s,t)&&Iy(s,t)}function u$(s){const t=s.split(",");for(let e=0;e<t.length;e++){const n=t[e].split(".");n.length>2&&n[0]==="avc1"&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(",")}function d$(s){if(s.startsWith("av01.")){const t=s.split("."),e=["0","111","01","01","01","0"];for(let n=t.length;n>4&&n<10;n++)t[n]=e[n-4];return t.join(".")}return s}function SA(s){const t=Tr(s)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function i0(s){return s.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const f$={supported:!0,powerEfficient:!0,smooth:!0},h$={supported:!1,smooth:!1,powerEfficient:!1},H_={supported:!0,configurations:[],decodingInfoResults:[f$]};function z_(s,t){return{supported:!1,configurations:t,decodingInfoResults:[h$],error:s}}function m$(s,t,e,n,i,a){const o=s.videoCodec,c=s.audioCodec?s.audioGroups:null,d=a?.audioCodec,f=a?.channels,h=f?parseInt(f):d?1/0:2;let p=null;if(c!=null&&c.length)try{c.length===1&&c[0]?p=t.groups[c[0]].channels:p=c.reduce((g,v)=>{if(v){const x=t.groups[v];if(!x)throw new Error(`Audio track group ${v} not found`);Object.keys(x.channels).forEach(S=>{g[S]=(g[S]||0)+x.channels[S]})}return g},{2:0})}catch{return!0}return o!==void 0&&(o.split(",").some(g=>Mf(g))||s.width>1920&&s.height>1088||s.height>1920&&s.width>1088||s.frameRate>Math.max(n,30)||s.videoRange!=="SDR"&&s.videoRange!==e||s.bitrate>Math.max(i,8e6))||!!p&&pt(h)&&Object.keys(p).some(g=>parseInt(g)>h)}function K_(s,t,e,n={}){const i=s.videoCodec;if(!i&&!s.audioCodec||!e)return Promise.resolve(H_);const a=[],o=p$(s),c=o.length,d=g$(s,t,c>0),f=d.length;for(let h=c||1*f||1;h--;){const p={type:"media-source"};if(c&&(p.video=o[h%c]),f){p.audio=d[h%f];const g=p.audio.bitrate;p.video&&g&&(p.video.bitrate-=g)}a.push(p)}if(i){const h=navigator.userAgent;if(i.split(",").some(p=>Mf(p))&&G_())return Promise.resolve(z_(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${h})`),a))}return Promise.all(a.map(h=>{const p=v$(h);return n[p]||(n[p]=e.decodingInfo(h))})).then(h=>({supported:!h.some(p=>!p.supported),configurations:a,decodingInfoResults:h})).catch(h=>({supported:!1,configurations:a,decodingInfoResults:[],error:h}))}function p$(s){var t;const e=(t=s.videoCodec)==null?void 0:t.split(","),n=q_(s),i=s.width||640,a=s.height||480,o=s.frameRate||30,c=s.videoRange.toLowerCase();return e?e.map(d=>{const f={contentType:bc(d$(d),"video"),width:i,height:a,bitrate:n,framerate:o};return c!=="sdr"&&(f.transferFunction=c),f}):[]}function g$(s,t,e){var n;const i=(n=s.audioCodec)==null?void 0:n.split(","),a=q_(s);return i&&s.audioGroups?s.audioGroups.reduce((o,c)=>{var d;const f=c?(d=t.groups[c])==null?void 0:d.tracks:null;return f?f.reduce((h,p)=>{if(p.groupId===c){const g=parseFloat(p.channels||"");
vendor: 4,647 bytes, line 183
183i.forEach(v=>{const x={contentType:bc(v,"audio"),bitrate:e?y$(v,a):a};g&&(x.channels=""+g),h.push(x)})}return h},o):o},[]):[]}function y$(s,t){if(t<=1)return 1;let e=128e3;return s==="ec-3"?e=768e3:s==="ac-3"&&(e=64e4),Math.min(t/2,e)}function q_(s){return Math.ceil(Math.max(s.bitrate*.9,s.averageBitrate)/1e3)*1e3||1}function v$(s){let t="";const{audio:e,video:n}=s;if(n){const i=i0(n.contentType);t+=`${i}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(e){const i=i0(e.contentType);t+=`${n?"_":""}${i}_c${e.channels}`}return t}const r0=["NONE","TYPE-0","TYPE-1",null];function x$(s){return r0.indexOf(s)>-1}const nf=["SDR","PQ","HLG"];function b$(s){return!!s&&nf.indexOf(s)>-1}var Nd={No:"",Yes:"YES",v2:"v2"};function EA(s){const{canSkipUntil:t,canSkipDateRanges:e,age:n}=s,i=n<t/2;return t&&i?e?Nd.v2:Nd.Yes:Nd.No}class TA{constructor(t,e,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=n}addDirectives(t){const e=new self.URL(t);return this.msn!==void 0&&e.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href}}class Sc{constructor(t){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in t){var e;this.supplemental=t.supplemental;const n=(e=t.supplemental)==null?void 0:e.videoCodec;n&&n!==t.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(t){return AA(this._audioGroups,t)}hasSubtitleGroup(t){return AA(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,e){if(e){if(t==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(e)===-1&&n.push(e)}else if(t==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(e)===-1&&n.push(e)}}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return(t=this.audioGroups)==null?void 0:t[0]}get textGroupId(){var t;return(t=this.subtitleGroups)==null?void 0:t[0]}addFallback(){}}function AA(s,t){return!t||!s?!1:s.indexOf(t)!==-1}function S$(){if(typeof matchMedia=="function"){const s=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(s.media!==t.media)return s.matches===!0}return!1}function E$(s,t){let e=!1,n=[];if(s&&(e=s!=="SDR",n=[s]),t){n=t.allowedVideoRanges||nf.slice(0);const i=n.join("")!=="SDR"&&!t.videoCodec;e=t.preferHDR!==void 0?t.preferHDR:i&&S$(),e||(n=["SDR"])}return{preferHDR:e,allowedVideoRanges:n}}const T$=s=>{const t=new WeakSet;return(e,n)=>{if(s&&(n=s(e,n)),typeof n=="object"&&n!==null){if(t.has(n))return;t.add(n)}return n}},re=(s,t)=>JSON.stringify(s,T$(t));function A$(s,t,e,n,i){const a=Object.keys(s),o=n?.channels,c=n?.audioCodec,d=i?.videoCodec,f=o&&parseInt(o)===2;let h=!1,p=!1,g=1/0,v=1/0,x=1/0,S=1/0,E=0,T=[];const{preferHDR:L,allowedVideoRanges:_}=E$(t,i);for(let I=a.length;I--;){const F=s[a[I]];h||(h=F.channels[2]>0),g=Math.min(g,F.minHeight),v=Math.min(v,F.minFramerate),x=Math.min(x,F.minBitrate),_.filter(z=>F.videoRanges[z]>0).length>0&&(p=!0)}
vendor: 4,420 bytes, line 183
183g=pt(g)?g:0,v=pt(v)?v:0;const P=Math.max(1080,g),D=Math.max(30,v);x=pt(x)?x:e,e=Math.max(x,e),p||(t=void 0);const B=a.length>1;return{codecSet:a.reduce((I,F)=>{const U=s[F];if(F===I)return I;if(T=p?_.filter(z=>U.videoRanges[z]>0):[],B){if(U.minBitrate>e)return Fn(F,`min bitrate of ${U.minBitrate} > current estimate of ${e}`),I;if(!U.hasDefaultAudio)return Fn(F,"no renditions with default or auto-select sound found"),I;if(c&&F.indexOf(c.substring(0,4))%5!==0)return Fn(F,`audio codec preference "${c}" not found`),I;if(o&&!f){if(!U.channels[o])return Fn(F,`no renditions with ${o} channel sound found (channels options: ${Object.keys(U.channels)})`),I}else if((!c||f)&&h&&U.channels[2]===0)return Fn(F,"no renditions with stereo sound found"),I;if(U.minHeight>P)return Fn(F,`min resolution of ${U.minHeight} > maximum of ${P}`),I;if(U.minFramerate>D)return Fn(F,`min framerate of ${U.minFramerate} > maximum of ${D}`),I;if(!T.some(z=>U.videoRanges[z]>0))return Fn(F,`no variants with VIDEO-RANGE of ${re(T)} found`),I;if(d&&F.indexOf(d.substring(0,4))%5!==0)return Fn(F,`video codec preference "${d}" not found`),I;if(U.maxScore<E)return Fn(F,`max score of ${U.maxScore} < selected max of ${E}`),I}return I&&(ef(F)>=ef(I)||U.fragmentError>s[I].fragmentError)?I:(S=U.minIndex,E=U.maxScore,F)},void 0),videoRanges:T,preferHDR:L,minFramerate:v,minBitrate:x,minIndex:S}}function Fn(s,t){Xt.log(`[abr] start candidates with "${s}" ignored because ${t}`)}function Y_(s){return s.reduce((t,e)=>{let n=t.groups[e.groupId];n||(n=t.groups[e.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(e);const i=e.channels||"2";return n.channels[i]=(n.channels[i]||0)+1,n.hasDefault=n.hasDefault||e.default,n.hasAutoSelect=n.hasAutoSelect||e.autoselect,n.hasDefault&&(t.hasDefaultAudio=!0),n.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function R$(s,t,e,n){return s.slice(e,n+1).reduce((i,a,o)=>{if(!a.codecSet)return i;const c=a.audioGroups;let d=i[a.codecSet];d||(i[a.codecSet]=d={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:o,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!c,fragmentError:0}),d.minBitrate=Math.min(d.minBitrate,a.bitrate);const f=Math.min(a.height,a.width);return d.minHeight=Math.min(d.minHeight,f),d.minFramerate=Math.min(d.minFramerate,a.frameRate),d.minIndex=Math.min(d.minIndex,o),d.maxScore=Math.max(d.maxScore,a.score),d.fragmentError+=a.fragmentError,d.videoRanges[a.videoRange]=(d.videoRanges[a.videoRange]||0)+1,c&&c.forEach(h=>{if(!h)return;const p=t.groups[h];p&&(d.hasDefaultAudio=d.hasDefaultAudio||t.hasDefaultAudio?p.hasDefault:p.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(p.channels).forEach(g=>{d.channels[g]=(d.channels[g]||0)+p.channels[g]}))}),i},{})}function RA(s){if(!s)return s;const{lang:t,assocLang:e,characteristics:n,channels:i,audioCodec:a}=s;return{lang:t,assocLang:e,characteristics:n,channels:i,audioCodec:a}}function Hn(s,t,e){if("attrs"in s){const n=t.indexOf(s);if(n!==-1)return n}for(let n=0;n<t.length;n++){const i=t[n];if(aa(s,i,e))return n}return-1}function aa(s,t,e){const{groupId:n,name:i,lang:a,assocLang:o,default:c}=s,d=s.forced;return(n===void 0||t.groupId===n)&&(i===void 0||t.name===i)&&(a===void 0||w$(a,t.lang))&&(a===void 0||t.assocLang===o)&&(c===void 0||t.default===c)&&(d===void 0||t.forced===d)&&(!("characteristics"in s)||L$(s.characteristics||"",t.characteristics))&&(e===void 0||e(s,t))}function w$(s,t="--"){return s.length===t.length?s===t:s.startsWith(t)||t.startsWith(s)}function L$(s,t=""){const e=s.split(","),n=t.split(",");return e.length===n.length&&!e.some(i=>n.indexOf(i)===-1)}function Jr(s,t){const{audioCodec:e,channels:n}=s;return(e===void 0||(t.audioCodec||"").substring(0,4)===e.substring(0,4))&&(n===void 0||n===(t.channels||"2"))}function _$(s,t,e,n,i){const a=t[n],c=t.reduce((g,v,x)=>{const S=v.uri;return(g[S]||(g[S]=[])).push(x),g},{})[a.uri];c.length>1&&(n=Math.max.apply(Math,c));const d=a.videoRange,f=a.frameRate,h=a.codecSet.substring(0,4),p=wA(t,n,g=>{if(g.videoRange!==d||g.frameRate!==f||g.codecSet.substring(0,4)!==h)return!1;const v=g.audioGroups,x=e.filter(S=>!v||v.indexOf(S.groupId)!==-1);return Hn(s,x,i)>-1});return p>-1?p:wA(t,n,g=>{const v=g.audioGroups,x=e.filter(S=>!v||v.indexOf(S.groupId)!==-1);return Hn(s,x,i)>-1})}function wA(s,t,e){for(let n=t;n>-1;n--)if(e(s[n]))return n;
vendor: 5,207 bytes, lines 183-193
183for(let n=t+1;n<s.length;n++)if(e(s[n]))return n;return-1}function rf(s,t){var e;return!!s&&s!==((e=t.loadLevelObj)==null?void 0:e.uri)}class C$ extends mn{constructor(t){super("abr",t.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{var n;const{fragCurrent:i,partCurrent:a,hls:o}=this,{autoLevelEnabled:c,media:d}=o;if(!i||!d)return;const f=performance.now(),h=a?a.stats:i.stats,p=a?a.duration:i.duration,g=f-h.loading.start,v=o.minAutoLevel,x=i.level,S=this._nextAutoLevel;if(h.aborted||h.loaded&&h.loaded===h.total||x<=v){this.clearTimer(),this._nextAutoLevel=-1;return}if(!c)return;const E=S>-1&&S!==x,T=!!e||E;if(!T&&(d.paused||!d.playbackRate||!d.readyState))return;const L=o.mainForwardBufferInfo;if(!T&&L===null)return;const _=this.bwEstimator.getEstimateTTFB(),P=Math.abs(d.playbackRate);if(g<=Math.max(_,1e3*(p/(P*2))))return;const D=L?L.len/P:0,B=h.loading.first?h.loading.first-h.loading.start:-1,C=h.loaded&&B>-1,I=this.getBwEstimate(),F=o.levels,U=F[x],z=Math.max(h.loaded,Math.round(p*(i.bitrate||U.averageBitrate)/8));let Y=C?g-B:g;Y<1&&C&&(Y=Math.min(g,h.loaded*8/I));const nt=C?h.loaded*1e3/Y:0,it=_/1e3,rt=nt?(z-h.loaded)/nt:z*8/I+it;if(rt<=D)return;const M=nt?nt*8:I,j=((n=e?.details||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,N=this.hls.config.abrBandWidthUpFactor;let V=Number.POSITIVE_INFINITY,X;for(X=x-1;X>v;X--){const J=F[X].maxBitrate,ot=!F[X].details||j;if(V=this.getTimeToLoadFrag(it,M,p*J,ot),V<Math.min(D,p+it))break}if(V>=rt||V>p*10)return;C?this.bwEstimator.sample(g-Math.min(_,B),h.loaded):this.bwEstimator.sampleTTFB(g);const O=F[X].maxBitrate;this.getBwEstimate()*N>O&&this.resetEstimator(O);const G=this.findBestLevel(O,v,X,0,D,1,1);G>-1&&(X=G),this.warn(`Fragment ${i.sn}${a?" part "+a.index:""} of level ${x} is loading too slowly; 184 Fragment duration: ${i.duration.toFixed(3)} 185 Time to underbuffer: ${D.toFixed(3)} s 186 Estimated load time for current fragment: ${rt.toFixed(3)} s 187 Estimated load time for down switch fragment: ${V.toFixed(3)} s 188 TTFB estimate: ${B|0} ms 189 Current BW estimate: ${pt(I)?I|0:"Unknown"} bps 190 New BW estimate: ${this.getBwEstimate()|0} bps 191 Switching to level ${X} @ ${O|0} bps`),o.nextLoadLevel=o.nextAutoLevel=X,this.clearTimer();const K=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===X&&X>0){const J=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${X>0?"and switching down":""} 192 Fragment duration: ${i.duration.toFixed(3)} s 193 Time to underbuffer: ${J.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,X>v){let ot=this.findBestLevel(this.hls.levels[v].bitrate,v,X,0,J,1,1);ot===-1&&(ot=v),this.hls.nextLoadLevel=this.hls.nextAutoLevel=ot,this.resetEstimator(this.hls.levels[ot].bitrate)}}};E||rt>V*2?K():this.timer=self.setInterval(K,V*1e3),o.trigger(w.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:a,stats:h})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new P8(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.FRAG_LOADING,this.onFragLoading,this),t.on(w.FRAG_LOADED,this.onFragLoaded,this),t.on(w.FRAG_BUFFERED,this.onFragBuffered,this),t.on(w.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(w.LEVEL_LOADED,this.onLevelLoaded,this),t.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(w.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(w.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.FRAG_LOADING,this.onFragLoading,this),t.off(w.FRAG_LOADED,this.onFragLoaded,this),t.off(w.FRAG_BUFFERED,this.onFragBuffered,this),t.off(w.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(w.LEVEL_LOADED,this.onLevelLoaded,this),t.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(w.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(w.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,e){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(t,e){const n=e.frag;
vendor: 3,237 bytes, line 193
193if(!this.ignoreFragment(n)){if(!n.bitrateTest){var i;this.fragCurrent=n,this.partCurrent=(i=e.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(t,e){this.clearTimer()}onError(t,e){if(!e.fatal)switch(e.details){case Z.BUFFER_ADD_CODEC_ERROR:case Z.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Z.FRAG_LOAD_TIMEOUT:{const n=e.frag,{fragCurrent:i,partCurrent:a}=this;if(n&&i&&n.sn===i.sn&&n.level===i.level){const o=performance.now(),c=a?a.stats:n.stats,d=o-c.loading.start,f=c.loading.first?c.loading.first-c.loading.start:-1;if(c.loaded&&f>-1){const p=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(d-Math.min(p,f),c.loaded)}else this.bwEstimator.sampleTTFB(d)}break}}}getTimeToLoadFrag(t,e,n,i){const a=t+n/e,o=i?t+this.lastLevelLoadSec:0;return a+o}onLevelLoaded(t,e){const n=this.hls.config,{loading:i}=e.stats,a=i.end-i.first;pt(a)&&(this.lastLevelLoadSec=a/1e3),e.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(e.levelInfo)}onFragLoaded(t,{frag:e,part:n}){const i=n?n.stats:e.stats;if(e.type===yt.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),e.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const a=n?n.duration:e.duration,o=this.hls.levels[e.level],c=(o.loaded?o.loaded.bytes:0)+i.loaded,d=(o.loaded?o.loaded.duration:0)+a;o.loaded={bytes:c,duration:d},o.realBitrate=Math.round(8*c/d)}if(e.bitrateTest){const a={stats:i,frag:e,part:n,id:e.type};this.onFragBuffered(w.FRAG_BUFFERED,a),e.bitrateTest=!1}else this.lastLoadedFragLevel=e.level}}onFragBuffered(t,e){const{frag:n,part:i}=e,a=i!=null&&i.stats.loaded?i.stats:n.stats;if(a.aborted||this.ignoreFragment(n))return;const o=a.parsing.end-a.loading.start-Math.min(a.loading.first-a.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,a.loaded),a.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==yt.MAIN||t.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:e}=this.hls,n=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,a=this.findBestLevel(n,e,t,0,i,1,1);if(a>-1)return a;const o=this.hls.firstLevel,c=Math.min(Math.max(o,e),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${c}`),c}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(t!==-1&&(!n||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return t;const a=n&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(t!==-1){const o=this.hls.levels;if(o.length>Math.max(t,a)&&o[t].loadError<=o[a].loadError)return t}return this._nextAutoLevel=a,this.nextAutoLevelKey=this.getAutoLevelKey(),a}getAutoLevelKey(){return`${this.getBwEstimate()}
193_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:i,config:a,minAutoLevel:o}=n,c=e?e.duration:t?t.duration:0,d=this.getBwEstimate(),f=this.getStarvationDelay();let h=a.abrBandWidthFactor,p=a.abrBandWidthUpFactor;if(f){const E=this.findBestLevel(d,o,i,f,0,h,p);if(E>=0)return this.rebufferNotice=-1,E}let g=c?Math.min(c,a.maxStarvationDelay):a.maxStarvationDelay;if(!f){const E=this.bitrateTestDelay;E&&(g=(c?Math.min(c,a.maxLoadingDelay):a.maxLoadingDelay)-E,this.info(`bitrate test took ${Math.round(1e3*E)}ms, set first fragment max fetchDuration to ${Math.round(1e3*g)} ms`),h=p=1)}const v=this.findBestLevel(d,o,i,f,g,h,p);if(this.rebufferNotice!==v&&(this.rebufferNotice=v,this.info(`${f?"rebuffering expected":"buffer is empty"}, optimal quality level ${v}`)),v>-1)return v;const x=n.levels[o],S=n.loadLevelObj;return S&&x?.bitrate<S.bitrate?o:n.loadLevel}getStarvationDelay(){const t=this.hls,e=t.media;if(!e)return 1/0;const n=e&&e.playbackRate!==0?Math.abs(e.playbackRate):1,i=t.mainForwardBufferInfo;return(i?i.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,e,n,i,a,o,c){var d;const f=i+a,h=this.lastLoadedFragLevel,p=h===-1?this.hls.firstLevel:h,{fragCurrent:g,partCurrent:v}=this,{levels:x,allAudioTracks:S,loadLevel:E,config:T}=this.hls;if(x.length===1)return 0;const L=x[p],_=!!((d=this.hls.latestLevelDetails)!=null&&d.live),P=E===-1||h===-1;let D,B="SDR",C=L?.frameRate||0;const{audioPreference:I,videoPreference:F}=T,U=this.audioTracksByGroup||(this.audioTracksByGroup=Y_(S));let z=-1;if(P){if(this.firstSelection!==-1)return this.firstSelection;const M=this.codecTiers||(this.codecTiers=R$(x,U,e,n)),j=A$(M,B,t,I,F),{codecSet:N,videoRanges:V,minFramerate:X,minBitrate:O,minIndex:G,preferHDR:K}=j;z=G,D=N,B=K?V[V.length-1]:V[0],C=X,t=Math.max(t,O),this.log(`picked start tier ${re(j)}`)}else D=L?.codecSet,B=L?.videoRange;const Y=v?v.duration:g?g.duration:0,nt=this.bwEstimator.getEstimateTTFB()/1e3,it=[];for(let M=n;M>=e;M--){var rt;const j=x[M],N=M>p;if(!j)continue;if(T.useMediaCapabilities&&!j.supportedResult&&!j.supportedPromise){const ot=navigator.mediaCapabilities;typeof ot?.decodingInfo=="function"&&m$(j,U,B,C,t,I)?(j.supportedPromise=K_(j,U,ot,this.supportedCache),j.supportedPromise.then(ft=>{if(!this.hls)return;j.supportedResult=ft;const ht=this.hls.levels,xt=ht.indexOf(j);ft.error?this.warn(`MediaCapabilities decodingInfo error: "${ft.error}" for level ${xt} ${re(ft)}`):ft.supported?ft.decodingInfoResults.some(wt=>wt.smooth===!1||wt.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${xt} not smooth or powerEfficient: ${re(ft)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${xt} ${re(ft)}`),xt>-1&&ht.length>1&&(this.log(`Removing unsupported level ${xt}`),this.hls.removeLevel(xt),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(ft=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${ft}`)})):j.supportedResult=H_}if((D&&j.codecSet!==D||B&&j.videoRange!==B||N&&C>j.frameRate||!N&&C>0&&C<j.frameRate||(rt=j.supportedResult)!=null&&(rt=rt.decodingInfoResults)!=null&&rt.some(ot=>ot.smooth===!1))&&(!P||M!==z)){it.push(M);continue}const V=j.details,X=(v?V?.partTarget:V?.averagetargetduration)||Y;let O;N?O=c*t:O=o*t;const G=Y&&i>=Y*2&&a===0?j.averageBitrate:j.maxBitrate,K=this.getTimeToLoadFrag(nt,O,G*X,V===void 0);if(O>=G&&(M===h||j.loadError===0&&j.fragmentError===0)&&(K<=nt||!pt(K)||_&&!this.bitrateTestDelay||K<f)){const ot=this.forcedAutoLevel;return M!==E&&(ot===-1||ot!==E)&&(it.length&&this.trace(`Skipped level(s) ${it.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${x[it[0]].codecs}" ${x[it[0]].videoRange}; not compatible with "${D}" ${B}`),this.info(`switch candidate:${p}->${M} adjustedbw(${Math.round(O)})-bitrate=${Math.round(O-G)} ttfb:${nt.toFixed(1)} avgDuration:${X.toFixed(1)} maxFetchDuration:${f.toFixed(1)} fetchDuration:${K.toFixed(1)}
193 firstSelection:${P} codecSet:${j.codecSet} videoRange:${j.videoRange} hls.loadLevel:${E}`)),P&&(this.firstSelection=M),M}}return-1}set nextAutoLevel(t){const e=this.deriveNextAutoLevel(t);this._nextAutoLevel!==e&&(this.nextAutoLevelKey="",this._nextAutoLevel=e)}deriveNextAutoLevel(t){const{maxAutoLevel:e,minAutoLevel:n}=this.hls;return Math.min(Math.max(t,n),e)}}const W_={search:function(s,t){let e=0,n=s.length-1,i=null,a=null;for(;e<=n;){i=(e+n)/2|0,a=s[i];const o=t(a);if(o>0)e=i+1;else if(o<0)n=i-1;else return a}return null}};function D$(s,t,e){if(t===null||!Array.isArray(s)||!s.length||!pt(t))return null;const n=s[0].programDateTime;if(t<(n||0))return null;const i=s[s.length-1].endProgramDateTime;if(t>=(i||0))return null;for(let a=0;a<s.length;++a){const o=s[a];if(O$(t,e,o))return o}return null}function ua(s,t,e=0,n=0,i=.005){let a=null;if(s){a=t[1+s.sn-t[0].sn]||null;const c=s.endDTS-e;c>0&&c<15e-7&&(e+=15e-7),a&&s.level!==a.level&&a.end<=s.end&&(a=t[2+s.sn-t[0].sn]||null)}else e===0&&t[0].start===0&&(a=t[0]);if(a&&((!s||s.level===a.level)&&LA(e,n,a)===0||I$(a,s,Math.min(i,n))))return a;const o=W_.search(t,LA.bind(null,e,n));return o&&(o!==s||!a)?o:a}function I$(s,t,e){if(t&&t.start===0&&t.level<s.level&&(t.endPTS||0)>0){const n=t.tagList.reduce((i,a)=>(a[0]==="INF"&&(i+=parseFloat(a[1])),i),e);return s.start<=n}return!1}function LA(s=0,t=0,e){if(e.start<=s&&e.start+e.duration>s)return 0;const n=Math.min(t,e.duration+(e.deltaPTS?e.deltaPTS:0));return e.start+e.duration-n<=s?1:e.start-n>s&&e.start?-1:0}function O$(s,t,e){const n=Math.min(t,e.duration+(e.deltaPTS?e.deltaPTS:0))*1e3;return(e.endProgramDateTime||0)-n>s}function Q_(s,t,e){if(s&&s.startCC<=t&&s.endCC>=t){let n=s.fragments;const{fragmentHint:i}=s;i&&(n=n.concat(i));let a;return W_.search(n,o=>o.cc<t?1:o.cc>t?-1:(a=o,o.end<=e?1:o.start>e?-1:0)),a||null}return null}function af(s){switch(s.details){case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_TIMEOUT:case Z.LEVEL_LOAD_TIMEOUT:case Z.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function X_(s){return s.details.startsWith("key")}function Z_(s){return X_(s)&&!!s.frag&&!s.frag.decryptdata}function _A(s,t){const e=af(t);return s.default[`${e?"timeout":"error"}Retry`]}function Oy(s,t){const e=s.backoff==="linear"?1:Math.pow(2,t);return Math.min(e*s.retryDelayMs,s.maxRetryDelayMs)}function CA(s){return Qt(Qt({},s),{errorRetry:null,timeoutRetry:null})}function of(s,t,e,n){if(!s)return!1;const i=n?.code,a=t<s.maxNumRetry&&(k$(i)||!!e);return s.shouldRetry?s.shouldRetry(s,t,e,n,a):a}function k$(s){return a0(s)||!!s&&(s<400||s>499)}function a0(s){return s===0&&navigator.onLine===!1}var es={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},Us={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4};class P$ extends mn{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(w.ERROR,this.onError,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(w.ERROR,this.onError,this),t.off(w.ERROR,this.onErrorOut,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return t?.type===yt.MAIN?t.level:this.getVariantIndex()}getVariantIndex(){var t;const e=this.hls,n=e.currentLevel;return(t=e.loadLevelObj)!=null&&t.details||n===-1?e.loadLevel:n}variantHasKey(t,e){if(t){var n;if((n=t.details)!=null&&n.hasKey(e))return!0;const i=t.audioGroups;if(i)return this.hls.allAudioTracks.filter(o=>i.indexOf(o.groupId)>=0).some(o=>{var c;return(c=o.details)==null?void 0:c.hasKey(e)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(t,e){var n;if(e.fatal)return;const i=this.hls,a=e.context;switch(e.details){case Z.FRAG_LOAD_ERROR:case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_ERROR:case Z.KEY_LOAD_TIMEOUT:e.errorAction=this.getFragRetryOrSwitchAction(e);return;case Z.FRAG_PARSING_ERROR:if((n=e.frag)!=null&&n.gap){e.errorAction=Ao();return}case Z.FRAG_GAP:case Z.FRAG_DECRYPT_ERROR:{e.errorAction=this.getFragRetryOrSwitchAction(e),e.errorAction.action=es.SendAlternateToPenaltyBox;return}case Z.LEVEL_EMPTY_ERROR:case Z.LEVEL_PARSING_ERROR:{var o;const d=e.parent===yt.MAIN?e.level:i.loadLevel;e.details===Z.LEVEL_EMPTY_ERROR&&((o=e.context)!=null&&(o=o.levelDetails)!=null&&o.live)?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,d):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,d))}return;case Z.LEVEL_LOAD_ERROR:case Z.LEVEL_LOAD_TIMEOUT:typeof a?.level=="number"&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,a.level));return;case Z.AUDIO_TRACK_LOAD_ERROR:case Z.AUDIO_TRACK_LOAD_TIMEOUT:case Z.SUBTITLE_LOAD_ERROR:case Z.SUBTITLE_TRACK_LOAD_TIMEOUT:if(a){const d=i.loadLevelObj;if(d&&(a.type===Ft.AUDIO_TRACK&&d.hasAudioGroup(a.groupId)||a.type===Ft.SUBTITLE_TRACK&&d.hasSubtitleGroup(a.groupId))){e.errorAction=this.getPlaylistRetryOrSwitchAction(e,i.loadLevel),e.errorAction.action=es.SendAlternateToPenaltyBox,e.errorAction.flags=Us.MoveAllAlternatesMatchingHost;return}}return;case Z.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:e.errorAction={action:es.SendAlternateToPenaltyBox,flags:Us.MoveAllAlternatesMatchingHDCP};return;case Z.KEY_SYSTEM_SESSION_UPDATE_FAILED:case Z.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case Z.KEY_SYSTEM_NO_SESSION:e.errorAction={action:es.SendAlternateToPenaltyBox,flags:Us.MoveAllAlternatesMatchingKey};return;
vendor: 11,036 bytes, line 193
193case Z.BUFFER_ADD_CODEC_ERROR:case Z.REMUX_ALLOC_ERROR:case Z.BUFFER_APPEND_ERROR:if(!e.errorAction){var c;e.errorAction=this.getLevelSwitchAction(e,(c=e.level)!=null?c:i.loadLevel)}return;case Z.INTERNAL_EXCEPTION:case Z.BUFFER_APPENDING_ERROR:case Z.BUFFER_FULL_ERROR:case Z.LEVEL_SWITCH_ERROR:case Z.BUFFER_STALLED_ERROR:case Z.BUFFER_SEEK_OVER_HOLE:case Z.BUFFER_NUDGE_ON_STALL:e.errorAction=Ao();return}e.type===Tt.KEY_SYSTEM_ERROR&&(e.levelRetry=!1,e.errorAction=Ao())}getPlaylistRetryOrSwitchAction(t,e){const n=this.hls,i=_A(n.config.playlistLoadPolicy,t),a=this.playlistError++;if(of(i,a,af(t),t.response))return{action:es.RetryRequest,flags:Us.None,retryConfig:i,retryCount:a};const c=this.getLevelSwitchAction(t,e);return i&&(c.retryConfig=i,c.retryCount=a),c}getFragRetryOrSwitchAction(t){const e=this.hls,n=this.getVariantLevelIndex(t.frag),i=e.levels[n],{fragLoadPolicy:a,keyLoadPolicy:o}=e.config,c=_A(X_(t)?o:a,t),d=e.levels.reduce((h,p)=>h+p.fragmentError,0);if(i&&(t.details!==Z.FRAG_GAP&&i.fragmentError++,!Z_(t)&&of(c,d,af(t),t.response)))return{action:es.RetryRequest,flags:Us.None,retryConfig:c,retryCount:d};const f=this.getLevelSwitchAction(t,n);return c&&(f.retryConfig=c,f.retryCount=d),f}getLevelSwitchAction(t,e){const n=this.hls;e==null&&(e=n.loadLevel);const i=this.hls.levels[e];if(i){var a,o;const f=t.details;i.loadError++,f===Z.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:p,loadLevel:g,minAutoLevel:v,maxAutoLevel:x}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const S=(a=t.frag)==null?void 0:a.type,T=(S===yt.AUDIO&&f===Z.FRAG_PARSING_ERROR||t.sourceBufferName==="audio"&&(f===Z.BUFFER_ADD_CODEC_ERROR||f===Z.BUFFER_APPEND_ERROR))&&p.some(({audioCodec:B})=>i.audioCodec!==B),_=t.sourceBufferName==="video"&&(f===Z.BUFFER_ADD_CODEC_ERROR||f===Z.BUFFER_APPEND_ERROR)&&p.some(({codecSet:B,audioCodec:C})=>i.codecSet!==B&&i.audioCodec===C),{type:P,groupId:D}=(o=t.context)!=null?o:{};for(let B=p.length;B--;){const C=(B+g)%p.length;if(C!==g&&C>=v&&C<=x&&p[C].loadError===0){var c,d;const I=p[C];if(f===Z.FRAG_GAP&&S===yt.MAIN&&t.frag){const F=p[C].details;if(F){const U=ua(t.frag,F.fragments,t.frag.start);if(U!=null&&U.gap)continue}}else{if(P===Ft.AUDIO_TRACK&&I.hasAudioGroup(D)||P===Ft.SUBTITLE_TRACK&&I.hasSubtitleGroup(D))continue;if(S===yt.AUDIO&&(c=i.audioGroups)!=null&&c.some(F=>I.hasAudioGroup(F))||S===yt.SUBTITLE&&(d=i.subtitleGroups)!=null&&d.some(F=>I.hasSubtitleGroup(F))||T&&i.audioCodec===I.audioCodec||_&&i.codecSet===I.codecSet||!T&&i.codecSet!==I.codecSet)continue}h=C;break}}if(h>-1&&n.loadLevel!==h)return t.levelRetry=!0,this.playlistError=0,{action:es.SendAlternateToPenaltyBox,flags:Us.None,nextAutoLevel:h}}return{action:es.SendAlternateToPenaltyBox,flags:Us.MoveAllAlternatesMatchingHost}}onErrorOut(t,e){var n;switch((n=e.errorAction)==null?void 0:n.action){case es.DoNothing:break;case es.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(e),!e.errorAction.resolved&&e.details!==Z.FRAG_GAP?e.fatal=!0:/MediaSource readyState: ended/.test(e.error.message)&&(this.warn(`MediaSource ended after "${e.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(e.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(t){const e=this.hls,n=t.errorAction;if(!n)return;const{flags:i}=n,a=n.nextAutoLevel;switch(i){case Us.None:this.switchLevel(t,a);break;case Us.MoveAllAlternatesMatchingHDCP:{const d=this.getVariantLevelIndex(t.frag),f=e.levels[d],h=f?.attrs["HDCP-LEVEL"];if(n.hdcpLevel=h,h==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(h){e.maxHdcpLevel=r0[r0.indexOf(h)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${e.maxHdcpLevel}" or lower`);break}}case Us.MoveAllAlternatesMatchingKey:{const d=t.decryptdata;if(d){const f=this.hls.levels,h=f.length;for(let g=h;g--;)if(this.variantHasKey(f[g],d)){var o,c;this.log(`Banned key found in level ${g} (${f[g].bitrate}bps) or audio group "${(o=f[g].audioGroups)==null?void 0:o.join(",")}" (${(c=t.frag)==null?void 0:c.type} fragment) ${ss(d.keyId||[])}`),f[g].fragmentError++,f[g].loadError++,this.log(`Removing level ${g} with key error (${t.error})`),this.hls.removeLevel(g)}const p=t.frag;if(this.hls.levels.length<h)n.resolved=!0;else if(p&&p.type!==yt.MAIN){const g=p.decryptdata;g&&!d.matches(g)&&(n.resolved=!0)}}break}}n.resolved||this.switchLevel(t,a)}switchLevel(t,e){if(e!==void 0&&t.errorAction&&(this.warn(`switching to level ${e} after ${t.details}`),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,t.details===Z.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&t.sourceBufferName!=="audiovideo")){const n=i0(t.mimeType),i=this.hls.levels;for(let a=i.length;a--;)i[a][`${t.sourceBufferName}Codec`]===n&&(this.log(`Removing level ${a} for ${t.details} ("${n}" not supported)`),this.hls.removeLevel(a))}}}function Ao(s){const t={action:es.DoNothing,flags:Us.None};return s&&(t.resolved=!0),t}var Ve={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class M${constructor(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t&&(t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.BUFFER_APPENDED,this.onBufferAppended,this),t.on(w.FRAG_BUFFERED,this.onFragBuffered,this),t.on(w.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.BUFFER_APPENDED,this.onBufferAppended,this),t.off(w.FRAG_BUFFERED,this.onFragBuffered,this),t.off(w.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const n=this.activePartLists[e];if(n)for(let i=n.length;i--;){const a=n[i];if(!a)break;if(a.start<=t&&t<=a.end&&a.loaded)return a}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){return this.getFragAtPos(t,e,!0)}getFragAtPos(t,e,n){const{fragments:i}=this,a=Object.keys(i);for(let o=a.length;o--;){const c=i[a[o]];if(c?.body.type===e&&(!n||c.buffered)){const d=c.body;if(d.start<=t&&t<=d.end)return d}}return null}detectEvictedFragments(t,e,n,i,a){this.timeRanges&&(this.timeRanges[t]=e);const o=i?.fragment.sn||-1;Object.keys(this.fragments).forEach(c=>{const d=this.fragments[c];if(!d||o>=d.body.sn)return;if(!d.buffered&&(!d.loaded||a)){d.body.type===n&&this.removeFragment(d.body);return}const f=d.range[t];if(f){if(f.time.length===0){this.removeFragment(d.body);return}f.time.some(h=>{const p=!this.isTimeBuffered(h.startPTS,h.endPTS,e);return p&&this.removeFragment(d.body),p})}})}detectPartialFragments(t){const e=this.timeRanges;if(!e||t.frag.sn==="initSegment")return;const n=t.frag,i=lo(n),a=this.fragments[i];if(!a||a.buffered&&n.gap)return;const o=!n.relurl;Object.keys(e).forEach(c=>{const d=n.elementaryStreams[c];if(!d)return;const f=e[c],h=o||d.partial===!0;a.range[c]=this.getBufferedTimes(n,t.part,h,f)}),a.loaded=null,Object.keys(a.range).length?(this.bufferedEnd(a,n),dd(a)||this.removeParts(n.sn-1,n.type)):this.removeFragment(a.body)}bufferedEnd(t,e){t.buffered=!0,(t.body.endList=e.endList||t.body.endList)&&(this.endListFragments[t.body.type]=t)}removeParts(t,e){const n=this.activePartLists[e];n&&(this.activePartLists[e]=DA(n,i=>i.fragment.sn>=t))}fragBuffered(t,e){const n=lo(t);let i=this.fragments[n];!i&&e&&(i=this.fragments[n]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,this.bufferedEnd(i,t))}getBufferedTimes(t,e,n,i){const a={time:[],partial:n},o=t.start,c=t.end,d=t.minEndPTS||c,f=t.maxStartPTS||o;for(let h=0;h<i.length;h++){const p=i.start(h)-this.bufferPadding,g=i.end(h)+this.bufferPadding;if(f>=p&&d<=g){a.time.push({startPTS:Math.max(o,i.start(h)),endPTS:Math.min(c,i.end(h))});break}else if(o<g&&c>p){const v=Math.max(o,i.start(h)),x=Math.min(c,i.end(h));x>v&&(a.partial=!0,a.time.push({startPTS:v,endPTS:x}))}else if(c<=p)break}return a}getPartialFragment(t){let e=null,n,i,a,o=0;const{bufferPadding:c,fragments:d}=this;return Object.keys(d).forEach(f=>{const h=d[f];h&&dd(h)&&(i=h.body.start-c,a=h.body.end+c,t>=i&&t<=a&&(n=Math.min(t-i,a-t),o<=n&&(e=h.body,o=n)))}),e}isEndListAppended(t){const e=this.endListFragments[t];return e!==void 0&&(e.buffered||dd(e))}getState(t){const e=lo(t),n=this.fragments[e];return n?n.buffered?dd(n)?Ve.PARTIAL:Ve.OK:Ve.APPENDING:Ve.NOT_LOADED}isTimeBuffered(t,e,n){let i,a;for(let o=0;o<n.length;o++){if(i=n.start(o)-this.bufferPadding,a=n.end(o)+this.bufferPadding,t>=i&&e<=a)return!0;if(e<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,e){if(e.frag.sn==="initSegment"||e.frag.bitrateTest)return;const n=e.frag,i=e.part?null:e,a=lo(n);this.fragments[a]={body:n,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:n,part:i,timeRanges:a,type:o}=e;if(n.sn==="initSegment")return;const c=n.type;if(i){let f=this.activePartLists[c];f||(this.activePartLists[c]=f=[]),f.push(i)}this.timeRanges=a;const d=a[o];this.detectEvictedFragments(o,d,c,i)}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=lo(t);return!!this.fragments[e]}hasFragments(t){const{fragments:e}=this,n=Object.keys(e);if(!t)return n.length>0;for(let i=n.length;i--;){const a=e[n[i]];if(a?.body.type===t)return!0}return!1}hasParts(t){var e;return!!((e=this.activePartLists[t])!=null&&e.length)}removeFragmentsInRange(t,e,n,i,a){i&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const c=this.fragments[o];if(!c)return;const d=c.body;d.type!==n||i&&!d.gap||d.start<e&&d.end>t&&(c.buffered||a)&&this.removeFragment(d)})}removeFragment(t){const e=lo(t);t.clearElementaryStreamInfo();const n=this.activePartLists[t.type];if(n){const i=t.sn;this.activePartLists[t.type]=DA(n,a=>a.fragment.sn!==i)}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const e=(t=this.hls)==null||(t=t.latestLevelDetails)==null?void 0:t.partList;e&&e.forEach(n=>n.clearElementaryStreamInfo())}}function dd(s){var t,e,n;return s.buffered&&!!(s.body.gap||(t=s.range.video)!=null&&t.partial||(e=s.range.audio)!=null&&e.partial||(n=s.range.audiovideo)!=null&&n.partial)}function lo(s){return`${s.type}_${s.level}_${s.sn}`}function DA(s,t){return s.filter(e=>{const n=t(e);return n||e.clearElementaryStreamInfo(),n})}var Ar={cbc:0,ctr:1};class N${constructor(t,e,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=e,this.aesMode=n}decrypt(t,e){switch(this.aesMode){case Ar.cbc:return this.subtle.decrypt({
vendor: 17,294 bytes, line 193
193name:"AES-CBC",iv:this.aesIV},e,t);case Ar.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},e,t);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function B$(s){const t=s.byteLength,e=t&&new DataView(s.buffer).getUint8(t-1);return e?s.slice(0,t-e):s}class F${constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(t){const e=new DataView(t),n=new Uint32Array(4);for(let i=0;i<4;i++)n[i]=e.getUint32(i*4);return n}initTable(){const t=this.sBox,e=this.invSBox,n=this.subMix,i=n[0],a=n[1],o=n[2],c=n[3],d=this.invSubMix,f=d[0],h=d[1],p=d[2],g=d[3],v=new Uint32Array(256);let x=0,S=0,E=0;for(E=0;E<256;E++)E<128?v[E]=E<<1:v[E]=E<<1^283;for(E=0;E<256;E++){let T=S^S<<1^S<<2^S<<3^S<<4;T=T>>>8^T&255^99,t[x]=T,e[T]=x;const L=v[x],_=v[L],P=v[_];let D=v[T]*257^T*16843008;i[x]=D<<24|D>>>8,a[x]=D<<16|D>>>16,o[x]=D<<8|D>>>24,c[x]=D,D=P*16843009^_*65537^L*257^x*16843008,f[T]=D<<24|D>>>8,h[T]=D<<16|D>>>16,p[T]=D<<8|D>>>24,g[T]=D,x?(x=L^v[v[v[P^L]]],S^=v[v[S]]):x=S=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let n=!0,i=0;for(;i<e.length&&n;)n=e[i]===this.key[i],i++;if(n)return;this.key=e;const a=this.keySize=e.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);const o=this.ksRows=(a+6+1)*4;let c,d;const f=this.keySchedule=new Uint32Array(o),h=this.invKeySchedule=new Uint32Array(o),p=this.sBox,g=this.rcon,v=this.invSubMix,x=v[0],S=v[1],E=v[2],T=v[3];let L,_;for(c=0;c<o;c++){if(c<a){L=f[c]=e[c];continue}_=L,c%a===0?(_=_<<8|_>>>24,_=p[_>>>24]<<24|p[_>>>16&255]<<16|p[_>>>8&255]<<8|p[_&255],_^=g[c/a|0]<<24):a>6&&c%a===4&&(_=p[_>>>24]<<24|p[_>>>16&255]<<16|p[_>>>8&255]<<8|p[_&255]),f[c]=L=(f[c-a]^_)>>>0}for(d=0;d<o;d++)c=o-d,d&3?_=f[c]:_=f[c-4],d<4||c<=4?h[d]=_:h[d]=x[p[_>>>24]]^S[p[_>>>16&255]]^E[p[_>>>8&255]]^T[p[_&255]],h[d]=h[d]>>>0}networkToHostOrderSwap(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24}decrypt(t,e,n){const i=this.keySize+6,a=this.invKeySchedule,o=this.invSBox,c=this.invSubMix,d=c[0],f=c[1],h=c[2],p=c[3],g=this.uint8ArrayToUint32Array_(n);let v=g[0],x=g[1],S=g[2],E=g[3];const T=new Int32Array(t),L=new Int32Array(T.length);let _,P,D,B,C,I,F,U,z,Y,nt,it,rt,M;const j=this.networkToHostOrderSwap;for(;e<T.length;){for(z=j(T[e]),Y=j(T[e+1]),nt=j(T[e+2]),it=j(T[e+3]),C=z^a[0],I=it^a[1],F=nt^a[2],U=Y^a[3],rt=4,M=1;M<i;M++)_=d[C>>>24]^f[I>>16&255]^h[F>>8&255]^p[U&255]^a[rt],P=d[I>>>24]^f[F>>16&255]^h[U>>8&255]^p[C&255]^a[rt+1],D=d[F>>>24]^f[U>>16&255]^h[C>>8&255]^p[I&255]^a[rt+2],B=d[U>>>24]^f[C>>16&255]^h[I>>8&255]^p[F&255]^a[rt+3],C=_,I=P,F=D,U=B,rt=rt+4;_=o[C>>>24]<<24^o[I>>16&255]<<16^o[F>>8&255]<<8^o[U&255]^a[rt],P=o[I>>>24]<<24^o[F>>16&255]<<16^o[U>>8&255]<<8^o[C&255]^a[rt+1],D=o[F>>>24]<<24^o[U>>16&255]<<16^o[C>>8&255]<<8^o[I&255]^a[rt+2],B=o[U>>>24]<<24^o[C>>16&255]<<16^o[I>>8&255]<<8^o[F&255]^a[rt+3],L[e]=j(_^v),L[e+1]=j(B^x),L[e+2]=j(D^S),L[e+3]=j(P^E),v=z,x=Y,S=nt,E=it,e=e+4}return L.buffer}}class U${constructor(t,e,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=e,this.aesMode=n}expandKey(){const t=j$(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}function j$(s){switch(s){case Ar.cbc:return"AES-CBC";case Ar.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${s}`)}}const $$=16;class ky{constructor(t,{removePKCS7Padding:e=!0}={}){if(this.logEnabled=!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.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=t.enableSoftwareAES,this.removePKCS7Padding=e,e)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:t,remainderData:e}=this;if(!t||e)return this.reset(),null;const n=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?B$(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(t,e,n,i){return this.useSoftware?new Promise((a,o)=>{const c=ArrayBuffer.isView(t)?t:new Uint8Array(t);this.softwareDecrypt(c,e,n,i);const d=this.flush();d?a(d.buffer):o(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(t),e,n,i)}softwareDecrypt(t,e,n,i){const{currentIV:a,currentResult:o,remainderData:c}=this;if(i!==Ar.cbc||e.byteLength!==16)return Xt.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),c&&(t=hn(c,t),this.remainderData=null);const d=this.getValidChunk(t);if(!d.length)return null;a&&(n=a);let f=this.softwareDecrypter;f||(f=this.softwareDecrypter=new F$),f.expandKey(e);const h=o;return this.currentResult=f.decrypt(d.buffer,0,n),this.currentIV=d.slice(-16).buffer,h||null}webCryptoDecrypt(t,e,n,i){if(this.key!==e||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,e,n,i));this.key=e,this.fastAesKey=new U$(this.subtle,e,i)}return this.fastAesKey.expandKey().then(a=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new N$(this.subtle,new Uint8Array(n),i).decrypt(t.buffer,a)):Promise.reject(new Error("web crypto not initialized"))).catch(a=>(Xt.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${a.name}: ${a.message}`),this.onWebCryptoError(t,e,n,i)))}onWebCryptoError(t,e,n,i){const a=this.enableSoftwareAES;if(a){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,n,i);const o=this.flush();if(o)return o.buffer}throw new Error("WebCrypto"+(a?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(t){let e=t;const n=t.length-t.length%$$;return n!==t.length&&(e=t.slice(0,n),this.remainderData=t.slice(n)),e}logOnce(t){this.logEnabled&&(Xt.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const IA=Math.pow(2,17);class V${constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const n=t.url;if(!n)return Promise.reject(new Ai({type:Tt.NETWORK_ERROR,details:Z.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,a=i.fLoader,o=i.loader;return new Promise((c,d)=>{if(this.loader&&this.loader.destroy(),t.gap)if(t.tagList.some(x=>x[0]==="GAP")){d(kA(t));return}else t.gap=!1;const f=this.loader=a?new a(i):new o(i),h=OA(t);t.loader=f;const p=CA(i.fragLoadPolicy.default),g={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:IA};t.stats=f.stats;const v={onSuccess:(x,S,E,T)=>{this.resetLoader(t,f);let L=x.data;E.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(L.slice(0,16)),L=L.slice(16)),c({frag:t,part:null,payload:L,networkDetails:T})},onError:(x,S,E,T)=>{this.resetLoader(t,f),d(new Ai({type:Tt.NETWORK_ERROR,details:Z.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:Qt({url:n,data:void 0},x),error:new Error(`HTTP Error ${x.code} ${x.text}`),networkDetails:E,stats:T}))},onAbort:(x,S,E)=>{this.resetLoader(t,f),d(new Ai({type:Tt.NETWORK_ERROR,details:Z.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:E,stats:x}))},onTimeout:(x,S,E)=>{this.resetLoader(t,f),d(new Ai({type:Tt.NETWORK_ERROR,details:Z.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${g.timeout}ms`),networkDetails:E,stats:x}))}};e&&(v.onProgress=(x,S,E,T)=>e({frag:t,part:null,payload:E,networkDetails:T})),f.load(h,g,v)})}loadPart(t,e,n){this.abort();const i=this.config,a=i.fLoader,o=i.loader;return new Promise((c,d)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap){d(kA(t,e));return}const f=this.loader=a?new a(i):new o(i),h=OA(t,e);t.loader=f;const p=CA(i.fragLoadPolicy.default),g={loadPolicy:p,timeout:p.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:IA};e.stats=f.stats,f.load(h,g,{onSuccess:(v,x,S,E)=>{this.resetLoader(t,f),this.updateStatsFromPart(t,e);const T={frag:t,part:e,payload:v.data,networkDetails:E};n(T),c(T)},onError:(v,x,S,E)=>{this.resetLoader(t,f),d(new Ai({type:Tt.NETWORK_ERROR,details:Z.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:Qt({url:h.url,data:void 0},v),error:new Error(`HTTP Error ${v.code} ${v.text}`),networkDetails:S,stats:E}))},onAbort:(v,x,S)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,f),d(new Ai({type:Tt.NETWORK_ERROR,details:Z.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:S,stats:v}))},onTimeout:(v,x,S)=>{this.resetLoader(t,f),d(new Ai({type:Tt.NETWORK_ERROR,details:Z.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error(`Timeout after ${g.timeout}ms`),networkDetails:S,stats:v}))}})})}updateStatsFromPart(t,e){const n=t.stats,i=e.stats,a=i.total;if(n.loaded+=i.loaded,a){const d=Math.round(t.duration/e.duration),f=Math.min(Math.round(n.loaded/a),d),p=(d-f)*Math.round(n.loaded/f);n.total=n.loaded+p}else n.total=Math.max(n.loaded,n.total);const o=n.loading,c=i.loading;o.start?o.first+=c.first-c.start:(o.start=c.start,o.first=c.first),o.end=c.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function OA(s,t=null){const e=t||s,n={frag:s,part:t,responseType:"arraybuffer",url:e.url,headers:{},rangeStart:0,rangeEnd:0},i=e.byteRangeStartOffset,a=e.byteRangeEndOffset;if(pt(i)&&pt(a)){var o;let c=i,d=a;if(s.sn==="initSegment"&&G$((o=s.decryptdata)==null?void 0:o.method)){const f=a-i;f%16&&(d=a+(16-f%16)),i!==0&&(n.resetIV=!0,c=i-16)}n.rangeStart=c,n.rangeEnd=d}return n}function kA(s,t){const e=new Error(`GAP ${s.gap?"tag":"attribute"} found`),n={type:Tt.MEDIA_ERROR,details:Z.FRAG_GAP,fatal:!1,frag:s,error:e,networkDetails:null};return t&&(n.part=t),(t||s).stats.aborted=!0,new Ai(n)}function G$(s){return s==="AES-128"||s==="AES-256"}class Ai extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class J_ extends mn{constructor(t,e){super(t,e),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(t){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Py{constructor(t,e,n,i=0,a=-1,o=!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=fd(),this.buffering={audio:fd(),video:fd(),audiovideo:fd()},this.level=t,this.sn=e,this.id=n,this.size=i,this.part=a,this.partial=o}}function fd(){return{start:0,executeStart:0,executeEnd:0,end:0}}const PA={length:0,start:()=>0,end:()=>0};class Dt{static isBuffered(t,e){if(t){const n=Dt.getBuffered(t);for(let i=n.length;i--;)if(e>=n.start(i)&&e<=n.end(i))return!0}return!1}static bufferedRanges(t){if(t){const e=Dt.getBuffered(t);return Dt.timeRangesToArray(e)}return[]}static timeRangesToArray(t){const e=[];for(let n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return e}static bufferInfo(t,e,n){if(t){const i=Dt.bufferedRanges(t);if(i.length)return Dt.bufferedInfo(i,e,n)}return{len:0,start:e,end:e,bufferedIndex:-1}}static bufferedInfo(t,e,n){e=Math.max(0,e),t.length>1&&t.sort((h,p)=>h.start-p.start||p.end-h.end);let i=-1,a=[];if(n)for(let h=0;h<t.length;h++){e>=t[h].start&&e<=t[h].end&&(i=h);const p=a.length;if(p){const g=a[p-1].end;t[h].start-g<n?t[h].end>g&&(a[p-1].end=t[h].end):a.push(t[h])}else a.push(t[h])}else a=t;let o=0,c,d=e,f=e;for(let h=0;h<a.length;h++){const p=a[h].start,g=a[h].end;if(i===-1&&e>=p&&e<=g&&(i=h),e+n>=p&&e<g)d=p,f=g,o=f-e;else if(e+n<p){c=p;break}}return{len:o,start:d||0,end:f||0,nextStart:c,buffered:t,bufferedIndex:i}}static getBuffered(t){try{return t.buffered||PA}catch(e){return Xt.log("failed to get media.buffered",e),PA}}}const tC=/\{\$([a-zA-Z0-9-_]+)\}/g;function MA(s){return tC.test(s)}function o0(s,t){if(s.variableList!==null||s.hasVariableRefs){const e=s.variableList;return t.replace(tC,n=>{const i=n.substring(2,n.length-1),a=e?.[i];return a===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),n):a})}return t}function NA(s,t,e){let n=s.variableList;n||(s.variableList=n={});let i,a;if("QUERYPARAM"in t){i=t.QUERYPARAM;try{const o=new self.URL(e).searchParams;if(o.has(i))a=o.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${e}"`)}catch(o){s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else i=t.NAME,a=t.VALUE;i in n?s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):n[i]=a||""}function H$(s,t,e){const n=t.IMPORT;if(e&&n in e){let i=s.variableList;i||(s.variableList=i={}),i[n]=e[n]}else s.playlistParsingError||(s.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const z$=/^(\d+)x(\d+)$/,BA=/(.+?)=(".*?"|.*?)(?:,|$)/g;class pe{constructor(t,e){typeof t=="string"&&(t=pe.parseAttrList(t,e)),se(this,t)}get clientAttrs(){return Object.keys(this).filter(t=>t.substring(0,2)==="X-")}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(e.length&1?"0":"")+e;const n=new Uint8Array(e.length/2);for(let i=0;i<e.length/2;i++)n[i]=parseInt(e.slice(i*2,i*2+2),16);return n}return null}hexadecimalIntegerAsNumber(t){const e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const n=this[t];return n?parseFloat(n):e}enumeratedString(t){return this[t]}enumeratedStringList(t,e){const n=this[t];return(n?n.split(/[ ,]+/):[]).reduce((i,a)=>(i[a.toLowerCase()]=!0,i),e)}bool(t){return this[t]==="YES"}decimalResolution(t){const e=z$.exec(this[t]);if(e!==null)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t,e){let n;const i={};for(BA.lastIndex=0;(n=BA.exec(t))!==null;){const o=n[1].trim();let c=n[2];const d=c.indexOf('"')===0&&c.lastIndexOf('"')===c.length-1;let f=!1;if(d)c=c.slice(1,-1);else switch(o){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":f=!0}if(e&&(d||f))c=o0(e,c);else if(!f&&!d)switch(o){case"CLOSED-CAPTIONS":if(c==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":Xt.warn(`${t}: attribute ${o} is missing quotes`)}i[o]=c}return i}}const K$="com.apple.hls.interstitial";function q$(s){return s!=="ID"&&s!=="CLASS"&&s!=="CUE"&&s!=="START-DATE"&&s!=="DURATION"&&s!=="END-DATE"&&s!=="END-ON-NEXT"}function Y$(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"||s==="SCTE35-CMD"}class eC{constructor(t,e,n=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=e?.tagAnchor||null,this.tagOrder=(i=e?.tagOrder)!=null?i:n,e){const a=e.attr;for(const o in a)if(Object.prototype.hasOwnProperty.call(t,o)&&t[o]!==a[o]){Xt.warn(`DATERANGE tag attribute: "${o}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=o;break}t=se(new pe({}),a,t)}if(this.attr=t,e?(this._startDate=e._startDate,this._cue=e._cue,this._endDate=e._endDate,this._dateAtEnd=e._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const a=e?.endD
vendor: 3,251 bytes, line 193
193ate||new Date(this.attr["END-DATE"]);pt(a.getTime())&&(this._endDate=a)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return t===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return t===null||t.programDateTime===null?(Xt.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const e=this.duration;return e!==null?this._dateAtEnd=new Date(this._startDate.getTime()+e*1e3):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(pt(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===K$}get isValid(){return!!this.id&&!this._badValueForSameId&&pt(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const W$=10;class Q${constructor(t){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.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t){this.advanced=!0,this.updated=!0;return}const e=this.lastPartSn-t.lastPartSn,n=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!n||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||e===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(t.misses*.6):this.misses=t.misses+1}hasKey(t){return this.encryptedFragments.some(e=>{let n=e.decryptdata;return n||(e.setKeyFormat(t.keyFormat),n=e.decryptdata),!!n&&t.matches(n)})}get hasProgramDateTime(){return this.fragments.length?pt(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||W$}
vendor: 3,580 bytes, line 193
193get drift(){const t=this.driftEndTime-this.driftStartTime;return t>0?(this.driftEnd-this.driftStart)*1e3/t:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const t=this.partList;if(t){const e=this.lastPartIndex;if(e!==-1){for(let n=t.length;n--;)if(t[n].index>e)return t[n].index;return e}}return 0}get lastPartSn(){var t;return(t=this.partList)!=null&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function lf(s,t){return s.length===t.length?!s.some((e,n)=>e!==t[n]):!1}function FA(s,t){return!s&&!t?!0:!s||!t?!1:lf(s,t)}function Ro(s){return s==="AES-128"||s==="AES-256"||s==="AES-256-CTR"}function My(s){switch(s){case"AES-128":case"AES-256":return Ar.cbc;case"AES-256-CTR":return Ar.ctr;default:throw new Error(`invalid full segment method ${s}`)}}function Ny(s){return Uint8Array.from(atob(s),t=>t.charCodeAt(0))}function l0(s){return Uint8Array.from(unescape(encodeURIComponent(s)),t=>t.charCodeAt(0))}function X$(s){const t=l0(s).subarray(0,16),e=new Uint8Array(16);return e.set(t,16-t.length),e}function sC(s){const t=function(n,i,a){const o=n[i];n[i]=n[a],n[a]=o};t(s,0,3),t(s,1,2),t(s,4,5),t(s,6,7)}function nC(s){const t=s.split(":");let e=null;if(t[0]==="data"&&t.length===2){const n=t[1].split(";"),i=n[n.length-1].split(",");if(i.length===2){const a=i[0]==="base64",o=i[1];a?(n.splice(-1,1),e=Ny(o)):e=X$(o)}}return e}const cf=typeof self<"u"?self:void 0;var ye={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ns={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Bd(s){switch(s){case ns.FAIRPLAY:return ye.FAIRPLAY;case ns.PLAYREADY:return ye.PLAYREADY;case ns.WIDEVINE:return ye.WIDEVINE;case ns.CLEARKEY:return ye.CLEARKEY}}function Pp(s){switch(s){case ye.FAIRPLAY:return ns.FAIRPLAY;case ye.PLAYREADY:return ns.PLAYREADY;case ye.WIDEVINE:return ns.WIDEVINE;case ye.CLEARKEY:return ns.CLEARKEY}}function zl(s){const{drmSystems:t,widevineLicenseUrl:e}=s,n=t?[ye.FAIRPLAY,ye.WIDEVINE,ye.PLAYREADY,ye.CLEARKEY].filter(i=>!!t[i]):[];return!n[ye.WIDEVINE]&&e&&n.push(ye.WIDEVINE),n}const iC=(function(s){return cf!=null&&(s=cf.navigator)!=null&&s.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null})();function Z$(s,t,e,n){let i;switch(s){case ye.FAIRPLAY:i=["cenc","sinf"];break;case ye.WIDEVINE:case ye.PLAYREADY:i=["cenc"];break;case ye.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${s}`)}return J$(i,t,e,n)}function J$(s,t,e,n){return[{initDataTypes:s,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:t.map(a=>({contentType:`audio/mp4; codecs=${a}
193`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:e.map(a=>({contentType:`video/mp4; codecs=${a}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function t6(s){var t;return!!s&&(s.sessionType==="persistent-license"||!!((t=s.sessionTypes)!=null&&t.some(e=>e==="persistent-license")))}function rC(s){const t=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/2),e=String.fromCharCode.apply(null,Array.from(t)),n=e.substring(e.indexOf("<"),e.length),o=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(o){const c=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(c){const d=Ny(c).subarray(0,16);return sC(d),d}}return null}let co={};class gr{static clearKeyUriToKeyIdMap(){co={}}static setKeyIdForUri(t,e){co[t]=e}static addKeyIdForUri(t){const e=Object.keys(co).length%Number.MAX_SAFE_INTEGER,n=new Uint8Array(16);return new DataView(n.buffer,12,4).setUint32(0,e),co[t]=n,n}constructor(t,e,n,i=[1],a=null,o){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=n,this.keyFormatVersions=i,this.iv=a,this.encrypted=t?t!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Ro(t),o!=null&&o.startsWith("0x")&&(this.keyId=new Uint8Array(k_(o)))}matches(t){return t.uri===this.uri&&t.method===this.method&&t.encrypted===this.encrypted&&t.keyFormat===this.keyFormat&&lf(t.keyFormatVersions,this.keyFormatVersions)&&FA(t.iv,this.iv)&&FA(t.keyId,this.keyId)}isSupported(){if(this.method){if(Ro(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case ns.FAIRPLAY:case ns.WIDEVINE:case ns.PLAYREADY:case ns.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(t,e){if(!this.encrypted||!this.uri)return null;if(Ro(this.method)){let a=this.iv;return a||(typeof t!="number"&&(Xt.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0),a=s6(t)),new gr(this.method,this.uri,"identity",this.keyFormatVersions,a)}if(this.keyId){const a=co[this.uri];if(a&&!lf(this.keyId,a)&&gr.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const n=nC(this.uri);if(n)switch(this.keyFormat){case ns.WIDEVINE:if(this.pssh=n,!this.keyId){const a=r$(n.buffer);if(a.length){var i;const o=a[0];this.keyId=(i=o.kids)!=null&&i.length?o.kids[0]:null}}this.keyId||(this.keyId=UA(e));break;case ns.PLAYREADY:{const a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=i$(a,null,n),this.keyId=rC(n);break}default:{let a=n.subarray(0,16);if(a.length!==16){const o=new Uint8Array(16);o.set(a,16-a.length),a=o}this.keyId=a;break}}if(!this.keyId||this.keyId.byteLength!==16){let a;a=e6(e),a||(a=UA(e),a||(a=co[this.uri])),a&&(this.keyId=a,gr.setKeyIdForUri(this.uri,a))}return this}}function e6(s){const t=s?.[ns.WIDEVINE];return t?t.keyId:null}function UA(s){const t=s?.[ns.PLAYREADY];if(t){const e=nC(t.uri);if(e)return rC(e)}return null}function s6(s){const t=new Uint8Array(16);for(let e=12;e<16;e++)t[e]=s>>8*(15-e)&255;return t}const jA=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,$A=/#EXT-X-MEDIA:(.*)/g,n6=/^#EXT(?:INF|-X-TARGETDURATION):/m,Mp=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),i6=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|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|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class zn{static findGroup(t,e){for(let n=0;n<t.length;n++){const i=t[n];if(i.id===e)return i}}static resolve(t,e){return Ly.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return n6.test(t)}static parseMasterPlaylist(t,e){const n=MA(t),i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},a=[];if(jA.lastIndex=0,!t.startsWith("#EXTM3U"))return i.playlistParsingError=new Error("no EXTM3U delimiter"),i;let o;for(;(o=jA.exec(t))!=null;)if(o[1]){var c;
vendor: 8,562 bytes, line 193
193const f=new pe(o[1],i),h=o0(i,o[2]),p={attrs:f,bitrate:f.decimalInteger("BANDWIDTH")||f.decimalInteger("AVERAGE-BANDWIDTH"),name:f.NAME,url:zn.resolve(h,e)},g=f.decimalResolution("RESOLUTION");g&&(p.width=g.width,p.height=g.height),HA(f.CODECS,p);const v=f["SUPPLEMENTAL-CODECS"];v&&(p.supplemental={},HA(v,p.supplemental)),(c=p.unknownCodecs)!=null&&c.length||a.push(p),i.levels.push(p)}else if(o[3]){const f=o[3],h=o[4];switch(f){case"SESSION-DATA":{const p=new pe(h,i),g=p["DATA-ID"];g&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[g]=p);break}case"SESSION-KEY":{const p=VA(h,e,i);p.encrypted&&p.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(p)):Xt.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const p=new pe(h,i);NA(i,p,e)}break}case"CONTENT-STEERING":{const p=new pe(h,i);i.contentSteering={uri:zn.resolve(p["SERVER-URI"],e),pathwayId:p["PATHWAY-ID"]||"."};break}case"START":{i.startTimeOffset=GA(h);break}}}const d=a.length>0&&a.length<i.levels.length;return i.levels=d?a:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(t,e,n){let i;const a={},o=n.levels,c={AUDIO:o.map(f=>({id:f.attrs.AUDIO,audioCodec:f.audioCodec})),SUBTITLES:o.map(f=>({id:f.attrs.SUBTITLES,textCodec:f.textCodec})),"CLOSED-CAPTIONS":[]};let d=0;for($A.lastIndex=0;(i=$A.exec(t))!==null;){const f=new pe(i[1],n),h=f.TYPE;if(h){const p=c[h],g=a[h]||[];a[h]=g;const v=f.LANGUAGE,x=f["ASSOC-LANGUAGE"],S=f.CHANNELS,E=f.CHARACTERISTICS,T=f["INSTREAM-ID"],L={attrs:f,bitrate:0,id:d++,groupId:f["GROUP-ID"]||"",name:f.NAME||v||"",type:h,default:f.bool("DEFAULT"),autoselect:f.bool("AUTOSELECT"),forced:f.bool("FORCED"),lang:v,url:f.URI?zn.resolve(f.URI,e):""};if(x&&(L.assocLang=x),S&&(L.channels=S),E&&(L.characteristics=E),T&&(L.instreamId=T),p!=null&&p.length){const _=zn.findGroup(p,L.groupId)||p[0];zA(L,_,"audioCodec"),zA(L,_,"textCodec")}g.push(L)}}return a}static parseLevelPlaylist(t,e,n,i,a,o){var c;const d={url:e},f=new Q$(e),h=f.fragments,p=[];let g=null,v=0,x=0,S=0,E=0,T=0,L=null,_=new Ip(i,d),P,D,B,C=-1,I=!1,F=null,U;if(Mp.lastIndex=0,f.m3u8=t,f.hasVariableRefs=MA(t),((c=Mp.exec(t))==null?void 0:c[0])!=="#EXTM3U")return f.playlistParsingError=new Error("Missing format identifier #EXTM3U"),f;for(;(P=Mp.exec(t))!==null;){I&&(I=!1,_=new Ip(i,d),_.playlistOffset=S,_.setStart(S),_.sn=v,_.cc=E,T&&(_.bitrate=T),_.level=n,g&&(_.initSegment=g,g.rawProgramDateTime&&(_.rawProgramDateTime=g.rawProgramDateTime,g.rawProgramDateTime=null),F&&(_.setByteRange(F),F=null)));const it=P[1];if(it){_.duration=parseFloat(it);const rt=(" "+P[2]).slice(1);_.title=rt||null,_.tagList.push(rt?["INF",it,rt]:["INF",it])}else if(P[3]){if(pt(_.duration)){_.playlistOffset=S,_.setStart(S),B&&qA(_,B,f),_.sn=v,_.level=n,_.cc=E,h.push(_);const rt=(" "+P[3]).slice(1);_.relurl=o0(f,rt),c0(_,L,p),L=_,S+=_.duration,v++,x=0,I=!0}}else{if(P=P[0].match(i6),!P){Xt.warn("No matches on slow regex match for level playlist!");continue}for(D=1;D<P.length&&P[D]===void 0;D++);const rt=(" "+P[D]).slice(1),M=(" "+P[D+1]).slice(1),j=P[D+2]?(" "+P[D+2]).slice(1):null;switch(rt){case"BYTERANGE":L?_.setByteRange(M,L):_.setByteRange(M);break;case"PROGRAM-DATE-TIME":_.rawProgramDateTime=M,_.tagList.push(["PROGRAM-DATE-TIME",M]),C===-1&&(C=h.length);break;case"PLAYLIST-TYPE":f.type&&Ei(f,rt,P),f.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":f.startSN!==0?Ei(f,rt,P):h.length>0&&YA(f,rt,P),v=f.startSN=parseInt(M);break;case"SKIP":{f.skippedSegments&&Ei(f,rt,P);const N=new pe(M,f),V=N.decimalInteger("SKIPPED-SEGMENTS");if(pt(V)){f.skippedSegments+=V;for(let O=V;O--;)h.push(null);v+=V}const X=N.enumeratedString("RECENTLY-REMOVED-DATERANGES");X&&(f.recentlyRemovedDateranges=(f.recentlyRemovedDateranges||[]).concat(X.split(" ")));break}case"TARGETDURATION":f.targetduration!==0&&Ei(f,rt,P),f.targetduration=Math.max(parseInt(M),1);break;case"VERSION":f.version!==null&&Ei(f,rt,P),f.version=parseInt(M);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":f.live||Ei(f,rt,P),f.live=!1;break;case"#":(M||j)&&_.tagList.push(j?[M,j]:[M]);break;case"DISCONTINUITY":E++,_.tagList.push(["DIS"]);break;case"GAP":_.gap=!0,_.tagList.push([rt]);break;case"BITRATE":_.tagList.push([rt,M]),T=parseInt(M)*1e3,pt(T)?_.bitrate=T:T=0;break;case"DATERANGE":{const N=new pe(M,f),V=new eC(N,f.dateRanges[N.ID],f.dateRangeTagCount);f.dateRangeTagCount++,V.isValid||f.skippedSegments?f.dateRanges[V.id]=V:Xt.warn(`Ignoring invalid DATERANGE tag: "${M}"`),_.tagList.push(["EXT-X-DATERANGE",M]);break}case"DEFINE":{{const N=new pe(M,f);"IMPORT"in N?H$(f,N,o):NA(f,N,e)}break}case"DISCONTINUITY-SEQUENCE":f.startCC!==0?Ei(f,rt,P):h.length>0&&YA(f,rt,P),f.startCC=E=parseInt(M);break;case"KEY":{const N=VA(M,e,f);if(N.isSupported()){if(N.method==="NONE"){B=void 0;break}B||(B={});const V=B[N.keyFormat];V!=null&&V.matches(N)||(V&&(B=se({},B)),B[N.keyFormat]=N)}else Xt.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${M}"`);break}case"START":f.startTimeOffset=GA(M);break;case"MAP":{const N=new pe(M,f);if(_.duration){const V=new Ip(i,d);KA(V,N,n,B),g=V,_.initSegment=g,g.rawProgramDateTime&&!_.rawProgramDateTime&&(_.rawProgramDateTime=g.rawProgramDateTime)}else{const V=_.byteRangeEndOffset;if(V){const X=_.byteRangeStartOffset;F=`${V-X}@${X}`}else F=null;KA(_,N,n,B),g=_,I=!0}g.cc=E;break}case"SERVER-CONTROL":{U&&Ei(f,rt,P),U=new pe(M),f.canBlockReload=U.bool("CAN-BLOCK-RELOAD"),f.canSkipUntil=U.optionalFloat("CAN-SKIP-UNTIL",0),f.canSkipDateRanges=f.canSkipUntil>0&&U.bool("CAN-SKIP-DATERANGES"),f.partHoldBack=U.optionalFloat("PART-HOLD-BACK",0),f.holdBack=U.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{f.partTarget&&Ei(f,rt,P);const N=new pe(M);f.partTarget=N.decimalFloatingPoint("PART-TARGET");break}case"PART":{let N=f.partList;N||(N=f.partList=[]);const V=x>0?N[N.length-1]:void 0,X=x++,O=new pe(M,f),G=new H8(O,_,d,X,V);N.push(G),_.duration+=G.duration;break}case"PRELOAD-HINT":{const N=new pe(M,f);f.preloadHint=N;break}case"RENDITION-REPORT":{const N=new pe(M,f);f.renditionReports=f.renditionReports||[],f.renditionReports.push(N);break}default:Xt.warn(`line parsed but not handled: ${P}`);break}}}L&&!L.relurl?(h.pop(),S-=L.duration,f.partList&&(f.fragmentHint=L)):f.partList&&(c0(_,L,p),_.cc=E,f.fragmentHint=_,B&&qA(_,B,f)),f.targetduration||(f.playlistParsingError=new Error("Missing Target Duration"));const z=h.length,Y=h[0],nt=h[z-1];if(S+=f.skippedSegments*f.targetduration,S>0&&z&&nt){f.averagetargetduration=S/z;const it=nt.sn;f.endSN=it!=="initSegment"?it:0,f.live||(nt.endList=!0),C>0&&(a6(h,C),Y&&p.unshift(Y))}return f.fragmentHint&&(S+=f.fragmentHint.duration),f.totalduration=S,p.length&&f.dateRangeTagCount&&Y&&aC(p,f),f.endCC=E,f}}function aC(s,t){let e=s.length;if(!e)if(t.hasProgramDateTime){const c=t.fragments[t.fragments.length-1];s.push(c),e++}else return;const n=s[e-1],i=t.live?1/0:t.totalduration,a=Object.keys(t.dateRanges);for(let c=a.length;c--;){const d=t.dateRanges[a[c]],f=d.startDate.getTime();d.tagAnchor=n.ref;for(let h=e;h--;){var o;if(((o=s[h])==null?void 0:o.sn)<t.startSN)break;const p=r6(t,f,s,h,i);if(p!==-1){d.tagAnchor=t.fragments[p].ref;break}}}}function r6(s,t,e,n,i){const a=e[n];if(a){const c=a.programDateTime;if(t>=c||n===0){var o;const d=(((o=e[n+1])==null?void 0:o.start)||i)-a.start;if(t<=c+d*1e3){const f=e[n].sn-s.startSN;if(f<0)return-1;const h=s.fragments;if(h.length>e.length){const g=(e[n+1]||h[h.length-1]).sn-s.startSN;for(let v=g;v>f;v--){const x=h[v].programDateTime;if(t>=x&&t<x+h[v].duration*1e3)return v}}return f}}}return-1}function VA(s,t,e){var n,i;const a=new pe(s,e),o=(n=a.METHOD)!=null?n:"",c=a.URI,d=a.hexadecimalInteger("IV"),f=a.KEYFORMATVERSIONS,h=(i=a.KEYFORMAT)!=null?i:"identity";c&&a.IV&&!d&&Xt.error(`Invalid IV: ${a.IV}`);const p=c?zn.resolve(c,t):"",g=(f||"1").split("/").map(Number).filter(Number.isFinite);return new gr(o,p,h,g,d,a.KEYID)}function GA(s){const e=new pe(s).decimalFloatingPoint("TIME-OFFSET");return pt(e)?e:null}function HA(s,t){let e=(s||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const i=e.filter(a=>Dy(a,n));i.length&&(t[`${n}Codec`]=i.map(a=>a.split("/")[0]).join(","),e=e.filter(a=>i.indexOf(a)===-1))}),t.unknownCodecs=e}function zA(s,t,e){const n=t[e];n&&(s[e]=n)}function a6(s,t){let e=s[t];for(let n=t;n--;){const i=s[n];if(!i)return;i.programDateTime=e.programDateTime-i.duration*1e3,e=i}}function c0(s,t,e){s.rawProgramDateTime?e.push(s):t!=null&&t.programDateTime&&(s.programDateTime=t.endProgramDateTime)}
vendor: 2,848 bytes, line 193
193function KA(s,t,e,n){s.relurl=t.URI,t.BYTERANGE&&s.setByteRange(t.BYTERANGE),s.level=e,s.sn="initSegment",n&&(s.levelkeys=n),s.initSegment=null}function qA(s,t,e){s.levelkeys=t;const{encryptedFragments:n}=e;(!n.length||n[n.length-1].levelkeys!==t)&&Object.keys(t).some(i=>t[i].isCommonEncryption)&&n.push(s)}function Ei(s,t,e){s.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${e[0]})`)}function YA(s,t,e){s.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${e[0]})`)}function Np(s,t){const e=t.startPTS;if(pt(e)){let n=0,i;t.sn>s.sn?(n=e-s.start,i=s):(n=s.start-e,i=t),i.duration!==n&&i.setDuration(n)}else t.sn>s.sn?s.cc===t.cc&&s.minEndPTS?t.setStart(s.start+(s.minEndPTS-s.start)):t.setStart(s.start+s.duration):t.setStart(Math.max(s.start-t.duration,0))}function oC(s,t,e,n,i,a,o){n-e<=0&&(o.warn("Fragment should have a positive duration",t),n=e+t.duration,a=i+t.duration);let d=e,f=n;const h=t.startPTS,p=t.endPTS;if(pt(h)){const T=Math.abs(h-e);s&&T>s.totalduration?o.warn(`media timestamps and playlist times differ by ${T}s for level ${t.level} ${s.url}`):pt(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,d=Math.max(e,h),e=Math.min(e,h),i=t.startDTS!==void 0?Math.min(i,t.startDTS):i,f=Math.min(n,p),n=Math.max(n,p),a=t.endDTS!==void 0?Math.max(a,t.endDTS):a}const g=e-t.start;t.start!==0&&t.setStart(e),t.setDuration(n-t.start),t.startPTS=e,t.maxStartPTS=d,t.startDTS=i,t.endPTS=n,t.minEndPTS=f,t.endDTS=a;const v=t.sn;if(!s||v<s.startSN||v>s.endSN)return 0;let x;const S=v-s.startSN,E=s.fragments;for(E[S]=t,x=S;x>0;x--)Np(E[x],E[x-1]);for(x=S;x<E.length-1;x++)Np(E[x],E[x+1]);return s.fragmentHint&&Np(E[E.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,g}function o6(s,t,e){if(s===t)return;let n=null;const i=s.fragments;for(let h=i.length-1;h>=0;h--){const p=i[h].initSegment;if(p){n=p;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;let a;u6(s,t,(h,p,g,v)=>{if((!t.startCC||t.skippedSegments)&&p.cc!==h.cc){const x=h.cc-p.cc;for(let S=g;S<v.length;S++)v[S].cc+=x;t.endCC=v[v.length-1].cc}pt(h.startPTS)&&pt(h.endPTS)&&(p.setStart(p.startPTS=h.startPTS),p.startDTS=h.startDTS,p.maxStartPTS=h.maxStartPTS,p.endPTS=h.endPTS,p.endDTS=h.endDTS,p.minEndPTS=h.minEndPTS,p.setDuration(h.endPTS-h.startPTS),p.duration&&(a=p),t.PTSKnown=t.alignedSliding=!0),h.hasStreams&&(p.elementaryStreams=h.elementaryStreams),p.loader=h.loader,h.hasStats&&(p.stats=h.stats),h.initSegment&&(p.initSegment=h.initSegment,n=h.initSegment)});const o=t.fragments,c=t.fragmentHint?o.concat(t.fragmentHint):o;if(n&&c.forEach(h=>{var p;h&&(!h.initSegment||h.initSegment.relurl===((p=n)==null?void 0:p.relurl))&&(h.initSegment=n)}),t.skippedSegments){if(t.deltaUpdateFailed=o.some(h=>!h),t.deltaUpdateFailed){e.warn("[level-helper] Previous playlist missing segments ski
193pped in delta playlist");for(let h=t.skippedSegments;h--;)o.shift();t.startSN=o[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=l6(s.dateRanges,t,e));const h=s.fragments.filter(p=>p.rawProgramDateTime);if(s.hasProgramDateTime&&!t.hasProgramDateTime)for(let p=1;p<c.length;p++)c[p].programDateTime===null&&c0(c[p],c[p-1],h);aC(h,t)}t.endCC=o[o.length-1].cc}if(!t.startCC){var d;const h=uC(s,t.startSN-1);t.startCC=(d=h?.cc)!=null?d:o[0].cc}c6(s.partList,t.partList,(h,p)=>{p.elementaryStreams=h.elementaryStreams,p.stats=h.stats}),a?oC(t,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS,e):lC(s,t),o.length&&(t.totalduration=t.edge-o[0].start),t.driftStartTime=s.driftStartTime,t.driftStart=s.driftStart;const f=t.advancedDateTime;if(t.advanced&&f){const h=t.edge;t.driftStart||(t.driftStartTime=f,t.driftStart=h),t.driftEndTime=f,t.driftEnd=h}else t.driftEndTime=s.driftEndTime,t.driftEnd=s.driftEnd,t.advancedDateTime=s.advancedDateTime;t.requestScheduled===-1&&(t.requestScheduled=s.requestScheduled)}function l6(s,t,e){const{dateRanges:n,recentlyRemovedDateranges:i}=t,a=se({},s);i&&i.forEach(d=>{delete a[d]});const c=Object.keys(a).length;return c?(Object.keys(n).forEach(d=>{const f=a[d],h=new eC(n[d].attr,f);h.isValid?(a[d]=h,f||(h.tagOrder+=c)):e.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${re(n[d].attr)}"`)}),a):n}function c6(s,t,e){if(s&&t){let n=0;for(let i=0,a=s.length;i<a;i++){const o=s[i],c=t[i+n];o&&c&&o.index===c.index&&o.fragment.sn===c.fragment.sn?e(o,c):n--}}}function u6(s,t,e){var n;const i=t.skippedSegments,a=Math.max(s.startSN,t.startSN)-t.startSN,o=(s.fragmentHint?1:0)+(i?t.endSN:Math.min(s.endSN,t.endSN))-t.startSN,c=t.startSN-s.startSN,d=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,f=(n=s.fragmentHint)!=null&&n.duration?s.fragments.concat(s.fragmentHint):s.fragments;for(let h=a;h<=o;h++){const p=f[c+h];let g=d[h];if(i&&!g&&p&&(g=t.fragments[h]=p),p&&g){e(p,g,h,d);const v=p.relurl,x=g.relurl;if(v&&d6(v,x)){t.playlistParsingError=WA(`media sequence mismatch ${g.sn}:`,s,t,p,g);return}else if(p.cc!==g.cc){t.playlistParsingError=WA(`discontinuity sequence mismatch (${p.cc}!=${g.cc})`,s,t,p,g);return}}}}function WA(s,t,e,n,i){return new Error(`${s} ${i.url} 194Playlist starting @${t.startSN} 195${t.m3u8} 196 197Playlist starting @${e.startSN} 198${e.m3u8}`)}function lC(s,t,e=!0){const n=t.startSN+t.skippedSegments-s.startSN,i=s.fragments,a=n>=0;let o=0;if(a&&n<i.length)o=i[n].start;else if(a&&t.startSN===s.endSN+1)o=s.fragmentEnd;else if(a&&e)o=s.fragmentStart+n*t.levelTargetDuration;else if(!t.skippedSegments&&t.fragmentStart===0)o=s.fragmentStart;else return;u0(t,o)}function u0(s,t){if(t){const e=s.fragments;for(let n=s.skippedSegments;n<e.length;n++)e[n].addStart(t);s.fragmentHint&&s.fragmentHint.addStart(t)}}function cC(s,t=1/0){let e=1e3*s.targetduration;if(s.updated){const n=s.fragments;if(n.length&&e*4>t){const a=n[n.length-1].duration*1e3;a<e&&(e=a)}}else e/=2;return Math.round(e)}function uC(s,t,e){if(!s)return null;let n=s.fragments[t-s.startSN];return n||(n=s.fragmentHint,n&&n.sn===t)?n:t<s.startSN&&e&&e.sn===t?e:null}function QA(s,t,e){return s?dC(s.partList,t,e):null}function dC(s,t,e){if(s)for(let n=s.length;n--;){const i=s[n];if(i.index===e&&i.fragment.sn===t)return i}return null}function fC(s){s.forEach((t,e)=>{var n;(n=t.details)==null||n.fragments.forEach(i=>{i.level=e,i.initSegment&&(i.initSegment.level=e)})})}function d6(s,t){return s!==t&&t?XA(s)!==XA(t):!1}function XA(s){return s.replace(/\?[^?]*$/,"")}function ec(s,t){for(let n=0,i=s.length;n<i;n++){var e;if(((e=s[n])==null?void 0:e.cc)===t)return s[n]}return null}function f6(s,t){return!!(s&&t.startCC<s.endCC&&t.endCC>s.startCC)}function ZA(s,t){const e=s.start+t;s.startPTS=e,s.setStart(e),s.endPTS=e+s.duration}function hC(s,t){const e=t.fragments;for(let n=0,i=e.length;n<i;n++)ZA(e[n],s);t.fragmentHint&&ZA(t.fragmentHint,s),t.alignedSliding=!0}function h6(s,t){s&&(mC(t,s),t.alignedSliding||uf(t,s),!t.alignedSliding&&!t.skippedSegments&&lC(s,t,!1))}function mC(s,t){if(!f6(t,s))return;const e=Math.min(t.endCC,s.endCC),n=ec(t.fragments,e),i=ec(s.fragments,e);if(!n||!i)return;Xt.log(`Aligning playlist at start of dicontinuity sequence ${e}`);const a=n.start-i.start;hC(a,s)}function uf(s,t){if(!s.hasProgramDateTime||!t.hasProgramDateTime)return;const e=s.fragments,n=t.fragments;if(!e.length||!n.length)return;let i,a;const o=Math.min(t.endCC,s.endCC);t.startCC<o&&s.startCC<o&&(i=ec(n,o),a=ec(e,o)),(!i||!a)&&(i=n[Math.floor(n.length/2)],a=ec(e,i.cc)||e[Math.floor(e.length/2)]);const c=i.programDateTime,d=a.programDateTime;if(!c||!d)return;const f=(d-c)/1e3-(a.start-i.start);
vendor: 37,706 bytes, line 198
198hC(f,s)}function ms(s,t,e){_s(s,t,e),s.addEventListener(t,e)}function _s(s,t,e){s.removeEventListener(t,e)}const m6={toString:function(s){let t="";const e=s.length;for(let n=0;n<e;n++)t+=`[${s.start(n).toFixed(3)}-${s.end(n).toFixed(3)}]`;return t}},ct={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"};class By extends J_{constructor(t,e,n,i,a){super(i,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=ct.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:o,fragCurrent:c,media:d,mediaBuffer:f,state:h}=this,p=d?d.currentTime:0,g=Dt.bufferInfo(f||d,p,o.maxBufferHole),v=!g.len;if(this.log(`Media seeking to ${pt(p)?p.toFixed(3):p}, state: ${h}, ${v?"out of":"in"} buffer`),this.state===ct.ENDED)this.resetLoadingState();else if(c){const x=o.maxFragLookUpTolerance,S=c.start-x,E=c.start+c.duration+x;if(v||E<g.start||S>g.end){const T=p>E;(p<S||T)&&(T&&c.loader&&(this.log(`Cancelling fragment load for seek (sn: ${c.sn})`),c.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(d){this.fragmentTracker.removeFragmentsInRange(p,1/0,this.playlistType,!0);const x=this.lastCurrentTime;if(p>x&&(this.lastCurrentTime=p),!this.loadingParts){const S=Math.max(g.end,p),E=this.shouldLoadParts(this.getLevelDetails(),S);E&&(this.log(`LL-Part loading ON after seeking to ${p.toFixed(2)} with buffer @${S.toFixed(2)}`),this.loadingParts=E)}}this.hls.hasEnoughToStart||(this.log(`Setting ${v?"startPosition":"nextLoadPosition"} to ${p} for seek without enough to start`),this.nextLoadPosition=p,v&&(this.startPosition=p)),v&&this.state===ct.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=a,this.hls=t,this.fragmentLoader=new V$(t.config),this.keyLoader=n,this.fragmentTracker=e,this.config=t.config,this.decrypter=new ky(t.config)}registerListeners(){const{hls:t}=this;t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(w.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(w.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===ct.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;t!=null&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=ct.STOPPED}get startPositionValue(){const{nextLoadPosition:t,startPosition:e}=this;return e===-1&&t?t:e}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,e){if(e.live||!this.media)return!1;const n=t.end||0,i=this.config.timelineOffset||0;if(n<=i)return!1;const a=t.buffered;this.config.maxBufferHole&&a&&a.length>1&&(t=Dt.bufferedInfo(a,t.start,0));const o=t.nextStart;if(o&&o>i&&o<e.edge||this.media.currentTime<t.start)return!1;const d=e.partList;if(d!=null&&d.length){const h=d[d.length-1];return Dt.isBuffered(this.media,h.start+h.duration/2)}const f=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(f)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const t=this.config.timelineOffset;if(t){var e;return((e=this.getLevelDetails())==null?void 0:e.appliedTimelineOffset)||t}return 0}onMediaAttached(t,e){const n=this.media=this.mediaBuffer=e.media;ms(n,"seeking",this.onMediaSeeking),ms(n,"ended",this.onMediaEnded);const i=this.config;this.levels&&i.autoStartLoad&&this.state===ct.STOPPED&&this.startLoad(i.startPosition)}onMediaDetaching(t,e){const n=!!e.transferMedia,i=this.media;if(i!==null){if(i.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),_s(i,"seeking",this.onMediaSeeking),_s(i,"ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(t,e){}onManifestLoaded(t,e){this.startTimeOffset=e.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=ct.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(t,e,n){this.startFragRequested=!0,this._loadFragForPlayback(t,e,n)}_loadFragForPlayback(t,e,n){const i=a=>{const o=a.frag;if(this.fragContextChanged(o)){this.warn(`${o.type} sn: ${o.sn}${a.part?" part: "+a.part.index:""} of ${this.fragInfo(o,!1,a.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(o);return}o.stats.chunkCount++,this._handleFragmentLoadProgress(a)};this._doFragLoad(t,e,n,i).then(a=>{if(!a)return;const o=this.state,c=a.frag;if(this.fragContextChanged(c)){(o===ct.FRAG_LOADING||!this.fragCurrent&&o===ct.PARSING)&&(this.fragmentTracker.removeFragment(c),this.state=ct.IDLE);return}"payload"in a&&(this.log(`Loaded ${c.type} sn: ${c.sn} of ${this.playlistLabel()} ${c.level}`),this.hls.trigger(w.FRAG_LOADED,a)),this._handleFragmentLoadComplete(a)}).catch(a=>{this.state===ct.STOPPED||this.state===ct.ERROR||(this.warn(`Frag error: ${a?.message||a}`),this.resetFragmentLoading(t))})}clearTrackerIfNeeded(t){var e;const{fragmentTracker:n}=this;if(n.getState(t)===Ve.APPENDING){const a=t.type,o=this.getFwdBufferInfo(this.mediaBuffer,a),c=Math.max(t.duration,o?o.len:this.config.maxBufferLength),d=this.backtrackFragment;((d?t.sn-d.sn:0)===1||this.reduceMaxBufferLength(c,t.duration))&&n.removeFragment(t)}else((e=this.mediaBuffer)==null?void 0:e.buffered.length)===0?n.removeAllFragments():n.hasParts(t.type)&&(n.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),n.getState(t)===Ve.PARTIAL&&n.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const e=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}waitForLive(t){const e=t.details;return e?.live&&e.type!=="EVENT"&&(this.levelLastLoaded!==t||e.expired)}flushMainBuffer(t,e,n=null){if(!(t-e))return;const i={startOffset:t,endOffset:e,type:n};this.hls.trigger(w.BUFFER_FLUSHING,i)}_loadInitSegment(t,e){this._doFragLoad(t,e).then(n=>{const i=n?.frag;if(!i||this.fragContextChanged(i)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:i}=this,{frag:a,payload:o}=n,c=a.decryptdata;if(o&&o.byteLength>0&&c!=null&&c.key&&c.iv&&Ro(c.method)){const d=self.performance.now();return this.decrypter.decrypt(new Uint8Array(o),c.key.buffer,c.iv.buffer,My(c.method)).catch(f=>{throw i.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_DECRYPT_ERROR,fatal:!1,error:f,reason:f.message,frag:a}),f}).then(f=>{const h=self.performance.now();return i.trigger(w.FRAG_DECRYPTED,{frag:a,payload:f,stats:{tstart:d,tdecrypt:h}}),n.payload=f,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===ct.STOPPED||this.state===ct.ERROR||(this.warn(n),this.resetFragmentLoading(t))})}completeInitSegmentLoad(t){const{levels:e}=this;if(!e)throw new Error("init load aborted, missing levels");const n=t.frag.stats;this.state!==ct.STOPPED&&(this.state=ct.IDLE),t.frag.data=new Uint8Array(t.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(t,e){var n,i;const a=t.tracks;if(a&&!e.encrypted&&((n=a.audio)!=null&&n.encrypted||(i=a.video)!=null&&i.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const o=this.media,c=new Error(`Encrypted track with no key in ${this.fragInfo(e)} (media ${o?"attached mediaKeys: "+o.mediaKeys:"detached"})`);return this.warn(c.message),!o||o.mediaKeys?!1:(this.hls.trigger(w.ERROR,{type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_KEYS,fatal:!1,error:c,frag:e}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.sn!==e.sn||t.level!==e.level}fragBufferedComplete(t,e){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)} > buffer:${n?m6.toString(Dt.getBuffered(n)):"(detached)"})`),_e(t)){var i;if(t.type!==yt.SUBTITLE){const o=t.elementaryStreams;if(!Object.keys(o).some(c=>!!o[c])){this.state=ct.IDLE;return}}const a=(i=this.levels)==null?void 0:i[t.level];a!=null&&a.fragmentError&&(this.log(`Resetting level fragment error count of ${a.fragmentError} on frag buffered`),a.fragmentError=0)}this.state=ct.IDLE}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:n,part:i,partsLoaded:a}=t,o=!a||a.length===0||a.some(d=>!d),c=new Py(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!o);e.flush(c)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,n=null,i){var a;this.fragCurrent=t;const o=e.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let c=null;if(t.encrypted&&!((a=t.decryptdata)!=null&&a.key)){if(this.log(`Loading key for ${t.sn} of [${o.startSN}-${o.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=ct.KEY_LOADING,this.fragCurrent=t,c=this.keyLoader.load(t).then(g=>{if(!this.fragContextChanged(g.frag))return this.hls.trigger(w.KEY_LOADED,g),this.state===ct.KEY_LOADING&&(this.state=ct.IDLE),g}),this.hls.trigger(w.KEY_LOADING,{frag:t}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else t.encrypted||(c=this.keyLoader.loadClear(t,o.encryptedFragments,this.startFragRequested),c&&this.log("[eme] blocking frag load until media-keys acquired"));const d=this.fragPrevious;if(_e(t)&&(!d||t.sn!==d.sn)){const g=this.shouldLoadParts(e.details,t.end);g!==this.loadingParts&&(this.log(`LL-Part loading ${g?"ON":"OFF"} loading sn ${d?.sn}->${t.sn}`),this.loadingParts=g)}if(n=Math.max(t.start,n||0),this.loadingParts&&_e(t)){const g=o.partList;if(g&&i){n>o.fragmentEnd&&o.fragmentHint&&(t=o.fragmentHint);const v=this.getNextPart(g,t,n);if(v>-1){const x=g[v];t=this.fragCurrent=x.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${x.index} (${v}/${g.length-1}) of ${this.fragInfo(t,!1,x)}) cc: ${t.cc} [${o.startSN}-${o.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=x.start+x.duration,this.state=ct.FRAG_LOADING;let S;return c?S=c.then(E=>!E||this.fragContextChanged(E.frag)?null:this.doFragPartsLoad(t,x,e,i)).catch(E=>this.handleFragLoadError(E)):S=this.doFragPartsLoad(t,x,e,i).catch(E=>this.handleFragLoadError(E)),this.hls.trigger(w.FRAG_LOADING,{frag:t,part:x,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):S}else if(!t.url||this.loadedEndOfParts(g,n))return Promise.resolve(null)}}if(_e(t)&&this.loadingParts){var f;this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${t.sn} loaded parts: ${(f=o.partList)==null?void 0:f.filter(g=>g.loaded).map(g=>`[${g.start}-${g.end}]`)}`),this.loadingParts=!1}else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${"["+o.startSN+"-"+o.endSN+"]"}, target: ${parseFloat(n.toFixed(3))}`),pt(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=ct.FRAG_LOADING;const h=this.config.progressive&&t.type!==yt.SUBTITLE;let p;return h&&c?p=c.then(g=>!g||this.fragContextChanged(g.frag)?null:this.fragmentLoader.load(t,i)).catch(g=>this.handleFragLoadError(g)):p=Promise.all([this.fragmentLoader.load(t,h?i:void 0),c]).then(([g])=>(!h&&i&&i(g),g)).catch(g=>this.handleFragLoadError(g)),this.hls.trigger(w.FRAG_LOADING,{frag:t,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):p}doFragPartsLoad(t,e,n,i){return new Promise((a,o)=>{var c;const d=[],f=(c=n.details)==null?void 0:c.partList,h=p=>{this.fragmentLoader.loadPart(t,p,i).then(g=>{d[p.index]=g;const v=g.part;this.hls.trigger(w.FRAG_LOADED,g);const x=QA(n.details,t.sn,p.index+1)||dC(f,t.sn,p.index+1);if(x)h(x);else return a({frag:t,part:v,partsLoaded:d})}).catch(o)};h(e)})}handleFragLoadError(t){if("data"in t){const e=t.data;e.frag&&e.details===Z.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):e.frag&&e.type===Tt.KEY_SYSTEM_ERROR?(e.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(e.frag)):this.hls.trigger(w.ERROR,e)}else this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==ct.PARSING){!this.fragCurrent&&this.state!==ct.STOPPED&&this.state!==ct.ERROR&&(this.state=ct.IDLE);return}const{frag:n,part:i,level:a}=e,o=self.performance.now();n.stats.parsing.end=o,i&&(i.stats.parsing.end=o);const c=this.getLevelDetails(),f=c&&n.sn>c.endSN||this.shouldLoadParts(c,n.end);f!==this.loadingParts&&(this.log(`LL-Part loading ${f?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=f),this.updateLevelTiming(n,i,a,t.partial)}shouldLoadParts(t,e){if(this.config.lowLatencyMode){if(!t)return this.loadingParts;if(t.partList){var n;const a=t.partList[0];if(a.fragment.type===yt.SUBTITLE)return!1;const o=a.end+(((n=t.fragmentHint)==null?void 0:n.duration)||0);if(e>=o){var i;if((this.hls.hasEnoughToStart?((i=this.media)==null?void 0:i.currentTime)||this.lastCurrentTime:this.getLoadPosition())>a.start-a.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:e,fragCurrent:n}=this,{level:i,sn:a,part:o}=t;if(!(e!=null&&e[i]))return this.warn(`Levels object was unset while buffering fragment ${a} of ${this.playlistLabel()} ${i}. The current chunk will not be buffered.`),null;const c=e[i],d=c.details,f=o>-1?QA(d,a,o):null,h=f?f.fragment:uC(d,a,n);return h?(n&&n!==h&&(h.stats=n.stats),{frag:h,part:f,level:c}):null}bufferFragmentData(t,e,n,i,a){if(this.state!==ct.PARSING)return;const{data1:o,data2:c}=t;let d=o;if(c&&(d=hn(o,c)),!d.length)return;const f=this.initPTS[e.cc],h=f?-f.baseTime/f.timescale:void 0,p={type:t.type,frag:e,part:n,chunkMeta:i,offset:h,parent:e.type,data:d};if(this.hls.trigger(w.BUFFER_APPENDING,p),t.dropped&&t.independent&&!n){if(a)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!Dt.isBuffered(e,e.currentTime)){this.flushMainBuffer(0,t.start);return}const n=e.currentTime,i=Dt.bufferInfo(e,n,0),a=t.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,a*.25),c=Math.max(Math.min(t.start-o,i.end-o),n+o);t.start-c>o&&this.flushMainBuffer(c,t.start)}getFwdBufferInfo(t,e){var n;const i=this.getLoadPosition();if(!pt(i))return null;const o=this.lastCurrentTime>i||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,i,e,o)}getFwdBufferInfoAtPos(t,e,n,i){const a=Dt.bufferInfo(t,e,i);if(a.len===0&&a.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(e,n);if(o&&(a.nextStart<=o.end||o.gap)){const c=Math.max(Math.min(a.nextStart,o.end)-e,i);return Dt.bufferInfo(t,e,c)}}return a}getMaxBufferLength(t){const{config:e}=this;let n;return t?n=Math.max(8*e.maxBufferSize/t,e.maxBufferLength):n=e.maxBufferLength,Math.min(n,e.maxMaxBufferLength)}exceedsMaxBuffer(t,e,n){const i=t.nextStart;if(i&&n.start>i){const a=t.buffered;if(a){let o=t.len;const c=t.bufferedIndex;for(let d=a.length-1;d>c;d--)a[d].start<n.start&&(o+=a[d].end-a[d].start);return o>=e}}return!1}reduceMaxBufferLength(t,e){const n=this.config,i=Math.max(Math.min(t-e,n.maxBufferLength),e),a=Math.max(t-e*3,n.maxMaxBufferLength/2,i);return a>=i?(n.maxMaxBufferLength=a,this.warn(`Reduce max buffer length to ${a}s`),!0):!1}getAppendedFrag(t,e=yt.MAIN){const n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(t,e):null;return n&&"fragment"in n?n.fragment:n}getNextFragment(t,e){const n=e.fragments,i=n.length;if(!i)return null;const{config:a}=this,o=e.fragmentStart,c=a.lowLatencyMode&&!!e.partList;let d=null;if(e.live){const p=a.initialLiveManifestSize;if(i<p)return this.warn(`Not enough fragments to start playback (have: ${i}, need: ${p})`),null;if(!e.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||t<o){var f;c&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),d=this.getInitialLiveFragment(e);const g=this.config.startPosition,v=this.hls.startPosition,x=this.hls.liveSyncPosition,S=((f=d)==null?void 0:f.start)||0;let E,T;v!==-1&&v>=o?(E=v,T=v===g?"config":"next load start"):x!==null?(E=x,T="live edge"):(E=t,T="buffer pos"),E<S&&(E=S,T="live frag start"),E<o&&(E=o,T="playlist start"),(this.startPosition!=E||this.nextLoadPosition!=E)&&(this.log(`Setting startPosition to ${E.toFixed(3)} ${v===-1?"":`(from ${g}) `}based on ${T}. live edge: ${x} live frag start: ${S.toFixed(3)} playlist start: ${o.toFixed(3)} buffer pos: ${t}`),this.startPosition=this.nextLoadPosition=E)}}else t<=o&&(d=n[0]);if(!d){const p=this.loadingParts?e.partEnd:e.fragmentEnd;d=this.getFragmentAtPosition(t,p,e)}let h=this.filterReplacedPrimary(d,e);if(!h&&d){const p=d.sn-e.startSN;h=this.filterReplacedPrimary(n[p+1]||null,e)}return this.mapToInitFragWhenRequired(h)}isLoopLoading(t,e){if(this.nextLoadPosition<=e)return!1;const n=this.fragmentTracker.getState(t);return n===Ve.OK||n===Ve.PARTIAL&&!!t.gap}getNextFragmentLoopLoading(t,e,n,i,a){let o=null;if(t.gap&&(o=this.getNextFragment(this.nextLoadPosition,e),o&&!o.gap&&n.nextStart)){const c=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,i,0);if(c!==null&&n.len+c.len>=a){const d=o.sn;return this.loopSn!==d&&(this.log(`buffer full after gaps in "${i}" playlist starting at sn: ${d}`),this.loopSn=d),null}}return this.loopSn=void 0,o}get primaryPrefetch(){if(JA(this.config)){var t;if((t=this.hls.interstitialsManager)==null||(t=t.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(t,e){if(!t)return t;if(JA(this.config)&&t.type!==yt.SUBTITLE){const n=this.hls.interstitialsManager,i=n?.bufferingItem;if(i){const o=i.event;if(o){if(o.appendInPlace||Math.abs(t.start-i.start)>1||i.start===0)return null}else if(t.end<=i.start&&e?.live===!1||t.start>i.end&&i.nextEvent&&(i.nextEvent.appendInPlace||t.start-i.end>1))return null}const a=n?.playerQueue;if(a)for(let o=a.length;o--;){const c=a[o].interstitial;if(c.appendInPlace&&t.start>=c.startTime&&t.end<=c.resumeTime)return null}}return t}mapToInitFragWhenRequired(t){return t!=null&&t.initSegment&&!t.initSegment.data&&!this.bitrateTest?t.initSegment:t}getNextPart(t,e,n){let i=-1,a=!1,o=!0;for(let c=0,d=t.length;c<d;c++){const f=t[c];if(o=o&&!f.independent,i>-1&&n<f.start)break;const h=f.loaded;h?i=-1:(a||(f.independent||o)&&f.fragment===e)&&(f.fragment!==e&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${f.start}`),i=c),a=h}return i}loadedEndOfParts(t,e){let n;for(let i=t.length;i--;){if(n=t[i],!n.loaded)return!1;if(e>n.start)return!0}return!1}getInitialLiveFragment(t){const e=t.fragments,n=this.fragPrevious;let i=null;if(n){if(t.hasProgramDateTime&&(i=D$(e,n.endProgramDateTime,this.config.maxFragLookUpTolerance),i&&this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`)),!i){const a=n.sn+1;if(a>=t.startSN&&a<=t.endSN){const o=e[a-t.startSN];n.cc===o.cc&&(i=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${i.sn}`))}i||(i=Q_(t,n.cc,n.end),i&&this.log(`Live playlist, switching playlist, load frag with same CC: ${i.sn}`))}}else{const a=this.hls.liveSyncPosition;a!==null&&(i=this.getFragmentAtPosition(a,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i}getFragmentAtPosition(t,e,n){const{config:i}=this;let{fragPrevious:a}=this,{fragments:o,endSN:c}=n;const{fragmentHint:d}=n,{maxFragLookUpTolerance:f}=i,h=n.partList,p=!!(this.loadingParts&&h!=null&&h.length&&d);p&&!this.bitrateTest&&h[h.length-1].fragment.sn===d.sn&&(o=o.concat(d),c=d.sn);let g;if(t<e){var v;const S=t<this.lastCurrentTime||t>e-f||(v=this.media)!=null&&v.paused||!this.startFragRequested?0:f;g=ua(a,o,t,S)}else g=o[o.length-1];if(g){const x=g.sn-n.startSN,S=this.fragmentTracker.getState(g);if((S===Ve.OK||S===Ve.PARTIAL&&g.gap)&&(a=g),a&&g.sn===a.sn&&(!p||h[0].fragment.sn>g.sn||!n.live)&&g.level===a.level){const T=o[x+1];g.sn<c&&this.fragmentTracker.getState(T)!==Ve.OK?g=T:g=null}}return g}alignPlaylists(t,e,n){const i=t.fragments.length;if(!i)return this.warn("No fragments in live playlist"),0;const a=t.fragmentStart,o=!e,c=t.alignedSliding&&pt(a);if(o||!c&&!a){h6(n,t);const d=t.fragmentStart;return this.log(`Live playlist sliding: ${d.toFixed(2)} start-sn: ${e?e.startSN:"na"}->${t.startSN} fragments: ${i}`),d}return a}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,t.partTarget*3)}setStartPosition(t,e){let n=this.startPosition;n<e&&(n=-1);const i=this.timelineOffset;if(n===-1){const a=this.startTimeOffset!==null,o=a?this.startTimeOffset:t.startTimeOffset;o!==null&&pt(o)?(n=e+o,o<0&&(n+=t.edge),n=Math.min(Math.max(e,n),e+t.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${o} found in ${a?"multivariant":"media"} playlist`),this.startPosition=n):t.live?(n=this.hls.liveSyncPosition||e,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+i}this.nextLoadPosition=n+i}getLoadPosition(){var t;const{media:e}=this;let n=0;return(t=this.hls)!=null&&t.hasEnoughToStart&&e?n=e.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(t,e){this.transmuxer&&t.type===this.playlistType&&_e(t)&&t.stats.aborted&&(this.log(`Fragment ${t.sn}${e?" part "+e.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){(!this.fragCurrent||!this.fragContextChanged(t)&&this.state!==ct.FRAG_LOADING_WAITING_RETRY)&&(this.state=ct.IDLE)}onFragmentOrKeyLoadError(t,e){var n;if(e.chunkMeta&&!e.frag){const T=this.getCurrentContext(e.chunkMeta);T&&(e.frag=T.frag)}const i=e.frag;if(!i||i.type!==t||!this.levels)return;if(this.fragContextChanged(i)){var a;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(a=this.fragCurrent)==null?void 0:a.url}`);return}const o=e.details===Z.FRAG_GAP;o&&this.fragmentTracker.fragBuffered(i,!0);const c=e.errorAction;if(!c){this.state=ct.ERROR;return}const{action:d,flags:f,retryCount:h=0,retryConfig:p}=c,g=!!p,v=g&&d===es.RetryRequest,x=g&&!c.resolved&&f===Us.MoveAllAlternatesMatchingHost,S=(n=this.hls.latestLevelDetails)==null?void 0:n.live;if(!v&&x&&_e(i)&&!i.endList&&S&&!Z_(e))this.resetFragmentErrors(t),this.treatAsGap(i),c.resolved=!0;else if((v||x)&&h<p.maxNumRetry){var E;const T=a0((E=e.response)==null?void 0:E.code),L=Oy(p,h);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+L,this.state=ct.FRAG_LOADING_WAITING_RETRY,c.resolved=!0,T){this.log("Waiting for connection (offline)"),this.retryDate=1/0,e.reason="offline";return}this.warn(`Fragment ${i.sn} of ${t} ${i.level} errored with ${e.details}, retrying loading ${h+1}/${p.maxNumRetry} in ${L}ms`)}else if(p)if(this.resetFragmentErrors(t),h<p.maxNumRetry)!o&&d!==es.RemoveAlternatePermanently&&(c.resolved=!0);else{this.warn(`${e.details} reached or exceeded max retry (${h})`);return}else d===es.SendAlternateToPenaltyBox?this.state=ct.WAITING_LEVEL:this.state=ct.ERROR;this.tickImmediate()}checkRetryDate(){const t=self.performance.now(),e=this.retryDate,n=e===1/0;(!e||t>=e||n&&!a0(0))&&(n&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=ct.IDLE)}reduceLengthAndFlushBuffer(t){if(this.state===ct.PARSING||this.state===ct.PARSED){const e=t.frag,n=t.parent,i=this.getFwdBufferInfo(this.mediaBuffer,n),a=i&&i.len>.5;a&&this.reduceMaxBufferLength(i.len,e?.duration||10);const o=!a;return o&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),e&&(this.fragmentTracker.removeFragment(e),this.nextLoadPosition=e.start),this.resetLoadingState(),o}return!1}resetFragmentErrors(t){t===yt.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==ct.STOPPED&&(this.state=ct.IDLE)}afterBufferFlushed(t,e,n){if(!t)return;const i=Dt.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,i,n),this.state===ct.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==ct.STOPPED&&(this.state=ct.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=this.levelLastLoaded,e=t?t.details:null;e!=null&&e.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(e,e.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.log(`Loading context changed while buffering sn ${t.sn} of ${this.playlistLabel()} ${t.level===-1?"<removed>":t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,n,i){const a=n.details;if(!a){this.warn("level.details undefined");return}if(!Object.keys(t.elementaryStreams).reduce((d,f)=>{const h=t.elementaryStreams[f];if(h){const p=h.endPTS-h.startPTS;if(p<=0)return this.warn(`Could not parse fragment ${t.sn} ${f} duration reliably (${p})`),d||!1;const g=i?0:oC(a,t,h.startPTS,h.endPTS,h.startDTS,h.endDTS,this);return this.hls.trigger(w.LEVEL_PTS_UPDATED,{details:a,level:n,drift:g,type:f,frag:t,start:h.startPTS,end:h.endPTS}),!0}return d},!1)){var c;const d=((c=this.transmuxer)==null?void 0:c.error)===null;if((n.fragmentError===0||d&&(n.fragmentError<2||t.endList))&&this.treatAsGap(t,n),d){const f=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(f.message),this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!1,error:f,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=ct.PARSED,this.log(`Parsed ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)})`),this.hls.trigger(w.FRAG_PARSED,{frag:t,part:e})}playlistLabel(){return this.playlistType===yt.MAIN?"level":"track"}fragInfo(t,e=!0,n){var i,a;return`${this.playlistLabel()} ${t.level} (${n?"part":"frag"}:[${((i=e&&!n?t.startPTS:(n||t).start)!=null?i:NaN).toFixed(3)}-${((a=e&&!n?t.endPTS:(n||t).end)!=null?a:NaN).toFixed(3)}]${n&&t.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(t,e){e&&e.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;(t=this.transmuxer)==null||t.reset()}recoverWorkerError(t){t.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(t){const e=this._state;e!==t&&(this._state=t,this.log(`${e}->${t}`))}get state(){return this._state}}function JA(s){return!!s.interstitialsController&&s.enableInterstitialPlayback!==!1}class pC{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:e}=this;let n;if(t.length)t.length===1?n=t[0]:n=p6(t,e);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function p6(s,t){const e=new Uint8Array(t);let n=0;for(let i=0;i<s.length;i++){const a=s[i];e.set(a,n),n+=a.length}return e}var Bp={exports:{}},t1;function g6(){return t1||(t1=1,(function(s){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function i(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function a(d,f,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new i(h,p||d,g),x=e?e+f:f;return d._events[x]?d._events[x].fn?d._events[x]=[d._events[x],v]:d._events[x].push(v):(d._events[x]=v,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new n:delete d._events[f]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(e?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=e?e+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,v=p.length,x=new Array(v);g<v;g++)x[g]=p[g].fn;return x},c.prototype.listenerCount=function(f){var h=e?e+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,g,v,x){var S=e?e+f:f;if(!this._events[S])return!1;var E=this._events[S],T=arguments.length,L,_;if(E.fn){switch(E.once&&this.removeListener(f,E.fn,void 0,!0),T){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,h),!0;case 3:return E.fn.call(E.context,h,p),!0;case 4:return E.fn.call(E.context,h,p,g),!0;case 5:return E.fn.call(E.context,h,p,g,v),!0;case 6:return E.fn.call(E.context,h,p,g,v,x),!0}for(_=1,L=new Array(T-1);_<T;_++)L[_-1]=arguments[_];E.fn.apply(E.context,L)}else{var P=E.length,D;for(_=0;_<P;_++)switch(E[_].once&&this.removeListener(f,E[_].fn,void 0,!0),T){case 1:E[_].fn.call(E[_].context);break;case 2:E[_].fn.call(E[_].context,h);break;case 3:E[_].fn.call(E[_].context,h,p);break;case 4:E[_].fn.call(E[_].context,h,p,g);break;default:if(!L)for(D=1,L=new Array(T-1);D<T;D++)L[D-1]=arguments[D];E[_].fn.apply(E[_].context,L)}}return!0},c.prototype.on=function(f,h,p){return a(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return a(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,g){var v=e?e+f:f;if(!this._events[v])return this;if(!h)return o(this,v),this;var x=this._events[v];if(x.fn)x.fn===h&&(!g||x.once)&&(!p||x.context===p)&&o(this,v);else{for(var S=0,E=[],T=x.length;S<T;S++)(x[S].fn!==h||g&&!x[S].once||p&&x[S].context!==p)&&E.push(x[S]);E.length?this._events[v]=E.length===1?E[0]:E:o(this,v)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=e?e+f:f,this._events[h]&&o(this,h)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=e,c.EventEmitter=c,s.exports=c})(Bp)),Bp.exports}var y6=g6(),Fy=V8(y6);const Ec="1.6.17",Mo={};function v6(){return typeof __HLS_WORKER_BUNDLE__=="function"}function x6(){const s=Mo[Ec];if(s)return s.clientCount++,s;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(t),i={worker:new self.Worker(e),objectURL:e,clientCount:1};return Mo[Ec]=i,i}function b6(s){const t=Mo[s];if(t)return t.clientCount++,t;const e=new self.URL(s,self.location.href).href,i={worker:new self.Worker(e),scriptURL:e,clientCount:1};return Mo[s]=i,i}function S6(s){const t=Mo[s||Ec];if(t&&t.clientCount--===1){const{worker:n,objectURL:i}=t;delete Mo[s||Ec],i&&self.URL.revokeObjectURL(i),n.terminate()}}function gC(s,t){return t+10<=s.length&&s[t]===51&&s[t+1]===68&&s[t+2]===73&&s[t+3]<255&&s[t+4]<255&&s[t+6]<128&&s[t+7]<128&&s[t+8]<128&&s[t+9]<128}function Uy(s,t){return t+10<=s.length&&s[t]===73&&s[t+1]===68&&s[t+2]===51&&s[t+3]<255&&s[t+4]<255&&s[t+6]<128&&s[t+7]<128&&s[t+8]<128&&s[t+9]<128}function Nf(s,t){let e=0;return e=(s[t]&127)<<21,e|=(s[t+1]&127)<<14,e|=(s[t+2]&127)<<7,e|=s[t+3]&127,e}function Tc(s,t){const e=t;let n=0;for(;Uy(s,t);){n+=10;const i=Nf(s,t+6);n+=i,gC(s,t+10)&&(n+=10),t+=n}if(n>0)return s.subarray(e,e+n)}function E6(s,t,e,n){const i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],a=t[e+2],o=a>>2&15;if(o>12){const v=new Error(`invalid ADTS sampling index:${o}`);s.emit(w.ERROR,w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!0,error:v,reason:v.message});return}const c=(a>>6&3)+1,d=t[e+3]>>6&3|(a&1)<<2,f="mp4a.40."+c,h=i[o];let p=o;(c===5||c===29)&&(p-=3);const g=[c<<3|(p&14)>>1,(p&1)<<7|d<<3];return Xt.log(`manifest codec:${n}, parsed codec:${f}, channels:${d}, rate:${h} (ADTS object type:${c} sampling index:${o})`),{config:g,samplerate:h,channelCount:d,codec:f,parsedCodec:f,manifestCodec:n}}function yC(s,t){return s[t]===255&&(s[t+1]&246)===240}function vC(s,t){return s[t+1]&1?7:9}function jy(s,t){return(s[t+3]&3)<<11|s[t+4]<<3|(s[t+5]&224)>>>5}function T6(s,t){return t+5<s.length}function df(s,t){return t+1<s.length&&yC(s,t)}function A6(s,t){return T6(s,t)&&yC(s,t)&&jy(s,t)<=s.length-t}function R6(s,t){if(df(s,t)){const e=vC(s,t);if(t+e>=s.length)return!1;const n=jy(s,t);if(n<=e)return!1;const i=t+n;return i===s.length||df(s,i)}return!1}function xC(s,t,e,n,i){if(!s.samplerate){const a=E6(t,e,n,i);if(!a)return;se(s,a)}}function bC(s){return 1024*9e4/s}function w6(s,t){const e=vC(s,t);if(t+e<=s.length){const n=jy(s,t)-e;if(n>0)return{headerLength:e,frameLength:n}}}function SC(s,t,e,n,i){const a=bC(s.samplerate),o=n+i*a,c=w6(t,e);let d;if(c){const{frameLength:p,headerLength:g}=c,v=g+p,x=Math.max(0,e+v-t.length);x?(d=new Uint8Array(v-g),d.set(t.subarray(e+g,t.length),0)):d=t.subarray(e+g,e+v);const S={unit:d,pts:o};return x||s.samples.push(S),{sample:S,length:v,missing:x}}const f=t.length-e;return d=new Uint8Array(f),d.set(t.subarray(e,t.length),0),{sample:{unit:d,pts:o},length:f,missing:-1}}function L6(s,t){return Uy(s,t)&&Nf(s,t+6)+10<=s.length-t}function _6(s){return s instanceof ArrayBuffer?s:s.byteOffset==0&&s.byteLength==s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer}function Fp(s,t=0,e=1/0){return C6(s,t,e,Uint8Array)}function C6(s,t,e,n){const i=D6(s);let a=1;"BYTES_PER_ELEMENT"in n&&(a=n.BYTES_PER_ELEMENT);const o=I6(s)?s.byteOffset:0,c=(o+s.byteLength)/a,d=(o+t)/a,f=Math.floor(Math.max(0,Math.min(d,c))),h=Math.floor(Math.min(f+Math.max(e,0),c));return new n(i,f,h-f)}function D6(s){return s instanceof ArrayBuffer?s:s.buffer}function I6(s){return s&&s.buffer instanceof ArrayBuffer&&s.byteLength!==void 0&&s.byteOffset!==void 0}function O6(s){const t={key:s.type,description:"",data:"",mimeType:null,pictureType:null},e=3;if(s.size<2)return;if(s.data[0]!==e){console.log("Ignore frame with unrecognized character encoding");return}const n=s.data.subarray(1).indexOf(0);if(n===-1)return;const i=qs(Fp(s.data,1,n)),a=s.data[2+n],o=s.data.subarray(3+n).indexOf(0);if(o===-1)return;const c=qs(Fp(s.data,3+n,o));let d;return i==="-->"?d=qs(Fp(s.data,4+n+o)):d=_6(s.data.subarray(4+n+o)),t.mimeType=i,t.pictureType=a,t.description=c,t.data=d,t}function k6(s){if(s.size<2)return;const t=qs(s.data,!0),e=new Uint8Array(s.data.subarray(t.length+1));return{key:s.type,info:t,data:e.buffer}}function P6(s){if(s.size<2)return;if(s.type==="TXXX"){let e=1;const n=qs(s.data.subarray(e),!0);e+=n.length+1;const i=qs(s.data.subarray(e));return{key:s.type,info:n,data:i}}const t=qs(s.data.subarray(1));return{key:s.type,info:"",data:t}}function M6(s){if(s.type==="WXXX"){if(s.size<2)return;let e=1;const n=qs(s.data.subarray(e),!0);e+=n.length+1;const i=qs(s.data.subarray(e));return{key:s.type,info:n,data:i}}const t=qs(s.data);return{key:s.type,info:"",data:t}}function N6(s){return s.type==="PRIV"?k6(s):s.type[0]==="W"?M6(s):s.type==="APIC"?O6(s):P6(s)}function B6(s){const t=String.fromCharCode(s[0],s[1],s[2],s[3]),e=Nf(s,4),n=10;return{type:t,size:e,data:s.subarray(n,n+e)}}const hd=10,F6=10;function EC(s){let t=0;const e=[];for(;
vendor: 8,859 bytes, line 198
198Uy(s,t);){const n=Nf(s,t+6);s[t+5]>>6&1&&(t+=hd),t+=hd;const i=t+n;for(;t+F6<i;){const a=B6(s.subarray(t)),o=N6(a);o&&e.push(o),t+=a.size+hd}gC(s,t)&&(t+=hd)}return e}function TC(s){return s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp"}function U6(s){if(s.data.byteLength===8){const t=new Uint8Array(s.data),e=t[3]&1;let n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,e&&(n+=4772185884e-2),Math.round(n)}}function $y(s){const t=EC(s);for(let e=0;e<t.length;e++){const n=t[e];if(TC(n))return U6(n)}}let Hs=(function(s){return s.audioId3="org.id3",s.dateRange="com.apple.quicktime.HLS",s.emsg="https://aomedia.org/emsg/ID3",s.misbklv="urn:misb:KLV:bin:1910.1",s})({});function Vn(s="",t=9e4){return{type:s,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class Vy{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,e,n,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,e){return!1}appendFrame(t,e,n){}demux(t,e){this.cachedData&&(t=hn(this.cachedData,t),this.cachedData=null);let n=Tc(t,0),i=n?n.length:0,a;const o=this._audioTrack,c=this._id3Track,d=n?$y(n):void 0,f=t.length;for((this.basePTS===null||this.frameIndex===0&&pt(d))&&(this.basePTS=j6(d,e,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Hs.audioId3,duration:Number.POSITIVE_INFINITY});i<f;){if(this.canParse(t,i)){const h=this.appendFrame(o,t,i);h?(this.frameIndex++,this.lastPTS=h.sample.pts,i+=h.length,a=i):i=f}else L6(t,i)?(n=Tc(t,i),c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Hs.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,a=i):i++;if(i===f&&a!==f){const h=t.slice(a);this.cachedData?this.cachedData=hn(this.cachedData,h):this.cachedData=h}}return{audioTrack:o,videoTrack:Vn(),id3Track:c,textTrack:Vn()}}demuxSampleAes(t,e,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:Vn(),id3Track:this._id3Track,textTrack:Vn()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const j6=(s,t,e)=>{if(pt(s))return s*90;const n=e?e.baseTime*9e4/e.timescale:0;return t*9e4+n};let md=null;const $6=[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],V6=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G6=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],H6=[0,1,1,4];function AC(s,t,e,n,i){if(e+24>t.length)return;const a=RC(t,e);if(a&&e+a.frameLength<=t.length){const o=a.samplesPerFrame*9e4/a.sampleRate,c=n+i*o,d={unit:t.subarray(e,e+a.frameLength),pts:c,dts:c};return s.config=[],s.channelCount=a.channelCount,s.samplerate=a.sampleRate,s.samples.push(d),{sample:d,length:a.frameLength,missing:0}}}function RC(s,t){const e=s[t+1]>>3&3,n=s[t+1]>>1&3,i=s[t+2]>>4&15,a=s[t+2]>>2&3;if(e!==1&&i!==0&&i!==15&&a!==3){const o=s[t+2]>>1&1,c=s[t+3]>>6,d=e===3?3-n:n===3?3:4,f=$6[d*14+i-1]*1e3,p=V6[(e===3?0:e===2?1:2)*3+a],g=c===3?1:2,v=G6[e][n],x=H6[n],S=v*8*x,E=Math.floor(v*f/p+o)*x;if(md===null){const _=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);md=_?parseInt(_[1]):0}return!!md&&md<=87&&n===2&&f>=224e3&&c===0&&(s[t+3]=s[t+3]|128),{sampleRate:p,channelCount:g,frameLength:E,samplesPerFrame:S}}}function Gy(s,t){return s[t]===255&&(s[t+1]&224)===224&&(s[t+1]&6)!==0}function wC(s,t){return t+1<s.length&&Gy(s,t)}function z6(s,t){return Gy(s,t)&&4<=s.length-t}function LC(s,t){if(t+1<s.length&&Gy(s,t)){const n=RC(s,t);let i=4;n!=null&&n.frameLength&&(i=n.frameLength);const a=t+i;return a===s.length||wC(s,a)}return!1}class K6 extends Vy{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,n,i){super.resetInitSegment(t,e,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}static probe(t,e){if(!t)return!1;const n=Tc(t,0);let i=n?.length||0;if(LC(t,i))return!1;for(let a=t.length;i<a;i++)if(R6(t,i))return e.log("ADTS sync word found !"),!0;return!1}canParse(t,e){return A6(t,e)}appendFrame(t,e,n){xC(t,this.observer,e,n,t.manifestCodec);const i=SC(t,e,n,this.basePTS,this.frameIndex);if(i&&i.missing===0)return i}}const _C=(s,t)=>{let e=0,n=5;t+=n;const i=new Uint32Array(1),a=new Uint32Array(1),o=new Uint8Array(1);for(;n>0;){o[0]=s[t];const c=Math.min(n,8),d=8-c;a[0]=4278190080>>>24+d<<d,i[0]=(o[0]&a[0])>>d,e=e?e<<c|i[0]:i[0],t+=1,n-=c}return e};class q6 extends Vy{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,e,n,i){super.resetInitSegment(t,e,n,i),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}canParse(t,e){return e+64<t.length}appendFrame(t,e,n){const i=CC(t,e,n,this.basePTS,this.frameIndex);if(i!==-1)return{sample:t.samples[t.samples.length-1],length:i,missing:0}}static probe(t){if(!t)return!1;const e=Tc(t,0);if(!e)return!1;const n=e.length;return t[n]===11&&t[n+1]===119&&$y(e)!==void 0&&_C(t,n)<16}}function CC(s,t,e,n,i){if(e+8>t.length||t[e]!==11||t[e+1]!==119)return-1;const a=t[e+4]>>6;if(a>=3)return-1;const c=[48e3,44100,32e3][a],d=t[e+4]&63,h=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][d*3+a]*2;if(e+h>t.length)return-1;const p=t[e+6]>>5;let g=0;p===2?g+=2:(p&1&&p!==1&&(g+=2),p&4&&(g+=2));const v=(t[e+6]<<8|t[e+7])>>12-g&1,S=[2,1,2,3,3,4,4,5][p]+v,E=t[e+5]>>3,T=t[e+5]&7,L=new Uint8Array([a<<6|E<<1|T>>2,(T&3)<<6|p<<3|v<<2|d>>4,d<<4&224]),_=1536/c*9e4,P=n+i*_,D=t.subarray(e,e+h);return s.config=L,s.channelCount=S,s.samplerate=c,s.samples.push({unit:D,pts:P}),h}class Y6 extends Vy{resetInitSegment(t,e,n,i){super.resetInitSegment(t,e,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;const e=Tc(t,0);let n=e?.length||0;if(e&&t[n]===11&&t[n+1]===119&&$y(e)!==void 0&&_C(t,n)<=16)return!1;for(let i=t.length;n<i;n++)if(LC(t,n))return Xt.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,e){return z6(t,e)}appendFrame(t,e,n){if(this.basePTS!==null)return AC(t,e,n,this.basePTS,this.frameIndex)}}const W6=/\/emsg[-/]ID3/i;class Q6{constructor(t,e){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=e}resetTimeStamp(){}resetInitSegment(t,e,n,i){const a=this.videoTrack=Vn("video",1),o=this.audioTrack=Vn("audio",1),c=this.txtTrack=Vn("text",1);if(this.id3Track=Vn("id3",1),this.timeOffset=0,!(t!=null&&t.byteLength))return;const d=U_(t);if(d.video){const{id:f,timescale:h,codec:p,supplemental:g}=d.video;a.id=f,a.timescale=c.timescale=h,a.codec=p,a.supplemental=g}if(d.audio){const{id:f,timescale:h,codec:p}=d.audio;o.id=f,o.timescale=h,o.codec=p}c.id=N_.text,a.sampleDuration=0,a.duration=o.duration=i}resetContiguity(){this.remainderData=null}static probe(t){return q8(t)}demux(t,e){this.timeOffset=e;let n=t;const i=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=hn(this.remainderData,t));const c=t$(n);this.remainderData=c.remainder,i.samples=c.valid||new Uint8Array}else i.samples=n;const o=this.extractID3Track(i,e);return a.samples=vA(e,i),{videoTrack:i,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,n=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const i=this.extractID3Track(e,this.timeOffset);return n.samples=vA(t,e),{videoTrack:e,audioTrack:Vn(),id3Track:i,textTrack:Vn()}}extractID3Track(t,e){const n=this.id3Track;if(t.samples.length){const i=Bt(t.samples,["emsg"]);
vendor: 23,884 bytes, line 198
198i&&i.forEach(a=>{const o=s$(a);if(W6.test(o.schemeIdUri)){const c=e1(o,e);let d=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;d<=.001&&(d=Number.POSITIVE_INFINITY);const f=o.payload;n.samples.push({data:f,len:f.byteLength,dts:c,pts:c,type:Hs.emsg,duration:d})}else if(this.config.enableEmsgKLVMetadata&&o.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const c=e1(o,e);n.samples.push({data:o.payload,len:o.payload.byteLength,dts:c,pts:c,type:Hs.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(t,e,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function e1(s,t){return pt(s.presentationTime)?s.presentationTime/s.timeScale:t+s.presentationTimeDelta/s.timeScale}class X6{constructor(t,e,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new ky(e,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Ar.cbc)}decryptAacSample(t,e,n){const i=t[e].unit;if(i.length<=16)return;const a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length);this.decryptBuffer(o).then(c=>{const d=new Uint8Array(c);i.set(d,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,n)}).catch(n)}decryptAacSamples(t,e,n){for(;;e++){if(e>=t.length){n();return}if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=Math.floor((t.length-48)/160)*16+16,n=new Int8Array(e);let i=0;for(let a=32;a<t.length-16;a+=160,i+=16)n.set(t.subarray(a,a+16),i);return n}getAvcDecryptedUnit(t,e){const n=new Uint8Array(e);let i=0;for(let a=32;a<t.length-16;a+=160,i+=16)t.set(n.subarray(i,i+16),a);return t}decryptAvcSample(t,e,n,i,a){const o=V_(a.data),c=this.getAvcEncryptedData(o);this.decryptBuffer(c.buffer).then(d=>{a.data=this.getAvcDecryptedUnit(o,d),this.decrypter.isSync()||this.decryptAvcSamples(t,e,n+1,i)}).catch(i)}decryptAvcSamples(t,e,n,i){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,n=0){if(e>=t.length){i();return}const a=t[e].units;for(;!(n>=a.length);n++){const o=a[n];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(t,e,n,i,o),!this.decrypter.isSync()))return}}}}class DC{constructor(){this.VideoSample=null}createVideoSample(t,e,n){return{key:t,frame:!1,pts:e,dts:n,units:[],length:0}}getLastNalUnit(t){var e;let n=this.VideoSample,i;if((!n||n.units.length===0)&&(n=t[t.length-1]),(e=n)!=null&&e.units){const a=n.units;i=a[a.length-1]}return i}pushAccessUnit(t,e){if(t.units.length&&t.frame){if(t.pts===void 0){const n=e.samples,i=n.length;if(i){const a=n[i-1];t.pts=a.pts,t.dts=a.dts}else{e.dropped++;return}}e.samples.push(t)}}parseNALu(t,e,n){const i=e.byteLength;let a=t.naluState||0;const o=a,c=[];let d=0,f,h,p,g=-1,v=0;for(a===-1&&(g=0,v=this.getNALuType(e,0),a=0,d=1);d<i;){if(f=e[d++],!a){a=f?0:1;continue}if(a===1){a=f?0:2;continue}if(!f)a=3;else if(f===1){if(h=d-a-1,g>=0){const x={data:e.subarray(g,h),type:v};c.push(x)}else{const x=this.getLastNalUnit(t.samples);x&&(o&&d<=4-o&&x.state&&(x.data=x.data.subarray(0,x.data.byteLength-o)),h>0&&(x.data=hn(x.data,e.subarray(0,h)),x.state=0))}d<i?(p=this.getNALuType(e,d),g=d,v=p,a=0):a=-1}else a=0}if(g>=0&&a>=0){const x={data:e.subarray(g,i),type:v,state:a};c.push(x)}if(c.length===0){const x=this.getLastNalUnit(t.samples);x&&(x.data=hn(x.data,e))}return t.naluState=a,c}}class sc{constructor(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const t=this.data,e=this.bytesAvailable,n=t.byteLength-e,i=new Uint8Array(4),a=Math.min(4,e);if(a===0)throw new Error("no bytes available");i.set(t.subarray(n,n+a)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=a*8,this.bytesAvailable-=a}skipBits(t){let e;t=Math.min(t,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const n=this.word>>>32-e;if(t>32&&Xt.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return e=t-e,e>0&&this.bitsAvailable?n<<e|this.readBits(e):n}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if((this.word&2147483648>>>t)!==0)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class Z6 extends DC{parsePES(t,e,n,i){const a=this.parseNALu(t,n.data,i);let o=this.VideoSample,c,d=!1;n.data=null,o&&a.length&&!t.audFound&&(this.pushAccessUnit(o,t),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),a.forEach(f=>{var h,p;switch(f.type){case 1:{let S=!1;c=!0;const E=f.data;if(d&&E.length>4){const T=this.readSliceType(E);(T===2||T===4||T===7||T===9)&&(S=!0)}if(S){var g;(g=o)!=null&&g.frame&&!o.key&&(this.pushAccessUnit(o,t),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.frame=!0,o.key=S;break}case 5:c=!0,(h=o)!=null&&h.frame&&!o.key&&(this.pushAccessUnit(o,t),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0,o.frame=!0;break;case 6:{c=!0,Cy(f.data,1,n.pts,e.samples);break}case 7:{var v,x;c=!0,d=!0;const S=f.data,E=this.readSPS(S);if(!t.sps||t.width!==E.width||t.height!==E.height||((v=t.pixelRatio)==null?void 0:v[0])!==E.pixelRatio[0]||((x=t.pixelRatio)==null?void 0:x[1])!==E.pixelRatio[1]){t.width=E.width,t.height=E.height,t.pixelRatio=E.pixelRatio,t.sps=[S];const T=S.subarray(1,4);let L="avc1.";for(let _=0;_<3;_++){let P=T[_].toString(16);P.length<2&&(P="0"+P),L+=P}t.codec=L}break}case 8:c=!0,t.pps=[f.data];break;case 9:c=!0,t.audFound=!0,(p=o)!=null&&p.frame&&(this.pushAccessUnit(o,t),o=null),o||(o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:c=!0;break;default:c=!1;break}o&&c&&o.units.push(f)}),i&&o&&(this.pushAccessUnit(o,t),this.VideoSample=null)}getNALuType(t,e){return t[e]&31}readSliceType(t){const e=new sc(t);return e.readUByte(),e.readUEG(),e.readUEG()}skipScalingList(t,e){let n=8,i=8,a;for(let o=0;o<t;o++)i!==0&&(a=e.readEG(),i=(n+a+256)%256),n=i===0?n:i}readSPS(t){const e=new sc(t);let n=0,i=0,a=0,o=0,c,d,f;const h=e.readUByte.bind(e),p=e.readBits.bind(e),g=e.readUEG.bind(e),v=e.readBoolean.bind(e),x=e.skipBits.bind(e),S=e.skipEG.bind(e),E=e.skipUEG.bind(e),T=this.skipScalingList.bind(this);h();const L=h();if(p(5),x(3),h(),E(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){const I=g();if(I===3&&x(1),E(),E(),x(1),v())for(d=I!==3?8:12,f=0;f<d;f++)v()&&(f<6?T(16,e):T(64,e))}E();const _=g();if(_===0)g();else if(_===1)for(x(1),S(),S(),c=g(),f=0;f<c;f++)S();E(),x(1);const P=g(),D=g(),B=p(1);B===0&&x(1),x(1),v()&&(n=g(),i=g(),a=g(),o=g());let C=[1,1];if(v()&&v())switch(h()){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[h()<<8|h(),h()<<8|h()];break}}return{width:Math.ceil((P+1)*16-n*2-i*2),height:(2-B)*(D+1)*16-(B?2:4)*(a+o),pixelRatio:C}}}class J6 extends DC{constructor(...t){super(...t),this.initVPS=null}parsePES(t,e,n,i){const a=this.parseNALu(t,n.data,i);let o=this.VideoSample,c,d=!1;n.data=null,o&&a.length&&!t.audFound&&(this.pushAccessUnit(o,t),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),a.forEach(f=>{var h,p;switch(f.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:o||(o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),o.frame=!0,c=!0;break;case 16:case 17:case 18:case 21:if(c=!0,d){var g;(g=o)!=null&&g.frame&&!o.key&&(this.pushAccessUnit(o,t),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0,o.frame=!0;break;case 19:case 20:c=!0,(h=o)!=null&&h.frame&&!o.key&&(this.pushAccessUnit(o,t),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0,o.frame=!0;break;case 39:c=!0,Cy(f.data,2,n.pts,e.samples);break;case 32:c=!0,t.vps||(typeof t.params!="object"&&(t.params={}),t.params=se(t.params,this.readVPS(f.data)),this.initVPS=f.data),t.vps=[f.data];break;case 33:if(c=!0,d=!0,t.vps!==void 0&&t.vps[0]!==this.initVPS&&t.sps!==void 0&&!this.matchSPS(t.sps[0],f.data)&&(this.initVPS=t.vps[0],t.sps=t.pps=void 0),!t.sps){const v=this.readSPS(f.data);t.width=v.width,t.height=v.height,t.pixelRatio=v.pixelRatio,t.codec=v.codecString,t.sps=[],typeof t.params!="object"&&(t.params={});for(const x in v.params)t.params[x]=v.params[x]}this.pushParameterSet(t.sps,f.data,t.vps),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0;break;case 34:if(c=!0,typeof t.params=="object"){if(!t.pps){t.pps=[];const v=this.readPPS(f.data);for(const x in v)t.params[x]=v[x]}this.pushParameterSet(t.pps,f.data,t.vps)}break;case 35:c=!0,t.audFound=!0,(p=o)!=null&&p.frame&&(this.pushAccessUnit(o,t),o=null),o||(o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:c=!1;break}o&&c&&o.units.push(f)}),i&&o&&(this.pushAccessUnit(o,t),this.VideoSample=null)}pushParameterSet(t,e,n){(n&&n[0]===this.initVPS||!n&&!t.length)&&t.push(e)}getNALuType(t,e){return(t[e]&126)>>>1}ebsp2rbsp(t){const e=new Uint8Array(t.byteLength);let n=0;for(let i=0;i<t.byteLength;i++)i>=2&&t[i]===3&&t[i-1]===0&&t[i-2]===0||(e[n]=t[i],n++);return new Uint8Array(e.buffer,0,n)}pushAccessUnit(t,e){super.pushAccessUnit(t,e),this.initVPS&&(this.initVPS=null)}readVPS(t){const e=new sc(t);e.readUByte(),e.readUByte(),e.readBits(4),e.skipBits(2),e.readBits(6);const n=e.readBits(3),i=e.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:i}}readSPS(t){const e=new sc(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.readBits(4);const n=e.readBits(3);e.readBoolean();const i=e.readBits(2),a=e.readBoolean(),o=e.readBits(5),c=e.readUByte(),d=e.readUByte(),f=e.readUByte(),h=e.readUByte(),p=e.readUByte(),g=e.readUByte(),v=e.readUByte(),x=e.readUByte(),S=e.readUByte(),E=e.readUByte(),T=e.readUByte(),L=[],_=[];for(let Mt=0;Mt<n;Mt++)L.push(e.readBoolean()),_.push(e.readBoolean());if(n>0)for(let Mt=n;Mt<8;Mt++)e.readBits(2);for(let Mt=0;Mt<n;Mt++)L[Mt]&&(e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte()),_[Mt]&&e.readUByte();e.readUEG();const P=e.readUEG();P==3&&e.skipBits(1);const D=e.readUEG(),B=e.readUEG(),C=e.readBoolean();let I=0,F=0,U=0,z=0;C&&(I+=e.readUEG(),F+=e.readUEG(),U+=e.readUEG(),z+=e.readUEG());const Y=e.readUEG(),nt=e.readUEG(),it=e.readUEG(),rt=e.readBoolean();for(let Mt=rt?0:n;Mt<=n;Mt++)e.skipUEG(),e.skipUEG(),e.skipUEG();if(e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.readBoolean()&&e.readBoolean())for(let le=0;le<4;le++)for(let Ge=0;Ge<(le===3?2:6);Ge++)if(!e.readBoolean())e.readUEG();else{const Ye=Math.min(64,1<<4+(le<<1));le>1&&e.readEG();for(let Ys=0;Ys<Ye;Ys++)e.readEG()}e.readBoolean(),e.readBoolean(),e.readBoolean()&&(e.readUByte(),e.skipUEG(),e.skipUEG(),e.readBoolean());const N=e.readUEG();let V=0;for(let Mt=0;Mt<N;Mt++){let le=!1;if(Mt!==0&&(le=e.readBoolean()),le){Mt===N&&e.readUEG(),e.readBoolean(),e.readUEG();let Ge=0;for(let Ae=0;Ae<=V;Ae++){const Ye=e.readBoolean();let Ys=!1;Ye||(Ys=e.readBoolean()),(Ye||Ys)&&Ge++}V=Ge}else{const Ge=e.readUEG(),Ae=e.readUEG();V=Ge+Ae;for(let Ye=0;Ye<Ge;Ye++)e.readUEG(),e.readBoolean();for(let Ye=0;Ye<Ae;Ye++)e.readUEG(),e.readBoolean()}}if(e.readBoolean()){const Mt=e.readUEG();for(let le=0;le<Mt;le++){for(let Ge=0;Ge<it+4;Ge++)e.readBits(1);e.readBits(1)}}let O=0,G=1,K=1,J=!0,ot=1,ft=0;e.readBoolean(),e.readBoolean();let ht=!1;if(e.readBoolean()){if(e.readBoolean()){const he=e.readUByte(),pn=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ie=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];he>0&&he<16?(G=pn[he-1],K=Ie[he-1]):he===255&&(G=e.readBits(16),K=e.readBits(16))}if(e.readBoolean()&&e.readBoolean(),e.readBoolean()&&(e.readBits(3),e.readBoolean(),e.readBoolean()&&(e.readUByte(),e.readUByte(),e.readUByte())),e.readBoolean()&&(e.readUEG(),e.readUEG()),e.readBoolean(),e.readBoolean(),e.readBoolean(),ht=e.readBoolean(),ht&&(e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG()),e.readBoolean()&&(ot=e.readBits(32),ft=e.readBits(32),e.readBoolean()&&e.readUEG(),e.readBoolean())){const Ie=e.readBoolean(),ya=e.readBoolean();let Ds=!1;(Ie||ya)&&(Ds=e.readBoolean(),Ds&&(e.readUByte(),e.readBits(5),e.readBoolean(),e.readBits(5)),e.readBits(4),e.readBits(4),Ds&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5));for(let Lr=0;Lr<=n;Lr++){J=e.readBoolean();const si=J||e.readBoolean();let ki=!1;si?e.readEG():ki=e.readBoolean();const Ws=ki?1:e.readUEG()+1;if(Ie)for(let Cn=0;Cn<Ws;Cn++)e.readUEG(),e.readUEG(),Ds&&(e.readUEG(),e.readUEG()),e.skipBits(1);if(ya)for(let Cn=0;Cn<Ws;Cn++)e.readUEG(),e.readUEG(),Ds&&(e.readUEG(),e.readUEG()),e.skipBits(1)}}e.readBoolean()&&(e.readBoolean(),e.readBoolean(),e.readBoolean(),O=e.readUEG())}let wt=D,Zt=B;if(C){let Mt=1,le=1;P===1?Mt=le=2:P==2&&(Mt=2),wt=D-Mt*F-Mt*I,Zt=B-le*z-le*U}const fe=i?["A","B","C"][i]:"",Fe=c<<24|d<<16|f<<8|h;let Cs=0;for(let Mt=0;Mt<32;Mt++)Cs=(Cs|(Fe>>Mt&1)<<31-Mt)>>>0;let cs=Cs.toString(16);return o===1&&cs==="2"&&(cs="6"),{codecString:`hvc1.${fe}${o}.${cs}.${a?"H":"L"}${T}.B0`,params:{general_tier_flag:a,general_profile_idc:o,general_profile_space:i,general_profile_compatibility_flags:[c,d,f,h],general_constraint_indicator_flags:[p,g,v,x,S,E],general_level_idc:T,bit_depth:Y+8,bit_depth_luma_minus8:Y,bit_depth_chroma_minus8:nt,min_spatial_segmentation_idc:O,chroma_format_idc:P,frame_rate:{fixed:J,fps:ft/ot}},width:wt,height:Zt,pixelRatio:[G,K]}}readPPS(t){const e=new sc(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.skipUEG(),e.skipUEG(),e.skipBits(2),e.skipBits(3),e.skipBits(2),e.skipUEG(),e.skipUEG(),e.skipEG(),e.skipBits(2),e.readBoolean()&&e.skipUEG(),e.skipEG(),e.skipEG(),e.skipBits(4);const i=e.readBoolean(),a=e.readBoolean();let o=1;return a&&i?o=0:a?o=3:i&&(o=2),{parallelismType:o}}matchSPS(t,e){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,e).substr(3)}}const qe=188;class fr{constructor(t,e,n,i){this.logger=void 0,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._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=t,this.config=e,this.typeSupported=n,this.logger=i,this.videoParser=null}static probe(t,e){const n=fr.syncOffset(t);return n>0&&e.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(t){const e=t.length;let n=Math.min(qe*5,e-qe)+1,i=0;for(;i<n;){let a=!1,o=-1,c=0;for(let d=i;d<e;d+=qe)if(t[d]===71&&(e-d===qe||t[d+qe]===71)){if(c++,o===-1&&(o=d,o!==0&&(n=Math.min(o+qe*99,t.length-qe)+1)),a||(a=d0(t,d)===0),a&&c>1&&(o===0&&c>2||d+qe>n))return o}else{if(c)return-1;break}i++}return-1}static createTrack(t,e){return{container:t==="video"||t==="audio"?"video/mp2t":void 0,type:t,id:N_[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:t==="audio"?e:void 0}}resetInitSegment(t,e,n,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=fr.createTrack("video"),this._videoTrack.duration=i,this._audioTrack=fr.createTrack("audio",i),this._id3Track=fr.createTrack("id3"),this._txtTrack=fr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:e,_id3Track:n}=this;t&&(t.pesData=null),e&&(e.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,e,n=!1,i=!1){n||(this.sampleAes=null);let a;const o=this._videoTrack,c=this._audioTrack,d=this._id3Track,f=this._txtTrack;let h=o.pid,p=o.pesData,g=c.pid,v=d.pid,x=c.pesData,S=d.pesData,E=null,T=this.pmtParsed,L=this._pmtId,_=t.length;if(this.remainderData&&(t=hn(this.remainderData,t),_=t.length,this.remainderData=null),_<qe&&!i)return this.remainderData=t,{audioTrack:c,videoTrack:o,id3Track:d,textTrack:f};const P=Math.max(0,fr.syncOffset(t));_-=(_-P)%qe,_<t.byteLength&&!i&&(this.remainderData=new Uint8Array(t.buffer,_,t.buffer.byteLength-_));let D=0;for(let C=P;C<_;C+=qe)if(t[C]===71){const I=!!(t[C+1]&64),F=d0(t,C),U=(t[C+3]&48)>>4;let z;if(U>1){if(z=C+5+t[C+4],z===C+qe)continue}else z=C+4;switch(F){case h:I&&(p&&(a=uo(p,this.logger))&&(this.readyVideoParser(o.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(o,f,a,!1)),p={data:[],size:0}),p&&(p.data.push(t.subarray(z,C+qe)),p.size+=C+qe-z);break;case g:if(I){if(x&&(a=uo(x,this.logger)))switch(c.segmentCodec){case"aac":this.parseAACPES(c,a);break;case"mp3":this.parseMPEGPES(c,a);break;case"ac3":this.parseAC3PES(c,a);break}x={data:[],size:0}}x&&(x.data.push(t.subarray(z,C+qe)),x.size+=C+qe-z);break;case v:I&&(S&&(a=uo(S,this.logger))&&this.parseID3PES(d,a),S={data:[],size:0}),S&&(S.data.push(t.subarray(z,C+qe)),S.size+=C+qe-z);break;case 0:I&&(z+=t[z]+1),L=this._pmtId=tV(t,z);break;case L:{I&&(z+=t[z]+1);const Y=eV(t,z,this.typeSupported,n,this.observer,this.logger);h=Y.videoPid,h>0&&(o.pid=h,o.segmentCodec=Y.segmentVideoCodec),g=Y.audioPid,g>0&&(c.pid=g,c.segmentCodec=Y.segmentAudioCodec),v=Y.id3Pid,v>0&&(d.pid=v),E!==null&&!T&&(this.logger.warn(`MPEG-TS PMT found at ${C} after unknown PID '${E}'. Backtracking to sync byte @${P} to parse all TS packets.`),E=null,C=P-188),T=this.pmtParsed=!0;break}case 17:case 8191:break;default:E=F;break}}else D++;D>0&&f0(this.observer,new Error(`Found ${D} TS packet/s that do not start with 0x47`),void 0,this.logger),o.pesData=p,c.pesData=x,d.pesData=S;const B={audioTrack:c,videoTrack:o,id3Track:d,textTrack:f};return i&&this.extractRemainingSamples(B),B}flush(){const{remainderData:t}=this;this.remainderData=null;let e;return t?e=this.demux(t,-1,!1,!0):e={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:n,id3Track:i,textTrack:a}=t,o=n.pesData,c=e.pesData,d=i.pesData;let f;if(o&&(f=uo(o,this.logger))?(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(n,a,f,!0),n.pesData=null)):n.pesData=o,c&&(f=uo(c,this.logger))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,f);break;case"mp3":this.parseMPEGPES(e,f);break;case"ac3":this.parseAC3PES(e,f);break}e.pesData=null}else c!=null&&c.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=c;d&&(f=uo(d,this.logger))?(this.parseID3PES(i,f),i.pesData=null):i.pesData=d}demuxSampleAes(t,e,n){const i=this.demux(t,n,!0,!this.config.progressive),a=this.sampleAes=new X6(this.observer,this.config,e);return this.decrypt(i,a)}readyVideoParser(t){this.videoParser===null&&(t==="avc"?this.videoParser=new Z6:t==="hevc"&&(this.videoParser=new J6))}decrypt(t,e){return new Promise(n=>{const{audioTrack:i,videoTrack:a}=t;i.samples&&i.segmentCodec==="aac"?e.decryptAacSamples(i.samples,0,()=>{a.samples?e.decryptAvcSamples(a.samples,0,0,()=>{n(t)}):n(t)}):a.samples&&e.decryptAvcSamples(a.samples,0,0,()=>{n(t)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(t,e){let n=0;const i=this.aacOverFlow;let a=e.data;if(i){this.aacOverFlow=null;const p=i.missing,g=i.sample.unit.byteLength;if(p===-1)a=hn(i.sample.unit,a);else{const v=g-p;i.sample.unit.set(a.subarray(0,p),v),t.samples.push(i.sample),n=i.missing}}let o,c;for(o=n,c=a.length;o<c-1&&!df(a,o);o++);if(o!==n){let p;const g=o<c-1;if(g?p=`AAC PES did not start with ADTS header,offset:${o}`:p="No ADTS header found in AAC PES",f0(this.observer,new Error(p),g,this.logger),!g)return}xC(t,this.observer,a,o,this.audioCodec);let d;if(e.pts!==void 0)d=e.pts;else if(i){const p=bC(t.samplerate);d=i.sample.pts+p}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let f=0,h;for(;o<c;)if(h=SC(t,a,o,d,f),o+=h.length,h.missing){this.aacOverFlow=h;break}else for(f++;o<c-1&&!df(a,o);o++);}parseMPEGPES(t,e){const n=e.data,i=n.length;let a=0,o=0;const c=e.pts;if(c===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<i;)if(wC(n,o)){const d=AC(t,n,o,c,a);if(d)o+=d.length,a++;else break}else o++}parseAC3PES(t,e){{const n=e.data,i=e.pts;if(i===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const a=n.length;let o=0,c=0,d;for(;c<a&&(d=CC(t,n,c,i,o++))>0;)c+=d}}parseID3PES(t,e){if(e.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=se({},e,{type:this._videoTrack?Hs.emsg:Hs.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(n)}}function d0(s,t){return((s[t+1]&31)<<8)+s[t+2]}function tV(s,t){return(s[t+10]&31)<<8|s[t+11]}function eV(s,t,e,n,i,a){const o={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},c=(s[t+1]&15)<<8|s[t+2],d=t+3+c-4,f=(s[t+10]&15)<<8|s[t+11];for(t+=12+f;t<d;){const h=d0(s,t),p=(s[t+3]&15)<<8|s[t+4];switch(s[t]){case 207:if(!n){Up("ADTS AAC",a);break}case 15:o.audioPid===-1&&(o.audioPid=h);break;case 21:o.id3Pid===-1&&(o.id3Pid=h);break;case 219:if(!n){Up("H.264",a);break}case 27:o.videoPid===-1&&(o.videoPid=h);break;case 3:case 4:!e.mpeg&&!e.mp3?a.log("MPEG audio found, not supported in this browser"):o.audioPid===-1&&(o.audioPid=h,o.segmentAudioCodec="mp3");break;case 193:if(!n){Up("AC-3",a);break}case 129:e.ac3?o.audioPid===-1&&(o.audioPid=h,o.segmentAudioCodec="ac3"):a.log("AC-3 audio found, not supported in this browser");break;case 6:if(o.audioPid===-1&&p>0){let g=t+5,v=p;for(;v>2;){switch(s[g]){case 106:e.ac3!==!0?a.log("AC-3 audio found, not supported in this browser for now"):(o.audioPid=h,o.segmentAudioCodec="ac3");break}const S=s[g+1]+2;g+=S,v-=S}}break;case 194:case 135:return f0(i,new Error("Unsupported EC-3 in M2TS found"),void 0,a),o;case 36:o.videoPid===-1&&(o.videoPid=h,o.segmentVideoCodec="hevc",a.log("HEVC in M2TS found"));break}t+=p+5}return o}function f0(s,t,e,n){n.warn(`parsing error: ${t.message}`),s.emit(w.ERROR,w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!1,levelRetry:e,error:t,reason:t.message})}function Up(s,t){t.log(`${s} with AES-128-CBC encryption found in unencrypted stream`)}function uo(s,t){let e=0,n,i,a,o,c;const d=s.data;if(!s||s.size===0)return null;for(;d[0].length<19&&d.length>1;)d[0]=hn(d[0],d[1]),d.splice(1,1);if(n=d[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(i=(n[4]<<8)+n[5],i&&i>s.size-6)return null;const h=n[7];
vendor: 6,997 bytes, line 198
198h&192&&(o=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,h&64?(c=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,o-c>60*9e4&&(t.warn(`${Math.round((o-c)/9e4)}s delta between PTS and DTS, align them`),o=c)):c=o),a=n[8];let p=a+9;if(s.size<=p)return null;s.size-=p;const g=new Uint8Array(s.size);for(let v=0,x=d.length;v<x;v++){n=d[v];let S=n.byteLength;if(p)if(p>S){p-=S;continue}else n=n.subarray(p),S-=p,p=0;g.set(n,e),e+=S}return i&&(i-=a+3),{data:g,pts:o,dts:c,len:i}}return null}class sV{static getSilentFrame(t,e){switch(t){case"mp4a.40.2":if(e===1)return new Uint8Array([0,200,0,128,35,128]);if(e===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(e===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(e===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(e===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(e===6)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]);break;default:if(e===1)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(e===2)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(e===3)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]);break}}}const or=Math.pow(2,32)-1;class Q{static init(){Q.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let t;for(t in Q.types)Q.types.hasOwnProperty(t)&&(Q.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);const e=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]);Q.HDLR_TYPES={video:e,audio:n};const i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);Q.STTS=Q.STSC=Q.STCO=a,Q.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Q.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Q.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Q.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),d=new Uint8Array([0,0,0,1]);Q.FTYP=Q.box(Q.types.ftyp,o,d,o,c),Q.DINF=Q.box(Q.types.dinf,Q.box(Q.types.dref,i))}static box(t,...e){let n=8,i=e.length;const a=i;for(;i--;)n+=e[i].byteLength;const o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(t,4),i=0,n=8;i<a;i++)o.set(e[i],n),n+=e[i].byteLength;return o}static hdlr(t){return Q.box(Q.types.hdlr,Q.HDLR_TYPES[t])}static mdat(t){return Q.box(Q.types.mdat,t)}static mdhd(t,e){e*=t;const n=Math.floor(e/(or+1)),i=Math.floor(e%(or+1));return Q.box(Q.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,t&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(t){return Q.box(Q.types.mdia,Q.mdhd(t.timescale||0,t.duration||0),Q.hdlr(t.type),Q.minf(t))}static mfhd(t){return Q.box(Q.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255]))}static minf(t){return t.type==="audio"?Q.box(Q.types.minf,Q.box(Q.types.smhd,Q.SMHD),Q.DINF,Q.stbl(t)):Q.box(Q.types.minf,Q.box(Q.types.vmhd,Q.VMHD),Q.DINF,Q.stbl(t))}static moof(t,e,n){return Q.box(Q.types.moof,Q.mfhd(t),Q.traf(n,e))}static moov(t){let e=t.length;const n=[];for(;e--;)n[e]=Q.trak(t[e]);return Q.box.apply(null,[Q.types.moov,Q.mvhd(t[0].timescale||0,t[0].duration||0)].concat(n).concat(Q.mvex(t)))}static mvex(t){let e=t.length;const n=[];for(;e--;)n[e]=Q.trex(t[e]);return Q.box.apply(null,[Q.types.mvex,...n])}static mvhd(t,e){e*=t;const n=Math.floor(e/(or+1)),i=Math.floor(e%(or+1)),a=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,t&255,n>>24,n>>16&255,n>>8&255,n&255,i>>24,i>>16&255,i>>8&255,i&255,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 Q.box(Q.types.mvhd,a)}static sdtp(t){const e=t.samples||[],n=new Uint8Array(4+e.length);let i,a;for(i=0;i<e.length;i++)a=e[i].flags,n[i+4]=a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy;return Q.box(Q.types.sdtp,n)}static stbl(t){return Q.box(Q.types.stbl,Q.stsd(t),Q.box(Q.types.stts,Q.STTS),Q.box(Q.types.stsc,Q.STSC),Q.box(Q.types.stsz,Q.STSZ),Q.box(Q.types.stco,Q.STCO))}static avc1(t){let e=[],n=[],i,a,o;for(i=0;i<t.sps.length;i++)a=t.sps[i],o=a.byteLength,e.push(o>>>8&255),e.push(o&255),e=e.concat(Array.prototype.slice.call(a));for(i=0;i<t.pps.length;i++)a=t.pps[i],o=a.byteLength,n.push(o>>>8&255),n.push(o&255),n=n.concat(Array.prototype.slice.call(a));const c=Q.box(Q.types.avcC,new Uint8Array([1,e[3],e[4],e[5],255,224|t.sps.length].concat(e).concat([t.pps.length]).concat(n))),d=t.width,f=t.height,h=t.pixelRatio[0],p=t.pixelRatio[1];return Q.box(Q.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,d>>8&255,d&255,f>>8&255,f&255,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]),c,Q.box(Q.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Q.box(Q.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,p>>24,p>>16&255,p>>8&255,p&255])))}static esds(t){const e=t.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...e,6,1,2])}static audioStsd(t){const e=t.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount||0,0,16,0,0,0,0,e>>8&255,e&255,0,0])}static mp4a(t){return Q.box(Q.types.mp4a,Q.audioStsd(t),Q.box(Q.types.esds,Q.esds(t)))}static mp3(t){return Q.box(Q.types[".mp3"],Q.audioStsd(t))}static ac3(t){return Q.box(Q.types["ac-3"],Q.audioStsd(t),Q.box(Q.types.dac3,t.config))}static stsd(t){const{segmentCodec:e}=t;if(t.type==="audio"){if(e==="aac")return Q.box(Q.types.stsd,Q.STSD,Q.mp4a(t));if(e==="ac3"&&t.config)return Q.box(Q.types.stsd,Q.STSD,Q.ac3(t));if(e==="mp3"&&t.codec==="mp3")return Q.box(Q.types.stsd,Q.STSD,Q.mp3(t))}else if(t.pps&&t.sps){if(e==="avc")return Q.box(Q.types.stsd,Q.STSD,Q.avc1(t));if(e==="hevc"&&t.vps)return Q.box(Q.types.stsd,Q.STSD,Q.hvc1(t))}
vendor: 22,271 bytes, line 198
198else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${t.type} segment codec (${e}/${t.codec})`)}static tkhd(t){const e=t.id,n=(t.duration||0)*(t.timescale||0),i=t.width||0,a=t.height||0,o=Math.floor(n/(or+1)),c=Math.floor(n%(or+1));return Q.box(Q.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,c>>24,c>>16&255,c>>8&255,c&255,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,i&255,0,0,a>>8&255,a&255,0,0]))}static traf(t,e){const n=Q.sdtp(t),i=t.id,a=Math.floor(e/(or+1)),o=Math.floor(e%(or+1));return Q.box(Q.types.traf,Q.box(Q.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),Q.box(Q.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,o>>24,o>>16&255,o>>8&255,o&255])),Q.trun(t,n.length+16+20+8+16+8+8),n)}static trak(t){return t.duration=t.duration||4294967295,Q.box(Q.types.trak,Q.tkhd(t),Q.mdia(t))}static trex(t){const e=t.id;return Q.box(Q.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){const n=t.samples||[],i=n.length,a=12+16*i,o=new Uint8Array(a);let c,d,f,h,p,g;for(e+=8+a,o.set([t.type==="video"?1:0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),c=0;c<i;c++)d=n[c],f=d.duration,h=d.size,p=d.flags,g=d.cts,o.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,p.isLeading<<2|p.dependsOn,p.isDependedOn<<6|p.hasRedundancy<<4|p.paddingValue<<1|p.isNonSync,p.degradPrio&61440,p.degradPrio&15,g>>>24&255,g>>>16&255,g>>>8&255,g&255],12+16*c);return Q.box(Q.types.trun,o)}static initSegment(t){Q.types||Q.init();const e=Q.moov(t);return hn(Q.FTYP,e)}static hvc1(t){const e=t.params,n=[t.vps,t.sps,t.pps],i=4,a=new Uint8Array([1,e.general_profile_space<<6|(e.general_tier_flag?32:0)|e.general_profile_idc,e.general_profile_compatibility_flags[0],e.general_profile_compatibility_flags[1],e.general_profile_compatibility_flags[2],e.general_profile_compatibility_flags[3],e.general_constraint_indicator_flags[0],e.general_constraint_indicator_flags[1],e.general_constraint_indicator_flags[2],e.general_constraint_indicator_flags[3],e.general_constraint_indicator_flags[4],e.general_constraint_indicator_flags[5],e.general_level_idc,240|e.min_spatial_segmentation_idc>>8,255&e.min_spatial_segmentation_idc,252|e.parallelismType,252|e.chroma_format_idc,248|e.bit_depth_luma_minus8,248|e.bit_depth_chroma_minus8,0,parseInt(e.frame_rate.fps),i-1|e.temporal_id_nested<<2|e.num_temporal_layers<<3|(e.frame_rate.fixed?64:0),n.length]);let o=a.length;for(let x=0;x<n.length;x+=1){o+=3;for(let S=0;S<n[x].length;S+=1)o+=2+n[x][S].length}const c=new Uint8Array(o);c.set(a,0),o=a.length;const d=n.length-1;for(let x=0;x<n.length;x+=1){c.set(new Uint8Array([32+x|(x===d?128:0),0,n[x].length]),o),o+=3;for(let S=0;S<n[x].length;S+=1)c.set(new Uint8Array([n[x][S].length>>8,n[x][S].length&255]),o),o+=2,c.set(n[x][S],o),o+=n[x][S].length}const f=Q.box(Q.types.hvcC,c),h=t.width,p=t.height,g=t.pixelRatio[0],v=t.pixelRatio[1];return Q.box(Q.types.hvc1,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,h>>8&255,h&255,p>>8&255,p&255,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]),f,Q.box(Q.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Q.box(Q.types.pasp,new Uint8Array([g>>24,g>>16&255,g>>8&255,g&255,v>>24,v>>16&255,v>>8&255,v&255])))}}Q.types=void 0;Q.HDLR_TYPES=void 0;Q.STTS=void 0;Q.STSC=void 0;Q.STCO=void 0;Q.STSZ=void 0;Q.VMHD=void 0;Q.SMHD=void 0;Q.STSD=void 0;Q.FTYP=void 0;Q.DINF=void 0;const IC=9e4;function Hy(s,t,e=1,n=!1){const i=s*t*e;return n?Math.round(i):i}function nV(s,t,e=1,n=!1){return Hy(s,t,1/e,n)}function $l(s,t=!1){return Hy(s,1e3,1/IC,t)}function iV(s,t=1){return Hy(s,IC,1/t)}function s1(s){const{baseTime:t,timescale:e,trackId:n}=s;return`${t/e} (${t}/${e}) trackId: ${n}`}const rV=10*1e3,aV=1024,oV=1152,lV=1536,h0=8589934592;let fo=null,jp=null;function n1(s,t,e,n){return{duration:t,size:e,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:s?2:1,isNonSync:s?0:1}}}class Fd extends mn{constructor(t,e,n,i){if(super("mp4-remuxer",i),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=e,this.typeSupported=n,this.ISGenerated=!1,fo===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);fo=o?parseInt(o[1]):0}if(jp===null){const a=navigator.userAgent.match(/Safari\/(\d+)/i);jp=a?parseInt(a[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){const e=this._initPTS;(!e||!t||t.trackId!==e.trackId||t.baseTime!==e.baseTime||t.timescale!==e.timescale)&&this.log(`Reset initPTS: ${e&&s1(e)} > ${t&&s1(t)}`),this._initPTS=this._initDTS=t}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(t){let e=!1;const n=t[0].pts,i=t.reduce((a,o)=>{let c=o.pts,d=c-a;return d<-4294967296&&(e=!0,c=js(c,n),d=c-a),d>0?a:c},n);return e&&this.debug("PTS rollover detected"),i}remux(t,e,n,i,a,o,c,d){let f,h,p,g,v,x,S=a,E=a;const T=t.pid>-1,L=e.pid>-1,_=e.samples.length,P=t.samples.length>0,D=c&&_>0||_>1;if((!T||P)&&(!L||D)||this.ISGenerated||c){if(this.ISGenerated){var C,I,F,U;const it=this.videoTrackConfig;(it&&(e.width!==it.width||e.height!==it.height||((C=e.pixelRatio)==null?void 0:C[0])!==((I=it.pixelRatio)==null?void 0:I[0])||((F=e.pixelRatio)==null?void 0:F[1])!==((U=it.pixelRatio)==null?void 0:U[1]))||!it&&D||this.nextAudioTs===null&&P)&&this.resetInitSegment()}this.ISGenerated||(p=this.generateIS(t,e,a,o));const z=this.isVideoContiguous;let Y=-1,nt;if(D&&(Y=cV(e.samples),!z&&this.config.forceKeyFrameOnDiscontinuity))if(x=!0,Y>0){this.warn(`Dropped ${Y} out of ${_} video samples due to a missing keyframe`);const it=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(Y),e.dropped+=Y,E+=(e.samples[0].pts-it)/e.inputTimeScale,nt=E}else Y===-1&&(this.warn(`No keyframe found out of ${_} video samples`),x=!1);if(this.ISGenerated){if(P&&D){const it=this.getVideoStartPts(e.samples),M=(js(t.samples[0].pts,it)-it)/e.inputTimeScale;S+=Math.max(0,M),E+=Math.max(0,-M)}if(P){if(t.samplerate||(this.warn("regenerate InitSegment as audio detected"),p=this.generateIS(t,e,a,o)),h=this.remuxAudio(t,S,this.isAudioContiguous,o,L||D||d===yt.AUDIO?E:void 0),D){const it=h?h.endPTS-h.startPTS:0;e.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),p=this.generateIS(t,e,a,o)),f=this.remuxVideo(e,E,z,it)}}else D&&(f=this.remuxVideo(e,E,z,0));f&&(f.firstKeyFrame=Y,f.independent=Y!==-1,f.firstKeyFramePTS=nt)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(v=OC(n,a,this._initPTS,this._initDTS)),i.samples.length&&(g=kC(i,a,this._initPTS))),{audio:h,video:f,initSegment:p,independent:x,text:g,id3:v}}computeInitPts(t,e,n,i){const a=Math.round(n*e);let o=js(t,a);if(o<a)for(this.log(`Adjusting PTS for rollover in timeline near ${(a-o)/e} ${i}`);o<a;)o+=h0;return o-a}generateIS(t,e,n,i){const a=t.samples,o=e.samples,c=this.typeSupported,d={},f=this._initPTS;let h=!f||i,p="audio/mp4",g,v,x,S=-1;if(h&&(g=v=1/0),t.config&&a.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":c.mpeg?(p="audio/mpeg",t.codec=""):c.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3";break}d.audio={id:"audio",container:p,codec:t.codec,initSegment:t.segmentCodec==="mp3"&&c.mpeg?new Uint8Array(0):Q.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(S=t.id,x=t.inputTimeScale,!f||x!==f.timescale?g=v=this.computeInitPts(a[0].pts,x,n,"audio"):h=!1)}if(e.sps&&e.pps&&o.length){if(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:Q.initSegment([e]),metadata:{width:e.width,height:e.height}},h)if(S=e.id,x=e.inputTimeScale,!f||x!==f.timescale){const E=this.getVideoStartPts(o),T=js(o[0].dts,E),L=this.computeInitPts(T,x,n,"video"),_=this.computeInitPts(E,x,n,"video");v=Math.min(v,L),g=Math.min(g,_)}else h=!1;this.videoTrackConfig={width:e.width,height:e.height,pixelRatio:e.pixelRatio}}if(Object.keys(d).length)return this.ISGenerated=!0,h?(f&&this.warn(`Timestamps at playlist time: ${i?"":"~"}${n} ${g/x} != initPTS: ${f.baseTime/f.timescale} (${f.baseTime}/${f.timescale}) trackId: ${f.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${g/x} (${g}/${x}) trackId: ${S}`),this._initPTS={baseTime:g,timescale:x,trackId:S},this._initDTS={baseTime:v,timescale:x,trackId:S}):g=x=void 0,{tracks:d,initPTS:g,timescale:x,trackId:S}}remuxVideo(t,e,n,i){const a=t.inputTimeScale,o=t.samples,c=[],d=o.length,f=this._initPTS,h=f.baseTime*a/f.timescale;let p=this.nextVideoTs,g=8,v=this.videoSampleDuration,x,S,E=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,L=!1;if(!n||p===null){const O=h+e*a,G=o[0].pts-js(o[0].dts,o[0].pts);fo&&p!==null&&Math.abs(O-G-(p+h))<15e3?n=!0:p=O-G-h}const _=p+h;for(let O=0;O<d;O++){const G=o[O];G.pts=js(G.pts,_),G.dts=js(G.dts,_),G.dts<o[O>0?O-1:O].dts&&(L=!0)}L&&o.sort(function(O,G){const K=O.dts-G.dts,J=O.pts-G.pts;return K||J}),x=o[0].dts,S=o[o.length-1].dts;const P=S-x,D=P?Math.round(P/(d-1)):v||t.inputTimeScale/30;if(n){const O=x-_,G=O>D,K=O<-1;if((G||K)&&(G?this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${$l(O,!0)} ms (${O}dts) hole between fragments detected at ${e.toFixed(3)}`):this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${$l(-O,!0)} ms (${O}dts) overlapping between fragments detected at ${e.toFixed(3)}`),!K||_>=o[0].pts||fo)){x=_;const J=o[0].pts-O;if(G)o[0].dts=x,o[0].pts=J;else{let ot=!0;for(let ft=0;ft<o.length&&!(o[ft].dts>J&&ot);ft++){const ht=o[ft].pts;if(o[ft].dts-=O,o[ft].pts-=O,ft<o.length-1){const xt=o[ft+1].pts,wt=o[ft].pts,Zt=xt<=wt,fe=xt<=ht;ot=Zt==fe}}}this.log(`Video: Initial PTS/DTS adjusted: ${$l(J,!0)}/${$l(x,!0)}, delta: ${$l(O,!0)} ms`)}}x=Math.max(0,x);let B=0,C=0,I=x;for(let O=0;O<d;O++){const G=o[O],K=G.units,J=K.length;let ot=0;for(let ft=0;ft<J;ft++)ot+=K[ft].data.length;C+=ot,B+=J,G.length=ot,G.dts<I?(G.dts=I,I+=D/4|0||1):I=G.dts,E=Math.min(G.pts,E),T=Math.max(G.pts,T)}S=o[d-1].dts;const F=C+4*B+8;let U;try{U=new Uint8Array(F)}catch(O){this.observer.emit(w.ERROR,w.ERROR,{type:Tt.MUX_ERROR,details:Z.REMUX_ALLOC_ERROR,fatal:!1,error:O,bytes:F,reason:`fail allocating video mdat ${F}`});return}const z=new DataView(U.buffer);z.setUint32(0,F),U.set(Q.types.mdat,4);let Y=!1,nt=Number.POSITIVE_INFINITY,it=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY,M=Number.NEGATIVE_INFINITY;for(let O=0;O<d;O++){const G=o[O],K=G.units;let J=0;for(let ht=0,xt=K.length;ht<xt;ht++){const wt=K[ht],Zt=wt.data,fe=wt.data.byteLength;z.setUint32(g,fe),g+=4,U.set(Zt,g),g+=fe,J+=4+fe}let ot;if(O<d-1)v=o[O+1].dts-G.dts,ot=o[O+1].pts-G.pts;else{const ht=this.config,xt=O>0?G.dts-o[O-1].dts:D;if(ot=O>0?G.pts-o[O-1].pts:D,ht.stretchShortVideoTrack&&this.nextAudioTs!==null){const wt=Math.floor(ht.maxBufferHole*a),Zt=(i?E+i*a:this.nextAudioTs+h)-G.pts;Zt>wt?(v=Zt-xt,v<0?v=xt:Y=!0,this.log(`It is approximately ${Zt/90} ms to the next segment; using duration ${v/90} ms for the last video frame.`)):v=xt}else v=xt}const ft=Math.round(G.pts-G.dts);nt=Math.min(nt,v),rt=Math.max(rt,v),it=Math.min(it,ot),M=Math.max(M,ot),c.push(n1(G.key,v,J,ft))}if(c.length){if(fo){if(fo<70){const O=c[0].flags;O.dependsOn=2,O.isNonSync=0}}else if(jp&&M-it<rt-nt&&D/rt<.025&&c[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let O=x;for(let G=0,K=c.length;G<K;G++){const J=O+c[G].duration,ot=O+c[G].cts;if(G<K-1){const ft=J+c[G+1].cts;c[G].duration=ft-ot}else c[G].duration=G?c[G-1].duration:D;c[G].cts=0,O=J}}}v=Y||!v?D:v;const j=S+v;this.nextVideoTs=p=j-h,this.videoSampleDuration=v,this.isVideoContiguous=!0;const X={data1:Q.moof(t.sequenceNumber++,x,se(t,{samples:c})),data2:U,startPTS:(E-h)/a,endPTS:(T+v-h)/a,startDTS:(x-h)/a,endDTS:p/a,type:"video",hasAudio:!1,hasVideo:!0,nb:c.length,dropped:t.dropped};return t.samples=[],t.dropped=0,X}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return oV;case"ac3":return lV;default:return aV}}remuxAudio(t,e,n,i,a){const o=t.inputTimeScale,c=t.samplerate?t.samplerate:o,d=o/c,f=this.getSamplesPerFrame(t),h=f*d,p=this._initPTS,g=t.segmentCodec==="mp3"&&this.typeSupported.mpeg,v=[],x=a!==void 0;let S=t.samples,E=g?0:8,T=this.nextAudioTs||-1;const L=p.baseTime*o/p.timescale,_=L+e*o;if(this.isAudioContiguous=n=n||S.length&&T>0&&(i&&Math.abs(_-(T+L))<9e3||Math.abs(js(S[0].pts,_)-(T+L))<20*h),S.forEach(function(M){M.pts=js(M.pts,_)}),!n||T<0){const M=S.length;if(S=S.filter(j=>j.pts>=0),M!==S.length&&this.warn(`Removed ${S.length-M} of ${M} samples (initPTS ${L} / ${o})`),!S.length)return;a===0?T=0:i&&!x?T=Math.max(0,_-L):T=S[0].pts-L}if(t.segmentCodec==="aac"){const M=this.config.maxAudioFramesDrift;for(let j=0,N=T+L;j<S.length;j++){const V=S[j],X=V.pts,O=X-N,G=Math.abs(1e3*O/o);if(O<=-M*h&&x)j===0&&(this.warn(`Audio frame @ ${(X/o).toFixed(3)}s overlaps marker by ${Math.round(1e3*O/o)} ms.`),this.nextAudioTs=T=X-L,N=X);else if(O>=M*h&&G<rV&&x){let K=Math.round(O/h);for(N=X-K*h;N<0&&K&&h;)K--,N+=h;j===0&&(this.nextAudioTs=T=N-L),this.warn(`Injecting ${K} audio frames @ ${((N-L)/o).toFixed(3)}s due to ${Math.round(1e3*O/o)} ms gap.`);for(let J=0;J<K;J++){let ot=sV.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);ot||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),ot=V.unit.subarray()),S.splice(j,0,{unit:ot,pts:N}),N+=h,j++}}V.pts=N,N+=h}}let P=null,D=null,B,C=0,I=S.length;for(;I--;)C+=S[I].unit.byteLength;for(let M=0,j=S.length;M<j;M++){const N=S[M],V=N.unit;let X=N.pts;if(D!==null){const G=v[M-1];G.duration=Math.round((X-D)/d)}else if(n&&t.segmentCodec==="aac"&&(X=T+L),P=X,C>0){C+=E;try{B=new Uint8Array(C)}catch(G){this.observer.emit(w.ERROR,w.ERROR,{type:Tt.MUX_ERROR,details:Z.REMUX_ALLOC_ERROR,fatal:!1,error:G,bytes:C,reason:`fail allocating audio mdat ${C}`});return}g||(new DataView(B.buffer).setUint32(0,C),B.set(Q.types.mdat,4))}else return;B.set(V,E);const O=V.byteLength;E+=O,v.push(n1(!0,f,O,0)),D=X}const F=v.length;if(!F)return;const U=v[v.length-1];T=D-L,this.nextAudioTs=T+d*U.duration;const z=g?new Uint8Array(0):Q.moof(t.sequenceNumber++,P/d,se({},t,{samples:v}));t.samples=[];const Y=(P-L)/o,nt=this.nextAudioTs/o,rt={data1:z,data2:B,startPTS:Y,endPTS:nt,startDTS:Y,endDTS:nt,type:"audio",hasAudio:!0,hasVideo:!1,nb:F};return this.isAudioContiguous=!0,rt}}function js(s,t){let e;if(t===null)return s;for(t<s?e=-h0:e=h0;Math.abs(s-t)>4294967296;)s+=e;return s}function cV(s){for(let t=0;t<s.length;t++)if(s[t].key)return t;return-1}function OC(s,t,e,n){const i=s.samples.length;if(!i)return;const a=s.inputTimeScale;for(let c=0;c<i;c++){const d=s.samples[c];d.pts=js(d.pts-e.baseTime*a/e.timescale,t*a)/a,d.dts=js(d.dts-n.baseTime*a/n.timescale,t*a)/a}const o=s.samples;return s.samples=[],{samples:o}}function kC(s,t,e){const n=s.samples.length;if(!n)return;const i=s.inputTimeScale;for(let o=0;o<n;o++){const c=s.samples[o];c.pts=js(c.pts-e.baseTime*i/e.timescale,t*i)/i}s.samples.sort((o,c)=>o.pts-c.pts);const a=s.samples;return s.samples=[],{samples:a}}class uV extends mn{constructor(t,e,n,i){super("passthrough-remuxer",i),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(t){this.lastEndTime=null;const e=this.initPTS;e&&t&&e.baseTime===t.baseTime&&e.timescale===t.timescale||(this.initPTS=t)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(t,e,n,i){this.audioCodec=e,this.videoCodec=n,this.generateInitSegment(t,i),this.emitInitSegment=!0}generateInitSegment(t,e){let{audioCodec:n,videoCodec:i}=this;if(!(t!=null&&t.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:a,video:o}=this.initData=U_(t);if(e)X8(t,e);else{const d=a||o;d!=null&&d.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${d.codec}")!`)}a&&(n=i1(a,ie.AUDIO,this)),o&&(i=i1(o,ie.VIDEO,this));const c={};a&&o?c.audiovideo={container:"video/mp4",codec:n+","+i,supplemental:o.supplemental,encrypted:o.encrypted,initSegment:t,id:"main"}:a?c.audio={container:"audio/mp4",codec:n,encrypted:a.encrypted,initSegment:t,id:"audio"}:o?c.video={container:"video/mp4",codec:i,supplemental:o.supplemental,encrypted:o.encrypted,initSegment:t,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=c}remux(t,e,n,i,a,o){var c,d;let{initPTS:f,lastEndTime:h}=this;const p={audio:void 0,video:void 0,text:i,id3:n,initSegment:void 0};pt(h)||(h=this.lastEndTime=a||0);const g=e.samples;if(!g.length)return p;const v={initPTS:void 0,timescale:void 0,trackId:void 0};let x=this.initData;if((c=x)!=null&&c.length||(this.generateInitSegment(g),x=this.initData),!((d=x)!=null&&d.length))return this.warn("Failed to generate initSegment."),p;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1);const S=J8(g,x,this),E=x.audio?S[x.audio.id]:null,T=x.video?S[x.video.id]:null,L=pd(T,1/0),_=pd(E,1/0),P=pd(T,0,!0),D=pd(E,0,!0);let B=a,C=0;const I=E&&(!T||!f&&_<L||f&&f.trackId===x.audio.id),F=I?E:T;if(F){const N=F.timescale,V=F.start-a*N,X=I?x.audio.id:x.video.id;B=F.start/N,C=I?D-_:P-L,(o||!f)&&(dV(f,B,a,C)||N!==f.timescale)&&(f&&this.warn(`Timestamps at playlist time: ${o?"":"~"}${a} ${V/N} != initPTS: ${f.baseTime/f.timescale} (${f.baseTime}/${f.timescale}) trackId: ${f.trackId}`),this.log(`Found initPTS at playlist time: ${a} offset: ${B-a} (${V}/${N}) trackId: ${X}`),f=null,v.initPTS=V,v.timescale=N,v.trackId=X)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${a}`);f?(v.initPTS=f.baseTime,v.timescale=f.timescale,v.trackId=f.trackId):((!v.timescale||v.trackId===void 0||v.initPTS===void 0)&&(this.warn("Could not set initPTS"),v.initPTS=B,v.timescale=1,v.trackId=-1),this.initPTS=f={baseTime:v.initPTS,timescale:v.timescale,trackId:v.trackId});const U=B-f.baseTime/f.timescale,z=U+C;C>0?this.lastEndTime=z:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Y=!!x.audio,nt=!!x.video;let it="";Y&&(it+="audio"),nt&&(it+="video");const rt=(x.audio?x.audio.encrypted:!1)||(x.video?x.video.encrypted:!1),M={data1:g,startPTS:U,startDTS:U,endPTS:z,endDTS:z,type:it,hasAudio:Y,hasVideo:nt,nb:1,dropped:0,encrypted:rt};p.audio=Y&&!nt?M:void 0,p.video=nt?M:void 0;const j=T?.sampleCount;if(j){const N=T.keyFrameIndex,V=N!==-1;M.nb=j,M.dropped=N===0||this.isVideoContiguous?0:V?N:j,M.independent=V,M.firstKeyFrame=N,V&&T.keyFrameStart&&(M.firstKeyFramePTS=(T.keyFrameStart-f.baseTime)/f.timescale),this.isVideoContiguous||(p.independent=V),this.isVideoContiguous||(this.isVideoContiguous=V),M.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${N}/${j} dropped: ${M.dropped} start: ${M.firstKeyFramePTS||"NA"}`)}return p.initSegment=v,p.id3=OC(n,a,f,f),i.samples.length&&(p.text=kC(i,a,f)),p}}function pd(s,t,e=!1){return s?.start!==void 0?(s.start+(e?s.duration:0))/s.timescale:t}function dV(s,t,e,n){if(s===null)return!0;const i=Math.max(n,1),a=t-s.baseTime/s.timescale;return Math.abs(a-e)>i}function i1(s,t,e){const n=s.codec;return n&&n.length>4?n:t===ie.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?sf(n,!1):(e.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(e.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let Ri;try{Ri=self.performance.now.bind(self.performance)}catch{Ri=Date.now}const Ud=[{demux:Q6,remux:uV},{demux:fr,remux:Fd},{demux:K6,remux:Fd},{demux:Y6,remux:Fd}];Ud.splice(2,0,{demux:q6,remux:Fd});class r1{constructor(t,e,n,i,a,o){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=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=t,this.typeSupported=e,this.config=n,this.id=a,this.logger=o}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,n,i){const a=n.transmuxing;a.executeStart=Ri();let o=new Uint8Array(t);const{currentTransmuxState:c,transmuxConfig:d}=this;i&&(this.currentTransmuxState=i);const{contiguous:f,discontinuity:h,trackSwitch:p,accurateTimeOffset:g,timeOffset:v,initSegmentChange:x}=i||c,{audioCodec:S,videoCodec:E,defaultInitPts:T,duration:L,initSegmentData:_}=d,P=fV(o,e);if(P&&Ro(P.method)){const I=this.getDecrypter(),F=My(P.method);if(I.isSync()){let U=I.softwareDecrypt(o,P.key.buffer,P.iv.buffer,F);if(n.part>-1){const Y=I.flush();U=Y&&Y.buffer}if(!U)return a.executeEnd=Ri(),$p(n);o=new Uint8Array(U)}else return this.asyncResult=!0,this.decryptionPromise=I.webCryptoDecrypt(o,P.key.buffer,P.iv.buffer,F).then(U=>{const z=this.push(U,null,n);return this.decryptionPromise=null,z}),this.decryptionPromise}const D=this.needsProbing(h,p);if(D){const I=this.configureTransmuxer(o);if(I)return this.logger.warn(`[transmuxer] ${I.message}`),this.observer.emit(w.ERROR,w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!1,error:I,reason:I.message}),a.executeEnd=Ri(),$p(n)}(h||p||x||D)&&this.resetInitSegment(_,S,E,L,e),(h||x||D)&&this.resetInitialTimestamp(T),f||this.resetContiguity();const B=this.transmux(o,P,v,g,n);this.asyncResult=Ac(B);const C=this.currentTransmuxState;return C.contiguous=!0,C.discontinuity=!1,C.trackSwitch=!1,a.executeEnd=Ri(),B}flush(t){const e=t.transmuxing;e.executeStart=Ri();const{decrypter:n,currentTransmuxState:i,decryptionPromise:a}=this;if(a)return this.asyncResult=!0,a.then(()=>this.flush(t));const o=[],{timeOffset:c}=i;
vendor: 5,139 bytes, line 198
198if(n){const p=n.flush();p&&o.push(this.push(p.buffer,null,t))}const{demuxer:d,remuxer:f}=this;if(!d||!f){e.executeEnd=Ri();const p=[$p(t)];return this.asyncResult?Promise.resolve(p):p}const h=d.flush(c);return Ac(h)?(this.asyncResult=!0,h.then(p=>(this.flushRemux(o,p,t),o))):(this.flushRemux(o,h,t),this.asyncResult?Promise.resolve(o):o)}flushRemux(t,e,n){const{audioTrack:i,videoTrack:a,id3Track:o,textTrack:c}=e,{accurateTimeOffset:d,timeOffset:f}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===yt.MAIN?"level":"track"} ${n.level}`);const h=this.remuxer.remux(i,a,o,c,f,d,!0,this.id);t.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=Ri()}resetInitialTimestamp(t){const{demuxer:e,remuxer:n}=this;!e||!n||(e.resetTimeStamp(t),n.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;!t||!e||(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,n,i,a){const{demuxer:o,remuxer:c}=this;!o||!c||(o.resetInitSegment(t,e,n,i),c.resetInitSegment(t,e,n,a))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,n,i,a){let o;return e&&e.method==="SAMPLE-AES"?o=this.transmuxSampleAes(t,e,n,i,a):o=this.transmuxUnencrypted(t,n,i,a),o}transmuxUnencrypted(t,e,n,i){const{audioTrack:a,videoTrack:o,id3Track:c,textTrack:d}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(a,o,c,d,e,n,!1,this.id),chunkMeta:i}}transmuxSampleAes(t,e,n,i,a){return this.demuxer.demuxSampleAes(t,e,n).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,n,i,!1,this.id),chunkMeta:a}))}configureTransmuxer(t){const{config:e,observer:n,typeSupported:i}=this;let a;for(let p=0,g=Ud.length;p<g;p++){var o;if((o=Ud[p].demux)!=null&&o.probe(t,this.logger)){a=Ud[p];break}}if(!a)return new Error("Failed to find demuxer by probing fragment data");const c=this.demuxer,d=this.remuxer,f=a.remux,h=a.demux;(!d||!(d instanceof f))&&(this.remuxer=new f(n,e,i,this.logger)),(!c||!(c instanceof h))&&(this.demuxer=new h(n,e,i,this.logger),this.probe=h.probe)}needsProbing(t,e){return!this.demuxer||!this.remuxer||t||e}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new ky(this.config)),t}}function fV(s,t){let e=null;return s.byteLength>0&&t?.key!=null&&t.iv!==null&&t.method!=null&&(e=t),e}const $p=s=>({remuxResult:{},chunkMeta:s});function Ac(s){return"then"in s&&s.then instanceof Function}class hV{constructor(t,e,n,i,a){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=n,this.duration=i,this.defaultInitPts=a||null}}class mV{constructor(t,e,n,i,a,o){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=t,this.contiguous=e,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=a,this.initSegmentChange=o}}let a1=0;class PC{constructor(t,e,n,i){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=a1++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=d=>{const f=d.data,h=this.hls;if(!(!h||!(f!=null&&f.event)||f.instanceNo!==this.instanceNo))switch(f.event){case"init":{var p;const g=(p=this.workerContext)==null?void 0:p.objectURL;g&&self.URL.revokeObjectURL(g);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}case"workerLog":{h.logger[f.data.logType]&&h.logger[f.data.logType](f.data.message);break}default:{f.data=f.data||{},f.data.frag=this.frag,f.data.part=this.part,f.data.id=this.id,h.trigger(f.event,f.data);break}}},this.onWorkerError=d=>{if(!this.hls)return;const f=new Error(`${d.message} (${d.filename}:${d.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:f})};const a=t.config;this.hls=t,this.id=e,this.useWorker=!!a.enableWorker,this.onTransmuxComplete=n,this.onFlush=i;const o=(d,f)=>{f=f||{},f.frag=this.frag||void 0,d===w.ERROR&&(f=f,f.parent=this.id,f.part=this.part,this.error=f.error),this.hls.trigger(d,f)};this.observer=new Fy,this.observer.on(w.FRAG_DECRYPTED,o),this.observer.on(w.ERROR,o);const c=SA(a.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const d=this.hls.logger;if(a.workerPath||v6()){try{a.workerPath?(d.log(`loading Web Worker ${a.workerPath} for "${e}"`),this.workerContext=b6(a.workerPath)):(d.log(`injecting Web Worker for "${e}"`),this.workerContext=x6());const{worker:h}=this.workerContext;h.addEventListener("message",this.onWorkerMessage),h.addEventListener("error",this.onWorkerError),h.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupp
vendor: 24,762 bytes, lines 198-204
198orted:c,id:e,config:re(a)})}catch(h){d.warn(`Error setting up "${e}" Web Worker, fallback to inline`,h),this.terminateWorker(),this.error=null,this.transmuxer=new r1(this.observer,c,a,"",e,t.logger)}return}}this.transmuxer=new r1(this.observer,c,a,"",e,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=a1++;const e=this.hls.config,n=SA(e.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:n,id:this.id,config:re(e)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),S6(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(t,e,n,i,a,o,c,d,f,h){var p,g;f.transmuxing.start=self.performance.now();const{instanceNo:v,transmuxer:x}=this,S=o?o.start:a.start,E=a.decryptdata,T=this.frag,L=!(T&&a.cc===T.cc),_=!(T&&f.level===T.level),P=T?f.sn-T.sn:-1,D=this.part?f.part-this.part.index:-1,B=P===0&&f.id>1&&f.id===T?.stats.chunkCount,C=!_&&(P===1||P===0&&(D===1||B&&D<=0)),I=self.performance.now();(_||P||a.stats.parsing.start===0)&&(a.stats.parsing.start=I),o&&(D||!C)&&(o.stats.parsing.start=I);const F=!(T&&((p=a.initSegment)==null?void 0:p.url)===((g=T.initSegment)==null?void 0:g.url)),U=new mV(L,C,d,_,S,F);if(!C||L||F){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${a.type} sn: ${f.sn}${f.part>-1?" part: "+f.part:""} ${this.id===yt.MAIN?"level":"track"}: ${f.level} id: ${f.id} 199 discontinuity: ${L} 200 trackSwitch: ${_} 201 contiguous: ${C} 202 accurateTimeOffset: ${d} 203 timeOffset: ${S} 204 initSegmentChange: ${F}`);const z=new hV(n,i,e,c,h);this.configureTransmuxer(z)}if(this.frag=a,this.part=o,this.workerContext)this.workerContext.worker.postMessage({instanceNo:v,cmd:"demux",data:t,decryptdata:E,chunkMeta:f,state:U},t instanceof ArrayBuffer?[t]:[]);else if(x){const z=x.push(t,E,f,U);Ac(z)?z.then(Y=>{this.handleTransmuxComplete(Y)}).catch(Y=>{this.transmuxerError(Y,f,"transmuxer-interface push error")}):this.handleTransmuxComplete(z)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:e,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:e,cmd:"flush",chunkMeta:t});else if(n){const i=n.flush(t);Ac(i)?i.then(a=>{this.handleFlushResult(a,t)}).catch(a=>{this.transmuxerError(a,t,"transmuxer-interface flush error")}):this.handleFlushResult(i,t)}}transmuxerError(t,e,n){this.hls&&(this.error=t,this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,chunkMeta:e,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:n}))}handleFlushResult(t,e){t.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(e)}configureTransmuxer(t){const{instanceNo:e,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:e,cmd:"configure",config:t}):n&&n.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}const o1=100;class pV extends By{constructor(t,e,n){super(t,e,n,"audio-stream-controller",yt.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(w.LEVEL_LOADED,this.onLevelLoaded,this),t.on(w.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(w.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(w.BUFFER_RESET,this.onBufferReset,this),t.on(w.BUFFER_CREATED,this.onBufferCreated,this),t.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(w.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(w.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(w.FRAG_LOADING,this.onFragLoading,this),t.on(w.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(w.LEVEL_LOADED,this.onLevelLoaded,this),t.off(w.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(w.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(w.BUFFER_RESET,this.onBufferReset,this),t.off(w.BUFFER_CREATED,this.onBufferCreated,this),t.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(w.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(w.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(w.FRAG_LOADING,this.onFragLoading,this),t.off(w.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:e,id:n,initPTS:i,timescale:a,trackId:o}){if(n===yt.MAIN){const c=e.cc,d=this.fragCurrent;if(this.initPTS[c]={baseTime:i,timescale:a,trackId:o},this.log(`InitPTS for cc: ${c} found from main: ${i/a} (${i}/${a}) trackId: ${o}`),this.mainAnchor=e,this.state===ct.WAITING_INIT_PTS){const f=this.waitingData;(!f&&!this.loadingParts||f&&f.frag.cc!==c)&&this.syncWithAnchor(e,f?.frag)}else!this.hls.hasEnoughToStart&&d&&d.cc!==c?(d.abortRequests(),this.syncWithAnchor(e,d)):this.state===ct.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(t,e){var n;const i=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(e&&i?.cc===e.cc)return;const a=(i||t).cc,o=this.getLevelDetails(),c=this.getLoadPosition(),d=Q_(o,a,c);d&&(this.log(`Syncing with main frag at ${d.start} cc ${d.cc}`),this.startFragRequested=!1,this.nextLoadPosition=d.start,this.resetLoadingState(),this.state===ct.IDLE&&this.doTickIdle())}startLoad(t,e){if(!this.levels){this.startPosition=t,this.state=ct.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(o1),n>0&&t===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),t=n,this.state=ct.IDLE):this.state=ct.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}doTick(){switch(this.state){case ct.IDLE:this.doTickIdle();break;case ct.WAITING_TRACK:{const{levels:t,trackId:e}=this,n=t?.[e],i=n?.details;if(i&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(i))break;this.state=ct.WAITING_INIT_PTS}break}case ct.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case ct.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:e,part:n,cache:i,complete:a}=t,o=this.mainAnchor;if(this.initPTS[e.cc]!==void 0){this.waitingData=null,this.state=ct.FRAG_LOADING;const c=i.flush().buffer,d={frag:e,part:n,payload:c,networkDetails:null};this._handleFragmentLoadProgress(d),a&&super._handleFragmentLoadComplete(d)}else o&&o.cc!==t.frag.cc&&this.syncWithAnchor(o,t.frag)}else this.state=ct.IDLE}}this.onTickEnd()}resetLoadingState(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:t}=this;t!=null&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:e,levels:n,media:i,trackId:a}=this,o=e.config;if(!this.buffering||!i&&!this.primaryPrefetch&&(this.startFragRequested||!o.startFragPrefetch)||!(n!=null&&n[a]))return;const c=n[a],d=c.details;if(!d||this.waitForLive(c)||this.waitForCdnTuneIn(d)){this.state=ct.WAITING_TRACK,this.startFragRequested=!1;return}const f=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&f&&(this.bufferFlushed=!1,this.afterBufferFlushed(f,ie.AUDIO,yt.AUDIO));const h=this.getFwdBufferInfo(f,yt.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,d)){e.trigger(w.BUFFER_EOS,{type:"audio"}),this.state=ct.ENDED;return}const p=h.len,g=e.maxBufferLength,v=d.fragments,x=v[0].start,S=this.getLoadPosition(),E=this.flushing?S:h.end;if(this.switchingTrack&&i){const _=S;d.PTSKnown&&_<x&&(h.end>x||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=x+.05)}if(p>=g&&!this.switchingTrack&&E<v[v.length-1].start)return;let T=this.getNextFragment(E,d);if(T&&this.isLoopLoading(T,E)&&(T=this.getNextFragmentLoopLoading(T,d,h,yt.MAIN,g)),!T){this.bufferFlushed=!0;return}if(this.exceedsMaxBuffer(h,g,T))return;let L=((t=this.mainFragLoading)==null?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&L&&_e(T)&&!T.endList&&(!d.live||!this.loadingParts&&E<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(L)===Ve.OK&&(this.mainFragLoading=L=null),L&&_e(L))){if(T.start>L.end){const P=this.fragmentTracker.getFragAtPos(E,yt.MAIN);P&&P.end>L.end&&(L=P,this.mainFragLoading={frag:P,targetBufferTime:null})}if(T.start>L.end)return}this.loadFragment(T,c,E)}onMediaDetaching(t,e){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,e)}onAudioTracksUpdated(t,{audioTracks:e}){this.resetTransmuxer(),this.levels=e.map(n=>new Sc(n))}onAudioTrackSwitching(t,e){const n=!!e.url;this.trackId=e.id;const{fragCurrent:i}=this;i&&(i.abortRequests(),this.removeUnbufferedFrags(i.start)),this.resetLoadingState(),n?(this.switchingTrack=e,this.flushAudioIfNeeded(e),this.state!==ct.STOPPED&&(this.setInterval(o1),this.state=ct.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=e,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,e){this.mainDetails=e.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(w.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(t,e){var n;const{levels:i}=this,{details:a,id:o,groupId:c,track:d}=e;if(!i){this.warn(`Audio tracks reset while loading track ${o} "${d.name}" of "${c}"`);return}const f=this.mainDetails;if(!f||a.endCC>f.endCC||f.expired){this.cachedTrackLoadedData=e,this.state!==ct.STOPPED&&(this.state=ct.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${o} "${d.name}" of "${c}" loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`);const h=i[o];let p=0;if(a.live||(n=h.details)!=null&&n.live){if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;if(h.details){var g;p=this.alignPlaylists(a,h.details,(g=this.levelLastLoaded)==null?void 0:g.details)}a.alignedSliding||(mC(a,f),a.alignedSliding||uf(a,f),p=a.fragmentStart)}h.details=a,this.levelLastLoaded=h,this.startFragRequested||this.setStartPosition(f,p),this.hls.trigger(w.AUDIO_TRACK_UPDATED,{details:a,id:o,groupId:e.groupId}),this.state===ct.WAITING_TRACK&&!this.waitForCdnTuneIn(a)&&(this.state=ct.IDLE),this.tick()}_handleFragmentLoadProgress(t){var e;const n=t.frag,{part:i,payload:a}=t,{config:o,trackId:c,levels:d}=this;if(!d){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const f=d[c];if(!f){this.warn("Audio track is undefined on fragment load progress");return}const h=f.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const p=o.defaultAudioCodec||f.audioCodec||"mp4a.40.2";let g=this.transmuxer;g||(g=this.transmuxer=new PC(this.hls,yt.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const v=this.initPTS[n.cc],x=(e=n.initSegment)==null?void 0:e.data;if(v!==void 0){const E=i?i.index:-1,T=E!==-1,L=new Py(n.level,n.sn,n.stats.chunkCount,a.byteLength,E,T);g.push(a,x,p,"",n,i,h.totalduration,!1,L,v)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${h.startSN} ,${h.endSN}],track ${c}`);const{cache:S}=this.waitingData=this.waitingData||{frag:n,part:i,cache:new pC,complete:!1};S.push(new Uint8Array(a)),this.state!==ct.STOPPED&&(this.state=ct.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(t){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,e){this.bufferFlushed=this.flushing=!1;const n=e.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(t,e){!this.audioOnly&&e.frag.type===yt.MAIN&&_e(e.frag)&&(this.mainFragLoading=e,this.state===ct.IDLE&&this.tick())}onFragBuffered(t,e){const{frag:n,part:i}=e;if(n.type!==yt.AUDIO){!this.audioOnly&&n.type===yt.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(_e(n)){this.fragPrevious=n;const a=this.switchingTrack;a&&(this.bufferedTrack=a,this.switchingTrack=null,this.hls.trigger(w.AUDIO_TRACK_SWITCHED,Qt({},a)))}this.fragBufferedComplete(n,i),this.media&&this.tick()}onError(t,e){var n;if(e.fatal){this.state=ct.ERROR;return}switch(e.details){case Z.FRAG_GAP:case Z.FRAG_PARSING_ERROR:case Z.FRAG_DECRYPT_ERROR:case Z.FRAG_LOAD_ERROR:case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_ERROR:case Z.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(yt.AUDIO,e);break;case Z.AUDIO_TRACK_LOAD_ERROR:case Z.AUDIO_TRACK_LOAD_TIMEOUT:case Z.LEVEL_PARSING_ERROR:!e.levelRetry&&this.state===ct.WAITING_TRACK&&((n=e.context)==null?void 0:n.type)===Ft.AUDIO_TRACK&&(this.state=ct.IDLE);break;case Z.BUFFER_ADD_CODEC_ERROR:case Z.BUFFER_APPEND_ERROR:if(e.parent!=="audio")return;this.reduceLengthAndFlushBuffer(e)||this.resetLoadingState();break;case Z.BUFFER_FULL_ERROR:if(e.parent!=="audio")return;this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Z.INTERNAL_EXCEPTION:this.recoverWorkerError(e);break}}onBufferFlushing(t,{type:e}){e!==ie.VIDEO&&(this.flushing=!0)}onBufferFlushed(t,{type:e}){if(e!==ie.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===ct.ENDED&&(this.state=ct.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,e,yt.AUDIO),this.tick())}}_handleTransmuxComplete(t){var e;const n="audio",{hls:i}=this,{remuxResult:a,chunkMeta:o}=t,c=this.getCurrentContext(o);if(!c){this.resetWhenMissingContext(o);return}const{frag:d,part:f,level:h}=c,{details:p}=h,{audio:g,text:v,id3:x,initSegment:S}=a;if(this.fragContextChanged(d)||!p){this.fragmentTracker.removeFragment(d);return}if(this.state=ct.PARSING,this.switchingTrack&&g&&this.completeAudioSwitch(this.switchingTrack),S!=null&&S.tracks){const E=d.initSegment||d;if(this.unhandledEncryptionError(S,d))return;this._bufferInitSegment(h,S.tracks,E,o),i.trigger(w.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:n,tracks:S.tracks})}if(g){const{startPTS:E,endPTS:T,startDTS:L,endDTS:_}=g;f&&(f.elementaryStreams[ie.AUDIO]={startPTS:E,endPTS:T,startDTS:L,endDTS:_}),d.setElementaryStreamInfo(ie.AUDIO,E,T,L,_),this.bufferFragmentData(g,d,f,o)}if(x!=null&&(e=x.samples)!=null&&e.length){const E=se({id:n,frag:d,details:p},x);i.trigger(w.FRAG_PARSING_METADATA,E)}if(v){const E=se({id:n,frag:d,details:p},v);i.trigger(w.FRAG_PARSING_USERDATA,E)}}_bufferInitSegment(t,e,n,i){if(this.state!==ct.PARSING||(e.video&&delete e.video,e.audiovideo&&delete e.audiovideo,!e.audio))return;const a=e.audio;a.id=yt.AUDIO;const o=t.audioCodec;this.log(`Init audio buffer, container:${a.container}, codecs[level/parsed]=[${o}/${a.codec}]`),o&&o.split(",").length===1&&(a.levelCodec=o),this.hls.trigger(w.BUFFER_CODECS,e);const c=a.initSegment;if(c!=null&&c.byteLength){const d={type:"audio",frag:n,part:null,chunkMeta:i,parent:n.type,data:c};this.hls.trigger(w.BUFFER_APPENDING,d)}this.tickImmediate()}loadFragment(t,e,n){const i=this.fragmentTracker.getState(t);if(this.switchingTrack||i===Ve.NOT_LOADED||i===Ve.PARTIAL){var a;if(!_e(t))this._loadInitSegment(t,e);else if((a=e.details)!=null&&a.live&&!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=ct.WAITING_INIT_PTS;const o=this.mainDetails;o&&o.fragmentStart!==e.details.fragmentStart&&uf(e.details,o)}else super.loadFragment(t,e,n)}else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:e,lang:n,assocLang:i,characteristics:a,audioCodec:o,channels:c}=this.bufferedTrack;aa({name:e,lang:n,assocLang:i,characteristics:a,audioCodec:o,channels:c},t,Jr)||(rf(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:e}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(w.AUDIO_TRACK_SWITCHED,Qt({},t))}}class zy extends mn{constructor(t,e){super(e,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e,n){const i=e?.renditionReports;if(i){let a=-1;for(let o=0;o<i.length;o++){const c=i[o];let d;try{d=new self.URL(c.URI,e.url).href}catch(f){this.warn(`Could not construct new URL for Rendition Report: ${f}`),d=c.URI||""}if(d===t){a=o;break}else d===t.substring(0,d.length)&&(a=o)}if(a!==-1){const o=i[a],c=parseInt(o["LAST-MSN"])||e.lastPartSn;let d=parseInt(o["LAST-PART"])||e.lastPartIndex;if(this.hls.config.lowLatencyMode){const h=Math.min(e.age-e.partTarget,e.targetduration);d>=0&&h>e.partTarget&&(d+=1)}const f=n&&EA(n);return new TA(c,d>=0?d:void 0,f)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,e){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,e){if(e)try{return e.addDirectives(t)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return t}playlistLoaded(t,e,n){const{details:i,stats:a}=e,o=self.performance.now(),c=a.loading.first?Math.max(0,o-a.loading.first):0;i.advancedDateTime=Date.now()-c;const d=this.hls.config.timelineOffset;if(d!==i.appliedTimelineOffset){const h=Math.max(d||0,0);i.appliedTimelineOffset=h,i.fragments.forEach(p=>{p.setStart(p.playlistOffset+h)})}if(i.live||n!=null&&n.live){const h="levelInfo"in e?e.levelInfo:e.track;if(i.reloaded(n),n&&i.fragments.length>0){o6(n,i,this);const L=i.playlistParsingError;if(L){this.warn(L);const _=this.hls;if(!_.config.ignorePlaylistParsingErrors){var f;const{networkDetails:P}=e;_.trigger(w.ERROR,{type:Tt.NETWORK_ERROR,details:Z.LEVEL_PARSING_ERROR,fatal:!1,url:i.url,error:L,reason:L.message,level:e.level||void 0,parent:(f=i.fragments[0])==null?void 0:f.type,networkDetails:P,stats:a});return}i.playlistParsingError=null}}i.requestScheduled===-1&&(i.requestScheduled=a.loading.start);const p=this.hls.mainForwardBufferInfo,g=p?p.end-p.len:0,v=(i.edge-g)*1e3,x=cC(i,v);if(i.requestScheduled+x<o?i.requestScheduled=o:i.requestScheduled<=o&&(i.requestScheduled+=x),this.log(`live playlist ${t} ${i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:i.updated?"UPDATED":"MISSED"}`),!this.canLoad||!i.live)return;let S,E,T;if(i.canBlockReload&&i.endSN&&i.advanced){const L=this.hls.config.lowLatencyMode,_=i.lastPartSn,P=i.endSN,D=i.lastPartIndex,B=D!==-1,C=_===P;B?C?(E=P+1,T=L?0:D):(E=_,T=L?D+1:i.maxPartIndex):E=P+1;const I=i.age,F=I+i.ageHeader;let U=Math.min(F-i.partTarget,i.targetduration*1.5);if(U>0){if(F>i.targetduration*3)this.log(`Playlist last advanced ${I.toFixed(2)}s ago. Omitting segment and part directives.`),E=void 0,T=void 0;else if(n!=null&&n.tuneInGoal&&F-i.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${U} with playlist age: ${i.age}`),U=0;else{const z=Math.floor(U/i.targetduration);if(E+=z,T!==void 0){const Y=Math.round(U%i.targetduration/i.partTarget);T+=Y}this.log(`CDN Tune-in age: ${i.ageHeader}s last advanced ${I.toFixed(2)}s goal: ${U} skip sn ${z} to part ${T}`)}i.tuneInGoal=U}if(S=this.getDeliveryDirectives(i,e.deliveryDirectives,E,T),L||!C){i.requestScheduled=o,this.loadingPlaylist(h,S);return}}else(i.canBlockReload||i.canSkipUntil)&&(S=this.getDeliveryDirectives(i,e.deliveryDirectives,E,T));S&&E!==void 0&&i.canBlockReload&&(i.requestScheduled=a.loading.first+Math.max(x-c*2,x/2)),this.scheduleLoading(h,S,i)}else this.clearTimer()}scheduleLoading(t,e,n){const i=n||t.details;if(!i){this.loadingPlaylist(t,e);return}const a=self.performance.now(),o=i.requestScheduled;if(a>=o){this.loadingPlaylist(t,e);return}const c=o-a;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(c)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(t,e),c)}getDeliveryDirectives(t,e,n,i){let a=EA(t);return e!=null&&e.skip&&t.deltaUpdateFailed&&(n=e.msn,i=e.part,a=Nd.No),new TA(n,i,a)}checkRetry(t){const e=t.details,n=af(t),i=t.errorAction,{action:a,retryCount:o=0,retryConfig:c}=i||{},d=!!i&&!!c&&(a===es.RetryRequest||!i.resolved&&a===es.SendAlternateToPenaltyBox);if(d){var f;if(o>=c.maxNumRetry)return!1;if(n&&(f=t.context)!=null&&f.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${c.maxNumRetry} after "${e}" without delivery-directives`),this.loadPlaylist();else{const h=Oy(c,o);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${o+1}/${c.maxNumRetry} after "${e}" in ${h}ms`)}t.levelRetry=!0,i.resolved=!0}return d}}function MC(s,t){if(s.length!==t.length)return!1;for(let e=0;e<s.length;e++)if(!Rc(s[e].attrs,t[e].attrs))return!1;return!0}function Rc(s,t,e){const n=s["STABLE-RENDITION-ID"];return n&&!e?n===t["STABLE-RENDITION-ID"]:!(e||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(i=>s[i]!==t[i])}function m0(s,t){return t.label.toLowerCase()===s.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(s.lang||"").toLowerCase())}class gV extends zy{constructor(t){super(t,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_PARSED,this.onManifestParsed,this),t.on(w.LEVEL_LOADING,this.onLevelLoading,this),t.on(w.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(w.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(w.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_PARSED,this.onManifestParsed,this),t.off(w.LEVEL_LOADING,this.onLevelLoading,this),t.off(w.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(w.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(w.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.audioTracks||[]}onAudioTrackLoaded(t,e){const{id:n,groupId:i,details:a}=e,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Audio track with id:${n} and group:${i} not found in active group ${o?.groupId}`);return}const c=o.details;o.details=e.details,this.log(`Audio track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${a.startSN}-${a.endSN}]`),n===this.trackId&&this.playlistLoaded(n,e,c)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const n=e.audioGroups||null,i=this.groupIds;let a=this.currentTrack;if(!n||i?.length!==n?.length||n!=null&&n.some(c=>i?.indexOf(c)===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const c=this.tracks.filter(g=>!n||n.indexOf(g.groupId)!==-1);if(c.length)this.selectDefaultTrack&&!c.some(g=>
vendor: 9,741 bytes, lines 204-207
204g.default)&&(this.selectDefaultTrack=!1),c.forEach((g,v)=>{g.id=v});else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=c;const d=this.hls.config.audioPreference;if(!a&&d){const g=Hn(d,c,Jr);if(g>-1)a=c[g];else{const v=Hn(d,this.tracks);a=this.tracks[v]}}let f=this.findTrackId(a);f===-1&&a&&(f=this.findTrackId(null));const h={audioTracks:c};this.log(`Updating audio tracks, ${c.length} track(s) found in group(s): ${n?.join(",")}`),this.hls.trigger(w.AUDIO_TRACKS_UPDATED,h);const p=this.trackId;if(f!==-1&&p===-1)this.setAudioTrack(f);else if(c.length&&p===-1){var o;const g=new Error(`No audio track selected for current audio group-ID(s): ${(o=this.groupIds)==null?void 0:o.join(",")} track count: ${c.length}`);this.warn(g.message),this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:g})}}}onError(t,e){e.fatal||!e.context||e.context.type===Ft.AUDIO_TRACK&&e.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(e.context.groupId)!==-1)&&this.checkRetry(e)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const e=this.hls;if(e.config.audioPreference=t,t){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const i=this.currentTrack;if(i&&aa(t,i,Jr))return i;const a=Hn(t,this.tracksInGroup,Jr);if(a>-1){const o=this.tracksInGroup[a];return this.setAudioTrack(a),o}else if(i){let o=e.loadLevel;o===-1&&(o=e.firstAutoLevel);const c=_$(t,e.levels,n,o,Jr);if(c===-1)return null;e.nextLoadLevel=c}if(t.channels||t.audioCodec){const o=Hn(t,n);if(o>-1)return n[o]}}}return null}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length){this.warn(`Invalid audio track id: ${t}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=e[t],a=i.details&&!i.details.live;if(t===this.trackId&&i===n&&a||(this.log(`Switching to audio-track ${t} "${i.name}" lang:${i.lang} group:${i.groupId} channels:${i.channels}`),this.trackId=t,this.currentTrack=i,this.hls.trigger(w.AUDIO_TRACK_SWITCHING,Qt({},i)),a))return;const o=this.switchParams(i.url,n?.details,i.details);this.loadPlaylist(o)}findTrackId(t){const e=this.tracksInGroup;for(let n=0;n<e.length;n++){const i=e[n];if(!(this.selectDefaultTrack&&!i.default)&&(!t||aa(t,i,Jr)))return n}if(t){const{name:n,lang:i,assocLang:a,characteristics:o,audioCodec:c,channels:d}=t;for(let f=0;f<e.length;f++){const h=e[f];if(aa({name:n,lang:i,assocLang:a,characteristics:o,audioCodec:c,channels:d},h,Jr))return f}for(let f=0;f<e.length;f++){const h=e[f];if(Rc(t.attrs,h.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return f}for(let f=0;f<e.length;f++){const h=e[f];if(Rc(t.attrs,h.attrs,["LANGUAGE"]))return f}}return-1}loadPlaylist(t){super.loadPlaylist();const e=this.currentTrack;this.shouldLoadPlaylist(e)&&rf(e.url,this.hls)&&this.scheduleLoading(e,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=t.id,i=t.groupId,a=this.getUrlWithDirectives(t.url,e),o=t.details,c=o?.age;this.log(`Loading audio-track ${n} "${t.name}" lang:${t.lang} group:${i}${e?.msn!==void 0?" at sn "+e.msn+" part "+e.part:""}${c&&o.live?" age "+c.toFixed(1)+(o.type&&" "+o.type||""):""} ${a}`),this.hls.trigger(w.AUDIO_TRACK_LOADING,{url:a,id:n,groupId:i,deliveryDirectives:e||null,track:t})}}class yV{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,e,n){if(this.queues===null||this.tracks===null)return;const i=this.queues[e];i.push(t),i.length===1&&!n&&this.executeNext(e)}appendBlocker(t){return new Promise(e=>{const n={label:"async-blocker",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,t)})}prependBlocker(t){return new Promise(e=>{if(this.queues){const n={label:"async-blocker-prepend",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(t=>{var e;const n=(e=t[0])==null?void 0:e.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(t[0].execute(),t.splice(0,1))})}unblockAudio(t){if(this.queues===null)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(this.queues===null||this.tracks===null)return;const e=this.queues[t];if(e.length){const i=e[0];try{i.execute()}catch(a){var n;if(i.onError(a),this.queues===null||this.tracks===null)return;const o=(n=this.tracks[t])==null?void 0:n.buffer;o!=null&&o.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){this.queues!==null&&(this.queues[t].shift(),this.executeNext(t))}current(t){var e;return((e=this.queues)==null?void 0:e[t][0])||null}toString(){const{queues:t,tracks:e}=this;return t===null||e===null?"<destroyed>":` 205${this.list("video")} 206${this.list("audio")} 207${this.list("audiovideo")}}`}list(t){var e,n;return(e=this.queues)!=null&&e[t]||(n=this.tracks)!=null&&n[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var e;const n=(e=this.tracks)==null?void 0:e[t],i=n?.buffer;return i?`SourceBuffer${i.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(t){var e;return((e=this.queues)==null?void 0:e[t].map(n=>n.label).join(", "))||""}}const l1=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,NC="HlsJsTrackRemovedError";class vV extends Error{constructor(t){super(t),this.name=NC}}class xV extends mn{constructor(t,e){super("buffer-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var i;this.hls&&((i=this.mediaSource)==null?void 0:i.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:i,mediaSource:a}=this;n&&this.log("Media source opened"),!(!i||!a)&&(a.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(w.MEDIA_ATTACHED,{media:i,mediaSource:a}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:i}=this;n!==i&&this.error(`Media element src was set while attaching MediaSource (${i} > ${n})`)},this.hls=t,this.fragmentTracker=e,this.appendSource=$8(Tr(t.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:t}=this;t.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_PARSED,this.onManifestParsed,this),t.on(w.BUFFER_RESET,this.onBufferReset,this),t.on(w.BUFFER_APPENDING,this.onBufferAppending,this),t.on(w.BUFFER_CODECS,this.onBufferCodecs,this),t.on(w.BUFFER_EOS,this.onBufferEos,this),t.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(w.FRAG_PARSED,this.onFragParsed,this),t.on(w.FRAG_CHANGED,this.onFragChanged,this),t.on(w.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_PARSED,this.onManifestParsed,this),t.off(w.BUFFER_RESET,this.onBufferReset,this),t.off(w.BUFFER_APPENDING,this.onBufferAppending,this),t.off(w.BUFFER_CODECS,this.onBufferCodecs,this),t.off(w.BUFFER_EOS,this.onBufferEos,this),t.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(w.FRAG_PARSED,this.onFragParsed,this),t.off(w.FRAG_CHANGED,this.onFragChanged,this),t.off(w.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:e}=this;if(!t)return null;const n={};if(this.operationQueue){const a=this.isUpdating();a||this.operationQueue.removeBlockers();const o=this.isQueued();(a||o)&&this.warn(`Transfering MediaSource with${o?" operations in queue":""}${a?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const i=this.transferData;return!this.sourceBufferCount&&i&&i.mediaSource===e?se(n,i.tracks):this.sourceBuffers.forEach(a=>{const[o]=a;o&&(n[o]=se({},this.tracks[o]),this.removeBuffer(o)),a[0]=a[1]=null}),{media:t,mediaSource:e,tracks:n}}initTracks(){const t={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=t,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){var n;let i=2;(e.audio&&!e.video||!e.altAudio)&&(i=1),this.bufferCodecEventsTotal=i,this.log(`${i}
207 bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&i&&this.bufferCreated()}onMediaAttaching(t,e){const n=this.media=e.media;this.transferData=this.overrides=void 0;const i=Tr(this.appendSource);if(i){const a=!!e.mediaSource;(a||e.overrides)&&(this.transferData=e,this.overrides=e.overrides);const o=this.mediaSource=e.mediaSource||new i;if(this.assignMediaSource(o),a)this._objectUrl=n.src,this.attachTransferred();else{const c=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{n.removeAttribute("src");const d=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||d&&o instanceof d,c1(n),bV(n,c),n.load()}catch{n.src=c}else n.src=c}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var e,n;this.log(`${((e=this.transferData)==null?void 0:e.mediaSource)===t?"transferred":"created"} media source: ${(n=t.constructor)==null?void 0:n.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const t=this.media,e=this.transferData;if(!e||!t)return;const n=this.tracks,i=e.tracks,a=i?Object.keys(i):null,o=a?a.length:0,c=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(i&&a&&o){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal}) 208required tracks: ${re(n,(d,f)=>d==="initSegment"?void 0:f)}; 209transfer tracks: ${re(i,(d,f)=>d==="initSegment"?void 0:f)}}`),!O_(i,n)){e.mediaSource=null,e.tracks=void 0;const d=t.currentTime,f=this.details,h=Math.max(d,f?.fragments[0].start||0);if(h-d>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${d} -> ${h}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(i)}"->"${Object.keys(n)}") start time: ${h} currentTime: ${d}`),this.onMediaDetaching(w.MEDIA_DETACHING,{}),this.onMediaAttaching(w.MEDIA_ATTACHING,e),t.currentTime=h;return}this.transferData=void 0,a.forEach(d=>{const f=d,h=i[f];if(h){const p=h.buffer;if(p){const g=this.fragmentTracker,v=h.id;if(g.hasFragments(v)||g.hasParts(v)){const E=Dt.getBuffered(p);g.detectEvictedFragments(f,E,v,null,!0)}const x=Vp(f),S=[f,p];this.sourceBuffers[x]=S,p.updating&&this.operationQueue&&this.operationQueue.prependBlocker(f),this.trackSourceBuffer(f,h)}}}),c(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),c()}get mediaSourceOpenOrEnded(){var t;const e=(t=this.mediaSource)==null?void 0:t.readyState;return e==="open"||e==="ended"}onMediaDetaching(t,e){const n=!!e.transferMedia;this.transferData=this.overrides=void 0;const{media:i,mediaSource:a,_objectUrl:o}=this;if(a){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([c])=>{c&&this.removeBuffer(c)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const c=a.readyState==="open";try{const d=a.sourceBuffers;for(let f=d.length;f--;)c&&d[f].abort(),a.removeSourceBuffer(d[f]);c&&a.endOfStream()}catch(d){this.warn(`onMediaDetaching: ${d.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(a.removeEventListener("startstreaming",this._onStartStreaming),a.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}i&&(i.removeEventListener("emptied",this._onMediaEmptied),n||(o&&self.URL.revokeObjectURL(o),this.mediaSrc===o?(i.removeAttribute("src"),this.appendSource&&c1(i),i.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(w.MEDIA_DETACHED,e)}
vendor: 16,542 bytes, line 209
209onBufferReset(){this.sourceBuffers.forEach(([t])=>{t&&this.resetBuffer(t)}),this.initTracks()}resetBuffer(t){var e;const n=(e=this.tracks[t])==null?void 0:e.buffer;if(this.removeBuffer(t),n)try{var i;(i=this.mediaSource)!=null&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(a){this.warn(`onBufferReset ${t}`,a)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[Vp(t)]=[null,null];const e=this.tracks[t];e&&(e.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new yV(this.tracks)}onBufferCodecs(t,e){var n;const i=this.tracks,a=Object.keys(e);this.log(`BUFFER_CODECS: "${a}" (current SB count ${this.sourceBufferCount})`);const o="audiovideo"in e&&(i.audio||i.video)||i.audiovideo&&("audio"in e||"video"in e),c=!o&&this.sourceBufferCount&&this.media&&a.some(d=>!i[d]);if(o||c){this.warn(`Unsupported transition between "${Object.keys(i)}" and "${a}" SourceBuffers`);return}a.forEach(d=>{var f,h;const p=e[d],{id:g,codec:v,levelCodec:x,container:S,metadata:E,supplemental:T}=p;let L=i[d];const _=(f=this.transferData)==null||(f=f.tracks)==null?void 0:f[d],P=_!=null&&_.buffer?_:L,D=P?.pendingCodec||P?.codec,B=P?.levelCodec;L||(L=i[d]={buffer:void 0,listeners:[],codec:v,supplemental:T,container:S,levelCodec:x,metadata:E,id:g});const C=Md(D,B),I=C?.replace(l1,"$1");let F=Md(v,x);const U=(h=F)==null?void 0:h.replace(l1,"$1");F&&C&&I!==U&&(d.slice(0,5)==="audio"&&(F=sf(F,this.appendSource)),this.log(`switching codec ${D} to ${F}`),F!==(L.pendingCodec||L.codec)&&(L.pendingCodec=F),L.container=S,this.appendChangeType(d,S,F))}),(this.tracksReady||this.sourceBufferCount)&&(e.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!e.video&&((n=e.audio)==null?void 0:n.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((t,e)=>{const n=this.tracks[e];return t[e]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},t},{})}appendChangeType(t,e,n){const i=`${e};codecs=${n}`,a={label:`change-type=${i}`,execute:()=>{const o=this.tracks[t];if(o){const c=o.buffer;c!=null&&c.changeType&&(this.log(`changing ${t} sourceBuffer type to ${i}`),c.changeType(i),o.codec=n,o.container=e)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn(`Failed to change ${t} SourceBuffer type`,o)}};this.append(a,t,this.isPending(this.tracks[t]))}blockAudio(t){var e;const n=t.start,i=n+t.duration*.05;if(((e=this.fragmentTracker.getAppendedFrag(n,yt.MAIN))==null?void 0:e.gap)===!0)return;const o={label:"block-audio",execute:()=>{var c;const d=this.tracks.video;(this.lastVideoAppendEnd>i||d!=null&&d.buffer&&Dt.isBuffered(d.buffer,i)||((c=this.fragmentTracker.getAppendedFrag(i,yt.MAIN))==null?void 0:c.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:c=>{this.warn("Error executing block-audio operation",c)}};this.blockedAudioAppend={op:o,frag:t},this.append(o,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:e}=this;t&&e&&(this.blockedAudioAppend=null,e.unblockAudio(t.op))}onBufferAppending(t,e){const{tracks:n}=this,{data:i,type:a,parent:o,frag:c,part:d,chunkMeta:f,offset:h}=e,p=f.buffering[a],{sn:g,cc:v}=c,x=self.performance.now();p.start=x;const S=c.stats.buffering,E=d?d.stats.buffering:null;S.start===0&&(S.start=x),E&&E.start===0&&(E.start=x);const T=n.audio;let L=!1;a==="audio"&&T?.container==="audio/mpeg"&&(L=!this.lastMpegAudioChunk||f.id===1||this.lastMpegAudioChunk.sn!==f.sn,this.lastMpegAudioChunk=f);const _=n.video,P=_?.buffer;if(P&&g!=="initSegment"){const C=d||c,I=this.blockedAudioAppend;if(a==="audio"&&o!=="main"&&!this.blockedAudioAppend&&!(_.ending||_.ended)){const U=C.start+C.duration*.05,z=P.buffered,Y=this.currentOp("video");!z.length&&!Y?this.blockAudio(C):!Y&&!Dt.isBuffered(P,U)&&this.lastVideoAppendEnd<U&&this.blockAudio(C)}else if(a==="video"){const F=C.end;if(I){const U=I.frag.start;(F>U||F<this.lastVideoAppendEnd||Dt.isBuffered(P,U))&&this.unblockAudio()}this.lastVideoAppendEnd=F}}const D=(d||c).start,B={label:`append-${a}`,execute:()=>{var C;p.executeStart=self.performance.now();const I=(C=this.tracks[a])==null?void 0:C.buffer;I&&(L?this.updateTimestampOffset(I,D,.1,a,g,v):h!==void 0&&pt(h)&&this.updateTimestampOffset(I,h,1e-6,a,g,v)),this.appendExecutor(i,a)},onStart:()=>{},onComplete:()=>{const C=self.performance.now();p.executeEnd=p.end=C,S.first===0&&(S.first=C),E&&E.first===0&&(E.first=C);const I={};this.sourceBuffers.forEach(([F,U])=>{F&&(I[F]=Dt.getBuffered(U))}),this.appendErrors[a]=0,a==="audio"||a==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(w.BUFFER_APPENDED,{type:a,frag:c,part:d,chunkMeta:f,parent:c.type,timeRanges:I})},onError:C=>{var I;const F={type:Tt.MEDIA_ERROR,parent:c.type,details:Z.BUFFER_APPEND_ERROR,sourceBufferName:a,frag:c,part:d,chunkMeta:f,error:C,err:C,fatal:!1},U=(I=this.media)==null?void 0:I.error;if(C.code===DOMException.QUOTA_EXCEEDED_ERR||C.name=="QuotaExceededError"||"quota"in C)F.details=Z.BUFFER_FULL_ERROR;else if(C.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!U)F.errorAction=Ao(!0);else if(C.name===NC&&this.sourceBufferCount===0)F.errorAction=Ao(!0);else{const z=++this.appendErrors[a];this.warn(`Failed ${z}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${a}" sourceBuffer (${U||"no media error"})`),(z>=this.hls.config.appendErrorMaxRetry||U)&&(F.fatal=!0)}this.hls.trigger(w.ERROR,F)}};this.log(`queuing "${a}" append sn: ${g}${d?" p: "+d.index:""} of ${c.type===yt.MAIN?"level":"track"} ${c.level} cc: ${v}`),this.append(B,a,this.isPending(this.tracks[a]))}getFlushOp(t,e,n){return this.log(`queuing "${t}" remove ${e}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(t,e,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(w.BUFFER_FLUSHED,{type:t})},onError:i=>{this.warn(`Failed to remove ${e}-${n} from "${t}" SourceBuffer`,i)}}}onBufferFlushing(t,e){const{type:n,startOffset:i,endOffset:a}=e;n?this.append(this.getFlushOp(n,i,a),n):this.sourceBuffers.forEach(([o])=>{o&&this.append(this.getFlushOp(o,i,a),o)})}onFragParsed(t,e){const{frag:n,part:i}=e,a=[],o=i?i.elementaryStreams:n.elementaryStreams;o[ie.AUDIOVIDEO]?a.push("audiovideo"):(o[ie.AUDIO]&&a.push("audio"),o[ie.VIDEO]&&a.push("video"));const c=()=>{const d=self.performance.now();n.stats.buffering.end=d,i&&(i.stats.buffering.end=d);const f=i?i.stats:n.stats;this.hls.trigger(w.FRAG_BUFFERED,{frag:n,part:i,stats:f,id:n.type})};a.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(c,a).catch(d=>{this.warn(`Fragment buffered callback ${d}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(t,e){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{if(t){const e=this.tracks[t];if(e)return!e.ended||e.ending}return!1})}onBufferEos(t,e){var n;this.sourceBuffers.forEach(([o])=>{if(o){const c=this.tracks[o];(!e.type||e.type===o)&&(c.ending=!0,c.ended||(c.ended=!0,this.log(`${o} buffer reached EOS`)))}});const i=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([o])=>{var c;return o&&!((c=this.tracks[o])!=null&&c.ended)})?i?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:o}=this;if(!o||o.readyState!=="open"){o&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${o.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),o.endOfStream(),this.hls.trigger(w.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(w.BUFFERED_TO_END,void 0)):e.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([t])=>{if(t!==null){const e=this.tracks[t];e&&(e.ending=!1)}})}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const t=this.getDurationAndRange();t&&this.updateMediaSource(t)})}onError(t,e){if(e.details===Z.BUFFER_APPEND_ERROR&&e.frag){var n;const i=(n=e.errorAction)==null?void 0:n.nextAutoLevel;pt(i)&&i!==e.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:e,media:n}=this;if(!n||e===null||!this.sourceBufferCount)return;const i=t.config,a=n.currentTime,o=e.levelTargetDuration,c=e.live&&i.liveBackBufferLength!==null?i.liveBackBufferLength:i.backBufferLength;if(pt(c)&&c>=0){const f=Math.max(c,o),h=Math.floor(a/o)*o-f;this.flushBackBuffer(a,o,h)}const d=i.frontBufferFlushThreshold;if(pt(d)&&d>0){const f=Math.max(i.maxBufferLength,d),h=Math.max(f,o),p=Math.floor(a/o)*o+h;this.flushFrontBuffer(a,o,p)}}flushBackBuffer(t,e,n){this.sourceBuffers.forEach(([i,a])=>{if(a){const c=Dt.getBuffered(a);if(c.length>0&&n>c.start(0)){var o;this.hls.trigger(w.BACK_BUFFER_REACHED,{bufferEnd:n});const d=this.tracks[i];if((o=this.details)!=null&&o.live)this.hls.trigger(w.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(d!=null&&d.ended){this.log(`Cannot flush ${i} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(w.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:i})}}})}flushFrontBuffer(t,e,n){this.sourceBuffers.forEach(([i,a])=>{if(a){const o=Dt.getBuffered(a),c=o.length;if(c<2)return;const d=o.start(c-1),f=o.end(c-1);if(n>d||t>=d&&t<=f)return;this.hls.trigger(w.BUFFER_FLUSHING,{startOffset:d,endOffset:1/0,type:i})}})}getDurationAndRange(){var t;const{details:e,mediaSource:n}=this;if(!e||!this.media||n?.readyState!=="open")return null;const i=e.edge;if(e.live&&this.hls.config.liveDurationInfinity){if(e.fragments.length&&n.setLiveSeekableRange){const f=Math.max(0,e.fragmentStart),h=Math.max(f,i);return{duration:1/0,start:f,end:h}}return{duration:1/0}}const a=(t=this.overrides)==null?void 0:t.duration;if(a)return pt(a)?{duration:a}:null;const o=this.media.duration,c=pt(n.duration)?n.duration:0;return i>c&&i>o||!pt(o)?{duration:i}:null}updateMediaSource({duration:t,start:e,end:n}){const i=this.mediaSource;!this.media||!i||i.readyState!=="open"||(i.duration!==t&&(pt(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),i.duration=t),e!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${i.duration}. Setting seekable range to ${e}-${n}.`),i.setLiveSeekableRange(e,n)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:e,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${e} codec events expected: ${t}) ${re(n)}`),this.tracksReady){var i;const a=(i=this.transferData)==null?void 0:i.tracks;a&&Object.keys(a).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach(([e,n])=>{if(e){const i=this.tracks[e];t[e]={buffer:n,container:i.container,codec:i.codec,supplemental:i.supplemental,levelCodec:i.levelCodec,id:i.id,metadata:i.metadata}}}),this.hls.trigger(w.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([e])=>{this.executeNext(e)})}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:e,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const a in t){const o=a,c=t[o];if(this.isPending(c)){const d=this.getTrackCodec(c,o),f=`${c.container};codecs=${d}`;c.codec=d,this.log(`creating sourceBuffer(${f})${this.currentOp(o)?" Queued":""} ${re(c)}`);try{const h=n.addSourceBuffer(f),p=Vp(o),g=[o,h];e[p]=g,c.buffer=h}catch(h){var i;this.error(`error while trying to add sourceBuffer: ${h.message}`),this.shiftAndExecuteNext(o),(i=this.operationQueue)==null||i.removeBlockers(),delete this.tracks[o],this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:o,mimeType:f,parent:c.id});return}this.trackSourceBuffer(o,c)}}this.bufferCreated()}getTrackCodec(t,e){const n=t.supplemental;let i=t.codec;n&&(e==="video"||e==="audiovideo")&&xc(n,"video")&&(i=c$(i,n));const a=Md(i,t.levelCodec);return a?e.slice(0,5)==="audio"?sf(a,this.appendSource):a:""}trackSourceBuffer(t,e){const n=e.buffer;if(!n)return;const i=this.getTrackCodec(e,t);this.tracks[t]={buffer:n,codec:i,container:e.container,levelCodec:e.levelCodec,supplemental:e.supplemental,metadata:e.metadata,id:e.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",(a,o)=>{const c=o.removedRanges;c!=null&&c.length&&this.hls.trigger(w.BUFFER_FLUSHED,{type:a})})}get mediaSrc(){var t,e;const n=((t=this.media)==null||(e=t.querySelector)==null?void 0:e.call(t,"source"))||this.media;return n?.src}onSBUpdateStart(t){const e=this.currentOp(t);e&&e.onStart()}onSBUpdateEnd(t){var e;if(((e=this.mediaSource)==null?void 0:e.readyState)==="closed"){this.resetBuffer(t);return}const n=this.currentOp(t);n&&(n.onComplete(),this.shiftAndExecuteNext(t))}onSBUpdateError(t,e){var n;const i=new Error(`${t} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${i}`,e),this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:i,fatal:!1});const a=this.currentOp(t);a&&a.onError(i)}updateTimestampOffset(t,e,n,i,a,o){const c=e-t.timestampOffset;Math.abs(c)>=n&&(this.log(`Updating ${i} SourceBuffer timestampOffset to ${e} (sn: ${a} cc: ${o})`),t.timestampOffset=e)}removeExecutor(t,e,n){const{media:i,mediaSource:a}=this,o=this.tracks[t],c=o?.buffer;if(!i||!a||!c){this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(t);return}const d=pt(i.duration)?i.duration:1/0,f=pt(a.duration)?a.duration:1/0,h=Math.max(0,e),p=Math.min(n,d,f);p>h&&(!o.ending||o.ended)?(o.ended=!1,this.log(`Removing [${h},${p}] from the ${t} SourceBuffer`),c.remove(h,p)):this.shiftAndExecuteNext(t)}appendExecutor(t,e){const n=this.tracks[e],i=n?.buffer;if(!i)throw new vV(`Attempting to append to the ${e} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,i.appendBuffer(t)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch(e=>{this.warn(`SourceBuffer blocked callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{t()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${e}`)}}isUpdating(){return this.sourceBuffers.some(([t,e])=>t&&e.updating)}isQueued(){return this.sourceBuffers.some(([t])=>t&&!!this.currentOp(t))}isPending(t){return!!t&&!t.buffer}blockBuffers(t,e=this.sourceBufferTypes){if(!e.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:n}=this,i=e.map(o=>this.appendBlocker(o));return e.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(i).then(o=>{n===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(t){t.forEach(e=>{var n;const i=(n=this.tracks[e])==null?void 0:n.buffer;!i||i.updating||this.shiftAndExecuteNext(e)})}append(t,e,n){this.operationQueue&&this.operationQueue.append(t,e,n)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((t,e)=>t+(this.isPending(this.tracks[e])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((t,[e])=>t+(e?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([t])=>t).filter(t=>!!t)}
vendor: 4,803 bytes, line 209
209addBufferListener(t,e,n){const i=this.tracks[t];if(!i)return;const a=i.buffer;if(!a)return;const o=n.bind(this,t);i.listeners.push({event:e,listener:o}),a.addEventListener(e,o)}removeBufferListeners(t){const e=this.tracks[t];if(!e)return;const n=e.buffer;n&&(e.listeners.forEach(i=>{n.removeEventListener(i.event,i.listener)}),e.listeners.length=0)}}function c1(s){const t=s.querySelectorAll("source");[].slice.call(t).forEach(e=>{s.removeChild(e)})}function bV(s,t){const e=self.document.createElement("source");e.type="video/mp4",e.src=t,s.appendChild(e)}function Vp(s){return s==="audio"?1:0}class Ky{constructor(t){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(w.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(w.MANIFEST_PARSED,this.onManifestParsed,this),t.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(w.BUFFER_CODECS,this.onBufferCodecs,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(w.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.MANIFEST_PARSED,this.onManifestParsed,this),t.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(w.BUFFER_CODECS,this.onBufferCodecs,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,e){const n=this.hls.levels[e.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,e){const n=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,n.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onLevelsUpdated(t,e){this.timer&&pt(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const t=this.hls.levels;if(t.length){const e=this.hls,n=this.getMaxLevel(t.length-1);n!==this.autoLevelCapping&&e.logger.log(`Setting autoLevelCapping to ${n}: ${t[n].height}p@${t[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),e.autoLevelCapping=n,e.autoLevelEnabled&&e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const n=e.filter((i,a)=>this.isLevelAllowed(i)&&a<=t);return this.clientRect=null,Ky.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const t=this.media,e={width:0,height:0};if(t){const n=t.getBoundingClientRect();e.width=n.width,e.height=n.height,!e.width&&!e.height&&(e.width=n.right-n.left||t.width||0,e.height=n.bottom-n.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch{}return Math.min(t,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(t){return!this.restrictedLevels.some(n=>t.bitrate===n.bitrate&&t.width===n.width&&t.height===n.height)}static getMaxLevelByMediaSize(t,e,n){if(!(t!=null&&t.length))return-1;const i=(c,d)=>d?c.width!==d.width||c.height!==d.height:!0;let a=t.length-1;const o=Math.max(e,n);for(let c=0;c<t.length;c+=1){const d=t[c];if((d.width>=o||d.height>=o)&&i(d,t[c+1])){a=c;break}}return a}}const SV={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",
vendor: 4,255 bytes, line 209
209KEY:"k",OTHER:"o"},Rs=SV,EV={HLS:"h"},TV=EV;class Zn{constructor(t,e){Array.isArray(t)&&(t=t.map(n=>n instanceof Zn?n:new Zn(n))),this.value=t,this.params=e}}const AV="Dict";function RV(s){return Array.isArray(s)?JSON.stringify(s):s instanceof Map?"Map{}":s instanceof Set?"Set{}":typeof s=="object"?JSON.stringify(s):String(s)}function wV(s,t,e,n){return new Error(`failed to ${s} "${RV(t)}" as ${e}`,{cause:n})}function Jn(s,t,e){return wV("serialize",s,t,e)}class BC{constructor(t){this.description=t}}const u1="Bare Item",LV="Boolean";function _V(s){if(typeof s!="boolean")throw Jn(s,LV);return s?"?1":"?0"}function CV(s){return btoa(String.fromCharCode(...s))}const DV="Byte Sequence";function IV(s){if(ArrayBuffer.isView(s)===!1)throw Jn(s,DV);return`:${CV(s)}:`}const OV="Integer";function kV(s){return s<-999999999999999||999999999999999<s}function FC(s){if(kV(s))throw Jn(s,OV);return s.toString()}function PV(s){return`@${FC(s.getTime()/1e3)}`}function UC(s,t){if(s<0)return-UC(-s,t);const e=Math.pow(10,t);if(Math.abs(s*e%1-.5)<Number.EPSILON){const i=Math.floor(s*e);return(i%2===0?i:i+1)/e}else return Math.round(s*e)/e}const MV="Decimal";function NV(s){const t=UC(s,3);if(Math.floor(Math.abs(t)).toString().length>12)throw Jn(s,MV);const e=t.toString();return e.includes(".")?e:`${e}.0`}const BV="String",FV=/[\x00-\x1f\x7f]+/;function UV(s){if(FV.test(s))throw Jn(s,BV);return`"${s.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function jV(s){return s.description||s.toString().slice(7,-1)}const $V="Token";function d1(s){const t=jV(s);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t)===!1)throw Jn(t,$V);return t}function p0(s){switch(typeof s){case"number":if(!pt(s))throw Jn(s,u1);return Number.isInteger(s)?FC(s):NV(s);case"string":return UV(s);case"symbol":return d1(s);case"boolean":return _V(s);case"object":if(s instanceof Date)return PV(s);if(s instanceof Uint8Array)return IV(s);if(s instanceof BC)return d1(s);default:throw Jn(s,u1)}}const VV="Key";function g0(s){if(/^[a-z*][a-z0-9\-_.*]*$/.test(s)===!1)throw Jn(s,VV);return s}function qy(s){return s==null?"":Object.entries(s).map(([t,e])=>e===!0?`;${g0(t)}`:`;${g0(t)}=${p0(e)}`).join("")}function jC(s){return s instanceof Zn?`${p0(s.value)}${qy(s.params)}`:p0(s)}function GV(s){return`(${s.value.map(jC).join(" ")})${qy(s.params)}`}function HV(s,t={whitespace:!0}){if(typeof s!="object"||s==null)throw Jn(s,AV);const e=s instanceof Map?s.entries():Object.entries(s),n=t?.whitespace?" ":"";return Array.from(e).map(([i,a])=>{a instanceof Zn||(a=new Zn(a));let o=g0(i);return a.value===!0?o+=qy(a.params):(o+="=",Array.isArray(a.value)?o+=GV(a):o+=jC(a)),o}).join(`,${n}`)}function $C(s,t){return HV(s,t)}const Un="CMCD-Object",Se="CMCD-Request",Qr="CMCD-Session",lr="CMCD-Status",zV={br:Un,ab:Un,d:Un,ot:Un,tb:Un,tpb:Un,lb:Un,tab:Un,lab:Un,url:Un,pb:Se,bl:Se,tbl:Se,dl:Se,ltc:Se,mtp:Se,nor:Se,nrr:Se,rc:Se,sn:Se,sta:Se,su:Se,ttfb:Se,ttfbb:Se,ttlb:Se,cmsdd:Se,cmsds:Se,smrt:Se,df:Se,cs:Se,ts:Se,cid:Qr,pr:Qr,sf:Qr,sid:Qr,st:Qr,v:Qr,msd:Qr,bs:lr,bsd:lr,cdn:lr,rtp:lr,bg:lr,pt:lr,ec:lr,e:lr},KV={REQUEST:Se};function qV(s){return Object.keys(s).reduce((t,e)=>{var n;return(n=s[e])===null||n===void 0||n.forEach(i=>t[i]=e),t},{})}function YV(s,t){const e={};if(!s)return e;const n=Object.keys(s),i=t?qV(t):{};return n.reduce((a,o)=>{var c;const d=zV[o]||i[o]||KV.REQUEST,f=(c=a[d])!==null&&c!==void 0?c:a[d]={};return f[o]=s[o],a},e)}function WV(s){return["ot","sf","st","e","sta"].includes(s)}function QV(s){return typeof s=="number"?pt(s):s!=null&&s!==""&&s!==!1}const VC="event";function XV(s,t){const e=new URL(s),n=new URL(t);if(e.origin!==n.origin)return s;const i=e.pathname.split("/").slice(1),a=n.pathname.split("/").slice(1,-1);for(;i[0]===a[0];)i.shift(),a.shift();for(;a.length;)a.shift(),i.unshift("..");return i.join("/")+e.search+e.hash}const jd=s=>Math.round(s),y0=(s,t)=>Array.isArray(s)?s.map(e=>y0(e,t)):s instanceof Zn&&typeof s.value=="string"?new Zn(y0(s.value,t),s.params):(t.baseUrl&&(s=XV(s,t.baseUrl)),t.version===1?encodeURIComponent(s):s),gd=s=>jd(s/100)*100,ZV=(s,t)=>{let e=s;return t.version>=2&&(s instanceof Zn&&typeof s.value=="string"?e=new Zn([s]):typeof s=="string"&&(e=[s])),y0(e,t)},JV={br:jd,d:jd,bl:gd,dl:gd,mtp:gd,nor:ZV,rtp:gd,tb:jd}
209,GC="request",HC="response",Yy=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],tG=["e"],eG=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Bf(s){return eG.test(s)}function sG(s){return Yy.includes(s)||tG.includes(s)||Bf(s)}const zC=["d","dl","nor","ot","rtp","su"];function nG(s){return Yy.includes(s)||zC.includes(s)||Bf(s)}const iG=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function rG(s){return Yy.includes(s)||zC.includes(s)||iG.includes(s)||Bf(s)}const aG=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function oG(s){return aG.includes(s)||Bf(s)}const lG={[HC]:rG,[VC]:sG,[GC]:nG};function KC(s,t={}){const e={};if(s==null||typeof s!="object")return e;const n=t.version||s.v||1,i=t.reportingMode||GC,a=n===1?oG:lG[i];let o=Object.keys(s).filter(a);const c=t.filter;typeof c=="function"&&(o=o.filter(c));const d=i===HC||i===VC;d&&!o.includes("ts")&&o.push("ts"),n>1&&!o.includes("v")&&o.push("v");const f=se({},JV,t.formatters),h={version:n,reportingMode:i,baseUrl:t.baseUrl};return o.sort().forEach(p=>{let g=s[p];const v=f[p];if(typeof v=="function"&&(g=v(g,h)),p==="v"){if(n===1)return;g=n}p=="pr"&&g===1||(d&&p==="ts"&&!pt(g)&&(g=Date.now()),QV(g)&&(WV(p)&&typeof g=="string"&&(g=new BC(g)),e[p]=g))}),e}function cG(s,t={}){const e={};if(!s)return e;const n=KC(s,t),i=YV(n,t?.customHeaderMap);return Object.entries(i).reduce((a,[o,c])=>{const d=$C(c,{whitespace:!1});return d&&(a[o]=d),a},e)}function uG(s,t,e){return se(s,cG(t,e))}const dG="CMCD";function fG(s,t={}){return s?$C(KC(s,t),{whitespace:!1}):""}function hG(s,t={}){if(!s)return"";const e=fG(s,t);return encodeURIComponent(e)}function mG(s,t={}){if(!s)return"";const e=hG(s,t);return`${dG}=${e}`}const f1=/CMCD=[^&#]+/;function pG(s,t,e){const n=mG(t,e);if(!n)return s;if(f1.test(s))return s.replace(f1,n);const i=s.includes("?")?"&":"?";return`${s}${i}${n}`}class gG{constructor(t){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=i=>{try{this.apply(i,{ot:Rs.MANIFEST,su:!this.initialized})}catch(a){this.hls.logger.warn("Could not generate manifest CMCD data.",a)}},this.applyFragmentData=i=>{try{const{frag:a,part:o}=i,c=this.hls.levels[a.level],d=this.getObjectType(a),f={d:(o||a).duration*1e3,ot:d};(d===Rs.VIDEO||d===Rs.AUDIO||d==Rs.MUXED)&&(f.br=c.bitrate/1e3,f.tb=this.getTopBandwidth(d)/1e3,f.bl=this.getBufferLength(d));const h=o?this.getNextPart(o):this.getNextFrag(a);h!=null&&h.url&&h.url!==a.url&&(f.nor=h.url),this.apply(i,f)}catch(a){this.hls.logger.warn("Could not generate segment CMCD data.",a)}},this.hls=t;const e=this.config=t.config,{cmcd:n}=e;n!=null&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||t.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHED,this.onMediaDetached,this),t.on(w.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHED,this.onMediaDetached,this),t.off(w.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(t,e){var n,i;this.audioBuffer=(n=e.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(i=e.tracks.video)==null?void 0:i.buffer}createData(){var t;return{v:1,sf:TV.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)==null?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){se(e,this.createData());const n=e.ot===Rs.INIT||e.ot===Rs.VIDEO||e.ot===Rs.MUXED;this.starved&&n&&(e.bs=!0,e.su=!0,this.starved=!1),e.su==null&&(e.su=this.buffering);const{includeKeys:i}=this;i&&(e=Object.keys(e).reduce((o,c)=>(i.includes(c)&&(o[c]=e[c]),o),{}));const a={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),uG(t.headers,e,a)):t.url=pG(t.url,e,a)}getNextFrag(t){var e;const n=(e=this.hls.levels[t.level])==null?void 0:e.details;if(n){const i=t.sn-n.startSN;return n.fragments[i+1]}}getNextPart(t){var e;const{index:n,fragment:i}=t,a=(e=this.hls.levels[i.level])==null||(e=e.details)==null?void 0:e.partList;if(a){const{sn:o}=i;for(let c=a.length-1;c>=0;c--){const d=a[c];if(d.index===n&&d.fragment.sn===o)return a[c+1]}}}getObjectType(t){const{type:e}=t;if(e==="subtitle")return Rs.TIMED_TEXT;if(t.sn==="initSegment")return Rs.INIT;if(e==="audio")return Rs.AUDIO;if(e==="main")return this.hls.audioTracks.length?Rs.VIDEO:Rs.MUXED}getTopBandwidth(t){let e=0,n;const i=this.hls;
vendor: 4,433 bytes, line 209
209if(t===Rs.AUDIO)n=i.audioTracks;else{const a=i.maxAutoLevel,o=a>-1?a+1:i.levels.length;n=i.levels.slice(0,o)}return n.forEach(a=>{a.bitrate>e&&(e=a.bitrate)}),e>0?e:NaN}getBufferLength(t){const e=this.media,n=t===Rs.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!e?NaN:Dt.bufferInfo(n,e.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,n=t||this.config.loader;return class{constructor(a){this.loader=void 0,this.loader=new n(a)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(a,o,c){e(a),this.loader.load(a,o,c)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,n=t||this.config.loader;return class{constructor(a){this.loader=void 0,this.loader=new n(a)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(a,o,c){e(a),this.loader.load(a,o,c)}}}}const yG=3e5;class vG extends mn{constructor(t){super("content-steering",t.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(w.MANIFEST_PARSED,this.onManifestParsed,this),t.on(w.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(w.MANIFEST_PARSED,this.onManifestParsed,this),t.off(w.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((t,e)=>(t.indexOf(e.pathwayId)===-1&&t.push(e.pathwayId),t),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=this.timeToLoad*1e3-(performance.now()-this.updated);if(t>0){this.scheduleRefresh(this.uri,t);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(t){const e=this.levels;e&&(this.levels=e.filter(n=>n!==t))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(t,e){const{contentSteering:n}=e;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(t,e){this.audioTracks=e.audioTracks,this.subtitleTracks=e.subtitleTracks}onError(t,e){const{errorAction:n}=e;if(n?.action===es.SendAlternateToPenaltyBox&&n.flags===Us.MoveAllAlternatesMatchingHost){const i=this.levels;let a=this._pathwayPriority,o=this.pathwayId;if(e.context){const{groupId:c,pathwayId:d,type:f}=e.context;c&&i?o=this.getPathwayForGroupId(c,f,o):d&&(o=d)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!a&&i&&(a=this.pathways()),a&&a.length>1&&(this.updatePathwayPriority(a),n.resolved=this.pathwayId!==o),e.details===Z.BUFFER_APPEND_ERROR&&!e.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${e.details} ("${e.error.message}") with content-steering for Pathway: ${o} levels: ${i&&i.length} priorities: ${re(a)} penalized: ${re(this.penalizedPathways)}`)}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(e.length===0){const n=t[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),e=this.getLevelsForPathway(n),this.pathwayId=n}return e.length!==t.length&&this.log(`Found ${e.length}/${t.length} levels in Pathway "${this.pathwayId}"`),e}getLevelsForPathway(t){return this.levels===null?[]:this.levels.filter(e=>t===e.pathwayId)}updatePathwayPriority(t){this._pathwayPriority=t;let e;const n=this.penalizedPathways,i=performance.now();
vendor: 4,346 bytes, line 209
209Object.keys(n).forEach(a=>{i-n[a]>yG&&delete n[a]});for(let a=0;a<t.length;a++){const o=t[a];if(o in n)continue;if(o===this.pathwayId)return;const c=this.hls.nextLoadLevel,d=this.hls.levels[c];if(e=this.getLevelsForPathway(o),e.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,fC(e),this.hls.trigger(w.LEVELS_UPDATED,{levels:e});const f=this.hls.levels[c];d&&f&&this.levels&&(f.attrs["STABLE-VARIANT-ID"]!==d.attrs["STABLE-VARIANT-ID"]&&f.bitrate!==d.bitrate&&this.log(`Unstable Pathways change from bitrate ${d.bitrate} to ${f.bitrate}`),this.hls.nextLoadLevel=c);break}}}getPathwayForGroupId(t,e,n){const i=this.getLevelsForPathway(n).concat(this.levels||[]);for(let a=0;a<i.length;a++)if(e===Ft.AUDIO_TRACK&&i[a].hasAudioGroup(t)||e===Ft.SUBTITLE_TRACK&&i[a].hasSubtitleGroup(t))return i[a].pathwayId;return n}clonePathways(t){const e=this.levels;if(!e)return;const n={},i={};t.forEach(a=>{const{ID:o,"BASE-ID":c,"URI-REPLACEMENT":d}=a;if(e.some(h=>h.pathwayId===o))return;const f=this.getLevelsForPathway(c).map(h=>{const p=new pe(h.attrs);p["PATHWAY-ID"]=o;const g=p.AUDIO&&`${p.AUDIO}_clone_${o}`,v=p.SUBTITLES&&`${p.SUBTITLES}_clone_${o}`;g&&(n[p.AUDIO]=g,p.AUDIO=g),v&&(i[p.SUBTITLES]=v,p.SUBTITLES=v);const x=qC(h.uri,p["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",d),S=new Sc({attrs:p,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:x,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let E=1;E<h.audioGroups.length;E++)S.addGroupId("audio",`${h.audioGroups[E]}_clone_${o}`);if(h.subtitleGroups)for(let E=1;E<h.subtitleGroups.length;E++)S.addGroupId("text",`${h.subtitleGroups[E]}_clone_${o}`);return S});e.push(...f),h1(this.audioTracks,n,d,o),h1(this.subtitleTracks,i,d,o)})}loadSteeringManifest(t){const e=this.hls.config,n=e.loader;this.loader&&this.loader.destroy(),this.loader=new n(e);let i;try{i=new self.URL(t)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${t}`);return}if(i.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate)|0;i.searchParams.set("_HLS_pathway",this.pathwayId),i.searchParams.set("_HLS_throughput",""+h)}const a={responseType:"json",url:i.href},o=e.steeringManifestLoadPolicy.default,c=o.errorRetry||o.timeoutRetry||{},d={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:c.maxNumRetry||0,retryDelay:c.retryDelayMs||0,maxRetryDelay:c.maxRetryDelayMs||0},f={onSuccess:(h,p,g,v)=>{this.log(`Loaded steering manifest: "${i}"`);const x=h.data;if(x?.VERSION!==1){this.log(`Steering VERSION ${x.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=x.TTL;const{"RELOAD-URI":S,"PATHWAY-CLONES":E,"PATHWAY-PRIORITY":T}=x;if(S)try{this.uri=new self.URL(S,i).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${S}`);return}this.scheduleRefresh(this.uri||g.url),E&&this.clonePathways(E);const L={steeringManifest:x,url:i.toString()};this.hls.trigger(w.STEERING_MANIFEST_LOADED,L),T&&this.updatePathwayPriority(T)},onError:(h,p,g,v)=>{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${p.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${p.url} no longer available`);return}let x=this.timeToLoad*1e3;if(h.code===429){const S=this.loader;if(typeof S?.getResponseHeader=="function"){const E=S.getResponseHeader("Retry-After");E&&(x=parseFloat(E)*1e3)}this.log(`Steering manifest ${p.url} rate limited`);return}this.scheduleRefresh(this.uri||p.url,x)},onTimeout:(h,p,g)=>{this.log(`Timeout loading steering manifest (${p.url})`),this.scheduleRefresh(this.uri||p.url)}};this.log(`Requesting steering manifest: ${i}`),this.loader.load(a,d,f)}scheduleRefresh(t,e=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const i=(n=this.hls)==null?void 0:n.media;if(i&&!i.ended){this.loadSteeringManifest(t);return}this.scheduleRefresh(t,this.timeToLoad*1e3)},e)}}function h1(s,t,e,n){s&&Object.keys(t).forEach(i=>{const a=s.filter(o=>o.groupId===i).map(o=>{const c=se({},o);return c.details=void 0,c.attrs=new pe(c.attrs),c.url=c.attrs.URI=qC(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",e),c.groupId=c.attrs["GROUP-ID"]=t[i],c.attrs["PATHWAY-ID"]=n,c});s.push(...a)})}function qC(s,t,e,n){const{HOST:i,PARAMS:a,[e]:o}=n;let c;t&&(c=o?.[t],c&&(s=c));const d=new self.URL(s);
209return i&&!c&&(d.host=i),a&&Object.keys(a).sort().forEach(f=>{f&&d.searchParams.set(f,a[f])}),d.href}class wo extends mn{constructor(t){super("eme",t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=wo.CDMCleanupPromise?[wo.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=e=>{const{initDataType:n,initData:i}=e,a=`"${e.type}" event: init data type: "${n}"`;if(this.debug(a),i!==null){if(!this.keyFormatPromise){let o=Object.keys(this.keySystemAccessPromises);o.length||(o=zl(this.config));const c=o.map(Pp).filter(d=>!!d);this.keyFormatPromise=this.getKeyFormatPromise(c)}this.keyFormatPromise.then(o=>{const c=Bd(o);if(n!=="sinf"||c!==ye.FAIRPLAY){this.log(`Ignoring "${e.type}" event with init data type: "${n}" for selected key-system ${c}`);return}let d;try{const v=$e(new Uint8Array(i)),x=Ny(JSON.parse(v).sinf),S=$_(x);if(!S)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");d=new Uint8Array(S.subarray(8,24))}catch(v){this.warn(`${a} Failed to parse sinf: ${v}`);return}const f=ss(d),{keyIdToKeySessionPromise:h,mediaKeySessions:p}=this;let g=h[f];for(let v=0;v<p.length;v++){const x=p[v],S=x.decryptdata;if(!S.keyId)continue;const E=ss(S.keyId);if(lf(d,S.keyId)||S.uri.replace(/-/g,"").indexOf(f)!==-1){if(g=h[E],!g)continue;if(S.pssh)break;delete h[E],S.pssh=new Uint8Array(i),S.keyId=d,g=h[f]=g.then(()=>this.generateRequestWithPreferredKeySession(x,n,i,"encrypted-event-key-match")),g.catch(T=>this.handleError(T));break}}g||this.handleError(new Error(`Key ID ${f} not encountered in playlist. Key-system sessions ${p.length}.`))}).catch(o=>this.handleError(o))}},this.onWaitingForKey=e=>{this.log(`"${e.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(w.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(w.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:n}=this.config,i=e?.[t];if(i)return i.licenseUrl;if(t===ye.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(t){const e=this.getLicenseServerUrl(t);if(e===void 0)throw new Error(`no license server URL configured for key-system "${t}"`);return e}getServerCertificateUrl(t){const{drmSystems:e}=this.config,n=e?.[t];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const e=this.hls.levels,n=(o,c,d)=>!!o&&d.indexOf(o)===c,i=e.map(o=>o.audioCodec).filter(n),a=e.map(o=>o.videoCodec).filter(n);return i.length+a.length===0&&a.push("avc1.42e01e"),new Promise((o,c)=>{const d=f=>{const h=f.shift();this.getMediaKeysPromise(h,i,a).then(p=>o({keySystem:h,mediaKeys:p})).catch(p=>{f.length?d(f):p instanceof Fs?c(p):c(new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_ACCESS,error:p,fatal:!0},p.message))})};d(t)})}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let i=`Configured requestMediaKeySystemAccess is not a function ${n}`;return iC===null&&self.location.protocol==="http:"&&(i=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(i))}return n(t,e)}getMediaKeysPromise(t,e,n){var i;const a=Z$(t,e,n,this.config.drmSystemOptions||{});let o=this.keySystemAccessPromises[t],c=(i=o)==null?void 0:i.keySystemAccess;if(!c){this.log(`Requesting encrypted media "${t}" key-system access with config: ${re(a)}`),c=this.requestMediaKeySystemAccess(t,a);const d=o=this.keySystemAccessPromises[t]={keySystemAccess:c};return c.catch(f=>{this.log(`Failed to obtain access to key-system "${t}": ${f}`)}),c.then(f=>{this.log(`Access for key-system "${f.keySystem}" obtained`);const h=this.fetchServerCertificate(t);this.log(`Create media-keys for "${t}"`);const p=d.mediaKeys=f.createMediaKeys().then(g=>(this.log(`Media-keys created for "${t}"`),d.hasMediaKeys=!0,h.then(v=>v?this.setMediaKeysServerCertificate(g,t,v):g)));return p.catch(g=>{this.error(`Failed to create media-keys for "${t}"}: ${g}`)}),p})}return c.then(()=>o.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:n}){this.log(`Creating key-system session "${e}" keyId: ${ss(t.keyId||[])} keyUri: ${t.uri}`);const i=n.createSession(),a={decryptdata:t,keySystem:e,mediaKeys:n,mediaKeysSession:i,keyStatus:"status-pending"};return this.mediaKeySessions.push(a),a}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const n=this.createMediaKeySessionContext(t),i=yd(e),a="cenc";this.keyIdToKeySessionPromise[i]=this.generateRequestWithPreferredKeySession(n,a,e.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}updateKeySession(t,e){const n=t.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${ss(t.decryptdata.keyId||[])} 210 } (data length: ${e.byteLength})`),n.update(e)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(t=>({keySystem:t,hasMediaKeys:this.keySystemAccessPromises[t].hasMediaKeys})).filter(({hasMediaKeys:t})=>!!t).map(({keySystem:t})=>Pp(t)).filter(t=>!!t)}getKeySystemAccess(t){return this.getKeySystemSelectionPromise(t).then(({keySystem:e,mediaKeys:n})=>this.attemptSetMediaKeys(e,n))}
vendor: 18,994 bytes, line 210
210selectKeySystem(t){return new Promise((e,n)=>{this.getKeySystemSelectionPromise(t).then(({keySystem:i})=>{const a=Pp(i);a?e(a):n(new Error(`Unable to find format for key-system "${i}"`))}).catch(n)})}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){const e=zl(this.config),n=t.map(Bd).filter(i=>!!i&&e.indexOf(i)!==-1);return this.selectKeySystem(n)}getKeyStatus(t){const{mediaKeySessions:e}=this;for(let n=0;n<e.length;n++){const i=xG(t,e[n]);if(i)return i}}loadKey(t){const e=t.keyInfo.decryptdata,n=yd(e),i=this.bannedKeyIds[n];if(i||this.getKeyStatus(e)==="internal-error"){const c=m1(i||"internal-error",e);return this.handleError(c,t.frag),Promise.reject(c)}const a=`(keyId: ${n} format: "${e.keyFormat}" method: ${e.method} uri: ${e.uri})`;this.log(`Starting session for key ${a}`);const o=this.keyIdToKeySessionPromise[n];if(!o){const c=this.getKeySystemForKeyPromise(e).then(({keySystem:d,mediaKeys:f})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${a}`),this.attemptSetMediaKeys(d,f).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:d,mediaKeys:f,decryptdata:e}))))).then(d=>{const f="cenc",h=e.pssh?e.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(d,f,h,"playlist-key")});return c.catch(d=>this.handleError(d,t.frag)),this.keyIdToKeySessionPromise[n]=c,c}return o.catch(c=>{if(c instanceof Fs){const d=Qt({},c.data);this.getKeyStatus(e)==="internal-error"&&(d.decryptdata=e);const f=new Fs(d,c.message);this.handleError(f,t.frag)}}),o}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t,e){if(this.hls)if(t instanceof Fs){e&&(t.data.frag=e);const n=t.data.decryptdata;this.error(`${t.message}${n?` (${ss(n.keyId||[])})`:""}`),this.hls.trigger(w.ERROR,t.data)}else this.error(t.message),this.hls.trigger(w.ERROR,{type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0})}getKeySystemForKeyPromise(t){const e=yd(t),n=this.keyIdToKeySessionPromise[e];if(!n){const i=Bd(t.keyFormat),a=i?[i]:zl(this.config);return this.attemptKeySystemAccess(a)}return n}getKeySystemSelectionPromise(t){if(t.length||(t=zl(this.config)),t.length===0)throw new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${re({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,e){if(this.mediaResolved=void 0,this.mediaKeys===e)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const i=Promise.all(n).then(()=>this.media?this.media.setMediaKeys(e):new Promise((a,o)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return o(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=e,this.media.setMediaKeys(e).then(a).catch(o)}}));return this.mediaKeys=e,this.setMediaKeysQueue.push(i),i.then(()=>{this.log(`Media-keys set for "${t}"`),n.push(i),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(a=>n.indexOf(a)===-1)})}generateRequestWithPreferredKeySession(t,e,n,i){var a;const o=(a=this.config.drmSystems)==null||(a=a[t.keySystem])==null?void 0:a.generateRequest;if(o)try{const x=o.call(this.hls,e,n,t);if(!x)throw new Error("Invalid response from configured generateRequest filter");e=x.initDataType,n=x.initData?x.initData:null,t.decryptdata.pssh=n?new Uint8Array(n):null}catch(x){if(this.warn(x.message),this.hls&&this.hls.config.debug)throw x}if(n===null)return this.log(`Skipping key-session request for "${i}" (no initData)`),Promise.resolve(t);const c=yd(t.decryptdata),d=t.decryptdata.uri;this.log(`Generating key-session request for "${i}" keyId: ${c} URI: ${d} (init data type: ${e} length: ${n.byteLength})`);const f=new Fy,h=t._onmessage=x=>{const S=t.mediaKeysSession;if(!S){f.emit("error",new Error("invalid state"));return}const{messageType:E,message:T}=x;this.log(`"${E}" message event for session "${S.sessionId}" message size: ${T.byteLength}`),E==="license-request"||E==="license-renewal"?this.renewLicense(t,T).catch(L=>{f.eventNames().length?f.emit("error",L):this.handleError(L)}):E==="license-release"?t.keySystem===ye.FAIRPLAY&&this.updateKeySession(t,l0("acknowledged")).then(()=>this.removeSession(t)).catch(L=>this.handleError(L)):this.warn(`unhandled media key message type "${E}"`)},p=(x,S)=>{S.keyStatus=x;let E;x.startsWith("usable")?f.emit("resolved"):x==="internal-error"||x==="output-restricted"||x==="output-downscaled"?E=m1(x,S.decryptdata):x==="expired"?E=new Error(`key expired (keyId: ${c})`):x==="released"?E=new Error("key released"):x==="status-pending"||this.warn(`unhandled key status change "${x}" (keyId: ${c})`),E&&(f.eventNames().length?f.emit("error",E):this.handleError(E))},g=t._onkeystatuseschange=x=>{if(!t.mediaKeysSession){f.emit("error",new Error("invalid state"));return}const E=this.getKeyStatuses(t);if(!Object.keys(E).some(P=>E[P]!=="status-pending"))return;if(E[c]==="expired"){this.log(`Expired key ${re(E)} in key-session "${t.mediaKeysSession.sessionId}"`),this.renewKeySession(t);return}let L=E[c];if(L)p(L,t);else{var _;t.keyStatusTimeouts||(t.keyStatusTimeouts={}),(_=t.keyStatusTimeouts)[c]||(_[c]=self.setTimeout(()=>{if(!t.mediaKeysSession||!this.mediaKeys)return;const D=this.getKeyStatus(t.decryptdata);if(D&&D!=="status-pending")return this.log(`No status for keyId ${c} in key-session "${t.mediaKeysSession.sessionId}". Using session key-status ${D} from other session.`),p(D,t);this.log(`key status for ${c} in key-session "${t.mediaKeysSession.sessionId}" timed out after 1000ms`),L="internal-error",p(L,t)},1e3)),this.log(`No status for keyId ${c} (${re(E)}).`)}};ms(t.mediaKeysSession,"message",h),ms(t.mediaKeysSession,"keystatuseschange",g);const v=new Promise((x,S)=>{f.on("error",S),f.on("resolved",x)});return t.mediaKeysSession.generateRequest(e,n).then(()=>{this.log(`Request generated for key-session "${t.mediaKeysSession.sessionId}" keyId: ${c} URI: ${d}`)}).catch(x=>{throw new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_SESSION,error:x,decryptdata:t.decryptdata,fatal:!1},`Error generating key-session request: ${x}`)}).then(()=>v).catch(x=>(f.removeAllListeners(),this.removeSession(t).then(()=>{throw x}))).then(()=>(f.removeAllListeners(),t))}getKeyStatuses(t){const e={};return t.mediaKeysSession.keyStatuses.forEach((n,i)=>{if(typeof i=="string"&&typeof n=="object"){const c=i;i=n,n=c}const a="buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i);if(t.keySystem===ye.PLAYREADY&&a.length===16){const c=ss(a);e[c]=n,sC(a)}const o=ss(a);n==="internal-error"&&(this.bannedKeyIds[o]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${o} key-session "${t.mediaKeysSession.sessionId}"`),e[o]=n}),e}fetchServerCertificate(t){const e=this.config,n=e.loader,i=new n(e),a=this.getServerCertificateUrl(t);return a?(this.log(`Fetching server certificate for "${t}"`),new Promise((o,c)=>{const d={responseType:"arraybuffer",url:a},f=e.certLoadPolicy.default,h={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(g,v,x,S)=>{o(g.data)},onError:(g,v,x,S)=>{c(new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:x,response:Qt({url:d.url,data:void 0},g)},`"${t}" certificate request failed (${a}). Status: ${g.code} (${g.text})`))},onTimeout:(g,v,x)=>{c(new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:x,response:{url:d.url,data:void 0}},`"${t}" certificate request timed out (${a})`))},onAbort:(g,v,x)=>{c(new Error("aborted"))}};i.load(d,h,p)})):Promise.resolve()}setMediaKeysServerCertificate(t,e,n){return new Promise((i,a)=>{t.setServerCertificate(n).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${n.byteLength}) on "${e}"`),i(t)}).catch(o=>{a(new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then(n=>this.updateKeySession(t,new Uint8Array(n)).catch(i=>{throw new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:t.decryptdata,error:i,fatal:!1},i.message)}))}unpackPlayReadyKeyMessage(t,e){const n=String.fromCharCode.apply(null,new Uint16Array(e.buffer));if(!n.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),e;const i=new DOMParser().parseFromString(n,"application/xml"),a=i.querySelectorAll("HttpHeader");if(a.length>0){let h;for(let p=0,g=a.length;p<g;p++){var o,c;h=a[p];const v=(o=h.querySelector("name"))==null?void 0:o.textContent,x=(c=h.querySelector("value"))==null?void 0:c.textContent;v&&x&&t.setRequestHeader(v,x)}}const d=i.querySelector("Challenge"),f=d?.textContent;if(!f)throw new Error("Cannot find <Challenge> in key message");return l0(atob(f))}setupLicenseXHR(t,e,n,i){const a=this.config.licenseXhrSetup;return a?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return a.call(this.hls,t,e,n,i)}).catch(o=>{if(!n.decryptdata)throw o;return t.open("POST",e,!0),a.call(this.hls,t,e,n,i)}).then(o=>(t.readyState||t.open("POST",e,!0),{xhr:t,licenseChallenge:o||i})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:i}))}requestLicense(t,e){const n=this.config.keyLoadPolicy.default;return new Promise((i,a)=>{const o=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${o}`);const c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return a(new Error("invalid state"));if(c.readyState===4)if(c.status===200){this._requestLicenseFailureCount=0;let d=c.response;this.log(`License received ${d instanceof ArrayBuffer?d.byteLength:d}`);const f=this.config.licenseResponseCallback;if(f)try{d=f.call(this.hls,c,o,t)}catch(h){this.error(h)}i(d)}else{const d=n.errorRetry,f=d?d.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>f||c.status>=400&&c.status<500)a(new Fs({type:Tt.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:t.decryptdata,fatal:!0,networkDetails:c,response:{url:o,data:void 0,code:c.status,text:c.statusText}},`License Request XHR failed (${o}). Status: ${c.status} (${c.statusText})`));else{const h=f-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(t,e).then(i,a)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=c,this.setupLicenseXHR(c,o,t,e).then(({xhr:d,licenseChallenge:f})=>{t.keySystem==ye.PLAYREADY&&(f=this.unpackPlayReadyKeyMessage(d,f)),d.send(f)}).catch(a)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const n=e.media;this.media=n,ms(n,"encrypted",this.onMediaEncrypted),ms(n,"waitingforkey",this.onWaitingForKey);const i=this.mediaResolved;i?i():this.mediaKeys=n.mediaKeys}onMediaDetached(){const t=this.media;t&&(_s(t,"encrypted",this.onMediaEncrypted),_s(t,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const e=this.mediaResolved;if(e&&e(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const n=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,gr.clearKeyUriToKeyIdMap();const a=i.length;wo.CDMCleanupPromise=Promise.all(i.map(o=>this.removeSession(o)).concat((n==null||(t=n.setMediaKeys(null))==null?void 0:t.catch(o=>{this.log(`Could not clear media keys: ${o}`),this.hls&&this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${o}`)})}))||Promise.resolve())).catch(o=>{this.log(`Could not close sessions and clear media keys: ${o}`),this.hls&&this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${o}`)})}).then(()=>{a&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(t,{sessionKeys:e}){if(!(!e||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=e.reduce((i,a)=>(i.indexOf(a.keyFormat)===-1&&i.push(a.keyFormat),i),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:n,decryptdata:i}=t;if(e){this.log(`Remove licenses and keys and close session "${e.sessionId}" keyId: ${ss(i?.keyId||[])}`),t._onmessage&&(e.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(e.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const a=this.mediaKeySessions.indexOf(t);a>-1&&this.mediaKeySessions.splice(a,1);const{keyStatusTimeouts:o}=t;o&&Object.keys(o).forEach(f=>self.clearTimeout(o[f]));const{drmSystemOptions:c}=this.config;return(t6(c)?new Promise((f,h)=>{self.setTimeout(()=>h(new Error("MediaKeySession.remove() timeout")),8e3),e.remove().then(f).catch(h)}):Promise.resolve()).catch(f=>{this.log(`Could not remove session: ${f}`),this.hls&&this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${f}`)})}).then(()=>e.close()).catch(f=>{this.log(`Could not close session: ${f}`),this.hls&&this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${f}`)})})}return Promise.resolve()}}wo.CDMCleanupPromise=void 0;function yd(s){if(!s)throw new Error("Could not read keyId of undefined decryptdata");if(s.keyId===null)throw new Error("keyId is null");return ss(s.keyId)}function xG(s,t){if(s.keyId&&t.mediaKeysSession.keyStatuses.has(s.keyId))return t.mediaKeysSession.keyStatuses.get(s.keyId);if(s.matches(t.decryptdata))return t.keyStatus}class Fs extends Error{constructor(t,e){super(e),this.data=void 0,t.error||(t.error=new Error(e)),this.data=t,t.err=t.error}}function m1(s,t){const e=s==="output-restricted",n=e?Z.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:Z.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Fs({type:Tt.KEY_SYSTEM_ERROR,details:n,fatal:!1,decryptdata:t},e?"HDCP level output restricted":`key status changed to "${s}"`)}class bG{constructor(t){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=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(w.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(w.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,e){const n=this.hls.config;if(n.capLevelOnFPSDrop){const i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&typeof i.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(t,e,n){const i=performance.now();if(e){if(this.lastTime){const a=i-this.lastTime,o=n-this.lastDroppedFrames,c=e-this.lastDecodedFrames,d=1e3*o/a,f=this.hls;if(f.trigger(w.FPS_DROP,{currentDropped:o,currentDecoded:c,totalDroppedFrames:n}),d>0&&o>f.config.fpsDroppedMonitoringThreshold*c){let h=f.currentLevel;f.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(f.autoLevelCapping===-1||f.autoLevelCapping>=h)&&(h=h-1,f.trigger(w.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:f.currentLevel}),f.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=n,this.lastDecodedFrames=e}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}}function YC(s,t){let e;try{e=new Event("addtrack")}catch{e=document.createEvent("Event"),e.initEvent("addtrack",!1,!1)}e.track=s,t.dispatchEvent(e)}function WC(s,t){const e=s.mode;if(e==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(t.id))try{if(s.addCue(t),!s.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(n){Xt.debug(`[texttrack-utils]: ${n}`);try{const i=new self.TextTrackCue(t.startTime,t.endTime,t.text);i.id=t.id,s.addCue(i)}catch(i){Xt.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${i}`)}}e==="disabled"&&(s.mode=e)}function So(s,t){const e=s.mode;if(e==="disabled"&&(s.mode="hidden"),s.cues)for(let n=s.cues.length;n--;)t&&s.cues[n].removeEventListener("enter",t),s.removeCue(s.cues[n]);e==="disabled"&&(s.mode=e)}function v0(s,t,e,n){const i=s.mode;if(i==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0){const a=EG(s.cues,t,e);for(let o=0;o<a.length;o++)(!n||n(a[o]))&&s.removeCue(a[o])}i==="disabled"&&(s.mode=i)}function SG(s,t){if(t<=s[0].startTime)return 0;const e=s.length-1;if(t>s[e].endTime)return-1;let n=0,i=e,a;for(;n<=i;)if(a=Math.floor((i+n)/2),t<s[a].startTime)i=a-1;else if(t>s[a].startTime&&n<e)n=a+1;else return a;return s[n].startTime-t<t-s[i].startTime?n:i}function EG(s,t,e){const n=[],i=SG(s,t);if(i>-1)for(let a=i,o=s.length;a<o;a++){const c=s[a];if(c.startTime>=t&&c.endTime<=e)n.push(c);else if(c.startTime>e)return n}return n}function $d(s){const t=[];for(let e=0;e<s.length;e++){const n=s[e];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&t.push(s[e])}return t}class TG extends zy{constructor(t){super(t,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>
vendor: 7,492 bytes, line 210
210{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const n=$d(this.media.textTracks);for(let a=0;a<n.length;a++)if(n[a].mode==="hidden")e=n[a];else if(n[a].mode==="showing"){e=n[a];break}const i=this.findTrackForTextTrack(e);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_PARSED,this.onManifestParsed,this),t.on(w.LEVEL_LOADING,this.onLevelLoading,this),t.on(w.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(w.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(w.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_PARSED,this.onManifestParsed,this),t.off(w.LEVEL_LOADING,this.onLevelLoading,this),t.off(w.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(w.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(w.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(t,e){const n=this.media;if(!n)return;const i=!!e.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,i)return;$d(n.textTracks).forEach(o=>{So(o)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.subtitleTracks}onSubtitleTrackLoaded(t,e){const{id:n,groupId:i,details:a}=e,o=this.tracksInGroup[n];if(!o||o.groupId!==i){this.warn(`Subtitle track with id:${n} and group:${i} not found in active group ${o?.groupId}`);return}const c=o.details;o.details=e.details,this.log(`Subtitle track ${n} "${o.name}" lang:${o.lang} group:${i} loaded [${a.startSN}-${a.endSN}]`),n===this.trackId&&this.playlistLoaded(n,e,c)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const n=e.subtitleGroups||null,i=this.groupIds;let a=this.currentTrack;if(!n||i?.length!==n?.length||n!=null&&n.some(o=>i?.indexOf(o)===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(h=>!n||n.indexOf(h.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(h=>h.default)&&(this.selectDefaultTrack=!1),o.forEach((h,p)=>{h.id=p});else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const c=this.hls.config.subtitlePreference;if(!a&&c){this.selectDefaultTrack=!1;const h=Hn(c,o);if(h>-1)a=o[h];else{const p=Hn(c,this.tracks);a=this.tracks[p]}}let d=this.findTrackId(a);d===-1&&a&&(d=this.findTrackId(null));const f={subtitleTracks:o};this.log(`Updating subtitle tracks, ${o.length} track(s) found in "${n?.join(",")}" group-id`),this.hls.trigger(w.SUBTITLE_TRACKS_UPDATED,f),d!==-1&&this.trackId===-1&&this.setSubtitleTrack(d)}}findTrackId(t){const e=this.tracksInGroup,n=this.selectDefaultTrack;for(let i=0;i<e.length;i++){const a=e[i];if(!(n&&!a.default||!n&&!t)&&(!t||aa(a,t)))return i}if(t){for(let i=0;i<e.length;i++){const a=e[i];if(Rc(t.attrs,a.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const a=e[i];if(Rc(t.attrs,a.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(t){if(t){const e=this.tracksInGroup;for(let n=0;n<e.length;n++){const i=e[n];if(m0(i,t))return n}}return-1}onError(t,e){e.fatal||!e.context||e.context.type===Ft.SUBTITLE_TRACK&&e.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(e.context.groupId)!==-1)&&this.checkRetry(e)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){if(t.id===-1)return this.setSubtitleTrack(-1),null;const e=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,e.length){const n=this.currentTrack;if(n&&aa(t,n))return n;const i=Hn(t,this.tracksInGroup);if(i>-1){const a=this.tracksInGroup[i];return this.setSubtitleTrack(i),a}else{if(n)return null;{const a=Hn(t,e);if(a>-1)return e[a]}}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=t.id,i=t.groupId,a=this.getUrlWithDirectives(t.url,e),o=t.details,c=o?.age;this.log(`Loading subtitle ${n} "${t.name}" lang:${t.lang} group:${i}${e?.msn!==void 0?" at sn "+e.msn+" part "+e.part:""}${c&&o.live?" age "+c.toFixed(1)+(o.type&&" "+o.type||""):""} ${a}`),this.hls.trigger(w.SUBTITLE_TRACK_LOADING,{url:a,id:n,groupId:i,deliveryDirectives:e||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const e=$d(t.textTracks),n=this.currentTrack;let i;if(n&&(i=e.filter(a=>m0(n,a))[0],i||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(e).forEach(a=>{a.mode!=="disabled"&&a!==i&&(a.mode="disabled")}),i){const a=this.subtitleDisplay?"showing":"hidden";i.mode!==a&&(i.mode=a)}}setSubtitleTrack(t){const e=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(t<-1||t>=e.length||!pt(t)){this.warn(`Invalid subtitle track id: ${t}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,i=e[t]||null;if(this.trackId=t,this.currentTrack=i,this.toggleTrackModes(),!i){this.hls.trigger(w.SUBTITLE_TRACK_SWITCH,{id:t});return}const a=!!i.details&&!i.details.live;if(t===this.trackId&&i===n&&a)return;this.log(`Switching to subtitle-track ${t}`+(i?` "${i.name}" lang:${i.lang} group:${i.groupId}`:""));const{id:o,groupId:c="",name:d,type:f,url:h}=i;this.hls.trigger(w.SUBTITLE_TRACK_SWITCH,{id:o,groupId:c,name:d,type:f,url:h});const p=this.switchParams(i.url,n?.details,i.details);this.loadPlaylist(p)}}function AG(){try{return crypto.randomUUID()}catch{try{const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}catch{let e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const a=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i=="x"?a:a&3|8).toString(16)})}}}function nc(s){let t=5381,e=s.length;for(;e;
vendor: 4,231 bytes, line 210
210)t=t*33^s.charCodeAt(--e);return(t>>>0).toString()}const Lo=.025;let ff=(function(s){return s[s.Point=0]="Point",s[s.Range=1]="Range",s})({});function RG(s,t,e){return`${s.identifier}-${e+1}-${nc(t)}`}class wG{constructor(t,e){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=e,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,(t=this.assetListLoader)==null||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){var e;if(t>0&&t>=this.assetList.length)return!0;const n=this.playoutLimit;return t<=0||isNaN(n)?!1:n===0?!0:(((e=this.assetList[t])==null?void 0:e.startOffset)||0)>n}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const e=this.dateRange.tagAnchor;if(e)return Gp(t,e)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const e=this.dateRange.startTime,n=Gp(e,t);return e-n<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,e=pt(t)?t:this.duration;return this.cumulativeDuration+e}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const e=this.resumeAnchor;if(e)return Gp(t,e)}return t}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Lo))}set appendInPlace(t){if(this.appendInPlaceStarted){this.resetOnResume=!t;return}this.appendInPlaceDisabled=!t}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let e;return this._duration!==null?e=this._duration:this.dateRange.duration?e=this.dateRange.duration:e=this.dateRange.plannedDuration||0,!isNaN(t)&&t<e&&(e=t),e}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?ff.Range:ff.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return LG(this)}}function Gp(s,t){return s-t.start<t.duration/2&&!(Math.abs(s-(t.start+t.duration))<Lo)?t.start:t.start+t.duration}function QC(s,t,e){const n=new self.URL(s,e);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",t),n}function Hp(s,t){for(;(e=s.assetList[++t])!=null&&e.error;)var e;return t}function LG(s){return`["${s.identifier}" ${s.cue.pre?"<pre>":s.cue.post?"<post>":""}${s.timelineStart.toFixed(2)}-${s.resumeTime.toFixed(2)}]`}function mo(s){const t=s.timelineStart,e=s.duration||0;return`["${s.identifier}" ${t.toFixed(2)}-${(t+e).toFixed(2)}]`}class _G{constructor(t,e,n,i){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetail
vendor: 4,234 bytes, line 210
210s=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(w.PLAYOUT_LIMIT_REACHED,{})};const a=this.hls=new t(e);this.interstitial=n,this.assetItem=i;const o=()=>{this.hasDetails=!0};a.once(w.LEVEL_LOADED,o),a.once(w.AUDIO_TRACK_LOADED,o),a.once(w.SUBTITLE_TRACK_LOADED,o),a.on(w.MEDIA_ATTACHING,(c,{media:d})=>{this.removeMediaListeners(),this.mediaAttached=d,this.interstitial.playoutLimit&&(d.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&a.on(w.BUFFER_APPENDED,()=>{const h=this.bufferedEnd;this.reachedPlayout(h)&&(this._bufferedEosTime=h,a.trigger(w.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const t=this.hls;if(t)if(t.url)t.levels.length&&!t.started&&t.startLoad(-1,!0);else{let e=this.assetItem.uri;try{e=QC(e,t.config.primarySessionId||"").href}catch{}t.loadSource(e)}}bufferedInPlaceToEnd(t){var e;if(!this.appendInPlace)return!1;if((e=this.hls)!=null&&e.bufferedToEnd)return!0;if(!t)return!1;const n=Math.min(this._bufferedEosTime||1/0,this.duration),i=this.timelineOffset,a=Dt.bufferInfo(t,i,0);return this.getAssetTime(a.end)>=n-.02}reachedPlayout(t){const n=this.interstitial.playoutLimit;return this.startOffset+t>=n}get destroyed(){var t;return!((t=this.hls)!=null&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return((t=this.hls)==null?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const e=Dt.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(e.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;if(!t)return 0;const e=this.interstitial.playoutLimit;if(e){const n=e-this.startOffset;if(n>0&&n<t)return n}return t}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return((t=this.hls)==null?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const e=this.timelineOffset;if(t!==e){const n=t-e;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=t}}}getAssetTime(t){const e=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,t-e),n)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var t;(t=this.hls)!=null&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(t){var e;this.loadSource(),(e=this.hls)==null||e.attachMedia(t)}detachMedia(){var t;this.removeMediaListeners(),this.mediaAttached=null,(t=this.hls)==null||t.detachMedia()}resumeBuffering(){var t;(t=this.hls)==null||t.resumeBuffering()}pauseBuffering(){var t;(t=this.hls)==null||t.pauseBuffering()}transferMedia(){var t;return this.bufferSnapShot(),((t=this.hls)==null?void 0:t.transferMedia())||null}resetDetails(){const t=this.hls;if(t&&this.hasDetails){t.stopLoad();const e=n=>delete n.details;t.levels.forEach(e),t.allAudioTracks.forEach(e),t.allSubtitleTracks.forEach(e),this.hasDetails=!1}}on(t,e,n){var i;(i=this.hls)==null||i.on(t,e)}once(t,e,n){var i;(i=this.hls)==null||i.once(t,e)}off(t,e,n){var i;(i=this.hls)==null||i.off(t,e)}toString(){var t;return`HlsAssetPlayer: ${mo(this.assetItem)} ${(t=this.hls)==null?void 0:t.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const p1=.033;class CG extends mn{constructor(t,e){super("interstitials-sched",e),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={}
vendor: 6,551 bytes, line 210
210,this.setDurations(0,0,0),this.events&&this.events.forEach(t=>t.reset()),this.events=this.items=null}resetErrorsInRange(t,e){return this.events?this.events.reduce((n,i)=>t<=i.startOffset&&e>i.startOffset?(delete i.error,n+1):n,0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,e){if(t.event)return this.findEventIndex(t.event.identifier);let n=-1;t.nextEvent?n=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(n=this.findEventIndex(t.previousEvent.identifier)+1);const i=this.items;if(i)for(i[n]||(e===void 0&&(e=t.start),n=this.findItemIndexAtTime(e));n>=0&&(a=i[n])!=null&&a.event;){var a;n--}return n}findItemIndexAtTime(t,e){const n=this.items;if(n)for(let i=0;i<n.length;i++){let a=n[i];if(e&&e!=="primary"&&(a=a[e]),t===a.start||t>a.start&&t<a.end)return i}return-1}findJumpRestrictedIndex(t,e){const n=this.items;if(n)for(let i=t;i<=e&&n[i];i++){const a=n[i].event;if(a!=null&&a.restrictions.jump&&!a.appendInPlace)return i}return-1}findEventIndex(t){const e=this.items;if(e)for(let i=e.length;i--;){var n;if(((n=e[i].event)==null?void 0:n.identifier)===t)return i}return-1}findAssetIndex(t,e){const n=t.assetList,i=n.length;if(i>1)for(let a=0;a<i;a++){const o=n[a];if(!o.error){const c=o.timelineStart;if(e===c||e>c&&(e<c+(o.duration||0)||a===i-1))return a}}return 0}get assetIdAtEnd(){var t;const e=(t=this.items)==null||(t=t[this.length-1])==null?void 0:t.event;if(e){const n=e.assetList,i=n[n.length-1];if(i)return i.identifier}return null}parseInterstitialDateRanges(t,e){const n=t.main.details,{dateRanges:i}=n,a=this.events,o=this.parseDateRanges(i,{url:n.url},e),c=Object.keys(i),d=a?a.filter(f=>!c.includes(f.identifier)):[];o.length&&o.sort((f,h)=>{const p=f.cue.pre,g=f.cue.post,v=h.cue.pre,x=h.cue.post;if(p&&!v)return-1;if(v&&!p||g&&!x)return 1;if(x&&!g)return-1;if(!p&&!v&&!g&&!x){const S=f.startTime,E=h.startTime;if(S!==E)return S-E}return f.dateRange.tagOrder-h.dateRange.tagOrder}),this.events=o,d.forEach(f=>{this.removeEvent(f)}),this.updateSchedule(t,d)}updateSchedule(t,e=[],n=!1){const i=this.events||[];if(i.length||e.length||this.length<2){const a=this.items,o=this.parseSchedule(i,t);(n||e.length||a?.length!==o.length||o.some((d,f)=>Math.abs(d.playout.start-a[f].playout.start)>.005||Math.abs(d.playout.end-a[f].playout.end)>.005))&&(this.items=o,this.onScheduleUpdate(e,a))}}parseDateRanges(t,e,n){const i=[],a=Object.keys(t);for(let o=0;o<a.length;o++){const c=a[o],d=t[c];if(d.isInterstitial){let f=this.eventMap[c];f?f.setDateRange(d):(f=new wG(d,e),this.eventMap[c]=f,n===!1&&(f.appendInPlace=n)),i.push(f)}}return i}parseSchedule(t,e){const n=[],i=e.main.details,a=i.live?1/0:i.edge;let o=0;if(t=t.filter(d=>!d.error&&!(d.cue.once&&d.hasPlayed)),t.length){this.resolveOffsets(t,e);let d=0,f=0;if(t.forEach((h,p)=>{const g=h.cue.pre,v=h.cue.post,x=t[p-1]||null,S=h.appendInPlace,E=v?a:h.startOffset,T=h.duration,L=h.timelineOccupancy===ff.Range?T:0,_=h.resumptionOffset,P=x?.startTime===E,D=E+h.cumulativeDuration;let B=S?D+T:E+_;if(g||!v&&E<=0){const I=f;f+=L,h.timelineStart=D;const F=o;o+=T,n.push({event:h,start:D,end:B,playout:{start:F,end:o},integrated:{start:I,end:f}})}else if(E<=a){if(!P){const U=E-d;if(U>p1){const z=d,Y=f;f+=U;const nt=o;o+=U;const it={previousEvent:t[p-1]||null,nextEvent:h,start:z,end:z+U,playout:{start:nt,end:o},integrated:{start:Y,end:f}};n.push(it)}else U>0&&x&&(x.cumulativeDuration+=U,n[n.length-1].end=E)}v&&(B=D),h.timelineStart=D;const I=f;f+=L;const F=o;o+=T,n.push({event:h,start:D,end:B,playout:{start:F,end:o},integrated:{start:I,end:f}})}else return;const C=h.resumeTime;v||C>a?d=a:d=C}),d<a){var c;const h=d,p=f,g=a-d;f+=g;const v=o;o+=g,n.push({previousEvent:((c=n[n.length-1])==null?void 0:c.event)||null,nextEvent:null,start:d,end:h+g,playout:{start:v,end:o},integrated:{start:p,end:f}})}this.setDurations(a,o,f)}else n.push({previousEvent:null,nextEvent:null,start:0,end:a,playout:{start:0,end:a},integrated:{start:0,end:a}}),this.setDurations(a,a,a);return n}setDurations(t,e,n){this.durations={primary:t,playout:e,integrated:n}}resolveOffsets(t,e){const n=e.main.details,i=n.live?1/0:n.edge;let a=0,o=-1;t.forEach((c,d)=>{const f=c.cue.pre,h=c.cue.post,p=f?0:h?i:c.startTime;this.updateAssetDurations(c),o===p?c.cumulativeDuration=a:(a=0,o=p),!h&&c.snapOptions.in&&(c.resumeAnchor=ua(null,n.fragments,c.startOffset+c.resumptionOffset,0,0)||void 0),c.appendInPlace&&!c.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(c,e)||(c.appendInPlace=!1)),!c.appendInPlace&&d+1<t.length&&t[d+1].startTime-t[d].resumeTime<p1&&(t[d+1].appendInPlace=!1,t[d+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${c}`));const v=pt(c.resumeOffset)?c.resumeOffset:c.duration;a+=v})}primaryCanResumeInPlaceAt(t,e){const n=t.resumeTime,i=t.startTime+t.resumptionOffset;return Math.abs(n-i)>Lo?(this.log(`"${t.identifier}" resumption ${n} not aligned with estimated timeline end ${i}`),!1):!Object.keys(e).some(o=>{const c=e[o].details,d=c.edge;if(n>=d)return this.log(`"${t.identifier}" resumption ${n} past ${o} playlist end ${d}`),!1;const f=ua(null,c.fragments,n);if(!f)return this.log(`"${t.identifier}" resumption ${n} does not align with any fragments in ${o} playlist (${c.fragStart}-${c.fragmentEnd})`),!0;const h=o==="audio"?.175:0;return Math.abs(f.start-n)<Lo+h||Math.abs(f.end-n)<Lo+h?!1:(this.log(`"${t.identifier}" resumption ${n} not aligned with ${o} fragment bounds (${f.start}-${f.end} sn: ${f.sn} cc: ${f.cc})`),!0)})}updateAssetDurations(t){if(!t.assetListLoaded)return;const e=t.timelineStart;let n=0,i=!1,a=!1;for(let o=0;o<t.assetList.length;o++){const c=t.assetList[o],d=e+n;c.startOffset=n,c.timelineStart=d,i||(i=c.duration===null),a||(a=!!c.error);const f=c.error?0:c.duration||0;n+=f}i&&!a?t.duration=Math.max(n,t.duration):t.duration=n}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function Sn(s){return`[${s.event?'"'+s.event.identifier+'"':"primary"}: ${s.start.toFixed(2)}-${s.end.toFixed(2)}]`}class DG{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,e){const n=t.assetListUrl;let i;try{i=QC(n,this.hls.sessionId,t.baseUrl)}catch(g){const v=this.assignAssetListError(t,Z.ASSET_LIST_LOAD_ERROR,g,n);this.hls.trigger(w.ERROR,v);return}e&&i.protocol!=="data:"&&i.searchParams.set("_HLS_start_offset",""+e);const a=this.hls.config,o=a.loader,c=new o(a),d={responseType:"json",url:i.href}
vendor: 4,411 bytes, lines 210-211
210,f=a.interstitialAssetListLoadPolicy.default,h={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(g,v,x,S)=>{const E=g.data,T=E?.ASSETS;if(!Array.isArray(T)){const L=this.assignAssetListError(t,Z.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),x.url,v,S);this.hls.trigger(w.ERROR,L);return}t.assetListResponse=E,this.hls.trigger(w.ASSET_LIST_LOADED,{event:t,assetListResponse:E,networkDetails:S})},onError:(g,v,x,S)=>{const E=this.assignAssetListError(t,Z.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${g.code} ${g.text} (${v.url})`),v.url,S,x);this.hls.trigger(w.ERROR,E)},onTimeout:(g,v,x)=>{const S=this.assignAssetListError(t,Z.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${v.url})`),v.url,g,x);this.hls.trigger(w.ERROR,S)}};return c.load(d,h,p),this.hls.trigger(w.ASSET_LIST_LOADING,{event:t}),c}assignAssetListError(t,e,n,i,a,o){return t.error=n,{type:Tt.NETWORK_ERROR,details:e,fatal:!1,interstitial:t,url:i,error:n,networkDetails:o,stats:a}}}function g1(s){var t;s==null||(t=s.play())==null||t.catch(()=>{})}function ho(s,t){return`[${s}] Advancing timeline position to ${t}`}class IG extends mn{constructor(t,e){super("interstitials",t.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled||!this.schedule)return;const i=n-this.timelinePos;if(Math.abs(i)<1/7056e5)return;const o=i<=-.01;this.timelinePos===-1&&!this.effectivePlayingItem&&this.checkStart(),this.timelinePos=n,this.bufferedPos=n;const c=this.playingItem;if(!c){this.checkBuffer();return}if(o&&this.schedule.resetErrorsInRange(n,n-i)&&this.updateSchedule(!0),this.checkBuffer(),o&&n<c.start||n>=c.end){var d;const v=this.findItemIndex(c);let x=this.schedule.findItemIndexAtTime(n);if(x===-1&&(x=v+(o?-1:1),this.log(`seeked ${o?"back ":""}to position not covered by schedule ${n} (resolving from ${v} to ${x})`)),!this.isInterstitial(c)&&(d=this.media)!=null&&d.paused&&(this.shouldPlay=!1),!o&&x>v){const S=this.schedule.findJumpRestrictedIndex(v+1,x);if(S>v){this.setSchedulePosition(S);return}}this.setSchedulePosition(x);return}const f=this.playingAsset;if(!f){if(this.playingLastItem&&this.isInterstitial(c)){const v=c.event.assetList[0];v&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,v))}return}const h=f.timelineStart,p=f.duration||0;if(o&&n<h||n>=h+p){var g;(g=c.event)!=null&&g.appendInPlace&&(this.clearAssetPlayers(c.event,c),this.flushFrontBuffer(n)),this.setScheduleToAssetAtTime(n,f)}},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(this.timelinePos===-1&&!this.effectivePlayingItem&&this.checkStart(),n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const i=this.playingItem;if(!i||this.playingLastItem)return;if(n>=i.end){this.timelinePos=i.end;const c=this.findItemIndex(i);this.setSchedulePosition(c+1)}const a=this.playingAsset;if(!a)return;const o=a.timelineStart+(a.duration||0);n>=o&&this.setScheduleToAssetAtTime(n,a)},this.onScheduleUpdate=(n,i)=>{const a=this.schedule;if(!a)return;const o=this.playingItem,c=a.events||[],d=a.items||[],f=a.durations,h=n.map(S=>S.identifier),p=!!(c.length||h.length);(p||i)&&this.log(`INTERSTITIALS_UPDATED (${c.length}): ${c} 211Schedule: ${d.map(S=>Sn(S))} pos: ${this.timelinePos}`),h.length&&this.log(`Removed events ${h}`);let g=null,v=null;o&&(g=this.updateItem(o,this.timelinePos),this.itemsMatch(o,g)?this.playingItem=g:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const x=this.bufferingItem;if(x&&(v=this.updateItem(x,this.bufferedPos),this.itemsMatch(x,v)?this.bufferingItem=v:x.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(x.event,null))),n.forEac
vendor: 40,322 bytes, line 211
211h(S=>{S.assetList.forEach(E=>{this.clearAssetPlayer(E.identifier,null)})}),this.playerQueue.forEach(S=>{if(S.interstitial.appendInPlace){const E=S.assetItem.timelineStart,T=S.timelineOffset-E;if(T)try{S.timelineOffset=E}catch(L){Math.abs(T)>Lo&&this.warn(`${L} ("${S.assetId}" ${S.timelineOffset}->${E})`)}}}),p||i){if(this.hls.trigger(w.INTERSTITIALS_UPDATED,{events:c.slice(0),schedule:d.slice(0),durations:f,removedIds:h}),this.isInterstitial(o)&&h.includes(o.event.identifier)){this.warn(`Interstitial "${o.event.identifier}" removed while playing`),this.primaryFallback(o.event);return}o&&this.trimInPlace(g,o),x&&v!==g&&this.trimInPlace(v,x),this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=e,this.assetListLoader=new DG(t),this.schedule=new CG(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t&&(t.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(w.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(w.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(w.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(w.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(w.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(w.BUFFER_APPENDED,this.onBufferAppended,this),t.on(w.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(w.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(w.MEDIA_ENDED,this.onMediaEnded,this),t.on(w.ERROR,this.onError,this),t.on(w.DESTROYING,this.onDestroying,this))}unregisterListeners(){const t=this.hls;t&&(t.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(w.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(w.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(w.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(w.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(w.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(w.BUFFER_CODECS,this.onBufferCodecs,this),t.off(w.BUFFER_APPENDED,this.onBufferAppended,this),t.off(w.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(w.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(w.MEDIA_ENDED,this.onMediaEnded,this),t.off(w.ERROR,this.onError,this),t.off(w.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;(t=this.getBufferingPlayer())==null||t.resumeBuffering()}pauseBuffering(){var t;(t=this.getBufferingPlayer())==null||t.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){_s(t,"play",this.onPlay),_s(t,"pause",this.onPause),_s(t,"seeking",this.onSeeking),_s(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,e){const n=this.media=e.media;ms(n,"seeking",this.onSeeking),ms(n,"timeupdate",this.onTimeupdate),ms(n,"play",this.onPlay),ms(n,"pause",this.onPause)}onMediaAttached(t,e){const n=this.effectivePlayingItem,i=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!i){this.clearScheduleState();const a=this.findItemIndex(n);this.setSchedulePosition(a)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,e){const n=!!e.transferMedia,i=this.media;if(this.media=null,!n&&(i&&this.removeMediaListeners(i),this.detachedData)){const a=this.getBufferingPlayer();a&&(this.log(`Removing schedule state for detachedData and ${a}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,a.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const t=this,e=()=>t.bufferingItem||t.waitingItem,n=p=>p&&t.getAssetPlayer(p.identifier),i=(p,g,v,x,S)=>{if(p){let E=p[g].start;const T=p.event;if(T){if(g==="playout"||T.timelineOccupancy!==ff.Point){const L=n(v);L?.interstitial===T&&(E+=L.assetItem.startOffset+L[S])}}else{const L=x==="bufferedPos"?o():t[x];E+=L-p.start}return E}return 0},a=(p,g)=>{var v;if(p!==0&&g!=="primary"&&(v=t.schedule)!=null&&v.length){var x;const S=t.schedule.findItemIndexAtTime(p),E=(x=t.schedule.items)==null?void 0:x[S];if(E){const T=E[g].start-E.start;return p+T}}return p},o=()=>{const p=t.bufferedPos;return p===Number.MAX_VALUE?c("primary"):Math.max(p,0)},c=p=>{var g,v;return(g=t.primaryDetails)!=null&&g.live?t.primaryDetails.edge:((v=t.schedule)==null?void 0:v.durations[p])||0},d=(p,g)=>{var v,x;const S=t.effectivePlayingItem;if(S!=null&&(v=S.event)!=null&&v.restrictions.skip||!t.schedule)return;t.log(`seek to ${p} "${g}"`);const E=t.effectivePlayingItem,T=t.schedule.findItemIndexAtTime(p,g),L=(x=t.schedule.items)==null?void 0:x[T],_=t.getBufferingPlayer(),P=_?.interstitial,D=P?.appendInPlace,B=E&&t.itemsMatch(E,L);if(E&&(D||B)){const C=n(t.playingAsset),I=C?.media||t.primaryMedia;if(I){const F=g==="primary"?I.currentTime:i(E,g,t.playingAsset,"timelinePos","currentTime"),U=p-F,z=(D?F:I.currentTime)+U;if(z>=0&&(!C||D||z<=C.duration)){I.currentTime=z;return}}}if(L){let C=p;if(g!=="primary"){const F=L[g].start,U=p-F;C=L.start+U}const I=!t.isInterstitial(L);if((!t.isInterstitial(E)||E.event.appendInPlace)&&(I||L.event.appendInPlace)){const F=t.media||(D?_?.media:null);F&&(F.currentTime=C)}else if(E){const F=t.findItemIndex(E);if(T>F){const z=t.schedule.findJumpRestrictedIndex(F+1,T);if(z>F){t.setSchedulePosition(z);return}}let U=0;if(I)t.timelinePos=C,t.checkBuffer();else{const z=L.event.assetList,Y=p-(L[g]||L).start;for(let nt=z.length;nt--;){const it=z[nt];if(it.duration&&Y>=it.startOffset&&Y<it.startOffset+it.duration){U=nt;break}}}t.setSchedulePosition(T,U)}}},f=()=>{const p=t.effectivePlayingItem;if(t.isInterstitial(p))return p;const g=e();return t.isInterstitial(g)?g:null},h={get bufferedEnd(){const p=e(),g=t.bufferingItem;if(g&&g===p){var v;return i(g,"playout",t.bufferingAsset,"bufferedPos","bufferedEnd")-g.playout.start||((v=t.bufferingAsset)==null?void 0:v.startOffset)||0}return 0},get currentTime(){const p=f(),g=t.effectivePlayingItem;return g&&g===p?i(g,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-g.playout.start:0},set currentTime(p){const g=f(),v=t.effectivePlayingItem;v&&v===g&&d(p+v.playout.start,"playout")},get duration(){const p=f();return p?p.playout.end-p.playout.start:0},get assetPlayers(){var p;const g=(p=f())==null?void 0:p.event.assetList;return g?g.map(v=>t.getAssetPlayer(v.identifier)):[]},get playingIndex(){var p;const g=(p=f())==null?void 0:p.event;return g&&t.effectivePlayingAsset?g.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return f()}};return this.manager={get events(){var p;return((p=t.schedule)==null||(p=p.events)==null?void 0:p.slice(0))||[]},get schedule(){var p;return((p=t.schedule)==null||(p=p.items)==null?void 0:p.slice(0))||[]},get interstitialPlayer(){return f()?h:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return e()},get bufferingIndex(){const p=e();return t.findItemIndex(p)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const p=t.effectivePlayingItem;return t.findItemIndex(p)},primary:{get bufferedEnd(){return o()},get currentTime(){const p=t.timelinePos;return p>0?p:0},set currentTime(p){d(p,"primary")},get duration(){return c("primary")},get seekableStart(){var p;return((p=t.primaryDetails)==null?void 0:p.fragmentStart)||0}},integrated:{get bufferedEnd(){return i(e(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return i(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(p){d(p,"integrated")},get duration(){return c("integrated")},get seekableStart(){var p;return a(((p=t.primaryDetails)==null?void 0:p.fragmentStart)||0,"integrated")}},skip:()=>{const p=t.effectivePlayingItem,g=p?.event;if(g&&!g.restrictions.skip){const v=t.findItemIndex(p);if(g.appendInPlace){const x=p.playout.start+p.event.duration;d(x+.001,"playout")}else t.advanceAfterAssetEnded(g,v,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const e=this.playingItem,n=(t=this.schedule)==null?void 0:t.items;return!this.playbackStarted||!e||!n?!1:this.findItemIndex(e)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var t,e;if(this.mediaSelection===null)return;const n=this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&!n.event.appendInPlace)return;let i=this.media;!i&&(t=this.bufferingItem)!=null&&(t=t.event)!=null&&t.appendInPlace&&(i=this.primaryMedia);const a=(e=i)==null?void 0:e.currentTime;if(!(a===void 0||!pt(a)))return a}get primaryMedia(){var t;return this.media||((t=this.detachedData)==null?void 0:t.media)||null}isInterstitial(t){return!!(t!=null&&t.event)}retreiveMediaSource(t,e){const n=this.getAssetPlayer(t);n&&this.transferMediaFromPlayer(n,e)}transferMediaFromPlayer(t,e){const n=t.interstitial.appendInPlace,i=t.media;if(n&&i===this.primaryMedia){if(this.bufferingAsset=null,(!e||this.isInterstitial(e)&&!e.event.appendInPlace)&&e&&i){this.detachedData={media:i};return}const a=t.transferMedia();this.log(`transfer MediaSource from ${t} ${re(a)}`),this.detachedData=a}else e&&i&&(this.shouldPlay||(this.shouldPlay=!i.paused))}transferMediaTo(t,e){var n,i;if(t.media===e)return;let a=null;const o=this.hls,c=t!==o,d=c&&t.interstitial.appendInPlace,f=(n=this.detachedData)==null?void 0:n.mediaSource;let h;if(o.media)d&&(a=o.transferMedia(),this.detachedData=a),h="Primary";else if(f){const x=this.getBufferingPlayer();x?(a=x.transferMedia(),h=`${x}`):h="detached MediaSource"}else h="detached media";if(!a){if(f)a=this.detachedData,this.log(`using detachedData: MediaSource ${re(a)}`);else if(!this.detachedData||o.media===e){const x=this.playerQueue;x.length>1&&x.forEach(S=>{if(c&&S.interstitial.appendInPlace!==d){const E=S.interstitial;this.clearInterstitial(S.interstitial,null),E.appendInPlace=!1,E.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${E}`)}}),this.hls.detachMedia(),this.detachedData={media:e}}}const p=a&&"mediaSource"in a&&((i=a.mediaSource)==null?void 0:i.readyState)!=="closed",g=p&&a?a:e;this.log(`${p?"transfering MediaSource":"attaching media"} to ${c?t:"Primary"} from ${h} (media.currentTime: ${e.currentTime})`);const v=this.schedule;if(g===a&&v){const x=c&&t.assetId===v.assetIdAtEnd;g.overrides={duration:v.duration,endOfStream:!c||x,cueRemoval:!c}}t.attachMedia(g)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,e=t?.events;if(!e||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,i=this.effectivePlayingItem;if(n===-1){const a=this.hls.startPosition;if(this.timelinePos=a,e.length===0)this.setSchedulePosition(0);else if(e[0].cue.pre){this.log(ho("checkStart (preroll)",a));const o=t.findEventIndex(e[0].identifier);this.setSchedulePosition(o)}else if(a>=0||!this.primaryLive){this.log(ho("checkStart",a));const o=this.timelinePos=a>0?a:0,c=t.findItemIndexAtTime(o);this.setSchedulePosition(c)}else this.hls.liveSyncPosition===0?this.setSchedulePosition(0):this.log("[checkStart] waiting for live start")}else if(i&&!this.playingItem){this.log(ho("checkStart (playing item)",i.start));const a=t.findItemIndex(i);this.setSchedulePosition(a)}}advanceAssetBuffering(t,e){const n=t.event,i=n.findAssetIndex(e),a=Hp(n,i);if(!n.isAssetPastPlayoutLimit(a))this.bufferedToEvent(t,a);else if(this.schedule){var o;const c=(o=this.schedule.items)==null?void 0:o[this.findItemIndex(t)+1];c&&this.bufferedToItem(c)}}advanceAfterAssetEnded(t,e,n){const i=Hp(t,n);if(t.isAssetPastPlayoutLimit(i)){if(this.schedule){const a=this.schedule.items;if(a){const o=e+1,c=a.length;if(o>=c){this.setSchedulePosition(-1);return}const d=t.resumeTime;this.timelinePos<d&&(this.log(ho("advanceAfterAssetEnded",d)),this.timelinePos=d,t.appendInPlace&&this.advanceInPlace(d),this.checkBuffer(this.bufferedPos<d)),this.setSchedulePosition(o)}}}else{if(t.appendInPlace){const a=t.assetList[i];a&&this.advanceInPlace(a.timelineStart)}this.setSchedulePosition(e,i)}}setScheduleToAssetAtTime(t,e){const n=this.schedule;if(!n)return;const i=e.parentIdentifier,a=n.getEvent(i);if(a){const o=n.findEventIndex(i),c=n.findAssetIndex(a,t);this.advanceAfterAssetEnded(a,o,c-1)}}setSchedulePosition(t,e){var n;const i=(n=this.schedule)==null?void 0:n.items;if(!i||this.playbackDisabled)return;const a=t>=0?i[t]:null;this.log(`setSchedulePosition ${t}, ${e} (${a&&Sn(a)}) pos: ${this.timelinePos}`);const o=this.waitingItem||this.playingItem,c=this.playingLastItem;if(this.isInterstitial(o)){const h=o.event,p=this.playingAsset,g=p?.identifier,v=g?this.getAssetPlayer(g):null;if(v&&g&&(!this.eventItemsMatch(o,a)||e!==void 0&&g!==h.assetList[e].identifier)){var d;const x=h.findAssetIndex(p);if(this.log(`INTERSTITIAL_ASSET_ENDED ${x+1}/${h.assetList.length} ${mo(p)}`),this.endedAsset=p,this.playingAsset=null,this.hls.trigger(w.INTERSTITIAL_ASSET_ENDED,{asset:p,assetListIndex:x,event:h,schedule:i.slice(0),scheduleIndex:t,player:v}),o!==this.playingItem){this.itemsMatch(o,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(h,this.findItemIndex(this.playingItem),x);return}this.retreiveMediaSource(g,a),v.media&&!((d=this.detachedData)!=null&&d.mediaSource)&&v.detachMedia()}if(!this.eventItemsMatch(o,a)&&(this.endedItem=o,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${h} ${Sn(o)}`),h.hasPlayed=!0,this.hls.trigger(w.INTERSTITIAL_ENDED,{event:h,schedule:i.slice(0),scheduleIndex:t}),h.cue.once)){var f;this.updateSchedule();const x=(f=this.schedule)==null?void 0:f.items;if(a&&x){const S=this.findItemIndex(a);this.advanceSchedule(S,x,e,o,c)}return}}this.advanceSchedule(t,i,e,o,c)}advanceSchedule(t,e,n,i,a){const o=this.schedule;if(!o)return;const c=e[t]||null,d=this.primaryMedia,f=this.playerQueue;if(f.length&&f.forEach(h=>{const p=h.interstitial,g=o.findEventIndex(p.identifier);(g<t||g>t+1)&&this.clearInterstitial(p,c)}),this.isInterstitial(c)){this.timelinePos=Math.min(Math.max(this.timelinePos,c.start),c.end);const h=c.event;if(n===void 0){n=o.findAssetIndex(h,this.timelinePos);const x=Hp(h,n-1);if(h.isAssetPastPlayoutLimit(x)||h.appendInPlace&&this.timelinePos===c.end){this.advanceAfterAssetEnded(h,t,n);return}n=x}const p=this.waitingItem;this.assetsBuffered(c,d)||this.setBufferingItem(c);let g=this.preloadAssets(h,n);if(this.eventItemsMatch(c,p||i)||(this.waitingItem=c,this.log(`INTERSTITIAL_STARTED ${Sn(c)} ${h.appendInPlace?"append in place":""}`),this.hls.trigger(w.INTERSTITIAL_STARTED,{event:h,schedule:e.slice(0),scheduleIndex:t})),!h.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${h}`);return}if(h.assetListLoader&&(h.assetListLoader.destroy(),h.assetListLoader=void 0),!d){this.log(`Waiting for attachMedia to start Interstitial ${h}`);return}this.waitingItem=this.endedItem=null,this.playingItem=c;const v=h.assetList[n];if(!v){this.advanceAfterAssetEnded(h,t,n||0);return}if(g||(g=this.getAssetPlayer(v.identifier)),g===null||g.destroyed){const x=h.assetList.length;this.warn(`asset ${n+1}/${x} player destroyed ${h}`),g=this.createAssetPlayer(h,v,n),g.loadSource()}if(!this.eventItemsMatch(c,this.bufferingItem)&&h.appendInPlace&&this.isAssetBuffered(v))return;this.startAssetPlayer(g,n,e,t,d),this.shouldPlay&&g1(g.media)}else c?(this.resumePrimary(c,t,i),this.shouldPlay&&g1(this.hls.media)):a&&this.isInterstitial(i)&&(this.endedItem=null,this.playingItem=i,i.event.appendInPlace||this.attachPrimary(o.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var t;return(t=this.mediaSelection)==null?void 0:t.main.details}get primaryLive(){var t;return!!((t=this.primaryDetails)!=null&&t.live)}resumePrimary(t,e,n){var i,a;if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${Sn(t)}`),!((i=this.detachedData)!=null&&i.mediaSource)){let c=this.timelinePos;(c<t.start||c>=t.end)&&(c=this.getPrimaryResumption(t,e),this.log(ho("resumePrimary",c)),this.timelinePos=c),this.attachPrimary(c,t)}if(!n)return;const o=(a=this.schedule)==null?void 0:a.items;o&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Sn(t)}`),this.hls.trigger(w.INTERSTITIALS_PRIMARY_RESUMED,{schedule:o.slice(0),scheduleIndex:e}),this.checkBuffer())}getPrimaryResumption(t,e){const n=t.start;if(this.primaryLive){const i=this.primaryDetails;if(e===0)return this.hls.startPosition;if(i&&(n<i.fragmentStart||n>i.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(t){const e=this.getAssetPlayer(t.identifier);return e!=null&&e.hls?e.hls.bufferedToEnd:Dt.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,e,n){e?this.setBufferingItem(e):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const i=this.primaryMedia;if(!i)return;const a=this.hls;a.media?this.checkBuffer():(this.transferMediaTo(a,i),n&&this.startLoadingPrimaryAt(t,n)),n||(this.log(ho("attachPrimary",t)),this.timelinePos=t,this.startLoadingPrimaryAt(t,n))}startLoadingPrimaryAt(t,e){var n;const i=this.hls;!i.loadingEnabled||!i.media||Math.abs((((n=i.mainForwardBufferInfo)==null?void 0:n.start)||i.media.currentTime)-t)>.5?i.startLoad(t,e):i.bufferingEnabled||i.resumeBuffering()}onManifestLoading(){var t;this.stopLoad(),(t=this.schedule)==null||t.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(w.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(w.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,e){if(e.level===-1||!this.schedule)return;const n=this.hls.levels[e.level];if(!n.details)return;const i=Qt(Qt({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=i,this.schedule.parseInterstitialDateRanges(i,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,e){const n=this.hls.audioTracks[e.id],i=this.mediaSelection;if(!i){this.altSelection=Qt(Qt({},this.altSelection),{},{audio:n});return}const a=Qt(Qt({},i),{},{audio:n});this.mediaSelection=a}onSubtitleTrackUpdated(t,e){const n=this.hls.subtitleTracks[e.id],i=this.mediaSelection;if(!i){this.altSelection=Qt(Qt({},this.altSelection),{},{subtitles:n});return}const a=Qt(Qt({},i),{},{subtitles:n});this.mediaSelection=a}onAudioTrackSwitching(t,e){const n=RA(e);this.playerQueue.forEach(({hls:i})=>i&&(i.setAudioOption(e)||i.setAudioOption(n)))}onSubtitleTrackSwitch(t,e){const n=RA(e);this.playerQueue.forEach(({hls:i})=>i&&(i.setSubtitleOption(e)||e.id!==-1&&i.setSubtitleOption(n)))}onBufferCodecs(t,e){const n=e.tracks;n&&(this.requiredTracks=n)}onBufferAppended(t,e){this.checkBuffer()}onBufferFlushed(t,e){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const i=this.timelinePos;this.bufferedPos=i,this.checkBuffer()}}onBufferedToEnd(t){if(!this.schedule)return;const e=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&e){for(let i=0;i<e.length;i++){const a=e[i];if(a.cue.post){var n;const o=this.schedule.findEventIndex(a.identifier),c=(n=this.schedule.items)==null?void 0:n[o];this.isInterstitial(c)&&this.eventItemsMatch(c,this.bufferingItem)&&this.bufferedToItem(c,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const e=this.playingItem;if(!this.playingLastItem&&e){const n=this.findItemIndex(e);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(t,e){var n;const i=(n=this.schedule)==null?void 0:n.items;if(t&&i){const a=this.findItemIndex(t,e);return i[a]||null}return null}trimInPlace(t,e){if(this.isInterstitial(t)&&t.event.appendInPlace&&e.end-t.end>.25){t.event.assetList.forEach((a,o)=>{t.event.isAssetPastPlayoutLimit(o)&&this.clearAssetPlayer(a.identifier,null)});const n=t.end+.25,i=Dt.bufferInfo(this.primaryMedia,n,0);(i.end>n||(i.nextStart||0)>n)&&(this.log(`trim buffered interstitial ${Sn(t)} (was ${Sn(e)})`),this.attachPrimary(n,null,!0),this.flushFrontBuffer(n))}}itemsMatch(t,e){return!!e&&(t===e||t.event&&e.event&&this.eventItemsMatch(t,e)||!t.event&&!e.event&&this.findItemIndex(t)===this.findItemIndex(e))}eventItemsMatch(t,e){var n;return!!e&&(t===e||t.event.identifier===((n=e.event)==null?void 0:n.identifier))}findItemIndex(t,e){return t&&this.schedule?this.schedule.findItemIndex(t,e):-1}updateSchedule(t=!1){var e;const n=this.mediaSelection;n&&((e=this.schedule)==null||e.updateSchedule(n,[],t))}checkBuffer(t){var e;const n=(e=this.schedule)==null?void 0:e.items;if(!n)return;const i=Dt.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=i.len<1),this.updateBufferedPos(i.end,n,t)}updateBufferedPos(t,e,n){const i=this.schedule,a=this.bufferingItem;if(this.bufferedPos>t||!i)return;if(e.length===1&&this.itemsMatch(e[0],a)){this.bufferedPos=t;return}const o=this.playingItem,c=this.findItemIndex(o);let d=i.findItemIndexAtTime(t);if(this.bufferedPos<t){var f;const h=this.findItemIndex(a),p=Math.min(h+1,e.length-1),g=e[p];if((d===-1&&a&&t>=a.end||(f=g.event)!=null&&f.appendInPlace&&t+.01>=g.start)&&(d=p),this.isInterstitial(a)){const v=a.event;if(p-c>1&&v.appendInPlace===!1||v.assetList.length===0&&v.assetListLoader)return}if(this.bufferedPos=t,d>h&&d>c)this.bufferedToItem(g);else{const v=this.primaryDetails;this.primaryLive&&v&&t>v.edge-v.targetduration&&g.start<v.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(g)&&this.preloadAssets(g.event,0)}}else n&&o&&!this.itemsMatch(o,a)&&(d===c?this.bufferedToItem(o):d===c+1&&this.bufferedToItem(e[d]))}assetsBuffered(t,e){return t.event.assetList.length===0?!1:!t.event.assetList.some(i=>{const a=this.getAssetPlayer(i.identifier);return!(a!=null&&a.bufferedInPlaceToEnd(e))})}setBufferingItem(t){const e=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(t,e)&&n){const{items:i,events:a}=n;if(!i||!a)return e;const o=this.isInterstitial(t),c=this.getBufferingPlayer();this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos));const d=c?c.remaining:e?e.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Sn(t)}`+(e?` (${d.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(o){const f=n.findAssetIndex(t.event,this.bufferedPos);t.event.assetList.forEach((h,p)=>{const g=this.getAssetPlayer(h.identifier);g&&(p===f&&g.loadSource(),g.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(f=>f.pauseBuffering());this.hls.trigger(w.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:a.slice(0),schedule:i.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==t&&(this.bufferingItem=t);return e}bufferedToItem(t,e=0){const n=this.setBufferingItem(t);if(!this.playbackDisabled){if(this.isInterstitial(t))this.bufferedToEvent(t,e);else if(n!==null){this.bufferingAsset=null;const i=this.detachedData;i?i.mediaSource?this.attachPrimary(t.start,t,!0):this.preloadPrimary(t):this.preloadPrimary(t)}}}preloadPrimary(t){const e=this.findItemIndex(t),n=this.getPrimaryResumption(t,e);this.startLoadingPrimaryAt(n)}bufferedToEvent(t,e){const n=t.event,i=n.assetList.length===0&&!n.assetListLoader,a=n.cue.once;if(i||!a){const o=this.preloadAssets(n,e);if(o!=null&&o.interstitial.appendInPlace){const c=this.primaryMedia;c&&this.bufferAssetPlayer(o,c)}}}preloadAssets(t,e){const n=t.assetUrl,i=t.assetList.length,a=i===0&&!t.assetListLoader,o=t.cue.once;if(a){const d=t.timelineStart;if(t.appendInPlace){var c;const g=this.playingItem;!this.isInterstitial(g)&&(g==null||(c=g.nextEvent)==null?void 0:c.identifier)===t.identifier&&this.flushFrontBuffer(d+.25)}let f,h=0;if(!this.playingItem&&this.primaryLive&&(h=this.hls.startPosition,h===-1&&(h=this.hls.liveSyncPosition||0)),h&&!(t.cue.pre||t.cue.post)){const g=h-d;g>0&&(f=Math.round(g*1e3)/1e3)}if(this.log(`Load interstitial asset ${e+1}/${n?1:i} ${t}${f?` live-start: ${h} start-offset: ${f}`:""}`),n)return this.createAsset(t,0,0,d,t.duration,n);const p=this.assetListLoader.loadAssetList(t,f);p&&(t.assetListLoader=p)}else if(!o&&i){for(let f=e;f<i;f++){const h=t.assetList[f],p=this.getAssetPlayerQueueIndex(h.identifier);(p===-1||this.playerQueue[p].destroyed)&&!h.error&&this.createAssetPlayer(t,h,f)}const d=t.assetList[e];if(d){const f=this.getAssetPlayer(d.identifier);return f&&f.loadSource(),f}}return null}flushFrontBuffer(t){const e=this.requiredTracks;if(!e)return;this.log(`Removing front buffer starting at ${t}`),Object.keys(e).forEach(i=>{this.hls.trigger(w.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:i})})}getAssetPlayerQueueIndex(t){const e=this.playerQueue;for(let n=0;n<e.length;n++)if(t===e[n].assetId)return n;return-1}getAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);return this.playerQueue[e]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:e}=this;if(e){for(let n=0;n<t.length;n++)if(t[n].media===e)return t[n]}return null}createAsset(t,e,n,i,a,o){const c={parentIdentifier:t.identifier,identifier:RG(t,o,e),duration:a,startOffset:n,timelineStart:i,uri:o};return this.createAssetPlayer(t,c,e)}createAssetPlayer(t,e,n){const i=this.hls,a=i.userConfig;let o=a.videoPreference;const c=i.loadLevelObj||i.levels[i.currentLevel];(o||c)&&(o=se({},o),c.videoCodec&&(o.videoCodec=c.videoCodec),c.videoRange&&(o.allowedVideoRanges=[c.videoRange]));const d=i.audioTracks[i.audioTrack],f=i.subtitleTracks[i.subtitleTrack];let h=0;if(this.primaryLive||t.appendInPlace){const P=this.timelinePos-e.timelineStart;if(P>1){const D=e.duration;D&&P<D&&(h=P)}}const p=e.identifier,g=Qt(Qt({},a),{},{maxMaxBufferLength:Math.min(180,i.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:i.sessionId,assetPlayerId:p,abrEwmaDefaultEstimate:i.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:o,audioPreference:d||a.audioPreference,subtitlePreference:f||a.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,e.timelineStart&&(g.timelineOffset=e.timelineStart));const v=g.cmcd;v!=null&&v.sessionId&&v.contentId&&(g.cmcd=se({},v,{contentId:nc(e.uri)})),this.getAssetPlayer(p)&&this.warn(`Duplicate date range identifier ${t} and asset ${p}`);const x=new _G(this.HlsPlayerClass,g,t,e);this.playerQueue.push(x),t.assetList[n]=e;let S=!0;const E=P=>{if(P.live){var D;const I=new Error(`Interstitials MUST be VOD assets ${t}`),F={fatal:!0,type:Tt.OTHER_ERROR,details:Z.INTERSTITIAL_ASSET_ITEM_ERROR,error:I},U=((D=this.schedule)==null?void 0:D.findEventIndex(t.identifier))||-1;this.handleAssetItemError(F,t,U,n,I.message);return}const B=P.edge-P.fragmentStart,C=e.duration;(S||C===null||B>C)&&(S=!1,this.log(`Interstitial asset "${p}" duration change ${C} > ${B}`),e.duration=B,this.updateSchedule())};x.on(w.LEVEL_UPDATED,(P,{details:D})=>E(D)),x.on(w.LEVEL_PTS_UPDATED,(P,{details:D})=>E(D)),x.on(w.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const T=(P,D)=>{const B=this.getAssetPlayer(p);if(B&&D.tracks){B.off(w.BUFFER_CODECS,T),B.tracks=D.tracks;const C=this.primaryMedia;this.bufferingAsset===B.assetItem&&C&&!B.media&&this.bufferAssetPlayer(B,C)}};x.on(w.BUFFER_CODECS,T);const L=()=>{var P;const D=this.getAssetPlayer(p);if(this.log(`buffered to end of asset ${D}`),!D||!this.schedule)return;const B=this.schedule.findEventIndex(t.identifier),C=(P=this.schedule.items)==null?void 0:P[B];this.isInterstitial(C)&&this.advanceAssetBuffering(C,e)};x.on(w.BUFFERED_TO_END,L);const _=P=>()=>{if(!this.getAssetPlayer(p)||!this.schedule)return;this.shouldPlay=!0;const B=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,B,P)};return x.once(w.MEDIA_ENDED,_(n)),x.once(w.PLAYOUT_LIMIT_REACHED,_(1/0)),x.on(w.ERROR,(P,D)=>{if(!this.schedule)return;const B=this.getAssetPlayer(p);if(D.details===Z.BUFFER_STALLED_ERROR){if(B!=null&&B.appendInPlace){this.handleInPlaceStall(t);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(D,t,this.schedule.findEventIndex(t.identifier),n,`Asset player error ${D.error} ${t}`)}),x.on(w.DESTROYING,()=>{if(!this.getAssetPlayer(p)||!this.schedule)return;const D=new Error(`Asset player destroyed unexpectedly ${p}`),B={fatal:!0,type:Tt.OTHER_ERROR,details:Z.INTERSTITIAL_ASSET_ITEM_ERROR,error:D};this.handleAssetItemError(B,t,this.schedule.findEventIndex(t.identifier),n,D.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${mo(e)}`),this.hls.trigger(w.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:e,assetListIndex:n,event:t,player:x}),x}clearInterstitial(t,e){this.clearAssetPlayers(t,e),t.reset()}clearAssetPlayers(t,e){t.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,e)})}resetAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);if(e!==-1){this.log(`reset asset player "${t}" after error`);const n=this.playerQueue[e];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(t,e){const n=this.getAssetPlayerQueueIndex(t);if(n!==-1){const i=this.playerQueue[n];this.log(`clear ${i} toSegment: ${e&&Sn(e)}`),this.transferMediaFromPlayer(i,e),this.playerQueue.splice(n,1),i.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,e,n,i,a){const{interstitial:o,assetItem:c,assetId:d}=t,f=o.assetList.length,h=this.playingAsset;this.endedAsset=null,this.playingAsset=c,(!h||h.identifier!==d)&&(h&&(this.clearAssetPlayer(h.identifier,n[i]),delete h.error),this.log(`INTERSTITIAL_ASSET_STARTED ${e+1}/${f} ${mo(c)}`),this.hls.trigger(w.INTERSTITIAL_ASSET_STARTED,{asset:c,assetListIndex:e,event:o,schedule:n.slice(0),scheduleIndex:i,player:t})),this.bufferAssetPlayer(t,a)}bufferAssetPlayer(t,e){var n,i;if(!this.schedule)return;const{interstitial:a,assetItem:o}=t,c=this.schedule.findEventIndex(a.identifier),d=(n=this.schedule.items)==null?void 0:n[c];if(!d)return;t.loadSource(),this.setBufferingItem(d),this.bufferingAsset=o;const f=this.getBufferingPlayer();if(f===t)return;const h=a.appendInPlace;if(h&&f?.interstitial.appendInPlace===!1)return;const p=f?.tracks||((i=this.detachedData)==null?void 0:i.tracks)||this.requiredTracks;if(h&&o!==this.playingAsset){if(!t.tracks){this.log(`Waiting for track info before buffering ${t}`);return}if(p&&!O_(p,t.tracks)){const g=new Error(`Asset ${mo(o)} SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(p)}')`),v={fatal:!0,type:Tt.OTHER_ERROR,details:Z.INTERSTITIAL_ASSET_ITEM_ERROR,error:g},x=a.findAssetIndex(o);this.handleAssetItemError(v,a,c,x,g.message);return}}this.transferMediaTo(t,e)}handleInPlaceStall(t){const e=this.schedule,n=this.primaryMedia;if(!e||!n)return;const i=n.currentTime,a=e.findAssetIndex(t,i),o=t.assetList[a];if(o){const c=this.getAssetPlayer(o.identifier);if(c){const d=c.currentTime||i-o.timelineStart,f=c.duration-d;if(this.warn(`Stalled at ${d} of ${d+f} in ${c} ${t} (media.currentTime: ${i})`),d&&(f/n.playbackRate<.5||c.bufferedInPlaceToEnd(n))&&c.hls){const h=e.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,h,a)}}}}advanceInPlace(t){const e=this.primaryMedia;e&&e.currentTime<t&&(e.currentTime=t)}handleAssetItemError(t,e,n,i,a){if(t.details===Z.BUFFER_STALLED_ERROR)return;const o=e.assetList[i]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${o&&mo(o)} ${t.error}`),!this.schedule)return;const c=o?.identifier||"",d=this.getAssetPlayerQueueIndex(c),f=this.playerQueue[d]||null,h=this.schedule.items,p=se({},t,{fatal:!1,errorAction:Ao(!0),asset:o,assetListIndex:i,event:e,schedule:h,scheduleIndex:n,player:f});if(this.hls.trigger(w.INTERSTITIAL_ASSET_ERROR,p),!t.fatal)return;const g=this.playingAsset,v=this.bufferingAsset,x=new Error(a);if(o&&(this.clearAssetPlayer(c,null),o.error=x),!e.assetList.some(S=>!S.error))e.error=x;else for(let S=i;S<e.assetList.length;S++)this.resetAssetPlayer(e.assetList[S].identifier);this.updateSchedule(!0),e.error?this.primaryFallback(e):g&&g.identifier===c?this.advanceAfterAssetEnded(e,n,i):v&&v.identifier===c&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,v)}primaryFallback(t){const e=t.timelineStart,n=this.effectivePlayingItem;let i=this.timelinePos;if(n){this.log(`Fallback to primary from event "${t.identifier}" start: ${e} pos: ${i} playing: ${Sn(n)} error: ${t.error}`),i===-1&&(i=this.hls.startPosition);const o=this.updateItem(n,i);this.itemsMatch(n,o)&&this.clearInterstitial(t,null),t.appendInPlace&&(this.attachPrimary(e,null),this.flushFrontBuffer(e))}else if(i===-1){this.checkStart();return}if(!this.schedule)return;const a=this.schedule.findItemIndexAtTime(i);this.setSchedulePosition(a)}onAssetListLoaded(t,e){var n,i;const a=e.event,o=a.identifier,c=e.assetListResponse.ASSETS;if(!((n=this.schedule)!=null&&n.hasEvent(o)))return;const d=a.timelineStart,f=a.duration;let h=0;c.forEach((S,E)=>{const T=parseFloat(S.DURATION);this.createAsset(a,E,h,d+h,T,S.URI),h+=T}),a.duration=h,this.log(`Loaded asset-list with duration: ${h} (was: ${f}) ${a}`);const p=this.waitingItem,g=p?.event.identifier===o;this.updateSchedule();const v=(i=this.bufferingItem)==null?void 0:i.event;if(g){var x;const S=this.schedule.findEventIndex(o),E=(x=this.schedule.items)==null?void 0:x[S];if(E){if(!this.playingItem&&this.timelinePos>E.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==S){a.error=new Error(`Interstitial ${c.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${a}`),this.log(a.error.message),this.updateSchedule(!0),this.primaryFallback(a);return}this.setBufferingItem(E)}this.setSchedulePosition(S)}else if(v?.identifier===o){const S=a.assetList[0];if(S){const E=this.getAssetPlayer(S.identifier);if(v.appendInPlace){const T=this.primaryMedia;E&&T&&this.bufferAssetPlayer(E,T)}else E&&E.loadSource()}}}onError(t,e){if(this.schedule)switch(e.details){case Z.ASSET_LIST_PARSING_ERROR:case Z.ASSET_LIST_LOAD_ERROR:case Z.ASSET_LIST_LOAD_TIMEOUT:{const n=e.interstitial;n&&(this.updateSchedule(!0),this.primaryFallback(n));break}case Z.BUFFER_STALLED_ERROR:{const n=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(n)&&n.event.appendInPlace){this.handleInPlaceStall(n.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const y1=500;class OG extends By{constructor(t,e,n){super(t,e,n,"subtitle-stream-controller",yt.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(w.LEVEL_LOADED,this.onLevelLoaded,this),t.on(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(w.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(w.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(w.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(w.LEVEL_LOADED,this.onLevelLoaded,this),t.off(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(w.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(w.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(w.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,e){this.stopLoad(),this.state=ct.IDLE,this.setInterval(y1),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,e){this.tracksBuffered=[],super.onMediaDetaching(t,e)}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:n,success:i}=e;if(this.fragContextChanged(n)||(_e(n)&&(this.fragPrevious=n),this.state=ct.IDLE),!i)return;const a=this.tracksBuffered[this.currentTrackId];if(!a)return;let o;const c=n.start;for(let f=0;f<a.length;f++)if(c>=a[f].start&&c<=a[f].end){o=a[f];break}const d=n.start+n.duration;o?o.end=d:(o={start:c,end:d},a.push(o)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(t,e){const{startOffset:n,endOffset:i}=e;if(n===0&&i!==Number.POSITIVE_INFINITY){const a=i-1;if(a<=0)return;e.endOffsetSubtitles=Math.max(0,a),this.tracksBuffered.forEach(o=>{for(let c=0;c<o.length;){if(o[c].end<=a){o.shift();continue}else if(o[c].start<a)o[c].start=a;else break;c++}}),this.fragmentTracker.removeFragmentsInRange(n,a,yt.SUBTITLE)}}onError(t,e){const n=e.frag;n?.type===yt.SUBTITLE&&(e.details===Z.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==ct.STOPPED&&(this.state=ct.IDLE))}onSubtitleTracksUpdated(t,{subtitleTracks:e}){if(this.levels&&MC(this.levels,e)){this.levels=e.map(n=>new Sc(n));return}this.tracksBuffered=[],this.levels=e.map(n=>{const i=new Sc(n);return this.tracksBuffered[i.id]=[],i}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,yt.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(t,e){var n;if(this.currentTrackId=e.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const i=this.levels[this.currentTrackId];i!=null&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.state!==ct.STOPPED&&this.setInterval(y1)}onSubtitleTrackLoaded(t,e){var n;const{currentTrackId:i,levels:a}=this,{details:o,id:c}=e;if(!a){this.warn(`Subtitle tracks were reset while loading level ${c}`);return}const d=a[c];if(c>=a.length||!d)return;this.log(`Subtitle track ${c} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let f=0;if(o.live||(n=d.details)!=null&&n.live){if(o.deltaUpdateFailed)return;const p=this.mainDetails;if(!p){this.startFragRequested=!1;return}const g=p.fragments[0];if(!d.details)o.hasProgramDateTime&&p.hasProgramDateTime?(uf(o,p),f=o.fragmentStart):g&&(f=g.start,u0(o,f));else{var h;f=this.alignPlaylists(o,d.details,(h=this.levelLastLoaded)==null?void 0:h.details),f===0&&g&&(f=g.start,u0(o,f))}p&&!this.startFragRequested&&this.setStartPosition(p,f)}d.details=o,this.levelLastLoaded=d,c===i&&(this.hls.trigger(w.SUBTITLE_TRACK_UPDATED,{details:o,id:c,groupId:e.groupId}),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===ct.IDLE&&(ua(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.details=void 0)))}_handleFragmentLoadComplete(t){const{frag:e,payload:n}=t,i=e.decryptdata,a=this.hls;if(!this.fragContextChanged(e)&&n&&n.byteLength>0&&i!=null&&i.key&&i.iv&&Ro(i.method)){const o=performance.now();
vendor: 28,992 bytes, lines 211-222
211this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,My(i.method)).catch(c=>{throw a.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.FRAG_DECRYPT_ERROR,fatal:!1,error:c,reason:c.message,frag:e}),c}).then(c=>{const d=performance.now();a.trigger(w.FRAG_DECRYPTED,{frag:e,payload:c,stats:{tstart:o,tdecrypt:d}})}).catch(c=>{this.warn(`${c.name}: ${c.message}`),this.state=ct.IDLE})}}doTick(){if(!this.media){this.state=ct.IDLE;return}if(this.state===ct.IDLE){const{currentTrackId:t,levels:e}=this,n=e?.[t];if(!n||!e.length||!n.details||this.waitForLive(n))return;const{config:i}=this,a=this.getLoadPosition(),o=Dt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a,i.maxBufferHole),{end:c,len:d}=o,f=n.details,h=this.hls.maxBufferLength+f.levelTargetDuration;if(d>h)return;const p=f.fragments,g=p.length,v=f.edge;let x=null;const S=this.fragPrevious;if(c<v){const L=i.maxFragLookUpTolerance,_=c>v-L?0:L;x=ua(S,p,Math.max(p[0].start,c),_),!x&&S&&S.start<p[0].start&&(x=p[0])}else x=p[g-1];if(x=this.filterReplacedPrimary(x,n.details),!x)return;const E=x.sn-f.startSN,T=p[E-1];if(T&&T.cc===x.cc&&this.fragmentTracker.getState(T)===Ve.NOT_LOADED&&(x=T),this.fragmentTracker.getState(x)===Ve.NOT_LOADED){const L=this.mapToInitFragWhenRequired(x);L&&this.loadFragment(L,n,c)}}}loadFragment(t,e,n){_e(t)?super.loadFragment(t,e,n):this._loadInitSegment(t,e)}get mediaBufferTimeRanges(){return new kG(this.tracksBuffered[this.currentTrackId]||[])}}class kG{constructor(t){this.buffered=void 0;const e=(n,i,a)=>{if(i=i>>>0,i>a-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${a})`);return t[i][n]};this.buffered={get length(){return t.length},end(n){return e("end",n,t.length)},start(n){return e("start",n,t.length)}}}}const PG={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},XC=s=>String.fromCharCode(PG[s]||s),Tn=15,Ti=100,MG={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},NG={17:2,18:4,21:6,22:8,23:10,19:13,20:15},BG={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},FG={25:2,26:4,29:6,30:8,31:10,27:13,28:15},UG=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class jG{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const n=typeof e=="function"?e():e;Xt.log(`${this.time} [${t}] ${n}`)}}}const Xr=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].toString(16));return e};class ZC{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(t){const e=["foreground","underline","italics","background","flash"];for(let n=0;n<e.length;n++){const i=e[n];t.hasOwnProperty(i)&&(this[i]=t[i])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class $G{constructor(){this.uchar=" ",this.penState=new ZC}reset(){this.uchar=" ",this.penState.reset()}setChar(t,e){this.uchar=t,this.penState.copy(e)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class VG{constructor(t){this.chars=[],this.pos=0,this.currPenState=new ZC,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<Ti;e++)this.chars.push(new $G);this.logger=t}equals(t){for(let e=0;e<Ti;e++)if(!this.chars[e].equals(t.chars[e]))return!1;return!0}copy(t){for(let e=0;e<Ti;e++)this.chars[e].copy(t.chars[e])}isEmpty(){let t=!0;for(let e=0;e<Ti;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t}setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Ti&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Ti)}moveCursor(t){const e=this.pos+t;if(t>1)for(let n=this.pos+1;n<e+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(t){t>=144&&this.backSpace();const e=XC(t);if(this.pos>=Ti){this.logger.log(0,()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)}clearFromPos(t){let e;for(e=t;e<Ti;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let e=!0;for(let n=0;n<Ti;n++){const i=this.chars[n].uchar;i!==" "&&(e=!1),t.push(i)}return e?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)}}class zp{constructor(t){this.rows=[],this.currRow=Tn-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let e=0;e<Tn;e++)this.rows.push(new VG(t));this.logger=t}reset(){for(let t=0;t<Tn;t++)this.rows[t].clear();this.currRow=Tn-1}equals(t){let e=!0;for(let n=0;n<Tn;n++)if(!this.rows[n].equals(t.rows[n])){e=!1;break}return e}copy(t){for(let e=0;e<Tn;e++)this.rows[e].copy(t.rows[e])}isEmpty(){let t=!0;for(let e=0;e<Tn;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t),this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,()=>"pacData = "+re(t));let e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let c=0;c<Tn;c++)this.rows[c].clear();const a=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const c=o.rows[a].cueStartTime,d=this.logger.time;if(c!==null&&d!==null&&c<d)for(let f=0;f<this.nrRollUpRows;f++)this.rows[e-this.nrRollUpRows+f+1].copy(o.rows[a+f])}}this.currRow=e;const n=this.rows[this.currRow];if(t.indent!==null){const a=t.indent,o=Math.max(a-1,0);n.setCursor(t.indent),t.color=n.chars[o].penState.foreground}const i={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(i)}setBkgData(t){this.logger.log(2,()=>"bkgData = "+re(t)),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let n="",i=-1;for(let a=0;a<Tn;a++){const o=this.rows[a].getTextString();o&&(i=a+1,t?e.push("Row "+i+": '"+o+"'"):e.push(o.trim()))}return e.length>0&&(t?n="["+e.join(" | ")+"]":n=e.join(` 212`)),n}getTextAndFormat(){return this.rows}}class v1{constructor(t,e,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new zp(n),this.nonDisplayedMemory=new zp(n),this.lastOutputScreen=new zp(n),this.currRollUpRow=this.displayedMemory.rows[Tn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Tn-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,()=>"MODE="+t),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let n=0;n<t.length;n++)this.writeScreen.insertChar(t[n]);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>e+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2===1,e.italics=t>=46,e.italics)e.foreground="white";else{const n=Math.floor(t/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=i[n]}this.logger.log(2,"MIDROW: "+re(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const e=this.logger.time;e!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=e:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class x1{constructor(t,e,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=HG(),this.logger=void 0;const i=this.logger=new jG;this.channels=[null,new v1(t,e,i),new v1(t+1,n,i)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(t,e){this.logger.time=t;for(let n=0;n<e.length;n+=2){const i=e[n]&127,a=e[n+1]&127;let o=!1,c=null;if(i===0&&a===0)continue;this.logger.log(3,()=>"["+Xr([e[n],e[n+1]])+"] -> ("+Xr([i,a])+")");const d=this.cmdHistory;if(i>=16&&i<=31){if(GG(i,a,d)){vd(null,null,d),this.logger.log(3,()=>"Repeated command ("+Xr([i,a])+") is dropped");continue}vd(i,a,this.cmdHistory),o=this.parseCmd(i,a),o||(o=this.parseMidrow(i,a)),o||(o=this.parsePAC(i,a)),o||(o=this.parseBackgroundAttributes(i,a))}else vd(null,null,d);if(!o&&(c=this.parseChars(i,a),c)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(c):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!o&&!c&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Xr([i,a])+" orig: "+Xr([e[n],e[n+1]]))}}parseCmd(t,e){const n=(t===20||t===28||t===21||t===29)&&e>=32&&e<=47,i=(t===23||t===31)&&e>=33&&e<=35;if(!(n||i))return!1;const a=t===20||t===21||t===23?1:2,o=this.channels[a];return t===20||t===21||t===28||t===29?e===32?o.ccRCL():e===33?o.ccBS():e===34?o.ccAOF():e===35?o.ccAON():e===36?o.ccDER():e===37?o.ccRU(2):e===38?o.ccRU(3):e===39?o.ccRU(4):e===40?o.ccFON():e===41?o.ccRDC():e===42?o.ccTR():e===43?o.ccRTD():e===44?o.ccEDM():e===45?o.ccCR():e===46?o.ccENM():e===47&&o.ccEOC():o.ccTO(e-32),this.currentChannel=a,!0}parseMidrow(t,e){let n=0;if((t===17||t===25)&&e>=32&&e<=47){if(t===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const i=this.channels[n];return i?(i.ccMIDROW(e),this.logger.log(3,()=>"MIDROW ("+Xr([t,e])+")"),!0):!1}return!1}parsePAC(t,e){let n;const i=(t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127,a=(t===16||t===24)&&e>=64&&e<=95;if(!(i||a))return!1;const o=t<=23?1:2;e>=64&&e<=95?n=o===1?MG[t]:BG[t]:n=o===1?NG[t]:FG[t];const c=this.channels[o];return c?(c.setPAC(this.interpretPAC(n,e)),this.currentChannel=o,!0):!1}interpretPAC(t,e){let n;const i={color:null,italics:!1,indent:null,underline:!1,row:t};return e>95?n=e-96:n=e-64,i.underline=(n&1)===1,n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=Math.floor((n-16)/2)*4,i}parseChars(t,e){let n,i=null,a=null;if(t>=25?(n=2,a=t-8):(n=1,a=t),a>=17&&a<=19){let o;a===17?o=e+80:a===18?o=e+112:o=e+144,this.logger.log(2,()=>"Special char '"+XC(o)+"' in channel "+n),i=[o]}else t>=32&&t<=127&&(i=e===0?[t]:[t,e]);return i&&this.logger.log(3,()=>"Char codes = "+Xr(i).join(",")),i}parseBackgroundAttributes(t,e){const n=(t===16||t===24)&&e>=32&&e<=47,i=(t===23||t===31)&&e>=45&&e<=47;if(!(n||i))return!1;let a;const o={};t===16||t===24?(a=Math.floor((e-32)/2),o.background=UG[a],e%2===1&&(o.background=o.background+"_semi")):e===45?o.background="transparent":(o.foreground="black",e===47&&(o.underline=!0));const c=t<=23?1:2;return this.channels[c].setBkgData(o),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const e=this.channels[t];e&&e.reset()}vd(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let e=0;e<this.channels.length;e++){const n=this.channels[e];n&&n.cueSplitAtTime(t)}}}function vd(s,t,e){e.a=s,e.b=t}function GG(s,t,e){return e.a===s&&e.b===t}function HG(){return{a:null,b:null}}var Wy=(function(){if(cf!=null&&cf.VTTCue)return self.VTTCue;const s=["","lr","rl"],t=["start","middle","end","left","right"];function e(c,d){if(typeof d!="string"||!Array.isArray(c))return!1;const f=d.toLowerCase();return~c.indexOf(f)?f:!1}function n(c){return e(s,c)}function i(c){return e(t,c)}function a(c,...d){let f=1;for(;f<arguments.length;f++){const h=arguments[f];for(const p in h)c[p]=h[p]}return c}function o(c,d,f){const h=this,p={enumerable:!0};h.hasBeenReset=!1;let g="",v=!1,x=c,S=d,E=f,T=null,L="",_=!0,P="auto",D="start",B=50,C="middle",I=50,F="middle";Object.defineProperty(h,"id",a({},p,{get:function(){return g},set:function(U){g=""+U}})),Object.defineProperty(h,"pauseOnExit",a({},p,{get:function(){return v},set:function(U){v=!!U}})),Object.defineProperty(h,"startTime",a({},p,{get:function(){return x},set:function(U){if(typeof U!="number")throw new TypeError("Start time must be set to a number.");x=U,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",a({},p,{get:function(){return S},set:function(U){if(typeof U!="number")throw new TypeError("End time must be set to a number.");S=U,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",a({},p,{get:function(){return E},set:function(U){E=""+U,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",a({},p,{get:function(){return T},set:function(U){T=U,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",a({},p,{get:function(){return L},set:function(U){const z=n(U);if(z===!1)throw new SyntaxError("An invalid or illegal string was specified.");L=z,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",a({},p,{get:function(){return _},set:function(U){_=!!U,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",a({},p,{get:function(){return P},set:function(U){if(typeof U!="number"&&U!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");P=U,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",a({},p,{get:function(){return D},set:function(U){const z=i(U);if(!z)throw new SyntaxError("An invalid or illegal string was specified.");D=z,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",a({},p,{get:function(){return B},set:function(U){if(U<0||U>100)throw new Error("Position must be between 0 and 100.");B=U,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",a({},p,{get:function(){return C},set:function(U){const z=i(U);if(!z)throw new SyntaxError("An invalid or illegal string was specified.");C=z,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",a({},p,{get:function(){return I},set:function(U){if(U<0||U>100)throw new Error("Size must be between 0 and 100.");I=U,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",a({},p,{get:function(){return F},set:function(U){const z=i(U);if(!z)throw new SyntaxError("An invalid or illegal string was specified.");F=z,this.hasBeenReset=!0}})),h.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o})();class zG{decode(t,e){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function JC(s){function t(n,i,a,o){return(n|0)*3600+(i|0)*60+(a|0)+parseFloat(o||0)}const e=s.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return e?parseFloat(e[2])>59?t(e[2],e[3],0,e[4]):t(e[1],e[2],e[3],e[4]):null}class KG{constructor(){this.values=Object.create(null)}set(t,e){!this.get(t)&&e!==""&&(this.values[t]=e)}get(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,n){for(let i=0;i<n.length;++i)if(e===n[i]){this.set(t,e);break}}integer(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))}percent(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){const n=parseFloat(e);if(n>=0&&n<=100)return this.set(t,n),!0}return!1}}function tD(s,t,e,n){const i=n?s.split(n):[s];for(const a in i){if(typeof i[a]!="string")continue;const o=i[a].split(e);if(o.length!==2)continue;const c=o[0],d=o[1];t(c,d)}}const x0=new Wy(0,0,""),xd=x0.align==="middle"?"middle":"center";function qG(s,t,e){const n=s;function i(){const c=JC(s);if(c===null)throw new Error("Malformed timestamp: "+n);return s=s.replace(/^[^\sa-zA-Z-]+/,""),c}function a(c,d){const f=new KG;tD(c,function(g,v){let x;switch(g){case"region":for(let S=e.length-1;S>=0;S--)if(e[S].id===v){f.set(g,e[S].region);break}break;case"vertical":f.alt(g,v,["rl","lr"]);break;case"line":x=v.split(","),f.integer(g,x[0]),f.percent(g,x[0])&&f.set("snapToLines",!1),f.alt(g,x[0],["auto"]),x.length===2&&f.alt("lineAlign",x[1],["start",xd,"end"]);break;case"position":x=v.split(","),f.percent(g,x[0]),x.length===2&&f.alt("positionAlign",x[1],["start",xd,"end","line-left","line-right","auto"]);break;case"size":f.percent(g,v);break;case"align":f.alt(g,v,["start",xd,"end","left","right"]);break}},/:/,/\s/),d.region=f.get("region",null),d.vertical=f.get("vertical","");let h=f.get("line","auto");h==="auto"&&x0.line===-1&&(h=-1),d.line=h,d.lineAlign=f.get("lineAlign","start"),d.snapToLines=f.get("snapToLines",!0),d.size=f.get("size",100),d.align=f.get("align",xd);let p=f.get("position","auto");p==="auto"&&x0.position===50&&(p=d.align==="start"||d.align==="left"?0:d.align==="end"||d.align==="right"?100:50),d.position=p}function o(){s=s.replace(/^\s+/,"")}if(o(),t.startTime=i(),o(),s.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);s=s.slice(3),o(),t.endTime=i(),o(),a(s,t)}function eD(s){return s.replace(/<br(?: \/)?>/gi,` 213`)}class YG{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new zG,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const e=this;t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));function n(){let a=e.buffer,o=0;for(a=eD(a);o<a.length&&a[o]!=="\r"&&a[o]!==` 214`;)++o;const c=a.slice(0,o);return a[o]==="\r"&&++o,a[o]===` 215`&&++o,e.buffer=a.slice(o),c}function i(a){tD(a,function(o,c){},/:/)}try{let a="";if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=n();const c=a.match(/^()?WEBVTT([ \t].*)?$/);if(!(c!=null&&c[0]))throw new Error("Malformed WebVTT signature.");e.state="HEADER"}let o=!1;for(;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(o?o=!1:a=n(),e.state){case"HEADER":/:/.test(a)?i(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;if(e.cue=new Wy(0,0,""),e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{qG(a,e.cue,e.regionList)}catch{e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{const c=a.indexOf("-->")!==-1;if(!a||c&&(o=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(e.cue===null)continue;e.cue.text&&(e.cue.text+=` 216`),e.cue.text+=a}continue;case"BADCUE":a||(e.state="ID")}}}catch{e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||t.state==="HEADER")&&(t.buffer+=` 217 218`,t.parse()),t.state==="INITIAL"||t.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const WG=/\r\n|\n\r|\n|\r/g,Kp=function(t,e,n=0){return t.slice(n,n+e.length)===e},QG=function(t){let e=parseInt(t.slice(-3));const n=parseInt(t.slice(-6,-4)),i=parseInt(t.slice(-9,-7)),a=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!pt(e)||!pt(n)||!pt(i)||!pt(a))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return e+=1e3*n,e+=60*1e3*i,e+=3600*1e3*a,e};function Qy(s,t,e){return nc(s.toString())+nc(t.toString())+nc(e)}const XG=function(t,e,n){let i=t[e],a=t[i.prevCC];if(!a||!a.new&&i.new){t.ccOffset=t.presentationOffset=i.start,i.new=!1;return}for(;(o=a)!=null&&o.new;){var o;t.ccOffset+=i.start-a.start,i.new=!1,i=a,a=t[i.prevCC]}t.presentationOffset=n};function ZG(s,t,e,n,i,a,o){const c=new YG,d=qs(new Uint8Array(s)).trim().replace(WG,` 219`).split(` 220`),f=[],h=t?iV(t.baseTime,t.timescale):0;let p="00:00.000",g=0,v=0,x,S=!0;c.oncue=function(E){const T=e[n];let L=e.ccOffset;const _=(g-h)/9e4;if(T!=null&&T.new&&(v!==void 0?L=e.ccOffset=T.start:XG(e,n,_)),_){if(!t){x=new Error("Missing initPTS for VTT MPEGTS");return}L=_-e.presentationOffset}const P=E.endTime-E.startTime,D=js((E.startTime+L-v)*9e4,i*9e4)/9e4;E.startTime=Math.max(D,0),E.endTime=Math.max(D+P,0);const B=E.text.trim();E.text=decodeURIComponent(encodeURIComponent(B)),E.id||(E.id=Qy(E.startTime,E.endTime,B)),E.endTime>0&&f.push(E)},c.onparsingerror=function(E){x=E},c.onflush=function(){if(x){o(x);return}a(f)},d.forEach(E=>{if(S)if(Kp(E,"X-TIMESTAMP-MAP=")){S=!1,E.slice(16).split(",").forEach(T=>{Kp(T,"LOCAL:")?p=T.slice(6):Kp(T,"MPEGTS:")&&(g=parseInt(T.slice(7)))});try{v=QG(p)/1e3}catch(T){x=T}return}else E===""&&(S=!1);c.parse(E+` 221`)}),c.flush()}const qp="stpp.ttml.im1t",sD=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,nD=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,JG={left:"start",center:"center",right:"end",start:"start",end:"end"};function b1(s,t,e,n){const i=Bt(new Uint8Array(s),["mdat"]);if(i.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const a=i.map(c=>qs(c)),o=nV(t.baseTime,1,t.timescale);try{a.forEach(c=>e(tH(c,o)))}catch(c){n(c)}}function tH(s,t){const i=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},o=Object.keys(a).reduce((p,g)=>(p[g]=i.getAttribute(`ttp:${g}`)||a[g],p),{}),c=i.getAttribute("xml:space")!=="preserve",d=S1(Yp(i,"styling","style")),f=S1(Yp(i,"layout","region")),h=Yp(i,"body","[begin]");return[].map.call(h,p=>{const g=iD(p,c);if(!g||!p.hasAttribute("begin"))return null;const v=Qp(p.getAttribute("begin"),o),x=Qp(p.getAttribute("dur"),o);let S=Qp(p.getAttribute("end"),o);if(v===null)throw E1(p);if(S===null){if(x===null)throw E1(p);S=v+x}const E=new Wy(v-t,S-t,g);E.id=Qy(E.startTime,E.endTime,E.text);const T=f[p.getAttribute("region")],L=d[p.getAttribute("style")],_=eH(T,L,d),{textAlign:P}=_;if(P){const D=JG[P];D&&(E.lineAlign=D),E.align=P}return se(E,_),E}).filter(p=>p!==null)}function Yp(s,t,e){const n=s.getElementsByTagName(t)[0];return n?[].slice.call(n.querySelectorAll(e)):[]}function S1(s){return s.reduce((t,e)=>{const n=e.getAttribute("xml:id");return n&&(t[n]=e),t},{})}function iD(s,t){return[].slice.call(s.childNodes).reduce((e,n,i)=>{var a;return n.nodeName==="br"&&i?e+` 222`:(a=n.childNodes)!=null&&a.length?iD(n,t):t?e+n.textContent.trim().replace(/\s+/g," "):e+n.textContent},"")}function eH(s,t,e){const n="http://www.w3.org/ns/ttml#styling";let i=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=s!=null&&s.hasAttribute("style")?s.getAttribute("style"):null;return o&&e.hasOwnProperty(o)&&(i=e[o]),a.reduce((c,d)=>{const f=Wp(t,n,d)||Wp(s,n,d)||Wp(i,n,d);return f&&(c[d]=f),c},{})}function Wp(s,t,e){return s&&s.hasAttributeNS(t,e)?s.getAttributeNS(t,e):null}function E1(s){return new Error(`Could not parse ttml timestamp ${s}`)}function Qp(s,t){if(!s)return null;let e=JC(s);return e===null&&(sD.test(s)?e=sH(s,t):nD.test(s)&&(e=nH(s,t))),e}function sH(s,t){const e=sD.exec(s),n=(e[4]|0)+(e[5]|0)/t.subFrameRate;return(e[1]|0)*3600+(e[2]|0)*60+(e[3]|0)+n/t.frameRate}function nH(s,t){const e=nD.exec(s),n=Number(e[1]);switch(e[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}class bd{constructor(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,e,n){(this.startTime===null||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class iH{constructor(t){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=A1(),this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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}}
vendor: 3,592 bytes, line 222
222,t.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(w.FRAG_LOADING,this.onFragLoading,this),t.on(w.FRAG_LOADED,this.onFragLoaded,this),t.on(w.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(w.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(w.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(w.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(w.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(w.FRAG_LOADING,this.onFragLoading,this),t.off(w.FRAG_LOADED,this.onFragLoaded,this),t.off(w.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(w.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(w.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(w.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new bd(this,"textTrack1"),e=new bd(this,"textTrack2"),n=new bd(this,"textTrack3"),i=new bd(this,"textTrack4");this.cea608Parser1=new x1(1,t,e),this.cea608Parser2=new x1(3,n,i)}addCues(t,e,n,i,a){let o=!1;for(let c=a.length;c--;){const d=a[c],f=rH(d[0],d[1],e,n);if(f>=0&&(d[0]=Math.min(d[0],e),d[1]=Math.max(d[1],n),o=!0,f/(n-e)>.5))return}if(o||a.push([e,n]),this.config.renderTextTracksNatively){const c=this.captionsTracks[t];this.Cues.newCue(c,e,n,i)}else{const c=this.Cues.newCue(null,e,n,i);this.hls.trigger(w.CUES_PARSED,{type:"captions",cues:c,track:t})}}onInitPtsFound(t,{frag:e,id:n,initPTS:i,timescale:a,trackId:o}){const{unparsedVttFrags:c}=this;n===yt.MAIN&&(this.initPTS[e.cc]={baseTime:i,timescale:a,trackId:o}),c.length&&(this.unparsedVttFrags=[],c.forEach(d=>{this.initPTS[d.frag.cc]?this.onFragLoaded(w.FRAG_LOADED,d):this.hls.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(t,e){const{media:n}=this;if(n)for(let i=0;i<n.textTracks.length;i++){const a=n.textTracks[i];if(T1(a,{name:t,lang:e,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return a}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:e,captionsTracks:n,media:i}=this,{label:a,languageCode:o}=e[t],c=this.getExistingTrack(a,o);if(c)n[t]=c,So(n[t]),YC(n[t],i);else{const d=this.createTextTrack("captions",a,o);d&&(d[t]=!0,n[t]=d)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const e=this.captionsProperties[t];if(!e)return;const n=e.label,i={_id:t,label:n,kind:"captions",default:e.media?!!e.media.default:!1,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=i,this.hls.trigger(w.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(t,e,n){const i=this.media;if(i)return i.addTextTrack(t,e,n)}onMediaAttaching(t,e){this.media=e.media,e.mediaSource||this._cleanTracks()}onMediaDetaching(t,e){const n=!!e.transferMedia;if(this.media=null,n)return;const{captionsTracks:i}=this;
vendor: 23,598 bytes, line 222
222Object.keys(i).forEach(a=>{So(i[a]),delete i[a]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=A1(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let n=0;n<e.length;n++)So(e[n])}onSubtitleTracksUpdated(t,e){const n=e.subtitleTracks||[],i=n.some(a=>a.textCodec===qp);if(this.config.enableWebVTT||i&&this.config.enableIMSC1){if(MC(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const o=this.media,c=o?$d(o.textTracks):null;if(this.tracks.forEach((d,f)=>{let h;if(c){let p=null;for(let g=0;g<c.length;g++)if(c[g]&&T1(c[g],d)){p=c[g],c[g]=null;break}p&&(h=p)}if(h)So(h);else{const p=rD(d);h=this.createTextTrack(p,d.name,d.lang),h&&(h.mode="disabled")}h&&this.textTracks.push(h)}),c!=null&&c.length){const d=c.filter(f=>f!==null).map(f=>f.label);d.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${d.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const o=this.tracks.map(c=>({label:c.name,kind:c.type.toLowerCase(),default:c.default,subtitleTrack:c}));this.hls.trigger(w.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}onManifestLoaded(t,e){this.config.enableCEA708Captions&&e.captions&&e.captions.forEach(n=>{const i=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!i)return;const a=`textTrack${i[1]}`,o=this.captionsProperties[a];o&&(o.label=n.name,n.lang&&(o.languageCode=n.lang),o.media=n)})}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return e?.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,e){if(this.enabled&&e.frag.type===yt.MAIN){var n,i;const{cea608Parser1:a,cea608Parser2:o,lastSn:c}=this,{cc:d,sn:f}=e.frag,h=(n=(i=e.part)==null?void 0:i.index)!=null?n:-1;a&&o&&(f!==c+1||f===c&&h!==this.lastPartIndex+1||d!==this.lastCc)&&(a.reset(),o.reset()),this.lastCc=d,this.lastSn=f,this.lastPartIndex=h}}onFragLoaded(t,e){const{frag:n,payload:i}=e;if(n.type===yt.SUBTITLE)if(i.byteLength){const a=n.decryptdata,o="stats"in e;if(a==null||!a.encrypted||o){const c=this.tracks[n.level],d=this.vttCCs;d[n.cc]||(d[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),c&&c.textCodec===qp?this._parseIMSC1(n,i):this._parseVTTs(e)}}else this.hls.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const n=this.hls;b1(e,this.initPTS[t.cc],i=>{this._appendCues(i,t.level),n.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},i=>{n.logger.log(`Failed to parse IMSC1: ${i}`),n.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:i})})}_parseVTTs(t){var e;const{frag:n,payload:i}=t,{initPTS:a,unparsedVttFrags:o}=this,c=a.length-1;if(!a[n.cc]&&c===-1){o.push(t);return}const d=this.hls,f=(e=n.initSegment)!=null&&e.data?hn(n.initSegment.data,new Uint8Array(i)).buffer:i;ZG(f,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,h=>{this._appendCues(h,n.level),d.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},h=>{const p=h.message==="Missing initPTS for VTT MPEGTS";p?o.push(t):this._fallbackToIMSC1(n,i),d.logger.log(`Failed to parse VTT cue: ${h}`),!(p&&c>n.cc)&&d.trigger(w.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:h})})}_fallbackToIMSC1(t,e){const n=this.tracks[t.level];n.textCodec||b1(e,this.initPTS[t.cc],()=>{n.textCodec=qp,this._parseIMSC1(t,e)},()=>{n.textCodec="wvtt"})}_appendCues(t,e){const n=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[e];if(!i||i.mode==="disabled")return;t.forEach(a=>WC(i,a))}else{const i=this.tracks[e];if(!i)return;const a=i.default?"default":"subtitles"+e;n.trigger(w.CUES_PARSED,{type:"subtitles",cues:t,track:a})}}onFragDecrypted(t,e){const{frag:n}=e;n.type===yt.SUBTITLE&&this.onFragLoaded(w.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:i}=e;if(!(n.type===yt.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let a=0;a<i.length;a++){const o=i[a].bytes;if(o){this.cea608Parser1||this.initCea608Parsers();const c=this.extractCea608Data(o);this.cea608Parser1.addData(i[a].pts,c[0]),this.cea608Parser2.addData(i[a].pts,c[1])}}}onBufferFlushing(t,{startOffset:e,endOffset:n,endOffsetSubtitles:i,type:a}){const{media:o}=this;if(!(!o||o.currentTime<n)){if(!a||a==="video"){const{captionsTracks:c}=this;Object.keys(c).forEach(d=>v0(c[d],e,n))}if(this.config.renderTextTracksNatively&&e===0&&i!==void 0){const{textTracks:c}=this;Object.keys(c).forEach(d=>v0(c[d],e,i))}}}extractCea608Data(t){const e=[[],[]],n=t[0]&31;let i=2;for(let a=0;a<n;a++){const o=t[i++],c=127&t[i++],d=127&t[i++];if(c===0&&d===0)continue;if((4&o)!==0){const h=3&o;(h===0||h===1)&&(e[h].push(c),e[h].push(d))}}return e}}function rD(s){return s.characteristics&&/transcribes-spoken-dialog/gi.test(s.characteristics)&&/describes-music-and-sound/gi.test(s.characteristics)?"captions":"subtitles"}function T1(s,t){return!!s&&s.kind===rD(t)&&m0(t,s)}function rH(s,t,e,n){return Math.min(t,n)-Math.max(s,e)}function A1(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const aH=/\s/,oH={newCue(s,t,e,n){const i=[];let a,o,c,d,f;const h=self.VTTCue||self.TextTrackCue;for(let g=0;g<n.rows.length;g++)if(a=n.rows[g],c=!0,d=0,f="",!a.isEmpty()){var p;for(let S=0;S<a.chars.length;S++)aH.test(a.chars[S].uchar)&&c?d++:(f+=a.chars[S].uchar,c=!1);a.cueStartTime=t,t===e&&(e+=1e-4),d>=16?d--:d++;const v=eD(f.trim()),x=Qy(t,e,v);s!=null&&(p=s.cues)!=null&&p.getCueById(x)||(o=new h(t,e,v),o.id=x,o.line=g+1,o.align="left",o.position=10+Math.min(80,Math.floor(d*8/32)*10),i.push(o))}return s&&i.length&&(i.sort((g,v)=>g.line==="auto"||v.line==="auto"?0:g.line>8&&v.line>8?v.line-g.line:g.line-v.line),i.forEach(g=>WC(s,g))),i}};function lH(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const cH=/(\d+)-(\d+)\/(\d+)/;class R1{constructor(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||hH,this.controller=new self.AbortController,this.stats=new _y}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,n){const i=this.stats;if(i.loading.start)throw new Error("Loader can only be used once.");i.loading.start=self.performance.now();const a=uH(t,this.controller.signal),o=t.responseType==="arraybuffer",c=o?"byteLength":"length",{maxTimeToFirstByteMs:d,maxLoadTimeMs:f}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=n,this.request=this.fetchSetup(t,a),self.clearTimeout(this.requestTimeout),e.timeout=d&&pt(d)?d:f,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,t,this.response))},e.timeout),(Ac(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(p=>{var g;this.response=this.loader=p;const v=Math.max(self.performance.now(),i.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=f,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(i,t,this.response))},f-(v-i.loading.start)),!p.ok){const{status:S,statusText:E}=p;throw new mH(E||"fetch, bad network response",S,p)}i.loading.first=v,i.total=fH(p.headers)||i.total;const x=(g=this.callbacks)==null?void 0:g.onProgress;return x&&pt(e.highWaterMark)?this.loadProgressively(p,i,t,e.highWaterMark,x):o?p.arrayBuffer():t.responseType==="json"?p.json():p.text()}).then(p=>{var g,v;const x=this.response;if(!x)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),i.loading.end=Math.max(self.performance.now(),i.loading.first);const S=p[c];S&&(i.loaded=i.total=S);const E={url:x.url,data:p,code:x.status},T=(g=this.callbacks)==null?void 0:g.onProgress;T&&!pt(e.highWaterMark)&&T(i,t,p,x),(v=this.callbacks)==null||v.onSuccess(E,i,t,x)}).catch(p=>{var g;if(self.clearTimeout(this.requestTimeout),i.aborted)return;const v=p&&p.code||0,x=p?p.message:null;(g=this.callbacks)==null||g.onError({code:v,text:x},t,p?p.details:null,i)})}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,e,n,i=0,a){const o=new pC,c=t.body.getReader(),d=()=>c.read().then(f=>{if(f.done)return o.dataLength&&a(e,n,o.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const h=f.value,p=h.length;return e.loaded+=p,p<i||o.dataLength?(o.push(h),o.dataLength>=i&&a(e,n,o.flush().buffer,t)):a(e,n,h.buffer,t),d()}).catch(()=>Promise.reject());return d()}}function uH(s,t){const e={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(se({},s.headers))};return s.rangeEnd&&e.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),e}function dH(s){const t=cH.exec(s);if(t)return parseInt(t[2])-parseInt(t[1])+1}function fH(s){const t=s.get("Content-Range");if(t){const n=dH(t);if(pt(n))return n}const e=s.get("Content-Length");if(e)return parseInt(e)}function hH(s,t){return new self.Request(s.url,t)}class mH extends Error{constructor(t,e,n){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=n}}const pH=/^age:\s*[\d.]+\s*$/im;class aD{constructor(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new _y,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,t.readyState!==4&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),(t=this.callbacks)!=null&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t||!e)return;const n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0,i.aborted=!1;const a=this.xhrSetup;a?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return a(n,e.url)}).catch(o=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",e.url,!0),a(n,e.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,e,t)}).catch(o=>{var c;(c=this.callbacks)==null||c.onError({code:n.status,text:o.message},e,n,i)}):this.openAndSendXhr(n,e,t)}openAndSendXhr(t,e,n){t.readyState||t.open("GET",e.url,!0);const i=e.headers,{maxTimeToFirstByteMs:a,maxLoadTimeMs:o}=n.loadPolicy;if(i)for(const c in i)t.setRequestHeader(c,i[c]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),n.timeout=a&&pt(a)?a:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:n}=this;if(!t||!e)return;const i=e.readyState,a=this.config;if(!n.aborted&&i>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),a.timeout!==a.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),a.timeout=a.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),i===4)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const f=e.status,h=e.responseType==="text"?e.responseText:null;if(f>=200&&f<300){const x=h??e.response;if(x!=null){var o,c;n.loading.end=Math.max(self.performance.now(),n.loading.first);const S=e.responseType==="arraybuffer"?x.byteLength:x.length;n.loaded=n.total=S,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const E=(o=this.callbacks)==null?void 0:o.onProgress;E&&E(n,t,x,e);const T={url:e.responseURL,data:x,code:f};(c=this.callbacks)==null||c.onSuccess(T,n,t,e);return}}const p=a.loadPolicy.errorRetry,g=n.retry,v={url:t.url,data:void 0,code:f};if(of(p,g,!1,v))this.retry(p);else{var d;Xt.error(`${f} while loading ${t.url}`),(d=this.callbacks)==null||d.onError({code:f,text:e.statusText},t,e,n)}}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry,e=this.stats.retry;if(of(t,e,!0))this.retry(t);else{var n;Xt.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:n}=this;this.retryDelay=Oy(t,n.retry),n.retry++,Xt.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${e?.url}, retrying ${n.retry}/${t.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&pH.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const gH={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},yH=Qt(Qt({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:aD,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:C$,bufferController:xV,capLevelController:Ky,errorController:P$,fpsController:bG,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:iC,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:gH},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},vH()),{},{subtitleStreamController:OG,subtitleTrackController:TG,timelineController:iH,audioStreamController:pV,audioTrackController:gV,emeController:wo,cmcdController:gG,contentSteeringController:vG,interstitialsController:IG});function vH(){return{cueHandler:oH,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function xH(s,t,e){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=b0(s),i=["manifest","level","frag"],a=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return i.forEach(o=>{const c=`${o==="level"?"playlist":o}LoadPolicy`,d=t[c]===void 0,f=[];a.forEach(h=>{const p=`${o}Loading${h}`,g=t[p];if(g!==void 0&&d){f.push(p);const v=n[c].default;switch(t[c]={default:v},h){case"TimeOut":v.maxLoadTimeMs=g,v.maxTimeToFirstByteMs=g;break;case"MaxRetry":v.errorRetry.maxNumRetry=g,v.timeoutRetry.maxNumRetry=g;break;case"RetryDelay":v.errorRetry.retryDelayMs=g,v.timeoutRetry.retryDelayMs=g;break;case"MaxRetryTimeout":v.errorRetry.maxRetryDelayMs=g,v.timeoutRetry.maxRetryDelayMs=g;break}}}),f.length&&e.warn(`hls.js config: "${f.join('", "')}" setting(s) are deprecated, use "${c}": ${re(t[c])}`)}),Qt(Qt({},n),t)}function b0(s){return s&&typeof s=="object"?Array.isArray(s)?s.map(b0):Object.keys(s).reduce((t,e)=>(t[e]=b0(s[e]),t),{}):s}function bH(s,t){const e=s.loader;e!==R1&&e!==aD?(t.log("[config]: Custom loader detected, cannot enable progressive streaming"),s.progressive=!1):lH()&&(s.loader=R1,s.progressive=!0,s.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Vd=2,SH=.1,EH=.05,TH=100;class AH extends J_{constructor(t,e){super("gap-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(w.MEDIA_ENDED,{stalled:!1})}},this.hls=t,this.fragmentTracker=e,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,e){this.setInterval(TH),this.mediaSource=e.mediaSource;const n=this.media=e.media;ms(n,"playing",this.onMediaPlaying),ms(n,"waiting",this.onMediaWaiting),ms(n,"ended",this.onMediaEnded)}onMediaDetaching(t,e){this.clearInterval();const{media:n}=this;n&&(_s(n,"playing",this.onMediaPlaying),_s(n,"waiting",this.onMediaWaiting),_s(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,e){this.buffered=e.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(!((t=this.media)!=null&&t.readyState)||!this.hasBuffered)return;const e=this.media.currentTime;this.poll(e,this.lastCurrentTime),this.lastCurrentTime=e}poll(t,e){var n,i;const a=(n=this.hls)==null?void 0:n.config;if(!a)return;const o=this.media;if(!o)return;const{seeking:c}=o,d=this.seeking&&!c,f=!this.seeking&&c,h=o.paused&&!c||o.ended||o.playbackRate===0;if(this.seeking=c,t!==e){e&&(this.ended=0),this.moved=!0,c||(this.nudgeRetry=0,a.nudgeOnVideoHole&&!h&&t>e&&this.nudgeOnVideoHole(t,e)),this.waiting===0&&this.stallResolved(t);return}if(f||d){d&&this.stallResolved(t);return}if(h){this.nudgeRetry=0,this.stallResolved(t),!this.ended&&o.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(w.MEDIA_ENDED,{stalled:!1}));return}if(!Dt.getBuffered(o).length){this.nudgeRetry=0;return}const p=Dt.bufferInfo(o,t,0),g=p.nextStart||0,v=this.fragmentTracker;if(c&&v&&this.hls){const B=w1(this.hls.inFlightFragments,t),C=p.len>Vd,I=!g||B||g-t>Vd&&!v.getPartialFragment(t);if(C||I)return;this.moved=!1}const x=(i=this.hls)==null?void 0:i.latestLevelDetails;if(!this.moved&&this.stalled!==null&&v){if(!(p.len>0)&&!g)return;
vendor: 23,006 bytes, line 222
222const C=Math.max(g,p.start||0)-t,F=!!(x!=null&&x.live)?x.targetduration*2:Vd,U=Sd(t,v);if(C>0&&(C<=F||U)){o.paused||this._trySkipBufferHole(U);return}}const S=a.detectStallWithCurrentTimeMs,E=self.performance.now(),T=this.waiting;let L=this.stalled;if(L===null)if(T>0&&E-T<S)L=this.stalled=T;else{this.stalled=E;return}const _=E-L;if(!c&&(_>=S||T)&&this.hls){var P;if(((P=this.mediaSource)==null?void 0:P.readyState)==="ended"&&!(x!=null&&x.live)&&Math.abs(t-(x?.edge||0))<1){if(this.ended)return;this.ended=t||1,this.hls.trigger(w.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(p),!this.media||!this.hls)return}const D=Dt.bufferInfo(o,t,a.maxBufferHole);this._tryFixBufferStall(D,_,t)}stallResolved(t){const e=this.stalled;if(e&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-e;this.log(`playback not stuck anymore @${t}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(w.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,e){var n;const i=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&i&&i.length>1&&t>i.end(0)){const a=Dt.bufferedInfo(Dt.timeRangesToArray(this.buffered.audio),t,0);if(a.len>1&&e>=a.start){const o=Dt.timeRangesToArray(i),c=Dt.bufferedInfo(o,e,0).bufferedIndex;if(c>-1&&c<o.length-1){const d=Dt.bufferedInfo(o,t,0).bufferedIndex,f=o[c].end,h=o[c+1].start;if((d===-1||d>c)&&h-f<1&&t-f<2){const p=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${f} -> ${h} buffered index: ${d}`);this.warn(p.message),this.media.currentTime+=1e-6;let g=Sd(t,this.fragmentTracker);g&&"fragment"in g?g=g.fragment:g||(g=void 0);const v=Dt.bufferInfo(this.media,t,0);this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:p,reason:p.message,frag:g,buffer:v.len,bufferInfo:v})}}}}}_tryFixBufferStall(t,e,n){var i,a;const{fragmentTracker:o,media:c}=this,d=(i=this.hls)==null?void 0:i.config;if(!c||!o||!d)return;const f=(a=this.hls)==null?void 0:a.latestLevelDetails,h=Sd(n,o);if((h||f!=null&&f.live&&n<f.fragmentStart)&&(this._trySkipBufferHole(h)||!this.media))return;const p=t.buffered,g=this.adjacentTraversal(t,n);(p&&p.length>1&&t.len>d.maxBufferHole||t.nextStart&&(t.nextStart-n<d.maxBufferHole||g))&&(e>d.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}adjacentTraversal(t,e){const n=this.fragmentTracker,i=t.nextStart;if(n&&i){const a=n.getFragAtPos(e,yt.MAIN),o=n.getFragAtPos(i,yt.MAIN);if(a&&o)return o.sn-a.sn<2}return!1}_reportStall(t){const{hls:e,media:n,stallReported:i,stalled:a}=this;if(!i&&a!==null&&n&&e){this.stallReported=!0;const o=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${re(t)})`);this.warn(o.message),e.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_STALLED_ERROR,fatal:!1,error:o,buffer:t.len,bufferInfo:t,stalled:{start:a}})}}_trySkipBufferHole(t){var e;const{fragmentTracker:n,media:i}=this,a=(e=this.hls)==null?void 0:e.config;if(!i||!n||!a)return 0;const o=i.currentTime,c=Dt.bufferInfo(i,o,0),d=o<c.start?c.start:c.nextStart;if(d&&this.hls){const h=c.len<=a.maxBufferHole,p=c.len>0&&c.len<1&&i.readyState<3,g=d-o;if(g>0&&(h||p)){if(g>a.maxBufferHole){let x=!1;if(o===0){const S=n.getAppendedFrag(0,yt.MAIN);S&&d<S.end&&(x=!0)}if(!x&&t){var f;if(!((f=this.hls.loadLevelObj)!=null&&f.details)||w1(this.hls.inFlightFragments,d))return 0;let E=!1,T=t.end;for(;T<d;){const L=Sd(T,n);if(L)T+=L.duration;else{E=!0;break}}if(E)return 0}}const v=Math.max(d+EH,o+SH);if(this.warn(`skipping hole, adjusting currentTime from ${o} to ${v}`),this.moved=!0,i.currentTime=v,!(t!=null&&t.gap)){const x=new Error(`fragment loaded with buffer holes, seeking from ${o} to ${v}`),S={type:Tt.MEDIA_ERROR,details:Z.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:x,reason:x.message,buffer:c.len,bufferInfo:c};t&&("fragment"in t?S.part=t:S.frag=t),this.hls.trigger(w.ERROR,S)}return v}}return 0}_tryNudgeBuffer(t){const{hls:e,media:n,nudgeRetry:i}=this,a=e?.config;if(!n||!a)return 0;const o=n.currentTime;if(this.nudgeRetry++,i<a.nudgeMaxRetry){const c=o+(i+1)*a.nudgeOffset,d=new Error(`Nudging 'currentTime' from ${o} to ${c}`);this.warn(d.message),n.currentTime=c,e.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_NUDGE_ON_STALL,error:d,fatal:!1,buffer:t.len,bufferInfo:t})}else{const c=new Error(`Playhead still not moving while enough data buffered @${o} after ${a.nudgeMaxRetry} nudges`);this.error(c.message),e.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.BUFFER_STALLED_ERROR,error:c,fatal:!0,buffer:t.len,bufferInfo:t})}}}function w1(s,t){const e=L1(s.main);if(e&&e.start<=t)return e;const n=L1(s.audio);return n&&n.start<=t?n:null}function L1(s){if(!s)return null;switch(s.state){case ct.IDLE:case ct.STOPPED:case ct.ENDED:case ct.ERROR:return null}return s.frag}function Sd(s,t){return t.getAppendedFrag(s,yt.MAIN)||t.getPartialFragment(s)}const RH=.25;function S0(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Xp(s,t,e,n,i){let a=new s(t,e,"");try{a.value=n,i&&(a.type=i)}catch{a=new s(t,e,re(i?Qt({type:i},n):n))}return a}const Ed=(()=>{const s=S0();try{s&&new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class wH{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(w.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t&&(t.on(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(w.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:t}=this;t&&(t.off(w.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(w.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(t,e){var n;this.media=e.media,((n=e.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var t;const e=(t=this.hls)==null?void 0:t.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(t,e){this.media=null,!e.transferMedia&&(this.id3Track&&(this.removeCues&&So(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const e=this.getID3Track(t.textTracks);return e.mode="hidden",e}getID3Track(t){if(this.media){for(let e=0;e<t.length;e++){const n=t[e];if(n.kind==="metadata"&&n.label==="id3")return YC(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,e){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:n,enableID3MetadataCues:i}=this.hls.config;if(!n&&!i)return;const{samples:a}=e;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=S0();if(o)for(let c=0;c<a.length;c++){const d=a[c].type;if(d===Hs.emsg&&!n||!i)continue;const f=EC(a[c].data),h=a[c].pts;let p=h+a[c].duration;p>Ed&&(p=Ed),p-h<=0&&(p=h+RH);for(let v=0;v<f.length;v++){const x=f[v];if(!TC(x)){this.updateId3CueEnds(h,d);const S=Xp(o,h,p,x,d);S&&this.id3Track.addCue(S)}}}}updateId3CueEnds(t,e){var n;const i=(n=this.id3Track)==null?void 0:n.cues;if(i)for(let a=i.length;a--;){const o=i[a];o.type===e&&o.startTime<t&&o.endTime===Ed&&(o.endTime=t)}}onBufferFlushing(t,{startOffset:e,endOffset:n,type:i}){const{id3Track:a,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:c,enableID3MetadataCues:d}}=o;if(a&&(c||d)){let f;i==="audio"?f=h=>h.type===Hs.audioId3&&d:i==="video"?f=h=>h.type===Hs.emsg&&c:f=h=>h.type===Hs.audioId3&&d||h.type===Hs.emsg&&c,v0(a,e,n,f)}}onLevelUpdated(t,{details:e}){this.updateDateRangeCues(e,!0)}onLevelPtsUpdated(t,e){Math.abs(e.drift)>.01&&this.updateDateRangeCues(e.details)}updateDateRangeCues(t,e){if(!this.hls||!this.media)return;const{assetPlayerId:n,timelineOffset:i,enableDateRangeMetadataCues:a,interstitialsController:o}=this.hls.config;if(!a)return;const c=S0();if(n&&i&&!o){const{fragmentStart:S,fragmentEnd:E}=t;let T=this.assetCue;T?(T.startTime=S,T.endTime=E):c&&(T=this.assetCue=Xp(c,S,E,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),T&&(T.id=n,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(T),T.addEventListener("enter",this.onEventCueEnter)))}if(!t.hasProgramDateTime)return;const{id3Track:d}=this,{dateRanges:f}=t,h=Object.keys(f);let p=this.dateRangeCuesAppended;if(d&&e){var g;if((g=d.cues)!=null&&g.length){const S=Object.keys(p).filter(E=>!h.includes(E));for(let E=S.length;E--;){var v;const T=S[E],L=(v=p[T])==null?void 0:v.cues;delete p[T],L&&Object.keys(L).forEach(_=>{const P=L[_];if(P){P.removeEventListener("enter",this.onEventCueEnter);try{d.removeCue(P)}catch{}}})}}else p=this.dateRangeCuesAppended={}}const x=t.fragments[t.fragments.length-1];if(!(h.length===0||!pt(x?.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let S=0;S<h.length;S++){const E=h[S],T=f[E],L=T.startTime,_=p[E],P=_?.cues||{};let D=_?.durationKnown||!1,B=Ed;const{duration:C,endDate:I}=T;if(I&&C!==null)B=L+C,D=!0;else if(T.endOnNext&&!D){const U=h.reduce((z,Y)=>{if(Y!==T.id){const nt=f[Y];if(nt.class===T.class&&nt.startDate>T.startDate&&(!z||T.startDate<z.startDate))return nt}return z},null);U&&(B=U.startTime,D=!0)}const F=Object.keys(T.attr);for(let U=0;U<F.length;U++){const z=F[U];if(!q$(z))continue;const Y=P[z];if(Y)D&&!(_!=null&&_.durationKnown)?Y.endTime=B:Math.abs(Y.startTime-L)>.01&&(Y.startTime=L,Y.endTime=B);else if(c){let nt=T.attr[z];Y$(z)&&(nt=k_(nt));const rt=Xp(c,L,B,{key:z,data:nt},Hs.dateRange);rt&&(rt.id=E,this.id3Track.addCue(rt),P[z]=rt,o&&(z==="X-ASSET-LIST"||z==="X-ASSET-URL")&&rt.addEventListener("enter",this.onEventCueEnter))}}p[E]={cues:P,dateRange:T,durationKnown:D}}}}}class LH{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:e}=this,n=this.levelDetails;if(!e||!n)return;this.currentTime=e.currentTime;const i=this.computeLatency();if(i===null)return;this._latency=i;const{lowLatencyMode:a,maxLiveSyncPlaybackRate:o}=this.config;if(!a||o===1||!n.live)return;const c=this.targetLatency;if(c===null)return;const d=i-c,f=Math.min(this.maxLatency,c+n.targetduration);if(d<f&&d>.05&&this.forwardBufferLength>1){const p=Math.min(2,Math.max(1,o)),g=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20,v=Math.min(p,Math.max(1,g));this.changeMediaPlaybackRate(e,v)}else e.playbackRate!==1&&e.playbackRate!==0&&this.changeMediaPlaybackRate(e,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return((t=this.hls)==null?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(t.liveMaxLatencyDuration!==void 0)return t.liveMaxLatencyDuration;const e=this.levelDetails;return e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const t=this.levelDetails;if(t===null||this.hls===null)return null;const{holdBack:e,partHoldBack:n,targetduration:i}=t,{liveSyncDuration:a,liveSyncDurationCount:o,lowLatencyMode:c}=this.config,d=this.hls.userConfig;let f=c&&n||e;(this._targetLatencyUpdated||d.liveSyncDuration||d.liveSyncDurationCount||f===0)&&(f=a!==void 0?a:o*i);const h=i;return f+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,h)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency;if(t===null||e===null)return null;const n=this.levelDetails;if(n===null)return null;const i=n.edge,a=t-e-this.edgeStalled,o=i-n.totalduration,c=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,a),c)}get drift(){const t=this.levelDetails;return t===null?1:t.drift}get edgeStalled(){const t=this.levelDetails;if(t===null)return 0;const e=(this.config.lowLatencyMode&&t.partTarget||t.targetduration)*3;return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t}=this,e=this.levelDetails;if(!t||!e)return 0;const n=t.buffered.length;return(n?t.buffered.end(n-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(w.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(w.ERROR,this.onError,this))}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:e}){e.advanced&&this.onTimeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,e){var n;e.details===Z.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,e){var n,i;t.playbackRate!==e&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(i=this.targetLatency)==null?void 0:i.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${e}`),t.playbackRate=e)}estimateLiveEdge(){const t=this.levelDetails;return t===null?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return t===null?null:t-this.currentTime}}class _H extends zy{constructor(t,e){super(t,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(w.LEVEL_LOADED,this.onLevelLoaded,this),t.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(w.FRAG_BUFFERED,this.onFragBuffered,this),t.on(w.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(w.LEVEL_LOADED,this.onLevelLoaded,this),t.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(w.FRAG_BUFFERED,this.onFragBuffered,this),t.off(w.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(t,e){this.resetLevels()}onManifestLoaded(t,e){const n=this.hls.config.preferManagedMediaSource,i=[],a={},o={};let c=!1,d=!1,f=!1;e.levels.forEach(h=>{const p=h.attrs;let{audioCodec:g,videoCodec:v}=h;g&&(h.audioCodec=g=sf(g,n)||void 0),v&&(v=h.videoCodec=u$(v));const{width:x,height:S,unknownCodecs:E}=h,T=E?.length||0;if(c||(c=!!(x&&S)),d||(d=!!v),f||(f=!!g),T||g&&!this.isAudioSupported(g)||v&&!this.isVideoSupported(v)){this.log(`Some or all CODECS not supported "${p.CODECS}"`);return}const{CODECS:L,"FRAME-RATE":_,"HDCP-LEVEL":P,"PATHWAY-ID":D,RESOLUTION:B,"VIDEO-RANGE":C}=p,F=`${`${D||"."}-`}${h.bitrate}-${B}-${_}-${L}-${C}-${P}`;if(a[F])if(a[F].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const U=o[F]+=1;h.attrs["PATHWAY-ID"]=new Array(U+1).join(".");const z=this.createLevel(h);a[F]=z,i.push(z)}else a[F].addGroupId("audio",p.AUDIO),a[F].addGroupId("text",p.SUBTITLES);else{const U=this.createLevel(h);a[F]=U,o[F]=1,i.push(U)}}),this.filterAndSortMediaOptions(i,e,c,d,f)}createLevel(t){const e=new Sc(t),n=t.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const i=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(i.message),e.supportedResult=z_(i,[])}return e}isAudioSupported(t){return xc(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return xc(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,e,n,i,a){var o;let c=[],d=[],f=t;const h=((o=e.stats)==null?void 0:o.parsing)||{};if((n||i)&&a&&(f=f.filter(({videoCodec:L,videoRange:_,width:P,height:D})=>(!!L||!!(P&&D))&&b$(_))),f.length===0){Promise.resolve().then(()=>{if(this.hls){let L="no level with compatible codecs found in manifest",_=L;e.levels.length&&(_=`one or more CODECS in variant not supported: ${re(e.levels.map(D=>D.attrs.CODECS).filter((D,B,C)=>C.indexOf(D)===B))}`,this.warn(_),L+=` (${_})`);const P=new Error(L);this.hls.trigger(w.ERROR,{type:Tt.MEDIA_ERROR,details:Z.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:P,reason:_})}}),h.end=performance.now();return}e.audioTracks&&(c=e.audioTracks.filter(L=>!L.audioCodec||this.isAudioSupported(L.audioCodec)),_1(c)),e.subtitles&&(d=e.subtitles,_1(d));const p=f.slice(0);f.sort((L,_)=>{if(L.attrs["HDCP-LEVEL"]!==_.attrs["HDCP-LEVEL"])return(L.attrs["HDCP-LEVEL"]||"")>(_.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&L.height!==_.height)return L.height-_.height;if(L.frameRate!==_.frameRate)return L.frameRate-_.frameRate;if(L.videoRange!==_.videoRange)return nf.indexOf(L.videoRange)-nf.indexOf(_.videoRange);if(L.videoCodec!==_.videoCodec){const P=xA(L.videoCodec),D=xA(_.videoCodec);if(P!==D)return D-P}if(L.uri===_.uri&&L.codecSet!==_.codecSet){const P=ef(L.codecSet),D=ef(_.codecSet);if(P!==D)return D-P}return L.averageBitrate!==_.averageBitrate?L.averageBitrate-_.averageBitrate:0});let g=p[0];if(this.steering&&(f=this.steering.filterParsedLevels(f),f.length!==p.length)){for(let L=0;L<p.length;L++)if(p[L].pathwayId===f[0].pathwayId){g=p[L];break}}this._levels=f;for(let L=0;L<f.length;L++)if(f[L]===g){var v;this._firstLevel=L;const _=g.bitrate,P=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${f.length} level(s) found, first bitrate: ${_}`),((v=this.hls.userConfig)==null?void 0:v.abrEwmaDefaultEstimate)===void 0){const D=Math.min(_,this.hls.config.abrEwmaDefaultEstimateMax);D>P&&P===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=D)}break}const x=a&&!i,S=this.hls.config,E=!!(S.audioStreamController&&S.audioTrackController),T={levels:f,audioTracks:c,subtitleTracks:d,sessionData:e.sessionData,sessionKeys:e.sessionKeys,firstLevel:this._firstLevel,stats:e.stats,audio:a,video:i,altAudio:E&&!x&&c.some(L=>!!L.url)};h.end=performance.now(),this.hls.trigger(w.MANIFEST_PARSED,T)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(e.length===0)return;if(t<0||t>=e.length){const h=new Error("invalid level idx"),p=t<0;if(this.hls.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.LEVEL_SWITCH_ERROR,level:t,fatal:p,error:h,reason:h.message}),p)return;t=Math.min(t,e.length-1)}const n=this.currentLevelIndex,i=this.currentLevel,a=i?i.attrs["PATHWAY-ID"]:void 0,o=e[t],c=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=o,n===t&&i&&a===c)return;this.log(`Switching to level ${t} (${o.height?o.height+"p ":""}${o.videoRange?o.videoRange+" ":""}${o.codecSet?o.codecSet+" ":""}@${o.bitrate})${c?" with Pathway "+c:""} from level ${n}${a?" with Pathway "+a:""}`);const d={level:t,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(w.LEVEL_SWITCHING,d);const f=o.details;if(!f||f.live){const h=this.switchParams(o.uri,i?.details,f);this.loadPlaylist(h)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,this._startLevel===void 0&&(this._startLevel=t),t!==-1&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(this._startLevel===void 0){const t=this.hls.config.startLevel;return t!==void 0?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const e=this.steering.pathways(),n=t.filter(i=>e.indexOf(i)!==-1);if(t.length<1){this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${e}`);return}this.steering.pathwayPriority=n}}onError(t,e){e.fatal||!e.context||e.context.type===Ft.LEVEL&&e.context.level===this.level&&this.checkRetry(e)}onFragBuffered(t,{frag:e}){if(e!==void 0&&e.type===yt.MAIN){const n=e.elementaryStreams;if(!Object.keys(n).some(a=>!!n[a]))return;const i=this._levels[e.level];i!=null&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(t,e){var n;const{level:i,details:a}=e,o=e.levelInfo;if(!o){var c;this.warn(`Invalid level index ${i}`),(c=e.deliveryDirectives)!=null&&c.skip&&(a.deltaUpdateFailed=!0);return}if(o===this.currentLevel||e.withoutMultiVariant){o.fragmentError===0&&(o.loadError=0);let d=o.details;d===e.details&&d.advanced&&(d=void 0),this.playlistLoaded(i,e,d)}else(n=e.deliveryDirectives)!=null&&n.skip&&(a.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLo
vendor: 4,405 bytes, line 222
222ading(this.currentLevel,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const n=this.getUrlWithDirectives(t.uri,e),i=this.currentLevelIndex,a=t.attrs["PATHWAY-ID"],o=t.details,c=o?.age;this.log(`Loading level index ${i}${e?.msn!==void 0?" at sn "+e.msn+" part "+e.part:""}${a?" Pathway "+a:""}${c&&o.live?" age "+c.toFixed(1)+(o.type&&" "+o.type||""):""} ${n}`),this.hls.trigger(w.LEVEL_LOADING,{url:n,level:i,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=t)}removeLevel(t){var e;if(this._levels.length===1)return;const n=this._levels.filter((a,o)=>o!==t?!0:(this.steering&&this.steering.removeLevel(a),a===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,a.details&&a.details.fragments.forEach(c=>c.level=-1)),!1));fC(n),this._levels=n,this.currentLevelIndex>-1&&(e=this.currentLevel)!=null&&e.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const i=n.length-1;this._firstLevel=Math.min(this._firstLevel,i),this._startLevel&&(this._startLevel=Math.min(this._startLevel,i)),this.hls.trigger(w.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(t,{levels:e}){this._levels=e}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:e,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==e&&(this._maxAutoLevel=e,this.hls.trigger(w.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:e,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function _1(s){const t={};s.forEach(e=>{const n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++})}function oD(){return self.SourceBuffer||self.WebKitSourceBuffer}function lD(){if(!Tr())return!1;const t=oD();return!t||t.prototype&&typeof t.prototype.appendBuffer=="function"&&typeof t.prototype.remove=="function"}function CH(){if(!lD())return!1;const s=Tr();return typeof s?.isTypeSupported=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(t=>s.isTypeSupported(bc(t,"video")))||["mp4a.40.2","fLaC"].some(t=>s.isTypeSupported(bc(t,"audio"))))}function DH(){var s;const t=oD();return typeof(t==null||(s=t.prototype)==null?void 0:s.changeType)=="function"}const IH=100;class OH extends By{constructor(t,e,n){super(t,e,n,"stream-controller",yt.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const i=this.media,a=i?i.currentTime:null;if(a===null||!pt(a)||(this.log(`Media seeked to ${a.toFixed(3)}`),!this.getBufferedFrag(a)))return;const o=this.getFwdBufferInfoAtPos(i,a,yt.MAIN,0);if(o===null||o.len===0){this.warn(`Main forward buffer length at ${a} on "seeked" event ${o?o.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(w.MANIFEST_PARSED,this.onManifestParsed,this),t.on(w.LEVEL_LOADING,this.onLevelLoading,this),t.on(w.LEVEL_LOADED,this.onLevelLoaded,this),t.on(w.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(w.BUFFER_CREATED,this.onBufferCreated,this),t.on(w.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(w.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(w.MANIFEST_PARSED,this.onManifestParsed,this),t.off(w.LEVEL_LOADED,this.onLevelLoaded,this),t.off(w.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(w.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(w.BUFFER_CREATED,this.onBufferCreated,this),t.off(w.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(w.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}
vendor: 36,644 bytes, line 222
222startLoad(t,e){if(this.levels){const{lastCurrentTime:n,hls:i}=this;if(this.stopLoad(),this.setInterval(IH),this.level=-1,!this.startFragRequested){let a=i.startLevel;a===-1&&(i.config.testBandwidth&&this.levels.length>1?(a=0,this.bitrateTest=!0):a=i.firstAutoLevel),i.nextLoadLevel=a,this.level=i.loadLevel,this._hasEnoughToStart=!!e}n>0&&t===-1&&!e&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),t=n),this.state=ct.IDLE,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=ct.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case ct.WAITING_LEVEL:{const{levels:t,level:e}=this,n=t?.[e],i=n?.details;if(i&&(!i.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(i))break;this.state=ct.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=ct.IDLE;break}break}case ct.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===ct.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),(t=this.media)!=null&&t.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:n,media:i}=this;if(e===null||!i&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const a=this.buffering?t.nextLoadLevel:t.loadLevel;if(!(n!=null&&n[a]))return;const o=n[a],c=this.getMainFwdBufferInfo();if(c===null)return;const d=this.getLevelDetails();if(d&&this._streamEnded(c,d)){const S={};this.altAudio===2&&(S.type="video"),this.hls.trigger(w.BUFFER_EOS,S),this.state=ct.ENDED;return}if(!this.buffering)return;t.loadLevel!==a&&t.manualLevel===-1&&this.log(`Adapting to level ${a} from level ${this.level}`),this.level=t.nextLoadLevel=a;const f=o.details;if(!f||this.state===ct.WAITING_LEVEL||this.waitForLive(o)){this.level=a,this.state=ct.WAITING_LEVEL,this.startFragRequested=!1;return}const h=c.len,p=this.getMaxBufferLength(o.maxBitrate);if(h>=p)return;this.backtrackFragment&&this.backtrackFragment.start>c.end&&(this.backtrackFragment=null);const g=this.backtrackFragment?this.backtrackFragment.start:c.end;let v=this.getNextFragment(g,f);if(this.couldBacktrack&&!this.fragPrevious&&v&&_e(v)&&this.fragmentTracker.getState(v)!==Ve.OK){var x;const E=((x=this.backtrackFragment)!=null?x:v).sn-f.startSN,T=f.fragments[E-1];T&&v.cc===T.cc&&(v=T,this.fragmentTracker.removeFragment(T))}else this.backtrackFragment&&c.len&&(this.backtrackFragment=null);if(v&&this.isLoopLoading(v,g)){if(!v.gap){const E=this.audioOnly&&!this.altAudio?ie.AUDIO:ie.VIDEO,T=(E===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;T&&this.afterBufferFlushed(T,E,yt.MAIN)}v=this.getNextFragmentLoopLoading(v,f,c,yt.MAIN,p)}v&&(this.exceedsMaxBuffer(c,p,v)||(v.initSegment&&!v.initSegment.data&&!this.bitrateTest&&(v=v.initSegment),this.loadFragment(v,o,g)))}loadFragment(t,e,n){const i=this.fragmentTracker.getState(t);i===Ve.NOT_LOADED||i===Ve.PARTIAL?_e(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,e)):super.loadFragment(t,e,n):this._loadInitSegment(t,e):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,yt.MAIN)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){if(this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY),this.altAudio!==0){var t;(((t=this.getLevelDetails())==null?void 0:t.fragmentStart)||0)>this.lastCurrentTime&&super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")}}nextLevelSwitch(){const{levels:t,media:e}=this;if(e!=null&&e.readyState){let n;const i=this.getAppendedFrag(e.currentTime);i&&i.start>1&&this.flushMainBuffer(0,i.start-1);const a=this.getLevelDetails();if(a!=null&&a.live){const c=this.getMainFwdBufferInfo();if(!c||c.len<a.targetduration*2)return}if(!e.paused&&t){const c=this.hls.nextLoadLevel,d=t[c],f=this.fragLastKbps;f&&this.fragCurrent?n=this.fragCurrent.duration*d.maxBitrate/(1e3*f)+1:n=0}else n=0;const o=this.getBufferedFrag(e.currentTime+n);if(o){const c=this.followingBufferedFrag(o);if(c){this.abortCurrentFrag();const d=c.maxStartPTS?c.maxStartPTS:c.start,f=c.duration,h=Math.max(o.end,d+Math.min(Math.max(f-this.config.maxFragLookUpTolerance,f*(this.couldBacktrack?.5:.125)),f*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case ct.KEY_LOADING:case ct.FRAG_LOADING:case ct.FRAG_LOADING_WAITING_RETRY:case ct.PARSING:case ct.PARSED:this.state=ct.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,e){super.flushMainBuffer(t,e,this.altAudio===2?"video":null)}onMediaAttached(t,e){super.onMediaAttached(t,e);const n=e.media;ms(n,"playing",this.onMediaPlaying),ms(n,"seeked",this.onMediaSeeked)}onMediaDetaching(t,e){const{media:n}=this;n&&(_s(n,"playing",this.onMediaPlaying),_s(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,e),!e.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(w.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(t,e){let n=!1,i=!1;for(let a=0;a<e.levels.length;a++){const o=e.levels[a].audioCodec;o&&(n=n||o.indexOf("mp4a.40.2")!==-1,i=i||o.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=n&&i&&!DH(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1}onLevelLoading(t,e){const{levels:n}=this;if(!n||this.state!==ct.IDLE)return;const i=e.levelInfo;(!i.details||i.details.live&&(this.levelLastLoaded!==i||i.details.expired)||this.waitForCdnTuneIn(i.details))&&(this.state=ct.WAITING_LEVEL)}onLevelLoaded(t,e){var n;const{levels:i,startFragRequested:a}=this,o=e.level,c=e.details,d=c.totalduration;if(!i){this.warn(`Levels were reset while loading level ${o}`);return}this.log(`Level ${o} loaded [${c.startSN},${c.endSN}]${c.lastPartSn?`[part-${c.lastPartSn}-${c.lastPartIndex}]`:""}, cc [${c.startCC}, ${c.endCC}] duration:${d}`);const f=e.levelInfo,h=this.fragCurrent;h&&(this.state===ct.FRAG_LOADING||this.state===ct.FRAG_LOADING_WAITING_RETRY)&&h.level!==e.level&&h.loader&&this.abortCurrentFrag();let p=0;if(c.live||(n=f.details)!=null&&n.live){var g;if(this.checkLiveUpdate(c),c.deltaUpdateFailed)return;p=this.alignPlaylists(c,f.details,(g=this.levelLastLoaded)==null?void 0:g.details)}if(f.details=c,this.levelLastLoaded=f,a||this.setStartPosition(c,p),this.hls.trigger(w.LEVEL_UPDATED,{details:c,level:o}),this.state===ct.WAITING_LEVEL){if(this.waitForCdnTuneIn(c))return;this.state=ct.IDLE}a&&c.live&&this.synchronizeToLiveEdge(c),this.tick()}synchronizeToLiveEdge(t){const{config:e,media:n}=this;if(!n)return;const i=this.hls.liveSyncPosition,a=this.getLoadPosition(),o=t.fragmentStart,c=t.edge,d=a>=o-e.maxFragLookUpTolerance&&a<=c;if(i!==null&&n.duration>i&&(a<i||!d)){const h=e.liveMaxLatencyDuration!==void 0?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;if((!d&&n.readyState<4||a<c-h)&&(this._hasEnoughToStart||(this.nextLoadPosition=i),n.readyState))if(this.warn(`Playback: ${a.toFixed(3)} is located too far from the end of live sliding playlist: ${c}, reset currentTime to : ${i.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var f;const p=Dt.bufferInfo(n,i,0);if(!((f=p.buffered)!=null&&f.length)){n.currentTime=i;return}if(p.start<=a){n.currentTime=i;return}const{nextStart:v}=Dt.bufferedInfo(p.buffered,a,0);v&&(n.currentTime=v)}else n.currentTime=i}}_handleFragmentLoadProgress(t){var e;const n=t.frag,{part:i,payload:a}=t,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const c=o[n.level];if(!c){this.warn(`Level ${n.level} not found on progress`);return}const d=c.details;if(!d){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const f=c.videoCodec,h=d.PTSKnown||!d.live,p=(e=n.initSegment)==null?void 0:e.data,g=this._getAudioCodec(c),v=this.transmuxer=this.transmuxer||new PC(this.hls,yt.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),x=i?i.index:-1,S=x!==-1,E=new Py(n.level,n.sn,n.stats.chunkCount,a.byteLength,x,S),T=this.initPTS[n.cc];v.push(a,p,g,f,n,i,d.totalduration,h,E,T)}onAudioTrackSwitching(t,e){const n=this.hls,i=this.altAudio!==0;if(rf(e.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(i){this.altAudio=0,this.fragmentTracker.removeAllFragments(),n.once(w.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(w.AUDIO_TRACK_SWITCHED,e)}),n.trigger(w.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(w.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const n=rf(e.url,this.hls);if(n){const 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?2:0,this.tick()}onBufferCreated(t,e){const n=e.tracks;let i,a,o=!1;for(const c in n){const d=n[c];if(d.id==="main"){if(a=c,i=d,c==="video"){const f=n[c];f&&(this.videoBuffer=f.buffer)}}else o=!0}o&&i?(this.log(`Alternate track found, use ${a}.buffered to schedule main fragment loading`),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:n,part:i}=e,a=n.type===yt.MAIN;if(a){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${i?" p: "+i.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===ct.PARSED&&(this.state=ct.IDLE);return}const c=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*c.total/(c.buffering.end-c.loading.first)),_e(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}const o=this.media;o&&(!this._hasEnoughToStart&&Dt.getBuffered(o).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),a&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,e){var n;if(e.fatal){this.state=ct.ERROR;return}switch(e.details){case Z.FRAG_GAP:case Z.FRAG_PARSING_ERROR:case Z.FRAG_DECRYPT_ERROR:case Z.FRAG_LOAD_ERROR:case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_ERROR:case Z.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(yt.MAIN,e);break;case Z.LEVEL_LOAD_ERROR:case Z.LEVEL_LOAD_TIMEOUT:case Z.LEVEL_PARSING_ERROR:!e.levelRetry&&this.state===ct.WAITING_LEVEL&&((n=e.context)==null?void 0:n.type)===Ft.LEVEL&&(this.state=ct.IDLE);break;case Z.BUFFER_ADD_CODEC_ERROR:case Z.BUFFER_APPEND_ERROR:if(e.parent!=="main")return;this.reduceLengthAndFlushBuffer(e)&&this.resetLoadingState();break;case Z.BUFFER_FULL_ERROR:if(e.parent!=="main")return;this.reduceLengthAndFlushBuffer(e)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case Z.INTERNAL_EXCEPTION:this.recoverWorkerError(e);break}}onFragLoadEmergencyAborted(){this.state=ct.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==ie.AUDIO||!this.altAudio){const n=(e===ie.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,e,yt.MAIN),this.tick())}}onLevelsUpdated(t,e){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=e.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let n=this.startPosition;if(n>=0&&e<n){if(t.seeking){this.log(`could not seek to ${n}, already seeking at ${e}`);return}const i=this.timelineOffset;i&&n&&(n+=i);const a=this.getLevelDetails(),o=Dt.getBuffered(t),c=o.length?o.start(0):0,d=c-n,f=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||d>0&&(d<f||this.loadingParts&&d<2*(a?.partTarget||0)))&&(this.log(`adjusting start position by ${d} to match buffer start`),n+=d,this.startPosition=n),e<n&&(this.log(`seek to target start position ${n} from current time ${e} buffer start ${c}`),t.currentTime=n)}}_getAudioCodec(t){let e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e.indexOf("mp4a.40.5")!==-1?e="mp4a.40.2":e="mp4a.40.5"),e}_loadBitrateTestFrag(t,e){t.bitrateTest=!0,this._doFragLoad(t,e).then(n=>{const{hls:i}=this,a=n?.frag;if(!a||this.fragContextChanged(a))return;e.fragmentError=0,this.state=ct.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const o=a.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),i.trigger(w.FRAG_LOADED,n),a.bitrateTest=!1}).catch(n=>{this.state===ct.STOPPED||this.state===ct.ERROR||(this.warn(n),this.resetFragmentLoading(t))})}_handleTransmuxComplete(t){const e=this.playlistType,{hls:n}=this,{remuxResult:i,chunkMeta:a}=t,o=this.getCurrentContext(a);if(!o){this.resetWhenMissingContext(a);return}const{frag:c,part:d,level:f}=o,{video:h,text:p,id3:g,initSegment:v}=i,{details:x}=f,S=this.altAudio?void 0:i.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=ct.PARSING,v){const E=v.tracks;if(E){const P=c.initSegment||c;if(this.unhandledEncryptionError(v,c))return;this._bufferInitSegment(f,E,P,a),n.trigger(w.FRAG_PARSING_INIT_SEGMENT,{frag:P,id:e,tracks:E})}const T=v.initPTS,L=v.timescale,_=this.initPTS[c.cc];if(pt(T)&&(!_||_.baseTime!==T||_.timescale!==L)){const P=v.trackId;this.initPTS[c.cc]={baseTime:T,timescale:L,trackId:P},n.trigger(w.INIT_PTS_FOUND,{frag:c,id:e,initPTS:T,timescale:L,trackId:P})}}if(h&&x){S&&h.type==="audiovideo"&&this.logMuxedErr(c);const E=x.fragments[c.sn-1-x.startSN],T=c.sn===x.startSN,L=!E||c.cc>E.cc;if(i.independent!==!1){const{startPTS:_,endPTS:P,startDTS:D,endDTS:B}=h;if(d)d.elementaryStreams[h.type]={startPTS:_,endPTS:P,startDTS:D,endDTS:B};else if(h.firstKeyFrame&&h.independent&&a.id===1&&!L&&(this.couldBacktrack=!0),h.dropped&&h.independent){const C=this.getMainFwdBufferInfo(),I=(C?C.end:this.getLoadPosition())+this.config.maxBufferHole,F=h.firstKeyFramePTS?h.firstKeyFramePTS:_;if(!T&&I<F-this.config.maxBufferHole&&!L){this.backtrack(c);return}else L&&(c.gap=!0);c.setElementaryStreamInfo(h.type,c.start,P,c.start,B,!0)}else T&&_-(x.appliedTimelineOffset||0)>Vd&&(c.gap=!0);c.setElementaryStreamInfo(h.type,_,P,D,B),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(h,c,d,a,T||L)}else if(T||L)c.gap=!0;else{this.backtrack(c);return}}if(S){const{startPTS:E,endPTS:T,startDTS:L,endDTS:_}=S;d&&(d.elementaryStreams[ie.AUDIO]={startPTS:E,endPTS:T,startDTS:L,endDTS:_}),c.setElementaryStreamInfo(ie.AUDIO,E,T,L,_),this.bufferFragmentData(S,c,d,a)}if(x&&g!=null&&g.samples.length){const E={id:e,frag:c,details:x,samples:g.samples};n.trigger(w.FRAG_PARSING_METADATA,E)}if(x&&p){const E={id:e,frag:c,details:x,samples:p.samples};n.trigger(w.FRAG_PARSING_USERDATA,E)}}logMuxedErr(t){this.warn(`${_e(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,e,n,i){if(this.state!==ct.PARSING)return;this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&(delete e.audio,e.audiovideo&&this.logMuxedErr(n));const{audio:a,video:o,audiovideo:c}=e;if(a){const f=t.audioCodec;let h=Md(a.codec,f);h==="mp4a"&&(h="mp4a.40.5");const p=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){h&&(h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5");const g=a.metadata;g&&"channelCount"in g&&(g.channelCount||1)!==1&&p.indexOf("firefox")===-1&&(h="mp4a.40.5")}h&&h.indexOf("mp4a.40.5")!==-1&&p.indexOf("android")!==-1&&a.container!=="audio/mpeg"&&(h="mp4a.40.2",this.log(`Android: force audio codec to ${h}`)),f&&f!==h&&this.log(`Swapping manifest audio codec "${f}" for "${h}"`),a.levelCodec=h,a.id=yt.MAIN,this.log(`Init audio buffer, container:${a.container}, codecs[selected/level/parsed]=[${h||""}/${f||""}/${a.codec}]`),delete e.audiovideo}if(o){o.levelCodec=t.videoCodec,o.id=yt.MAIN;const f=o.codec;if(f?.length===4)switch(f){case"hvc1":case"hev1":o.codec="hvc1.1.6.L120.90";break;case"av01":o.codec="av01.0.04M.08";break;case"avc1":o.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${t.videoCodec||""}/${f}]${o.codec!==f?" parsed-corrected="+o.codec:""}${o.supplemental?" supplemental="+o.supplemental:""}`),delete e.audiovideo}c&&(this.log(`Init audiovideo buffer, container:${c.container}, codecs[level/parsed]=[${t.codecs}/${c.codec}]`),delete e.video,delete e.audio);const d=Object.keys(e);if(d.length){if(this.hls.trigger(w.BUFFER_CODECS,e),!this.hls)return;d.forEach(f=>{const p=e[f].initSegment;p!=null&&p.byteLength&&this.hls.trigger(w.BUFFER_APPENDING,{type:f,data:p,frag:n,part:null,chunkMeta:i,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,yt.MAIN)}get maxBufferLength(){const{levels:t,level:e}=this,n=t?.[e];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=ct.IDLE}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&t.seeking===!1){const n=t.currentTime;if(Dt.isBuffered(t,n)?e=this.getAppendedFrag(n):Dt.isBuffered(t,n+.1)&&(e=this.getAppendedFrag(n+.1)),e){this.backtrackFragment=null;const i=this.fragPlaying,a=e.level;(!i||e.sn!==i.sn||i.level!==a)&&(this.fragPlaying=e,this.hls.trigger(w.FRAG_CHANGED,{frag:e}),(!i||i.level!==a)&&this.hls.trigger(w.LEVEL_SWITCHED,{level:a}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const e=((t=this.media)==null?void 0:t.currentTime)||this.lastCurrentTime;return pt(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){var t;const e=((t=this.media)==null?void 0:t.currentTime)||this.lastCurrentTime;if(pt(e)){const n=this.getLevelDetails(),i=this.currentFrag||(n?ua(null,n.fragments,e):null);if(i){const a=i.programDateTime;if(a!==null){const o=a+(e-i.start)*1e3;return new Date(o)}}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class kH extends mn{constructor(t,e){super("key-loader",e),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const n in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[n].loader;if(i){var e;if(t&&t!==((e=i.context)==null?void 0:e.frag.type))return;i.abort()}}}detach(){for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyIdToKeyInfo){const e=this.keyIdToKeyInfo[t].loader;e&&e.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(t,e=Z.KEY_LOAD_ERROR,n,i,a){return new Ai({type:Tt.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:a,error:n,networkDetails:i})}loadClear(t,e,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(e.length)for(let i=0,a=e.length;i<a;i++){const o=e[i];if(t.cc<=o.cc&&(!_e(t)||!_e(o)||t.sn<o.sn)||!n&&i==a-1)return this.emeController.selectKeySystemFormat(o).then(c=>{if(!this.emeController)return;o.setKeyFormat(c);const d=Bd(c);if(d)return this.emeController.getKeySystemAccess([d])})}if(this.config.requireKeySystemAccessOnStart){const i=zl(this.config);if(i.length)return this.emeController.getKeySystemAccess(i)}}return null}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then(e=>this.loadInternal(t,e)):this.loadInternal(t)}loadInternal(t,e){var n,i;e&&t.setKeyFormat(e);const a=t.decryptdata;if(!a){const f=new Error(e?`Expected frag.decryptdata to be defined after setting format ${e}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(t,Z.KEY_LOAD_ERROR,f))}const o=a.uri;if(!o)return Promise.reject(this.createKeyLoadError(t,Z.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));const c=Zp(a);let d=this.keyIdToKeyInfo[c];if((n=d)!=null&&n.decryptdata.key)return a.key=d.decryptdata.key,Promise.resolve({frag:t,keyInfo:d});if(this.emeController&&(i=d)!=null&&i.keyLoadPromise)switch(this.emeController.getKeyStatus(d.decryptdata)){case"usable":case"usable-in-future":return d.keyLoadPromise.then(h=>{const{keyInfo:p}=h;return a.key=p.decryptdata.key,{frag:t,keyInfo:p}})}switch(this.log(`${this.keyIdToKeyInfo[c]?"Rel":"L"}oading${a.keyId?" keyId: "+ss(a.keyId):""} URI: ${a.uri} from ${t.type} ${t.level}`),d=this.keyIdToKeyInfo[c]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return a.keyFormat==="identity"?this.loadKeyHTTP(d,t):this.loadKeyEME(d,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(d,t);default:return Promise.reject(this.createKeyLoadError(t,Z.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${a.method}"`)))}}loadKeyEME(t,e){const n={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var i;if(!t.decryptdata.keyId&&(i=e.initSegment)!=null&&i.data){const o=Z8(e.initSegment.data);if(o.length){let c=o[0];c.some(d=>d!==0)?(this.log(`Using keyId found in init segment ${ss(c)}`),gr.setKeyIdForUri(t.decryptdata.uri,c)):(c=gr.addKeyIdForUri(t.decryptdata.uri),this.log(`Generating keyId to patch media ${ss(c)}`)),t.decryptdata.keyId=c}}if(!t.decryptdata.keyId&&!_e(e))return Promise.resolve(n);const a=this.emeController.loadKey(n);return(t.keyLoadPromise=a.then(o=>(t.mediaKeySessionContext=o,n))).catch(o=>{throw t.keyLoadPromise=null,"data"in o&&(o.data.frag=e),o})}return Promise.resolve(n)}loadKeyHTTP(t,e){const n=this.config,i=n.loader,a=new i(n);return e.keyLoader=t.loader=a,t.keyLoadPromise=new Promise((o,c)=>{const d={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},f=n.keyLoadPolicy.default,h={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},p={onSuccess:(g,v,x,S)=>{const{frag:E,keyInfo:T}=x,L=Zp(T.decryptdata);if(!E.decryptdata||T!==this.keyIdToKeyInfo[L])return c(this.createKeyLoadError(E,Z.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),S));T.decryptdata.key=E.decryptdata.key=new Uint8Array(g.data),E.keyLoader=null,T.loader=null,o({frag:E,keyInfo:T})},onError:(g,v,x,S)=>{this.resetLoader(v),c(this.createKeyLoadError(e,Z.KEY_LOAD_ERROR,new Error(`HTTP Error ${g.code} loading key ${g.text}`),x,Qt({url:d.url,data:void 0},g)))},onTimeout:(g,v,x)=>{this.resetLoader(v),c(this.createKeyLoadError(e,Z.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),x))},onAbort:(g,v,x)=>{this.resetLoader(v),c(this.createKeyLoadError(e,Z.INTERNAL_ABORTED,new Error("key loading aborted"),x))}};a.load(d,h,p)})}resetLoader(t){const{frag:e,keyInfo:n,url:i}=t,a=n.loader;e.keyLoader===a&&(e.keyLoader=null,n.loader=null);const o=Zp(n.decryptdata)||i;delete this.keyIdToKeyInfo[o],a&&a.destroy()}}function Zp(s){if(s.keyFormat!==ns.FAIRPLAY){const t=s.keyId;if(t)return ss(t)}return s.uri}function C1(s){const{type:t}=s;switch(t){case Ft.AUDIO_TRACK:return yt.AUDIO;case Ft.SUBTITLE_TRACK:return yt.SUBTITLE;default:return yt.MAIN}}function Jp(s,t){let e=s.url;return(e===void 0||e.indexOf("data:")===0)&&(e=t.url),e}class PH{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.LEVEL_LOADING,this.onLevelLoading,this),t.on(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.LEVEL_LOADING,this.onLevelLoading,this),t.off(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const e=this.hls.config,n=e.pLoader,i=e.loader,a=n||i,o=new a(e);return this.loaders[t.type]=o,o}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,e){const{url:n}=e;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Ft.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,e){const{id:n,level:i,pathwayId:a,url:o,deliveryDirectives:c,levelInfo:d}=e;this.load({id:n,level:i,pathwayId:a,responseType:"text",type:Ft.LEVEL,url:o,deliveryDirectives:c,levelOrTrack:d})}onAudioTrackLoading(t,e){const{id:n,groupId:i,url:a,deliveryDirectives:o,track:c}=e;this.load({id:n,groupId:i,level:null,responseType:"text",type:Ft.AUDIO_TRACK,url:a,deliveryDirectives:o,levelOrTrack:c})}onSubtitleTrackLoading(t,e){const{id:n,groupId:i,url:a,deliveryDirectives:o,track:c}=e;this.load({id:n,groupId:i,level:null,responseType:"text",type:Ft.SUBTITLE_TRACK,url:a,deliveryDirectives:o,levelOrTrack:c})}onLevelsUpdated(t,e){const n=this.loaders[Ft.LEVEL];if(n){const i=n.context;i&&!e.levels.some(a=>a===i.levelOrTrack)&&(n.abort(),delete this.loaders[Ft.LEVEL])}}load(t){var e;const n=this.hls.config;let i=this.getInternalLoader(t);if(i){const f=this.hls.logger,h=i.context;if(h&&h.levelOrTrack===t.levelOrTrack&&(h.url===t.url||h.deliveryDirectives&&!t.deliveryDirectives)){h.url===t.url?f.log(`[playlist-loader]: ignore ${t.url} ongoing request`):f.log(`[playlist-loader]: ignore ${t.url} in favor of ${h.url}`);return}f.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),i.abort()}let a;if(t.type===Ft.MANIFEST?a=n.manifestLoadPolicy.default:a=se({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(t),pt((e=t.deliveryDirectives)==null?void 0:e.part)){let f;if(t.type===Ft.LEVEL&&t.level!==null?f=this.hls.levels[t.level].details:t.type===Ft.AUDIO_TRACK&&t.id!==null?f=this.hls.audioTracks[t.id].details:t.type===Ft.SUBTITLE_TRACK&&t.id!==null&&(f=this.hls.subtitleTracks[t.id].details),f){const h=f.partTarget,p=f.targetduration;if(h&&p){const g=Math.max(h*3,p*.8)*1e3;a=se({},a,{maxTimeToFirstByteMs:Math.min(g,a.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(g,a.maxTimeToFirstByteMs)})}}}const o=a.errorRetry||a.timeoutRetry||{},c={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},d={onSuccess:(f,h,p,g)=>{const v=this.getInternalLoader(p);this.resetInternalLoader(p.type);const x=f.data;h.parsing.start=performance.now(),zn.isMediaPlaylist(x)||p.type!==Ft.MANIFEST?this.handleTrackOrLevelPlaylist(f,h,p,g||null,v):this.handleMasterPlaylist(f,h,p,g)},onError:(f,h,p,g)=>{this.handleNetworkError(h,p,!1,f,g)},onTimeout:(f,h,p)=>{this.handleNetworkError(h,p,!0,void 0,f)}};i.load(t,c,d)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:e},forceStartLoad:n}=this.hls;(t||n)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${e}`),this.hls.startLoad(e))}handleMasterPlaylist(t,e,n,i){const a=this.hls,o=t.data,c=Jp(t,n),d=zn.parseMasterPlaylist(o,c);if(d.playlistParsingError){e.parsing.end=performance.now(),this.handleManifestParsingError(t,n,d.playlistParsingError,i,e);return}const{contentSteering:f,levels:h,sessionData:p,sessionKeys:g,startTimeOffset:v,variableList:x}=d;this.variableList=x,h.forEach(L=>{const{unknownCodecs:_}=L;if(_){const{preferManagedMediaSource:P}=this.hls.config;let{audioCodec:D,videoCodec:B}=L;for(let C=_.length;C--;){const I=_[C];xc(I,"audio",P)?(L.audioCodec=D=D?`${D},${I}`:I,Po.audio[D.substring(0,4)]=2,_.splice(C,1)):xc(I,"video",P)&&(L.videoCodec=B=B?`${B},${I}`:I,Po.video[B.substring(0,4)]=2,_.splice(C,1))}}});const{AUDIO:S=[],SUBTITLES:E,"CLOSED-CAPTIONS":T}=zn.parseMasterPlaylistMedia(o,c,d);S.length&&!S.some(_=>!_.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new pe({}),bitrate:0,url:""})),a.trigger(w.MANIFEST_LOADED,{levels:h,audioTracks:S,subtitles:E,captions:T,contentSteering:f,url:c,stats:e,networkDetails:i,sessionData:p,sessionKeys:g,startTimeOffset:v,variableList:x})}handleTrackOrLevelPlaylist(t,e,n,i,a){const o=this.hls,{id:c,level:d,type:f}=n,h=Jp(t,n),p=pt(d)?d:pt(c)?c:0,g=C1(n),v=zn.parseLevelPlaylist(t.data,h,p,g,0,this.variableList);if(f===Ft.MANIFEST){const x={attrs:new pe({}),bitrate:0,details:v,name:"",url:h};v.requestScheduled=e.loading.start+cC(v,0),o.trigger(w.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:h,stats:e,networkDetails:i,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),n.levelDetails=v,this.handlePlaylistLoaded(v,t,e,n,i,a)}handleManifestParsingError(t,e,n,i,a){this.hls.trigger(w.ERROR,{type:Tt.NETWORK_ERROR,details:Z.MANIFEST_PARSING_ERROR,fatal:e.type===Ft.MANIFEST,url:t.url,err:n,error:n,reason:n.message,response:t,context:e,networkDetails:i,stats:a})}handleNetworkError(t,e,n=!1,i,a){let o=`A network ${n?"timeout":"error"+(i?" (status "+i.code+")":"")} occurred while loading ${t.type}`;t.type===Ft.LEVEL?o+=`: ${t.level} id: ${t.id}`:(t.type===Ft.AUDIO_TRACK||t.type===Ft.SUBTITLE_TRACK)&&(o+=` id: ${t.id} group-id: "${t.groupId}"`);const c=new Error(o);this.hls.logger.warn(`[playlist-loader]: ${o}`);let d=Z.UNKNOWN,f=!1;const h=this.getInternalLoader(t);switch(t.type){case Ft.MANIFEST:d=n?Z.MANIFEST_LOAD_TIMEOUT:Z.MANIFEST_LOAD_ERROR,f=!0;break;case Ft.LEVEL:d=n?Z.LEVEL_LOAD_TIMEOUT:Z.LEVEL_LOAD_ERROR,f=!1;break;case Ft.AUDIO_TRACK:d=n?Z.AUDIO_TRACK_LOAD_TIMEOUT:Z.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case Ft.SUBTITLE_TRACK:d=n?Z.SUBTITLE_TRACK_LOAD_TIMEOUT:Z.SUBTITLE_LOAD_ERROR,f=!1;break}h&&this.resetInternalLoader(t.type);const p={type:Tt.NETWORK_ERROR,details:d,fatal:f,url:t.url,loader:h,context:t,error:c,networkDetails:e,stats:a};if(i){const g=e?.url||t.url;p.response=Qt({url:g,data:void 0},i)}this.hls.trigger(w.ERROR,p)}handlePlaylistLoaded(t,e,n,i,a,o){const c=this.hls,{type:d,level:f,levelOrTrack:h,id:p,groupId:g,deliveryDirectives:v}=i,x=Jp(e,i),S=C1(i);let E=typeof i.level=="number"&&S===yt.MAIN?f:void 0;const T=t.playlistParsingError;if(T){if(this.hls.logger.warn(`${T} ${t.url}`),!c.config.ignorePlaylistParsingErrors){c.trigger(w.ERROR,{type:Tt.NETWORK_ERROR,details:Z.LEVEL_PARSING_ERROR,fatal:!1,url:x,error:T,reason:T.message,response:e,context:i,level:E,parent:S,networkDetails:a,stats:n});return}t.playlistParsingError=null}if(!t.fragments.length){const L=t.playlistParsingError=new Error("No Segments found in Playlist");c.trigger(w.ERROR,{type:Tt.NETWORK_ERROR,details:Z.LEVEL_EMPTY_ERROR,fatal:!1,url:x,error:L,reason:L.message,response:e,context:i,level:E,parent:S,networkDetails:a,stats:n});return}switch(t.live&&o&&(o.getCacheAge&&(t.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(t.ageHeader))&&(t.ageHeader=0)),d){case Ft.MANIFEST:case Ft.LEVEL:if(E){if(!h)E=0;else if(h!==c.levels[E]){const L=c.levels.indexOf(h);L>-1&&(E=L)}}c.trigger(w.LEVEL_LOADED,{details:t,levelInfo:h||c.levels[0],level:E||0,id:p||0,stats:n,networkDetails:a,deliveryDirectives:v,withoutMultiVariant:d===Ft.MANIFEST});break;case Ft.AUDIO_TRACK:c.trigger(w.AUDIO_TRACK_LOADED,{details:t,track:h,id:p||0,groupId:g||"",stats:n,networkDetails:a,deliveryDirectives:v});break;case Ft.SUBTITLE_TRACK:c.trigger(w.SUBTITLE_TRACK_LOADED,{details:t,track:h,id:p||0,groupId:g||"",stats:n,networkDetails:a,deliveryDirectives:v});break}}}class Rn{static get version(){return Ec}static isMSESupported(){return lD()}static isSupported(){return CH()}static getMediaSource(){return Tr()}static get Events(){return w}static get MetadataSchema(){return Hs}static get ErrorTypes(){return Tt}static get ErrorDetails(){return Z}static get DefaultConfig(){return Rn.defaultConfig?Rn.defaultConfig:yH}static set DefaultConfig(t){Rn.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Fy,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const e=this.logger=j8(t.debug||!1,"Hls instance",t.assetPlayerId),n=this.config=xH(Rn.DefaultConfig,t,e);this.userConfig=t,n.progressive&&bH(n,e);const{abrController:i,bufferController:a,capLevelController:o,errorController:c,fpsController:d}=n,f=new c(this),h=this.abrController=new i(this),p=new M$(this),g=n.interstitialsController,v=g?this.interstitialsController=new g(this,Rn):null,x=this.bufferController=new a(this,p),S=this.capLevelController=new o(this),E=new d(this),T=new PH(this),L=n.contentSteeringController,_=L?new L(this):null,P=this.levelController=new _H(this,_),D=new wH(this),B=new kH(this.config,this.logger),C=this.streamController=new OH(this,p,B),I=this.gapController=new AH(this,p);S.setStreamController(C),E.setStreamController(C);const F=[T,P,C];v&&F.splice(1,0,v),_&&F.splice(1,0,_),this.networkControllers=F;const U=[h,x,I,S,E,D,p];this.audioTrackController=this.createController(n.audioTrackController,F);const z=n.audioStreamController;z&&F.push(this.audioStreamController=new z(this,p,B)),this.subtitleTrackController=this.createController(n.subtitleTrackController,F);const Y=n.subtitleStreamController;Y&&F.push(this.subtititleStreamController=new Y(this,p,B)),this.createController(n.timelineController,U),B.emeController=this.emeController=this.createController(n.emeController,U),this.cmcdController=this.createController(n.cmcdController,U),this.latencyController=this.createController(LH,U),this.coreComponents=U,F.push(f);const nt=f.onErrorOut;typeof nt=="function"&&this.on(w.ERROR,nt,f),this.on(w.MANIFEST_LOADED,T.onManifestLoaded,T)}createController(t,e){if(t){const n=new t(this);return e&&e.push(n),n}return null}on(t,e,n=this){this._emitter.on(t,e,n)}once(t,e,n=this){this._emitter.once(t,e,n)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,n=this,i){this._emitter.off(t,e,n,i)}listeners(t){return this._emitter.listeners(t)}emit(t,e,n){return this._emitter.emit(t,e,n)}
vendor: 3,500 bytes, line 222
222trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(n){if(this.logger.error("An internal error happened while handling event "+t+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const i=t===w.ERROR;this.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.INTERNAL_EXCEPTION,fatal:i,event:t,error:n}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(w.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;const t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){if(!t||"media"in t&&!t.media){const a=new Error(`attachMedia failed: invalid argument (${t})`);this.trigger(w.ERROR,{type:Tt.OTHER_ERROR,details:Z.ATTACH_MEDIA_ERROR,fatal:!0,error:a});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const e="media"in t,n=e?t.media:t,i=e?t:{media:n};this._media=n,this.trigger(w.MEDIA_ATTACHING,i)}detachMedia(){this.logger.log("detachMedia"),this.trigger(w.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(w.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const e=this.media,n=this._url,i=this._url=Ly.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${i}`),e&&n&&(n!==i||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(w.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,e){this.logger.log(`startLoad(${t+(e?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(t,e),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!(this.started||!this.networkControllers));t++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(t=>{t.resumeBuffering&&t.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(t=>{t.pauseBuffering&&t.pauseBuffering()}))}get inFlightFragments(){const t={[yt.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[yt.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[yt.SUBTITLE]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,e=t?.currentTime;this.detachMedia(),t&&(this.attachMedia(t),e&&this.startLoad(e))}removeLevel(t){this.levelController.removeLevel(t)}
222get sessionId(){let t=this._sessionId;return t||(t=this._sessionId=AG()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){this.logger.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return t===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){this.logger.log(`set startLevel:${t}`),t!==-1&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){x$(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const n=t.length;for(let i=0;i<n;i++)if(t[i].maxBitrate>=e)return i;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:n}=this;let i;if(e===-1&&t!=null&&t.length?i=t.length-1:i=e,n)for(let a=i;a--;){const o=t[a].attrs["HDCP-LEVEL"];if(o&&o<=n)return a}return i}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var e;return((e=this.audioTrackController)==null?void 0:e.setAudioOption(t))||null}setSubtitleOption(t){var e;return((e=this.subtitleTrackController)==null?void 0:e.setSubtitleOption(t))||null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return t?t.subtitleDisplay:!1}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(t){this.latencyController.targetLatency=t}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!!((t=this.bufferController)!=null&&t.bufferedToEnd)}get interstitialsManager(){var t;return((t=this.interstitialsController)==null?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,e=this.allAudioTracks){const n=Y_(e);return K_(t,n,navigator.mediaCapabilities)}}Rn.defaultConfig=void 0;const tg=[{id:1,name:"Tadweer Sports 1",nameAr:"تدÙÙØ± Ø³Ø¨ÙØ±ØªØ³ 1",logo:"",streamUrl:"/live",category:"tadweer",isLive:!0,description:"ÙÙØ§ØªÙا Ø§ÙØ±Ø³Ù
ÙØ© - Ø§ÙØ¨Ø·ÙÙØ© Ø§ÙØ¯Ø§Ø®ÙÙØ©"},{id:2,name:"Tadweer Sports 2",nameAr:"تدÙÙØ± Ø³Ø¨ÙØ±ØªØ³ 2",logo:"",streamUrl:"",category:"tadweer",isLive:!0,isFacebook:!0,facebookUrl:"https://www.facebook.com/61582422636759/videos/891691906922863/",facebookEmbed:"https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2F61582422636759%2Fvideos%2F891691906922863%2F&show_text=0&width=560",description:"بث Ù
باشر عبر ÙÙØ³Ø¨ÙÙ"},{id:14,name:"Tadweer Sports 3",nameAr:"تدÙÙØ± Ø³Ø¨ÙØ±ØªØ³ 3",logo:"",streamUrl:"",category:"tadweer",isLive:!0,isTwitch:!0,twitchChannel:"tadweersports2",description:"بث Ù
باشر عبر Twitch"},{id:3,name:"beIN SPORTS XTRA",nameAr:"Ø¨Ù Ø¥Ù Ø³Ø¨ÙØ±ØªØ³ Ø¥ÙØ³ØªØ±Ø§",logo:"https://i.ibb.co/HT49GPmB/XTRA-2.png",streamUrl:"/api/hls-proxy/bein-xtra/playlist.m3u8",category:"bein",isLive:!0,description:"اÙÙÙØ§Ø© اÙÙ
جاÙÙØ© Ø§ÙØ±Ø³Ù
ÙØ© Ù
Ù beIN"},{id:11,name:"Al Jazeera Arabic",nameAr:"Ø§ÙØ¬Ø²Ùرة Ø§ÙØ¹Ø±Ø¨ÙØ©",logo:"https://i.imgur.com/7bRVpnu.png",streamUrl:"/api/hls-proxy/aljazeera/index.m3u8",category:"news",isLive:!0,description:"ÙÙØ§Ø© Ø§ÙØ¬Ø²Ùرة Ø§ÙØ¥Ø®Ø¨Ø§Ø±ÙØ©"},{id:12,name:"Al Jazeera Mubasher",nameAr:"Ø§ÙØ¬Ø²Ùرة Ù
باشر",logo:"https://i.imgur.com/X80DQvF.png",streamUrl:"/api/hls-proxy/aljazeera-mubasher/index.m3u8",category:"news",isLive:!0,description:"ÙÙØ§Ø© Ø§ÙØ¬Ø²Ùرة Ù
باشر"},{id:13,name:"Al Arabiya",nameAr:"Ø§ÙØ¹Ø±Ø¨ÙØ©",logo:"https://shahid.mbc.net/mediaObject/a4c125db-ede8-4970-9eed-963948c78651?height=auto&width=512&croppingPoint=&version=1&type=png",streamUrl:"/api/hls-proxy/alarabiya/alarabiya.smil/playlist.m3u8",category:"news",isLive:!0,description:"ÙÙØ§Ø© Ø§ÙØ¹Ø±Ø¨ÙØ© Ø§ÙØ¥Ø®Ø¨Ø§Ø±ÙØ©"},{id:4,name:"Alkass One",nameAr:"اÙÙØµØ¨ Ø§ÙØ£ÙÙÙ",logo:"https://i.imgur.com/10mmlha.png",streamUrl:"/api/hls-proxy/alkass1/main.m3u8",category:"alkass",isLive:!0,description:"ÙÙØ§Ø© اÙÙØµØ¨ Ø§ÙØ±ÙØ§Ø¶ÙØ© اÙÙØ·Ø±ÙØ©"},{id:5,name:"Alkass Two",nameAr:"اÙÙØµØ¨ Ø§ÙØ«Ø§ÙÙØ©",logo:"https://i.imgur.com/8w61kFX.png",streamUrl:"/api/hls-proxy/alkass2/main.m3u8",category:"alkass",isLive:!0},{id:6,name:"Alkass Three",nameAr:"اÙÙØµØ¨ Ø§ÙØ«Ø§Ùثة",logo:"https://i.imgur.com/d57BdFh.png",streamUrl:"/api/hls-proxy/alkass3/main.m3u8",category:"alkass",isLive:!0},{id:7,name:"Alkass Four",nameAr:"اÙÙØµØ¨ Ø§ÙØ±Ø§Ø¨Ø¹Ø©",logo:"https://i.imgur.com/iDL65Wu.png",streamUrl:"/api/hls-proxy/alkass4/main.m3u8",category:"alkass",isLive:!0},{id:8,name:"Alkass Six",nameAr:"اÙÙØµØ¨ Ø§ÙØ³Ø§Ø¯Ø³Ø©",logo:"https://i.imgur.com/CrPSPSC.png",streamUrl:"/api/hls-proxy/alkass6/main.m3u8",category:"alkass",isLive:!0},{id:9,name:"Alkass SHOOF",nameAr:"اÙÙØµØ¨ Ø´ÙÙ",logo:"https://shoof.alkass.net/assets/images/shoof.png",streamUrl:"/api/hls-proxy/alkass-shoof/main.m3u8",category:"alkass",isLive:!0,description:"Ù
ØØªÙÙ Ø±ÙØ§Ø¶Ù Ù
جاÙÙ"},{id:10,name:"Alkass SHOOF 2",nameAr:"اÙÙØµØ¨ Ø´ÙÙ 2",logo:"https://shoof.alkass.net/assets/images/shoof2.png",streamUrl:"/api/hls-proxy/alkass-shoof2/main.m3u8",category:"alkass",isLive:!0,description:"Ù
ØØªÙÙ Ø±ÙØ§Ø¶Ù Ù
جاÙÙ"}],Vl={tadweer:{label:"Tadweer Sports",color:"#00a0e3"},bein:{label:"beIN Sports",color:"#e63946"},alkass:{label:"Alkass",color:"#f4a261"},news:{label:"أخبار",color:"#2a9d8f"}};function eg({size:s=40,num:t=1}){return A.jsxs("svg",{"data-loc":"client/src/pages/Channels.tsx:179",viewBox:"0 0 100 100",width:s,height:s,children:[A.jsx("rect",{"data-loc":"client/src/pages/Channels.tsx:180",width:"100",height:"100",fill:"#000",rx:"10"}),A.jsx("text",{"data-loc":"client/src/pages/Channels.tsx:181",x:"50",y:"28",textAnchor:"middle",fill:"#00a0e3",fontSize:"14",fontWeight:"900",fontFamily:"Arial",children:"TADWEER"}),A.jsx("text",{"data-loc":"client/src/pages/Channels.tsx:182",x:"50",y:"48",textAnchor:"middle",fill:"#fff",fontSize:"12",fontWeight:"700",fontFamily:"Arial",children:"SPORTS"}),A.jsx("text",{"data-loc":"client/src/pages/Channels.tsx:183",x:"50",y:"72",textAnchor:"middle",fill:"#00a0e3",fontSize:"24",fontWeight:"900",fontFamily:"Arial",children:t}),A.jsx("rect",{"data-loc":"client/src/pages/Channels.tsx:184",x:"8",y:"78",width:"84",height:"3",fill:"#00a0e3",rx:"1.5"})]})}function MH({url:s,autoPlay:t=!1}){const e=$.useRef(null),n=$.useRef(null),[i,a]=$.useState(!1),[o,c]=$.useState(!0);$.useEffect(()=>{if(!s||!e.current)return;a(!1),c(!0);const f=e.current;if(Rn.isSupported()){const h=new Rn({enableWorker:!0,lowLatencyMode:!0,backBufferLength:30});n.current=h,h.loadSource(s),h.attachMedia(f),h.on(Rn.Events.MANIFEST_PARSED,()=>{c(!1),t&&f.play().catch(()=>{})}),h.on(Rn.Events.ERROR,(p,g)=>{g.fatal&&(a(!0),c(!1))})}else f.canPlayType("application/vnd.apple.mpegurl")?(f.src=s,f.addEventListener("loadedmetadata",()=>{c(!1),t&&f.play().catch(()=>{})}),f.addEventListener("error",()=>{a(!0),c(!1)})):(a(!0),c(!1));return()=>{n.current?.destroy(),n.current=null}},[s]);const d=()=>{e.current?.requestFullscreen&&e.current.requestFullscreen()};return A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:241",className:"relative w-full bg-black",style:{aspectRatio:"16/9"},children:[A.jsx("video",{"data-loc":"client/src/pages/Channels.tsx:242",ref:e,controls:!0,playsInl
222ine:!0,className:"w-full h-full object-contain",style:{display:i||o?"none":"block"}}),o&&!i&&A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:250",className:"absolute inset-0 flex flex-col items-center justify-center gap-3",children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:251",className:"flex gap-1.5",children:[0,1,2].map(f=>A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:253",className:"w-2 h-2 rounded-full bg-primary animate-bounce",style:{animationDelay:`${f*.15}s`}},f))}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:256",className:"text-xs text-muted-foreground",children:"جار٠تØÙ
ÙÙ Ø§ÙØ¨Ø«..."})]}),i&&A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:260",className:"absolute inset-0 flex flex-col items-center justify-center gap-3",children:[A.jsx(mF,{"data-loc":"client/src/pages/Channels.tsx:261",size:32,className:"text-red-400 opacity-60"}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:262",className:"text-sm text-muted-foreground font-bold",children:"ØªØ¹Ø°ÙØ± تØÙ
ÙÙ Ø§ÙØ¨Ø«"}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:263",className:"text-xs text-muted-foreground/60",children:"ÙØ¯ ÙÙÙÙ Ø§ÙØ¨Ø« Ù
تÙÙÙØ§Ù Ø£Ù Ù
ØØ¸Ùرا٠ÙÙ Ù
ÙØ·ÙتÙ"})]}),!i&&!o&&A.jsx("button",{"data-loc":"client/src/pages/Channels.tsx:267",onClick:d,className:"absolute top-2 left-2 p-1.5 rounded-lg bg-black/50 text-white hover:bg-black/70 transition-colors",children:A.jsx(iF,{"data-loc":"client/src/pages/Channels.tsx:269",size:14})})]})}function NH(){const[s,t]=$.useState(null),[e,n]=$.useState("all"),i=["all",...Array.from(new Set(tg.map(o=>o.category)))],a=e==="all"?tg:tg.filter(o=>o.category===e);return A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:284",className:"min-h-screen",style:{background:"radial-gradient(ellipse at 50% 0%, oklch(0.12 0.05 230) 0%, oklch(0.05 0.02 240) 70%)"},children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:286",className:"sticky top-0 z-20 px-4 py-3 border-b border-white/10",style:{background:"oklch(0.08 0.04 230 / 0.97)",backdropFilter:"blur(20px)"},children:A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:288",className:"flex items-center gap-3 max-w-4xl mx-auto",children:[A.jsx(ca,{"data-loc":"client/src/pages/Channels.tsx:289",href:"/",children:A.jsx("button",{"data-loc":"client/src/pages/Channels.tsx:290",className:"text-muted-foreground hover:text-white transition-colors",children:A.jsx(JB,{"data-loc":"client/src/pages/Channels.tsx:291",size:20})})}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:294",children:[A.jsx("h1",{"data-loc":"client/src/pages/Channels.tsx:295",className:"text-lg font-black text-white",children:"ðº ÙÙÙØ§Øª Ø§ÙØ¨Ø« اÙÙ
باشر"}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:296",className:"text-xs text-muted-foreground",children:"Ø´Ø§ÙØ¯ اÙÙÙÙØ§Øª Ø§ÙØ±ÙØ§Ø¶ÙØ© Ù
باشرة"})]})]})}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:301",className:"max-w-4xl mx-auto px-4 py-4 space-y-4",children:[s&&A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:304",className:"rounded-2xl overflow-hidden",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.3 0.07 220)"},children:[s.isFacebook?A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:306",style:{background:"#000"},children:[s.facebookEmbed?A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:308",className:"relative w-full",style:{paddingTop:"56.25%"},children:A.jsx("iframe",{"data-loc":"client/src/pages/Channels.tsx:309",src:s.facebookEmbed,className:"absolute inset-0 w-full h-full",style:{border:"none",overflow:"hidden"},scrolling:"no",frameBorder:0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",allowFullScreen:!0})}):A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:320",className:"aspect-video flex flex-col items-center justify-center gap-3",style:{background:"oklch(0.07 0.03 230)"},children:[A.jsx("span",{"data-loc":"client/src/pages/Channels.tsx:322",className:"text-5xl",children:"ð"}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:323",className:"text-white font-black text-lg",children:"Tadweer Sports 2"}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:324",className:"text-muted-foreground text-sm",children:"رابط Ø§ÙØ¨Ø« سÙÙØ¶Ø§Ù ÙØ±ÙباÙ"})]}),s.facebookUrl&&A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:328",className:"px-4 py-2 flex justify-end border-t border-white/10",children:A.jsx("a",{"data-loc":"client/src/pages/Channels.tsx:329",href:s.facebookUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-bold px-3 py-1.5 rounded-lg text-white",style:{background:"#1877F2"},children:"ð ÙØªØ ÙÙ ÙÙØ³Ø¨ÙÙ â"})})]}):s.isTwitch?A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:338",style:{background:"#000"},children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:339",className:"relative w-full",style:{paddingTop:"56.25%"},children:A.jsx("iframe",{"data-loc":"client/src/pages/Channels.tsx:340",src:`https://player.twitch.tv/?channel=${s.twitchChannel}&parent=beinsportt-ktzrlvux.manus.space`,className:"absolute inset-0 w-full h-full",style:{border:"none"},allowFullScreen:!0})}),A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:347",className:"px-4 py-2 flex justify-end border-t border-white/10",children:A.jsx("a",{"data-loc":"client/src/pages/Channels.tsx:348",href:`https://www.twitch.tv/${s.twitchChannel}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-bold px-3 py-1.5 rounded-lg text-white",style:{background:"#9146FF"},children:"ð£ ÙØªØ ÙÙ Twitch â"})})]}):s.streamUrl==="/live"?A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:356",className:"aspect-video flex flex-col items-center justify-center gap-3",style:{background:"oklch(0.07 0.03 230)"},children:[A.jsx(eg,{"data-loc":"client/src/pages/Channels.tsx:358",size:64,num:1}),A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:359",className:"text-white font-black",children:"Tadweer Sports 1"}),A.jsx(ca,{"data-loc":"client/src/pages/Channels.tsx:360",href:"/live",children:A.jsx("button",{"data-loc":"client/src/pages/Channels.tsx:361",className:"px-5 py-2.5 rounded-xl text-sm font-black text-white",style:{background:"linear-gradient(135deg, oklch(0.58 0.18 220), oklch(0.45 0.15 240))"},children:"ðº Ø´Ø§Ùد Ø§ÙØ¨Ø« اÙÙ
باشر â"})})]}):A.jsx(MH,{"data-loc":"client/src/pages/Channels.tsx:368",url:s.streamUrl,autoPlay:!0}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:370",className:"px-4 py-3 flex items-center gap-3",children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:371",className:"w-10 h-10 rounded-xl bg-black flex items-center justify-center overflow-hidden flex-shrink-0",children:s.category==="tadweer"?A.jsx(eg,{"data-loc":"client/src/pages/Channels.tsx:373",size:36,num:s.id===1?1:2}):s.logo?A.jsx("img",{"data-loc":"client/src/pages/Channels.tsx:375",src:s.logo,alt:s.name,className:"w-8 h-8 object-contain"}):A.jsx("span",{"data-loc":"client/src/pages/Channels.tsx:377",className:"text-xl",children:"ðº"})}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:380",className:"flex-1 min-w-0",children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:381",className:"text-white font-black text-sm",children:s.nameAr}),A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:382",className:"text-muted-foreground text-xs",children:s.name})]}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:384",className:"flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-bold",style:{background:Vl[s.c
222ategory].color+"22",color:Vl[s.category].color,border:`1px solid ${Vl[s.category].color}44`},children:[A.jsx(pF,{"data-loc":"client/src/pages/Channels.tsx:386",size:10}),Vl[s.category].label]})]})]}),A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:394",className:"flex gap-2 overflow-x-auto pb-1 scrollbar-hide",children:i.map(o=>A.jsx("button",{"data-loc":"client/src/pages/Channels.tsx:396",onClick:()=>n(o),className:"flex-shrink-0 px-4 py-2 rounded-xl text-xs font-black transition-all active:scale-95",style:{background:e===o?"linear-gradient(135deg, oklch(0.45 0.15 220), oklch(0.35 0.12 240))":"oklch(0.12 0.04 230)",border:e===o?"1px solid oklch(0.58 0.18 220)":"1px solid oklch(0.22 0.05 220)",color:e===o?"#fff":"oklch(0.65 0.08 220)"},children:o==="all"?"ð Ø§ÙÙÙ":o==="tadweer"?"ð Tadweer":o==="bein"?"ð¡ beIN":o==="alkass"?"â½ Alkass":"ð° Ø£Ø®Ø¨Ø§Ø±"},o))}),A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:413",className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:a.map(o=>{const c=s?.id===o.id,d=Vl[o.category].color;return A.jsxs("button",{"data-loc":"client/src/pages/Channels.tsx:418",onClick:()=>t(c?null:o),className:"flex flex-col items-center gap-2 p-4 rounded-2xl text-center transition-all active:scale-95",style:{background:c?`${d}22`:"oklch(0.1 0.04 230)",border:c?`2px solid ${d}`:"1px solid oklch(0.22 0.05 220)",boxShadow:c?`0 0 20px ${d}33`:"none"},children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:429",className:"w-14 h-14 rounded-2xl bg-black flex items-center justify-center overflow-hidden",style:{border:`1px solid ${d}44`},children:o.category==="tadweer"?A.jsx(eg,{"data-loc":"client/src/pages/Channels.tsx:432",size:48,num:o.id===1?1:2}):o.logo?A.jsx("img",{"data-loc":"client/src/pages/Channels.tsx:434",src:o.logo,alt:o.name,className:"w-10 h-10 object-contain",onError:f=>{f.target.style.display="none"}}):A.jsx("span",{"data-loc":"client/src/pages/Channels.tsx:436",className:"text-3xl",children:"ðº"})}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:441",children:[A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:442",className:"text-white text-xs font-black leading-tight",children:o.nameAr}),A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:443",className:"text-muted-foreground text-xs opacity-70 mt-0.5",children:o.name})]}),A.jsxs("div",{"data-loc":"client/src/pages/Channels.tsx:447",className:"flex items-center gap-1 text-xs font-bold",style:{color:o.isLive?"#4ade80":"#94a3b8"},children:[A.jsx("span",{"data-loc":"client/src/pages/Channels.tsx:449",className:`w-1.5 h-1.5 rounded-full ${o.isLive?"bg-green-400 animate-pulse":"bg-slate-400"}`}),o.isFacebook?"ÙÙØ³Ø¨ÙÙ":o.isLive?"Ù
باشر":"ÙØ±ÙباÙ"]})]},o.id)})}),A.jsx("div",{"data-loc":"client/src/pages/Channels.tsx:458",className:"rounded-xl p-3 text-center",style:{background:"oklch(0.1 0.04 230)",border:"1px solid oklch(0.2 0.05 220)"},children:A.jsx("p",{"data-loc":"client/src/pages/Channels.tsx:459",className:"text-xs text-muted-foreground/70",children:"بعض اÙÙÙÙØ§Øª ÙØ¯ تÙÙÙ Ù
ØØ¸Ùرة جغراÙÙØ§Ù ⢠جÙ
ÙØ¹ اÙÙÙÙØ§Øª اÙÙ
درجة تÙ
Ø§Ø®ØªØ¨Ø§Ø±ÙØ§ Ù
Ø³Ø¨ÙØ§Ù"})})]})]})}function BH({children:s}){return A.jsxs("div",{"data-loc":"client/src/App.tsx:21",className:"min-h-screen flex flex-col bg-background",children:[A.jsx(Oj,{"data-loc":"client/src/App.tsx:22"}),A.jsxs("div",{"data-loc":"client/src/App.tsx:23",className:"flex flex-1 overflow-hidden",children:[A.jsx(Ij,{"data-loc":"client/src/App.tsx:24"}),A.jsx("main",{"data-loc":"client/src/App.tsx:25",className:"flex-1 overflow-y-auto",children:s})]})]})}function FH(){return A.jsxs(QE,{"data-loc":"client/src/App.tsx:35",children:[A.jsx(on,{"data-loc":"client/src/App.tsx:37",path:"/admin-stream",component:D8}),A.jsx(on,{"data-loc":"client/src/App.tsx:38",path:"/live",component:I8}),A.jsx(on,{"data-loc":"client/src/App.tsx:39",path:"/channels",component:NH}),A.jsx(on,{"data-loc":"client/src/App.tsx:41",children:A.jsx(BH,{"data-loc":"client/src/App.tsx:42",children:A.jsxs(QE,{"data-loc":"client/src/App.tsx:43",children:[A.jsx(on,{"data-loc":"client/src/App.tsx:44",path:"/",component:Aj}),A.jsx(on,{"data-loc":"client/src/App.tsx:45",path:"/scorers",component:Rj}),A.jsx(on,{"data-loc":"client/src/App.tsx:46",path:"/standings",component:wj}),A.jsx(on,{"data-loc":"client/src/App.tsx:47",path:"/matches",component:Lj}
222),A.jsx(on,{"data-loc":"client/src/App.tsx:48",path:"/teams",component:_j}),A.jsx(on,{"data-loc":"client/src/App.tsx:49",path:"/members",component:Cj}),A.jsx(on,{"data-loc":"client/src/App.tsx:50",path:"/404",component:XE}),A.jsx(on,{"data-loc":"client/src/App.tsx:51",component:XE})]})})})]})}function UH(){return A.jsx(FF,{"data-loc":"client/src/App.tsx:61",children:A.jsx(jF,{"data-loc":"client/src/App.tsx:62",defaultTheme:"dark",children:A.jsxs(HB,{"data-loc":"client/src/App.tsx:63",children:[A.jsx(eM,{"data-loc":"client/src/App.tsx:64"}),A.jsx(FH,{"data-loc":"client/src/App.tsx:65"})]})})})}const jH=()=>{const s="https://manus.im",t="KtZrLvuXFjyMboN2WEMuMQ",e=`${window.location.origin}/api/oauth/callback`,n=crypto.randomUUID();document.cookie=`${NP}=${n}; Path=/; Max-Age=600; SameSite=None; Secure`;const i=BP({redirectUri:e,nonce:n}),a=new URL(`${s}/app-auth`);a.searchParams.set("appId",t),a.searchParams.set("redirectUri",e),a.searchParams.set("state",i),a.searchParams.set("type","signIn"),window.location.href=a.toString()},hf=new XO,cD=s=>{!(s instanceof ac)||typeof window>"u"||!(s.message===MP)||jH()};hf.getQueryCache().subscribe(s=>{if(s.type==="updated"&&s.action.type==="error"){const t=s.query.state.error;cD(t),console.error("[API Query Error]",t)}});hf.getMutationCache().subscribe(s=>{if(s.type==="updated"&&s.action.type==="error"){const t=s.mutation.state.error;cD(t),console.error("[API Mutation Error]",t)}});const $H=gR.createClient({links:[oP({url:"/api/trpc",transformer:Oi,headers(){try{const s=sessionStorage.getItem("manus-cookie");if(s){const t=`${PP}=`,n=s.split(";").find(i=>i.trim().startsWith(t))?.trim().slice(t.length);if(n)return{Authorization:`Bearer ${n}`}}}catch{}return{}},fetch(s,t){return globalThis.fetch(s,{...t??{},credentials:"include"})}})]});GP.createRoot(document.getElementById("root")).render(A.jsx(gR.Provider,{"data-loc":"client/src/main.tsx:76",client:$H,queryClient:hf,children:A.jsx(JO,{"data-loc":"client/src/main.tsx:77",client:hf,children:A.jsx(UH,{"data-loc":"client/src/main.tsx:78"})})}));
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.