ode-explorer 1.3.3-develop.202402071721 → 1.3.3-develop.202402221526

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1347 +0,0 @@
1
- var cu=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var D=(t,e,r)=>(cu(t,e,"read from private field"),r?r.call(t):e.get(t)),Y=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},H=(t,e,r,i)=>(cu(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var xl=(t,e,r,i)=>({set _(s){H(t,e,s,r)},get _(){return D(t,e,i)}}),ue=(t,e,r)=>(cu(t,e,"access private method"),r);import{r as E,c as Be,a as rs,R as Zy,g as Js,b as Ve,d as uE,u as Ce,C as xh,e as Ky}from"./react.js";import{odeServices as Ae}from"/assets/js/edifice-ts-client/index.js";import{S as Sp,a as po,b as Qy,c as dE,d as fE,e as Jy,f as pE,g as mE,h as gE,i as vE,j as yE,k as Pd,l as bE,m as xE,n as _E,o as wE,p as EE,q as SE}from"./edifice-icons.js";var eb={exports:{}},_h={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 TE=E,AE=Symbol.for("react.element"),CE=Symbol.for("react.fragment"),IE=Object.prototype.hasOwnProperty,RE=TE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PE={key:!0,ref:!0,__self:!0,__source:!0};function tb(t,e,r){var i,s={},n=null,a=null;r!==void 0&&(n=""+r),e.key!==void 0&&(n=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)IE.call(e,i)&&!PE.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)s[i]===void 0&&(s[i]=e[i]);return{$$typeof:AE,type:t,key:n,ref:a,props:s,_owner:RE.current}}_h.Fragment=CE;_h.jsx=tb;_h.jsxs=tb;eb.exports=_h;var x=eb.exports,fa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Qn=typeof window>"u"||"Deno"in window;function $t(){}function ME(t,e){return typeof t=="function"?t(e):t}function Md(t){return typeof t=="number"&&t>=0&&t!==1/0}function rb(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Um(t,e){const{type:r="all",exact:i,fetchStatus:s,predicate:n,queryKey:a,stale:o}=t;if(a){if(i){if(e.queryHash!==Tp(a,e.options))return!1}else if(!go(e.queryKey,a))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||typeof s<"u"&&s!==e.state.fetchStatus||n&&!n(e))}function jm(t,e){const{exact:r,status:i,predicate:s,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(r){if(mo(e.options.mutationKey)!==mo(n))return!1}else if(!go(e.options.mutationKey,n))return!1}return!(i&&e.state.status!==i||s&&!s(e))}function Tp(t,e){return((e==null?void 0:e.queryKeyHashFn)||mo)(t)}function mo(t){return JSON.stringify(t,(e,r)=>Od(r)?Object.keys(r).sort().reduce((i,s)=>(i[s]=r[s],i),{}):r)}function go(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!go(t[r],e[r])):!1}function ib(t,e){if(t===e)return t;const r=$m(t)&&$m(e);if(r||Od(t)&&Od(e)){const i=r?t.length:Object.keys(t).length,s=r?e:Object.keys(e),n=s.length,a=r?[]:{};let o=0;for(let l=0;l<n;l++){const c=r?l:s[l];a[c]=ib(t[c],e[c]),a[c]===t[c]&&o++}return i===n&&o===i?t:a}return e}function kc(t,e){if(t&&!e||e&&!t)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function $m(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Od(t){if(!Gm(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!Gm(r)||!r.hasOwnProperty("isPrototypeOf"))}function Gm(t){return Object.prototype.toString.call(t)==="[object Object]"}function sb(t){return new Promise(e=>{setTimeout(e,t)})}function zm(t){sb(0).then(t)}function kd(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?ib(t,e):e}function OE(t,e,r=0){const i=[...t,e];return r&&i.length>r?i.slice(1):i}function kE(t,e,r=0){const i=[e,...t];return r&&i.length>r?i.slice(0,-1):i}var Cs,Ii,Ln,jy,DE=(jy=class extends fa{constructor(){super();Y(this,Cs,void 0);Y(this,Ii,void 0);Y(this,Ln,void 0);H(this,Ln,e=>{if(!Qn&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){D(this,Ii)||this.setEventListener(D(this,Ln))}onUnsubscribe(){var e;this.hasListeners()||((e=D(this,Ii))==null||e.call(this),H(this,Ii,void 0))}setEventListener(e){var r;H(this,Ln,e),(r=D(this,Ii))==null||r.call(this),H(this,Ii,e(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(e){D(this,Cs)!==e&&(H(this,Cs,e),this.onFocus())}onFocus(){this.listeners.forEach(e=>{e()})}isFocused(){var e;return typeof D(this,Cs)=="boolean"?D(this,Cs):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Cs=new WeakMap,Ii=new WeakMap,Ln=new WeakMap,jy),Dc=new DE,Bn,Ri,Fn,$y,NE=($y=class extends fa{constructor(){super();Y(this,Bn,!0);Y(this,Ri,void 0);Y(this,Fn,void 0);H(this,Fn,e=>{if(!Qn&&window.addEventListener){const r=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){D(this,Ri)||this.setEventListener(D(this,Fn))}onUnsubscribe(){var e;this.hasListeners()||((e=D(this,Ri))==null||e.call(this),H(this,Ri,void 0))}setEventListener(e){var r;H(this,Fn,e),(r=D(this,Ri))==null||r.call(this),H(this,Ri,e(this.setOnline.bind(this)))}setOnline(e){D(this,Bn)!==e&&(H(this,Bn,e),this.listeners.forEach(i=>{i(e)}))}isOnline(){return D(this,Bn)}},Bn=new WeakMap,Ri=new WeakMap,Fn=new WeakMap,$y),Nc=new NE;function LE(t){return Math.min(1e3*2**t,3e4)}function wh(t){return(t??"online")==="online"?Nc.isOnline():!0}var nb=class{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function hu(t){return t instanceof nb}function ab(t){let e=!1,r=0,i=!1,s,n,a;const o=new Promise((g,y)=>{n=g,a=y}),l=g=>{var y;i||(d(new nb(g)),(y=t.abort)==null||y.call(t))},c=()=>{e=!0},h=()=>{e=!1},f=()=>!Dc.isFocused()||t.networkMode!=="always"&&!Nc.isOnline(),u=g=>{var y;i||(i=!0,(y=t.onSuccess)==null||y.call(t,g),s==null||s(),n(g))},d=g=>{var y;i||(i=!0,(y=t.onError)==null||y.call(t,g),s==null||s(),a(g))},p=()=>new Promise(g=>{var y;s=_=>{const v=i||!f();return v&&g(_),v},(y=t.onPause)==null||y.call(t)}).then(()=>{var g;s=void 0,i||(g=t.onContinue)==null||g.call(t)}),m=()=>{if(i)return;let g;try{g=t.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(u).catch(y=>{var A;if(i)return;const _=t.retry??(Qn?0:3),v=t.retryDelay??LE,b=typeof v=="function"?v(r,y):v,w=_===!0||typeof _=="number"&&r<_||typeof _=="function"&&_(r,y);if(e||!w){d(y);return}r++,(A=t.onFail)==null||A.call(t,r,y),sb(b).then(()=>{if(f())return p()}).then(()=>{e?d(y):m()})})};return wh(t.networkMode)?m():p().then(m),{promise:o,cancel:l,continue:()=>(s==null?void 0:s())?o:Promise.resolve(),cancelRetry:c,continueRetry:h}}function BE(){let t=[],e=0,r=h=>{h()},i=h=>{h()};const s=h=>{let f;e++;try{f=h()}finally{e--,e||o()}return f},n=h=>{e?t.push(h):zm(()=>{r(h)})},a=h=>(...f)=>{n(()=>{h(...f)})},o=()=>{const h=t;t=[],h.length&&zm(()=>{i(()=>{h.forEach(f=>{r(f)})})})};return{batch:s,batchCalls:a,schedule:n,setNotifyFunction:h=>{r=h},setBatchNotifyFunction:h=>{i=h}}}var Xe=BE(),Is,Gy,ob=(Gy=class{constructor(){Y(this,Is,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Md(this.gcTime)&&H(this,Is,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Qn?1/0:5*60*1e3))}clearGcTimeout(){D(this,Is)&&(clearTimeout(D(this,Is)),H(this,Is,void 0))}},Is=new WeakMap,Gy),Un,jn,Bt,Pi,Ft,Ke,Vo,Rs,$n,uc,nr,Qr,zy,FE=(zy=class extends ob{constructor(e){super();Y(this,$n);Y(this,nr);Y(this,Un,void 0);Y(this,jn,void 0);Y(this,Bt,void 0);Y(this,Pi,void 0);Y(this,Ft,void 0);Y(this,Ke,void 0);Y(this,Vo,void 0);Y(this,Rs,void 0);H(this,Rs,!1),H(this,Vo,e.defaultOptions),ue(this,$n,uc).call(this,e.options),H(this,Ke,[]),H(this,Bt,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,H(this,Un,e.state||UE(this.options)),this.state=D(this,Un),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!D(this,Ke).length&&this.state.fetchStatus==="idle"&&D(this,Bt).remove(this)}setData(e,r){const i=kd(this.state.data,e,this.options);return ue(this,nr,Qr).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(e,r){ue(this,nr,Qr).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var i;const r=D(this,Pi);return(i=D(this,Ft))==null||i.cancel(e),r?r.then($t).catch($t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,Un))}isActive(){return D(this,Ke).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||D(this,Ke).some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!rb(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=D(this,Ke).find(i=>i.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=D(this,Ft))==null||r.continue()}onOnline(){var r;const e=D(this,Ke).find(i=>i.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=D(this,Ft))==null||r.continue()}addObserver(e){D(this,Ke).includes(e)||(D(this,Ke).push(e),this.clearGcTimeout(),D(this,Bt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){D(this,Ke).includes(e)&&(H(this,Ke,D(this,Ke).filter(r=>r!==e)),D(this,Ke).length||(D(this,Ft)&&(D(this,Rs)?D(this,Ft).cancel({revert:!0}):D(this,Ft).cancelRetry()),this.scheduleGc()),D(this,Bt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return D(this,Ke).length}invalidate(){this.state.isInvalidated||ue(this,nr,Qr).call(this,{type:"invalidate"})}fetch(e,r){var c,h,f,u;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(D(this,Pi))return(c=D(this,Ft))==null||c.continueRetry(),D(this,Pi)}if(e&&ue(this,$n,uc).call(this,e),!this.options.queryFn){const d=D(this,Ke).find(p=>p.options.queryFn);d&&ue(this,$n,uc).call(this,d.options)}const i=new AbortController,s={queryKey:this.queryKey,meta:this.meta},n=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(H(this,Rs,!0),i.signal)})};n(s);const a=()=>this.options.queryFn?(H(this,Rs,!1),this.options.persister?this.options.persister(this.options.queryFn,s,this):this.options.queryFn(s)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};n(o),(h=this.options.behavior)==null||h.onFetch(o,this),H(this,jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=o.fetchOptions)==null?void 0:f.meta))&&ue(this,nr,Qr).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const l=d=>{var p,m,g,y;hu(d)&&d.silent||ue(this,nr,Qr).call(this,{type:"error",error:d}),hu(d)||((m=(p=D(this,Bt).config).onError)==null||m.call(p,d,this),(y=(g=D(this,Bt).config).onSettled)==null||y.call(g,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return H(this,Ft,ab({fn:o.fetchFn,abort:i.abort.bind(i),onSuccess:d=>{var p,m,g,y;if(typeof d>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(d),(m=(p=D(this,Bt).config).onSuccess)==null||m.call(p,d,this),(y=(g=D(this,Bt).config).onSettled)==null||y.call(g,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(d,p)=>{ue(this,nr,Qr).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{ue(this,nr,Qr).call(this,{type:"pause"})},onContinue:()=>{ue(this,nr,Qr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode})),H(this,Pi,D(this,Ft).promise),D(this,Pi)}},Un=new WeakMap,jn=new WeakMap,Bt=new WeakMap,Pi=new WeakMap,Ft=new WeakMap,Ke=new WeakMap,Vo=new WeakMap,Rs=new WeakMap,$n=new WeakSet,uc=function(e){this.options={...D(this,Vo),...e},this.updateGcTime(this.options.gcTime)},nr=new WeakSet,Qr=function(e){const r=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:e.meta??null,fetchStatus:wh(this.options.networkMode)?"fetching":"paused",...!i.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return hu(s)&&s.revert&&D(this,jn)?{...D(this,jn),fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=r(this.state),Xe.batch(()=>{D(this,Ke).forEach(i=>{i.onQueryUpdate()}),D(this,Bt).notify({query:this,type:"updated",action:e})})},zy);function UE(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",i=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Cr,Hy,jE=(Hy=class extends fa{constructor(e={}){super();Y(this,Cr,void 0);this.config=e,H(this,Cr,new Map)}build(e,r,i){const s=r.queryKey,n=r.queryHash??Tp(s,r);let a=this.get(n);return a||(a=new FE({cache:this,queryKey:s,queryHash:n,options:e.defaultQueryOptions(r),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){D(this,Cr).has(e.queryHash)||(D(this,Cr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=D(this,Cr).get(e.queryHash);r&&(e.destroy(),r===e&&D(this,Cr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Xe.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return D(this,Cr).get(e)}getAll(){return[...D(this,Cr).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(i=>Um(r,i))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(i=>Um(e,i)):r}notify(e){Xe.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Xe.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Xe.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Cr=new WeakMap,Hy),Ir,Wo,It,Gn,Rr,xi,Vy,$E=(Vy=class extends ob{constructor(e){super();Y(this,Rr);Y(this,Ir,void 0);Y(this,Wo,void 0);Y(this,It,void 0);Y(this,Gn,void 0);this.mutationId=e.mutationId,H(this,Wo,e.defaultOptions),H(this,It,e.mutationCache),H(this,Ir,[]),this.state=e.state||lb(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...D(this,Wo),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){D(this,Ir).includes(e)||(D(this,Ir).push(e),this.clearGcTimeout(),D(this,It).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){H(this,Ir,D(this,Ir).filter(r=>r!==e)),this.scheduleGc(),D(this,It).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){D(this,Ir).length||(this.state.status==="pending"?this.scheduleGc():D(this,It).remove(this))}continue(){var e;return((e=D(this,Gn))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,n,a,o,l,c,h,f,u,d,p,m,g,y,_,v,b,w,A,S;const r=()=>(H(this,Gn,ab({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{ue(this,Rr,xi).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{ue(this,Rr,xi).call(this,{type:"pause"})},onContinue:()=>{ue(this,Rr,xi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),D(this,Gn).promise),i=this.state.status==="pending";try{if(!i){ue(this,Rr,xi).call(this,{type:"pending",variables:e}),await((n=(s=D(this,It).config).onMutate)==null?void 0:n.call(s,e,this));const T=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));T!==this.state.context&&ue(this,Rr,xi).call(this,{type:"pending",context:T,variables:e})}const C=await r();return await((c=(l=D(this,It).config).onSuccess)==null?void 0:c.call(l,C,e,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,C,e,this.state.context)),await((d=(u=D(this,It).config).onSettled)==null?void 0:d.call(u,C,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,C,null,e,this.state.context)),ue(this,Rr,xi).call(this,{type:"success",data:C}),C}catch(C){try{throw await((y=(g=D(this,It).config).onError)==null?void 0:y.call(g,C,e,this.state.context,this)),await((v=(_=this.options).onError)==null?void 0:v.call(_,C,e,this.state.context)),await((w=(b=D(this,It).config).onSettled)==null?void 0:w.call(b,void 0,C,this.state.variables,this.state.context,this)),await((S=(A=this.options).onSettled)==null?void 0:S.call(A,void 0,C,e,this.state.context)),C}finally{ue(this,Rr,xi).call(this,{type:"error",error:C})}}}},Ir=new WeakMap,Wo=new WeakMap,It=new WeakMap,Gn=new WeakMap,Rr=new WeakSet,xi=function(e){const r=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!wh(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Xe.batch(()=>{D(this,Ir).forEach(i=>{i.onMutationUpdate(e)}),D(this,It).notify({mutation:this,type:"updated",action:e})})},Vy);function lb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ut,Xo,Ps,Wy,GE=(Wy=class extends fa{constructor(e={}){super();Y(this,Ut,void 0);Y(this,Xo,void 0);Y(this,Ps,void 0);this.config=e,H(this,Ut,[]),H(this,Xo,0)}build(e,r,i){const s=new $E({mutationCache:this,mutationId:++xl(this,Xo)._,options:e.defaultMutationOptions(r),state:i});return this.add(s),s}add(e){D(this,Ut).push(e),this.notify({type:"added",mutation:e})}remove(e){H(this,Ut,D(this,Ut).filter(r=>r!==e)),this.notify({type:"removed",mutation:e})}clear(){Xe.batch(()=>{D(this,Ut).forEach(e=>{this.remove(e)})})}getAll(){return D(this,Ut)}find(e){const r={exact:!0,...e};return D(this,Ut).find(i=>jm(r,i))}findAll(e={}){return D(this,Ut).filter(r=>jm(e,r))}notify(e){Xe.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){return H(this,Ps,(D(this,Ps)??Promise.resolve()).then(()=>{const e=D(this,Ut).filter(r=>r.state.isPaused);return Xe.batch(()=>e.reduce((r,i)=>r.then(()=>i.continue().catch($t)),Promise.resolve()))}).then(()=>{H(this,Ps,void 0)})),D(this,Ps)}},Ut=new WeakMap,Xo=new WeakMap,Ps=new WeakMap,Wy);function Dd(t){return{onFetch:(e,r)=>{const i=async()=>{var p,m,g,y,_;const s=e.options,n=(g=(m=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:g.direction,a=((y=e.state.data)==null?void 0:y.pages)||[],o=((_=e.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const h=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(e.signal.aborted?c=!0:e.signal.addEventListener("abort",()=>{c=!0}),e.signal)})},f=e.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),u=async(v,b,w)=>{if(c)return Promise.reject();if(b==null&&v.pages.length)return Promise.resolve(v);const A={queryKey:e.queryKey,pageParam:b,direction:w?"backward":"forward",meta:e.options.meta};h(A);const S=await f(A),{maxPages:C}=e.options,T=w?kE:OE;return{pages:T(v.pages,S,C),pageParams:T(v.pageParams,b,C)}};let d;if(n&&a.length){const v=n==="backward",b=v?cb:Nd,w={pages:a,pageParams:o},A=b(s,w);d=await u(w,A,v)}else{d=await u(l,o[0]??s.initialPageParam);const v=t??a.length;for(let b=1;b<v;b++){const w=Nd(s,d);d=await u(d,w)}}return d};e.options.persister?e.fetchFn=()=>{var s,n;return(n=(s=e.options).persister)==null?void 0:n.call(s,i,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=i}}}function Nd(t,{pages:e,pageParams:r}){const i=e.length-1;return t.getNextPageParam(e[i],e,r[i],r)}function cb(t,{pages:e,pageParams:r}){var i;return(i=t.getPreviousPageParam)==null?void 0:i.call(t,e[0],e,r[0],r)}function zE(t,e){return e?Nd(t,e)!=null:!1}function HE(t,e){return!e||!t.getPreviousPageParam?!1:cb(t,e)!=null}var ze,Mi,Oi,zn,Hn,ki,Vn,Wn,Xy,ZU=(Xy=class{constructor(t={}){Y(this,ze,void 0);Y(this,Mi,void 0);Y(this,Oi,void 0);Y(this,zn,void 0);Y(this,Hn,void 0);Y(this,ki,void 0);Y(this,Vn,void 0);Y(this,Wn,void 0);H(this,ze,t.queryCache||new jE),H(this,Mi,t.mutationCache||new GE),H(this,Oi,t.defaultOptions||{}),H(this,zn,new Map),H(this,Hn,new Map),H(this,ki,0)}mount(){xl(this,ki)._++,D(this,ki)===1&&(H(this,Vn,Dc.subscribe(()=>{Dc.isFocused()&&(this.resumePausedMutations(),D(this,ze).onFocus())})),H(this,Wn,Nc.subscribe(()=>{Nc.isOnline()&&(this.resumePausedMutations(),D(this,ze).onOnline())})))}unmount(){var t,e;xl(this,ki)._--,D(this,ki)===0&&((t=D(this,Vn))==null||t.call(this),H(this,Vn,void 0),(e=D(this,Wn))==null||e.call(this),H(this,Wn,void 0))}isFetching(t){return D(this,ze).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return D(this,Mi).findAll({...t,status:"pending"}).length}getQueryData(t){var e;return(e=D(this,ze).find({queryKey:t}))==null?void 0:e.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);return e!==void 0?Promise.resolve(e):this.fetchQuery(t)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:e,state:r})=>{const i=r.data;return[e,i]})}setQueryData(t,e,r){const i=D(this,ze).find({queryKey:t}),s=i==null?void 0:i.state.data,n=ME(e,s);if(typeof n>"u")return;const a=this.defaultQueryOptions({queryKey:t});return D(this,ze).build(this,a).setData(n,{...r,manual:!0})}setQueriesData(t,e,r){return Xe.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,r)]))}getQueryState(t){var e;return(e=D(this,ze).find({queryKey:t}))==null?void 0:e.state}removeQueries(t){const e=D(this,ze);Xe.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=D(this,ze),i={type:"active",...t};return Xe.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(i,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},i=Xe.batch(()=>D(this,ze).findAll(t).map(s=>s.cancel(r)));return Promise.all(i).then($t).catch($t)}invalidateQueries(t={},e={}){return Xe.batch(()=>{if(D(this,ze).findAll(t).forEach(i=>{i.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t={},e){const r={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},i=Xe.batch(()=>D(this,ze).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let n=s.fetch(void 0,r);return r.throwOnError||(n=n.catch($t)),s.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(i).then($t)}fetchQuery(t){const e=this.defaultQueryOptions(t);typeof e.retry>"u"&&(e.retry=!1);const r=D(this,ze).build(this,e);return r.isStaleByTime(e.staleTime)?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then($t).catch($t)}fetchInfiniteQuery(t){return t.behavior=Dd(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then($t).catch($t)}resumePausedMutations(){return D(this,Mi).resumePausedMutations()}getQueryCache(){return D(this,ze)}getMutationCache(){return D(this,Mi)}getDefaultOptions(){return D(this,Oi)}setDefaultOptions(t){H(this,Oi,t)}setQueryDefaults(t,e){D(this,zn).set(mo(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...D(this,zn).values()];let r={};return e.forEach(i=>{go(t,i.queryKey)&&(r={...r,...i.defaultOptions})}),r}setMutationDefaults(t,e){D(this,Hn).set(mo(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...D(this,Hn).values()];let r={};return e.forEach(i=>{go(t,i.mutationKey)&&(r={...r,...i.defaultOptions})}),r}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const e={...D(this,Oi).queries,...(t==null?void 0:t.queryKey)&&this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Tp(e.queryKey,e)),typeof e.refetchOnReconnect>"u"&&(e.refetchOnReconnect=e.networkMode!=="always"),typeof e.throwOnError>"u"&&(e.throwOnError=!!e.suspense),typeof e.networkMode>"u"&&e.persister&&(e.networkMode="offlineFirst"),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...D(this,Oi).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){D(this,ze).clear(),D(this,Mi).clear()}},ze=new WeakMap,Mi=new WeakMap,Oi=new WeakMap,zn=new WeakMap,Hn=new WeakMap,ki=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,Xy),vt,Me,Xn,at,Ms,Yn,Pr,Yo,qn,Zn,Os,ks,Di,Ds,Ns,Ba,qo,Ld,Zo,Bd,Ko,Fd,Qo,Ud,Jo,jd,el,$d,tl,Gd,bh,ub,Yy,hb=(Yy=class extends fa{constructor(e,r){super();Y(this,Ns);Y(this,qo);Y(this,Zo);Y(this,Ko);Y(this,Qo);Y(this,Jo);Y(this,el);Y(this,tl);Y(this,bh);Y(this,vt,void 0);Y(this,Me,void 0);Y(this,Xn,void 0);Y(this,at,void 0);Y(this,Ms,void 0);Y(this,Yn,void 0);Y(this,Pr,void 0);Y(this,Yo,void 0);Y(this,qn,void 0);Y(this,Zn,void 0);Y(this,Os,void 0);Y(this,ks,void 0);Y(this,Di,void 0);Y(this,Ds,void 0);H(this,Me,void 0),H(this,Xn,void 0),H(this,at,void 0),H(this,Ds,new Set),H(this,vt,e),this.options=r,H(this,Pr,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,Me).addObserver(this),Hm(D(this,Me),this.options)?ue(this,Ns,Ba).call(this):this.updateResult(),ue(this,Qo,Ud).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zd(D(this,Me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zd(D(this,Me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,Jo,jd).call(this),ue(this,el,$d).call(this),D(this,Me).removeObserver(this)}setOptions(e,r){const i=this.options,s=D(this,Me);if(this.options=D(this,vt).defaultQueryOptions(e),kc(i,this.options)||D(this,vt).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,Me),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=i.queryKey),ue(this,tl,Gd).call(this);const n=this.hasListeners();n&&Vm(D(this,Me),s,this.options,i)&&ue(this,Ns,Ba).call(this),this.updateResult(r),n&&(D(this,Me)!==s||this.options.enabled!==i.enabled||this.options.staleTime!==i.staleTime)&&ue(this,qo,Ld).call(this);const a=ue(this,Zo,Bd).call(this);n&&(D(this,Me)!==s||this.options.enabled!==i.enabled||a!==D(this,Di))&&ue(this,Ko,Fd).call(this,a)}getOptimisticResult(e){const r=D(this,vt).getQueryCache().build(D(this,vt),e),i=this.createResult(r,e);return WE(this,i)&&(H(this,at,i),H(this,Yn,this.options),H(this,Ms,D(this,Me).state)),i}getCurrentResult(){return D(this,at)}trackResult(e){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(D(this,Ds).add(i),e[i])})}),r}getCurrentQuery(){return D(this,Me)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=D(this,vt).defaultQueryOptions(e),i=D(this,vt).getQueryCache().build(D(this,vt),r);return i.isFetchingOptimistic=!0,i.fetch().then(()=>this.createResult(i,r))}fetch(e){return ue(this,Ns,Ba).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,at)))}createResult(e,r){var A;const i=D(this,Me),s=this.options,n=D(this,at),a=D(this,Ms),o=D(this,Yn),c=e!==i?e.state:D(this,Xn),{state:h}=e;let{error:f,errorUpdatedAt:u,fetchStatus:d,status:p}=h,m=!1,g;if(r._optimisticResults){const S=this.hasListeners(),C=!S&&Hm(e,r),T=S&&Vm(e,i,r,s);(C||T)&&(d=wh(e.options.networkMode)?"fetching":"paused",h.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(d="idle")}if(r.select&&typeof h.data<"u")if(n&&h.data===(a==null?void 0:a.data)&&r.select===D(this,Yo))g=D(this,qn);else try{H(this,Yo,r.select),g=r.select(h.data),g=kd(n==null?void 0:n.data,g,r),H(this,qn,g),H(this,Pr,null)}catch(S){H(this,Pr,S)}else g=h.data;if(typeof r.placeholderData<"u"&&typeof g>"u"&&p==="pending"){let S;if(n!=null&&n.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData))S=n.data;else if(S=typeof r.placeholderData=="function"?r.placeholderData((A=D(this,Zn))==null?void 0:A.state.data,D(this,Zn)):r.placeholderData,r.select&&typeof S<"u")try{S=r.select(S),H(this,Pr,null)}catch(C){H(this,Pr,C)}typeof S<"u"&&(p="success",g=kd(n==null?void 0:n.data,S,r),m=!0)}D(this,Pr)&&(f=D(this,Pr),g=D(this,qn),u=Date.now(),p="error");const y=d==="fetching",_=p==="pending",v=p==="error",b=_&&y;return{status:p,fetchStatus:d,isPending:_,isSuccess:p==="success",isError:v,isInitialLoading:b,isLoading:b,data:g,dataUpdatedAt:h.dataUpdatedAt,error:f,errorUpdatedAt:u,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:v&&h.dataUpdatedAt===0,isPaused:d==="paused",isPlaceholderData:m,isRefetchError:v&&h.dataUpdatedAt!==0,isStale:Ap(e,r),refetch:this.refetch}}updateResult(e){const r=D(this,at),i=this.createResult(D(this,Me),this.options);if(H(this,Ms,D(this,Me).state),H(this,Yn,this.options),D(this,Ms).data!==void 0&&H(this,Zn,D(this,Me)),kc(i,r))return;H(this,at,i);const s={},n=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!D(this,Ds).size)return!0;const l=new Set(o??D(this,Ds));return this.options.throwOnError&&l.add("error"),Object.keys(D(this,at)).some(c=>{const h=c;return D(this,at)[h]!==r[h]&&l.has(h)})};(e==null?void 0:e.listeners)!==!1&&n()&&(s.listeners=!0),ue(this,bh,ub).call(this,{...s,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,Qo,Ud).call(this)}},vt=new WeakMap,Me=new WeakMap,Xn=new WeakMap,at=new WeakMap,Ms=new WeakMap,Yn=new WeakMap,Pr=new WeakMap,Yo=new WeakMap,qn=new WeakMap,Zn=new WeakMap,Os=new WeakMap,ks=new WeakMap,Di=new WeakMap,Ds=new WeakMap,Ns=new WeakSet,Ba=function(e){ue(this,tl,Gd).call(this);let r=D(this,Me).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch($t)),r},qo=new WeakSet,Ld=function(){if(ue(this,Jo,jd).call(this),Qn||D(this,at).isStale||!Md(this.options.staleTime))return;const r=rb(D(this,at).dataUpdatedAt,this.options.staleTime)+1;H(this,Os,setTimeout(()=>{D(this,at).isStale||this.updateResult()},r))},Zo=new WeakSet,Bd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,Me)):this.options.refetchInterval)??!1},Ko=new WeakSet,Fd=function(e){ue(this,el,$d).call(this),H(this,Di,e),!(Qn||this.options.enabled===!1||!Md(D(this,Di))||D(this,Di)===0)&&H(this,ks,setInterval(()=>{(this.options.refetchIntervalInBackground||Dc.isFocused())&&ue(this,Ns,Ba).call(this)},D(this,Di)))},Qo=new WeakSet,Ud=function(){ue(this,qo,Ld).call(this),ue(this,Ko,Fd).call(this,ue(this,Zo,Bd).call(this))},Jo=new WeakSet,jd=function(){D(this,Os)&&(clearTimeout(D(this,Os)),H(this,Os,void 0))},el=new WeakSet,$d=function(){D(this,ks)&&(clearInterval(D(this,ks)),H(this,ks,void 0))},tl=new WeakSet,Gd=function(){const e=D(this,vt).getQueryCache().build(D(this,vt),this.options);if(e===D(this,Me))return;const r=D(this,Me);H(this,Me,e),H(this,Xn,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},bh=new WeakSet,ub=function(e){Xe.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(D(this,at))}),D(this,vt).getQueryCache().notify({query:D(this,Me),type:"observerResultsUpdated"})})},Yy);function VE(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Hm(t,e){return VE(t,e)||t.state.dataUpdatedAt>0&&zd(t,e,e.refetchOnMount)}function zd(t,e,r){if(e.enabled!==!1){const i=typeof r=="function"?r(t):r;return i==="always"||i!==!1&&Ap(t,e)}return!1}function Vm(t,e,r,i){return r.enabled!==!1&&(t!==e||i.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&Ap(t,r)}function Ap(t,e){return t.isStaleByTime(e.staleTime)}function WE(t,e){return!kc(t.getCurrentResult(),e)}var XE=class extends hb{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:Dd()},e)}getOptimisticResult(t){return t.behavior=Dd(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var l,c,h,f;const{state:r}=t,i=super.createResult(t,e),{isFetching:s,isRefetching:n}=i,a=s&&((c=(l=r.fetchMeta)==null?void 0:l.fetchMore)==null?void 0:c.direction)==="forward",o=s&&((f=(h=r.fetchMeta)==null?void 0:h.fetchMore)==null?void 0:f.direction)==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:zE(e,r.data),hasPreviousPage:HE(e,r.data),isFetchingNextPage:a,isFetchingPreviousPage:o,isRefetching:n&&!a&&!o}}},Ni,ht,jt,ni,Kn,dc,rl,Hd,qy,YE=(qy=class extends fa{constructor(r,i){super();Y(this,Kn);Y(this,rl);Y(this,Ni,void 0);Y(this,ht,void 0);Y(this,jt,void 0);Y(this,ni,void 0);H(this,ht,void 0),H(this,Ni,r),this.setOptions(i),this.bindMethods(),ue(this,Kn,dc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const i=this.options;this.options=D(this,Ni).defaultMutationOptions(r),kc(i,this.options)||D(this,Ni).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,jt),observer:this}),(s=D(this,jt))==null||s.setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=D(this,jt))==null||r.removeObserver(this)}onMutationUpdate(r){ue(this,Kn,dc).call(this),ue(this,rl,Hd).call(this,r)}getCurrentResult(){return D(this,ht)}reset(){H(this,jt,void 0),ue(this,Kn,dc).call(this),ue(this,rl,Hd).call(this)}mutate(r,i){var s;return H(this,ni,i),(s=D(this,jt))==null||s.removeObserver(this),H(this,jt,D(this,Ni).getMutationCache().build(D(this,Ni),this.options)),D(this,jt).addObserver(this),D(this,jt).execute(r)}},Ni=new WeakMap,ht=new WeakMap,jt=new WeakMap,ni=new WeakMap,Kn=new WeakSet,dc=function(){var i;const r=((i=D(this,jt))==null?void 0:i.state)??lb();H(this,ht,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},rl=new WeakSet,Hd=function(r){Xe.batch(()=>{var i,s,n,a,o,l,c,h;D(this,ni)&&this.hasListeners()&&((r==null?void 0:r.type)==="success"?((s=(i=D(this,ni)).onSuccess)==null||s.call(i,r.data,D(this,ht).variables,D(this,ht).context),(a=(n=D(this,ni)).onSettled)==null||a.call(n,r.data,null,D(this,ht).variables,D(this,ht).context)):(r==null?void 0:r.type)==="error"&&((l=(o=D(this,ni)).onError)==null||l.call(o,r.error,D(this,ht).variables,D(this,ht).context),(h=(c=D(this,ni)).onSettled)==null||h.call(c,void 0,r.error,D(this,ht).variables,D(this,ht).context))),this.listeners.forEach(f=>{f(D(this,ht))})})},qy),db=E.createContext(void 0),fb=t=>{const e=E.useContext(db);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},QU=({client:t,children:e})=>(E.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),E.createElement(db.Provider,{value:t},e)),pb=E.createContext(!1),qE=()=>E.useContext(pb);pb.Provider;function ZE(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var KE=E.createContext(ZE()),QE=()=>E.useContext(KE);function mb(t,e){return typeof t=="function"?t(...e):!!t}var JE=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},eS=t=>{E.useEffect(()=>{t.clearReset()},[t])},tS=({result:t,errorResetBoundary:e,throwOnError:r,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&mb(r,[t.error,i]),rS=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},iS=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,sS=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function gb(t,e,r){const i=fb(r),s=qE(),n=QE(),a=i.defaultQueryOptions(t);a._optimisticResults=s?"isRestoring":"optimistic",rS(a),JE(a,n),eS(n);const[o]=E.useState(()=>new e(i,a)),l=o.getOptimisticResult(a);if(E.useSyncExternalStore(E.useCallback(c=>{const h=s?()=>{}:o.subscribe(Xe.batchCalls(c));return o.updateResult(),h},[o,s]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),E.useEffect(()=>{o.setOptions(a,{listeners:!1})},[a,o]),iS(a,l))throw sS(a,o,n);if(tS({result:l,errorResetBoundary:n,throwOnError:a.throwOnError,query:o.getCurrentQuery()}))throw l.error;return a.notifyOnChangeProps?l:o.trackResult(l)}function vb(t,e){return gb(t,hb,e)}function yb(t,e){const r=fb(e),[i]=E.useState(()=>new YE(r,t));E.useEffect(()=>{i.setOptions(t)},[i,t]);const s=E.useSyncExternalStore(E.useCallback(a=>i.subscribe(Xe.batchCalls(a)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),n=E.useCallback((a,o)=>{i.mutate(a,o).catch(nS)},[i]);if(s.error&&mb(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:n,mutateAsync:s.mutate}}function nS(){}function JU(t,e){return gb(t,XE,e)}function bb(t){var e,r,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=bb(t[e]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r);return i}function re(){for(var t,e,r=0,i="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=bb(t))&&(i&&(i+=" "),i+=e);return i}var Wm={exports:{}};(function(t,e){(function(r,i){var s="1.0.36",n="",a="?",o="function",l="undefined",c="object",h="string",f="major",u="model",d="name",p="type",m="vendor",g="version",y="architecture",_="console",v="mobile",b="tablet",w="smarttv",A="wearable",S="embedded",C=350,T="Amazon",M="Apple",I="ASUS",k="BlackBerry",P="Browser",R="Chrome",O="Edge",L="Firefox",N="Google",B="Huawei",U="LG",F="Microsoft",j="Motorola",z="Opera",q="Samsung",J="Sharp",ee="Sony",ne="Xiaomi",se="Zebra",pe="Facebook",ge="Chromium OS",ae="Mac OS",he=function(ve,Te){var oe={};for(var Pe in ve)Te[Pe]&&Te[Pe].length%2===0?oe[Pe]=Te[Pe].concat(ve[Pe]):oe[Pe]=ve[Pe];return oe},ye=function(ve){for(var Te={},oe=0;oe<ve.length;oe++)Te[ve[oe].toUpperCase()]=ve[oe];return Te},Ee=function(ve,Te){return typeof ve===h?Ue(Te).indexOf(Ue(ve))!==-1:!1},Ue=function(ve){return ve.toLowerCase()},qe=function(ve){return typeof ve===h?ve.replace(/[^\d\.]/g,n).split(".")[0]:i},Tt=function(ve,Te){if(typeof ve===h)return ve=ve.replace(/^\s\s*/,n),typeof Te===l?ve:ve.substring(0,C)},mr=function(ve,Te){for(var oe=0,Pe,vi,yr,Re,le,br;oe<Te.length&&!le;){var lu=Te[oe],Fm=Te[oe+1];for(Pe=vi=0;Pe<lu.length&&!le&&lu[Pe];)if(le=lu[Pe++].exec(ve),le)for(yr=0;yr<Fm.length;yr++)br=le[++vi],Re=Fm[yr],typeof Re===c&&Re.length>0?Re.length===2?typeof Re[1]==o?this[Re[0]]=Re[1].call(this,br):this[Re[0]]=Re[1]:Re.length===3?typeof Re[1]===o&&!(Re[1].exec&&Re[1].test)?this[Re[0]]=br?Re[1].call(this,br,Re[2]):i:this[Re[0]]=br?br.replace(Re[1],Re[2]):i:Re.length===4&&(this[Re[0]]=br?Re[3].call(this,br.replace(Re[1],Re[2])):i):this[Re]=br||i;oe+=2}},gr=function(ve,Te){for(var oe in Te)if(typeof Te[oe]===c&&Te[oe].length>0){for(var Pe=0;Pe<Te[oe].length;Pe++)if(Ee(Te[oe][Pe],ve))return oe===a?i:oe}else if(Ee(Te[oe],ve))return oe===a?i:oe;return ve},ou={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},vr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},hs={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,g],[/opios[\/ ]+([\w\.]+)/i],[g,[d,z+" Mini"]],[/\bopr\/([\w\.]+)/i],[g,[d,z]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,g],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[d,"UC"+P]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[g,[d,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[g,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[d,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+P],g],[/\bfocus\/([\w\.]+)/i],[g,[d,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[d,z+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[d,z+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[d,"MIUI "+P]],[/fxios\/([-\w\.]+)/i],[g,[d,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 "+P]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 "+P],g],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[d,g],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,pe],g],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[d,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,R+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[d,"Android "+P]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[g,gr,ou]],[/(webkit|khtml)\/([\w\.]+)/i],[d,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[d,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[d,g],[/(cobalt)\/([\w\.]+)/i],[d,[g,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,Ue]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,n,Ue]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,Ue]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[m,q],[p,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[m,q],[p,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[m,M],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[m,M],[p,b]],[/(macintosh);/i],[u,[m,M]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[m,J],[p,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[m,B],[p,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[m,B],[p,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[m,ne],[p,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[m,ne],[p,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[m,"OPPO"],[p,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[m,"Vivo"],[p,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[m,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[m,j],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[m,j],[p,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[m,U],[p,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[m,U],[p,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[m,"Lenovo"],[p,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[m,"Nokia"],[p,v]],[/(pixel c)\b/i],[u,[m,N],[p,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[m,N],[p,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[m,ee],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[m,ee],[p,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[m,"OnePlus"],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[m,T],[p,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[m,T],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,m,[p,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[m,k],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[m,I],[p,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[m,I],[p,v]],[/(nexus 9)/i],[u,[m,"HTC"],[p,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[u,/_/g," "],[p,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[m,"Acer"],[p,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[m,"Meizu"],[p,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[m,u,[p,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[m,u,[p,b]],[/(surface duo)/i],[u,[m,F],[p,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[m,"Fairphone"],[p,v]],[/(u304aa)/i],[u,[m,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[u,[m,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[u,[m,"RCA"],[p,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[m,"Dell"],[p,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[m,"Verizon"],[p,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[m,"Barnes & Noble"],[p,b]],[/\b(tm\d{3}\w+) b/i],[u,[m,"NuVision"],[p,b]],[/\b(k88) b/i],[u,[m,"ZTE"],[p,b]],[/\b(nx\d{3}j) b/i],[u,[m,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[u,[m,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[u,[m,"Swiss"],[p,b]],[/\b((zeki)?tb.*\b) b/i],[u,[m,"Zeki"],[p,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],u,[p,b]],[/\b(ns-?\w{0,9}) b/i],[u,[m,"Insignia"],[p,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[m,"NextBook"],[p,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],u,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],u,[p,v]],[/\b(ph-1) /i],[u,[m,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[m,"Envizen"],[p,b]],[/\b(trio[-\w\. ]+) b/i],[u,[m,"MachSpeed"],[p,b]],[/\btu_(1491) b/i],[u,[m,"Rotor"],[p,b]],[/(shield[\w ]+) b/i],[u,[m,"Nvidia"],[p,b]],[/(sprint) (\w+)/i],[m,u,[p,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[m,F],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[m,se],[p,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[m,se],[p,v]],[/smart-tv.+(samsung)/i],[m,[p,w]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[m,q],[p,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,U],[p,w]],[/(apple) ?tv/i],[m,[u,M+" TV"],[p,w]],[/crkey/i],[[u,R+"cast"],[m,N],[p,w]],[/droid.+aft(\w+)( bui|\))/i],[u,[m,T],[p,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[m,J],[p,w]],[/(bravia[\w ]+)( bui|\))/i],[u,[m,ee],[p,w]],[/(mitv-\w{5}) bui/i],[u,[m,ne],[p,w]],[/Hbbtv.*(technisat) (.*);/i],[m,u,[p,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,Tt],[u,Tt],[p,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,u,[p,_]],[/droid.+; (shield) bui/i],[u,[m,"Nvidia"],[p,_]],[/(playstation [345portablevi]+)/i],[u,[m,ee],[p,_]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[m,F],[p,_]],[/((pebble))app/i],[m,u,[p,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[m,M],[p,A]],[/droid.+; (glass) \d/i],[u,[m,N],[p,A]],[/droid.+; (wt63?0{2,3})\)/i],[u,[m,se],[p,A]],[/(quest( 2| pro)?)/i],[u,[m,pe],[p,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[p,S]],[/(aeobc)\b/i],[u,[m,T],[p,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[p,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[d,O+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,g],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,g],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[d,[g,gr,vr]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[d,"Windows"],[g,gr,vr]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,ae],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,g],[/\(bb(10);/i],[g,[d,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[g,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[d,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[d,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,ge],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,g],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,g]]},gt=function(ve,Te){if(typeof ve===c&&(Te=ve,ve=i),!(this instanceof gt))return new gt(ve,Te).getResult();var oe=typeof r!==l&&r.navigator?r.navigator:i,Pe=ve||(oe&&oe.userAgent?oe.userAgent:n),vi=oe&&oe.userAgentData?oe.userAgentData:i,yr=Te?he(hs,Te):hs,Re=oe&&oe.userAgent==Pe;return this.getBrowser=function(){var le={};return le[d]=i,le[g]=i,mr.call(le,Pe,yr.browser),le[f]=qe(le[g]),Re&&oe&&oe.brave&&typeof oe.brave.isBrave==o&&(le[d]="Brave"),le},this.getCPU=function(){var le={};return le[y]=i,mr.call(le,Pe,yr.cpu),le},this.getDevice=function(){var le={};return le[m]=i,le[u]=i,le[p]=i,mr.call(le,Pe,yr.device),Re&&!le[p]&&vi&&vi.mobile&&(le[p]=v),Re&&le[u]=="Macintosh"&&oe&&typeof oe.standalone!==l&&oe.maxTouchPoints&&oe.maxTouchPoints>2&&(le[u]="iPad",le[p]=b),le},this.getEngine=function(){var le={};return le[d]=i,le[g]=i,mr.call(le,Pe,yr.engine),le},this.getOS=function(){var le={};return le[d]=i,le[g]=i,mr.call(le,Pe,yr.os),Re&&!le[d]&&vi&&vi.platform!="Unknown"&&(le[d]=vi.platform.replace(/chrome os/i,ge).replace(/macos/i,ae)),le},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Pe},this.setUA=function(le){return Pe=typeof le===h&&le.length>C?Tt(le,C):le,this},this.setUA(Pe),this};gt.VERSION=s,gt.BROWSER=ye([d,g,f]),gt.CPU=ye([y]),gt.DEVICE=ye([u,m,p,_,v,w,b,A,S]),gt.ENGINE=gt.OS=ye([d,g]),t.exports&&(e=t.exports=gt),e.UAParser=gt;var Xr=typeof r!==l&&(r.jQuery||r.Zepto);if(Xr&&!Xr.ua){var gi=new gt;Xr.ua=gi.getResult(),Xr.ua.get=function(){return gi.getUA()},Xr.ua.set=function(ve){gi.setUA(ve);var Te=gi.getResult();for(var oe in Te)Xr.ua[oe]=Te[oe]}}})(typeof window=="object"?window:Be)})(Wm,Wm.exports);let aS={data:""},oS=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||aS,lS=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,cS=/\/\*[^]*?\*\/| +/g,Xm=/\n+/g,Ti=(t,e)=>{let r="",i="",s="";for(let n in t){let a=t[n];n[0]=="@"?n[1]=="i"?r=n+" "+a+";":i+=n[1]=="f"?Ti(a,n):n+"{"+Ti(a,n[1]=="k"?"":e)+"}":typeof a=="object"?i+=Ti(a,e?e.replace(/([^,])+/g,o=>n.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,o):o?o+" "+l:l)):n):a!=null&&(n=/^--/.test(n)?n:n.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Ti.p?Ti.p(n,a):n+":"+a+";")}return r+(e&&s?e+"{"+s+"}":s)+i},Yr={},xb=t=>{if(typeof t=="object"){let e="";for(let r in t)e+=r+xb(t[r]);return e}return t},hS=(t,e,r,i,s)=>{let n=xb(t),a=Yr[n]||(Yr[n]=(l=>{let c=0,h=11;for(;c<l.length;)h=101*h+l.charCodeAt(c++)>>>0;return"go"+h})(n));if(!Yr[a]){let l=n!==t?t:(c=>{let h,f,u=[{}];for(;h=lS.exec(c.replace(cS,""));)h[4]?u.shift():h[3]?(f=h[3].replace(Xm," ").trim(),u.unshift(u[0][f]=u[0][f]||{})):u[0][h[1]]=h[2].replace(Xm," ").trim();return u[0]})(t);Yr[a]=Ti(s?{["@keyframes "+a]:l}:l,r?"":"."+a)}let o=r&&Yr.g?Yr.g:null;return r&&(Yr.g=Yr[a]),((l,c,h,f)=>{f?c.data=c.data.replace(f,l):c.data.indexOf(l)===-1&&(c.data=h?l+c.data:c.data+l)})(Yr[a],e,i,o),a},uS=(t,e,r)=>t.reduce((i,s,n)=>{let a=e[n];if(a&&a.call){let o=a(r),l=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=l?"."+l:o&&typeof o=="object"?o.props?"":Ti(o,""):o===!1?"":o}return i+s+(a??"")},"");function Eh(t){let e=this||{},r=t.call?t(e.p):t;return hS(r.unshift?r.raw?uS(r,[].slice.call(arguments,1),e.p):r.reduce((i,s)=>Object.assign(i,s&&s.call?s(e.p):s),{}):r,oS(e.target),e.g,e.o,e.k)}let _b,Vd,Wd;Eh.bind({g:1});let ui=Eh.bind({k:1});function dS(t,e,r,i){Ti.p=e,_b=t,Vd=r,Wd=i}function is(t,e){let r=this||{};return function(){let i=arguments;function s(n,a){let o=Object.assign({},n),l=o.className||s.className;r.p=Object.assign({theme:Vd&&Vd()},o),r.o=/ *go\d+/.test(l),o.className=Eh.apply(r,i)+(l?" "+l:""),e&&(o.ref=a);let c=t;return t[0]&&(c=o.as||t,delete o.as),Wd&&c[0]&&Wd(o),_b(c,o)}return e?e(s):s}}var fS=t=>typeof t=="function",Lc=(t,e)=>fS(t)?t(e):t,pS=(()=>{let t=0;return()=>(++t).toString()})(),wb=(()=>{let t;return()=>{if(t===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");t=!e||e.matches}return t}})(),mS=20,fc=new Map,gS=1e3,Ym=t=>{if(fc.has(t))return;let e=setTimeout(()=>{fc.delete(t),en({type:4,toastId:t})},gS);fc.set(t,e)},vS=t=>{let e=fc.get(t);e&&clearTimeout(e)},Xd=(t,e)=>{switch(e.type){case 0:return{...t,toasts:[e.toast,...t.toasts].slice(0,mS)};case 1:return e.toast.id&&vS(e.toast.id),{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case 2:let{toast:r}=e;return t.toasts.find(n=>n.id===r.id)?Xd(t,{type:1,toast:r}):Xd(t,{type:0,toast:r});case 3:let{toastId:i}=e;return i?Ym(i):t.toasts.forEach(n=>{Ym(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===i||i===void 0?{...n,visible:!1}:n)};case 4:return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)};case 5:return{...t,pausedAt:e.time};case 6:let s=e.time-(t.pausedAt||0);return{...t,pausedAt:void 0,toasts:t.toasts.map(n=>({...n,pauseDuration:n.pauseDuration+s}))}}},pc=[],mc={toasts:[],pausedAt:void 0},en=t=>{mc=Xd(mc,t),pc.forEach(e=>{e(mc)})},yS={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},bS=(t={})=>{let[e,r]=E.useState(mc);E.useEffect(()=>(pc.push(r),()=>{let s=pc.indexOf(r);s>-1&&pc.splice(s,1)}),[e]);let i=e.toasts.map(s=>{var n,a;return{...t,...t[s.type],...s,duration:s.duration||((n=t[s.type])==null?void 0:n.duration)||(t==null?void 0:t.duration)||yS[s.type],style:{...t.style,...(a=t[s.type])==null?void 0:a.style,...s.style}}});return{...e,toasts:i}},xS=(t,e="blank",r)=>({createdAt:Date.now(),visible:!0,type:e,ariaProps:{role:"status","aria-live":"polite"},message:t,pauseDuration:0,...r,id:(r==null?void 0:r.id)||pS()}),il=t=>(e,r)=>{let i=xS(e,t,r);return en({type:2,toast:i}),i.id},Mt=(t,e)=>il("blank")(t,e);Mt.error=il("error");Mt.success=il("success");Mt.loading=il("loading");Mt.custom=il("custom");Mt.dismiss=t=>{en({type:3,toastId:t})};Mt.remove=t=>en({type:4,toastId:t});Mt.promise=(t,e,r)=>{let i=Mt.loading(e.loading,{...r,...r==null?void 0:r.loading});return t.then(s=>(Mt.success(Lc(e.success,s),{id:i,...r,...r==null?void 0:r.success}),s)).catch(s=>{Mt.error(Lc(e.error,s),{id:i,...r,...r==null?void 0:r.error})}),t};var _S=(t,e)=>{en({type:1,toast:{id:t,height:e}})},wS=()=>{en({type:5,time:Date.now()})},ES=t=>{let{toasts:e,pausedAt:r}=bS(t);E.useEffect(()=>{if(r)return;let n=Date.now(),a=e.map(o=>{if(o.duration===1/0)return;let l=(o.duration||0)+o.pauseDuration-(n-o.createdAt);if(l<0){o.visible&&Mt.dismiss(o.id);return}return setTimeout(()=>Mt.dismiss(o.id),l)});return()=>{a.forEach(o=>o&&clearTimeout(o))}},[e,r]);let i=E.useCallback(()=>{r&&en({type:6,time:Date.now()})},[r]),s=E.useCallback((n,a)=>{let{reverseOrder:o=!1,gutter:l=8,defaultPosition:c}=a||{},h=e.filter(d=>(d.position||c)===(n.position||c)&&d.height),f=h.findIndex(d=>d.id===n.id),u=h.filter((d,p)=>p<f&&d.visible).length;return h.filter(d=>d.visible).slice(...o?[u+1]:[0,u]).reduce((d,p)=>d+(p.height||0)+l,0)},[e]);return{toasts:e,handlers:{updateHeight:_S,startPause:wS,endPause:i,calculateOffset:s}}},SS=ui`
10
- from {
11
- transform: scale(0) rotate(45deg);
12
- opacity: 0;
13
- }
14
- to {
15
- transform: scale(1) rotate(45deg);
16
- opacity: 1;
17
- }`,TS=ui`
18
- from {
19
- transform: scale(0);
20
- opacity: 0;
21
- }
22
- to {
23
- transform: scale(1);
24
- opacity: 1;
25
- }`,AS=ui`
26
- from {
27
- transform: scale(0) rotate(90deg);
28
- opacity: 0;
29
- }
30
- to {
31
- transform: scale(1) rotate(90deg);
32
- opacity: 1;
33
- }`,CS=is("div")`
34
- width: 20px;
35
- opacity: 0;
36
- height: 20px;
37
- border-radius: 10px;
38
- background: ${t=>t.primary||"#ff4b4b"};
39
- position: relative;
40
- transform: rotate(45deg);
41
-
42
- animation: ${SS} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
43
- forwards;
44
- animation-delay: 100ms;
45
-
46
- &:after,
47
- &:before {
48
- content: '';
49
- animation: ${TS} 0.15s ease-out forwards;
50
- animation-delay: 150ms;
51
- position: absolute;
52
- border-radius: 3px;
53
- opacity: 0;
54
- background: ${t=>t.secondary||"#fff"};
55
- bottom: 9px;
56
- left: 4px;
57
- height: 2px;
58
- width: 12px;
59
- }
60
-
61
- &:before {
62
- animation: ${AS} 0.15s ease-out forwards;
63
- animation-delay: 180ms;
64
- transform: rotate(90deg);
65
- }
66
- `,IS=ui`
67
- from {
68
- transform: rotate(0deg);
69
- }
70
- to {
71
- transform: rotate(360deg);
72
- }
73
- `,RS=is("div")`
74
- width: 12px;
75
- height: 12px;
76
- box-sizing: border-box;
77
- border: 2px solid;
78
- border-radius: 100%;
79
- border-color: ${t=>t.secondary||"#e0e0e0"};
80
- border-right-color: ${t=>t.primary||"#616161"};
81
- animation: ${IS} 1s linear infinite;
82
- `,PS=ui`
83
- from {
84
- transform: scale(0) rotate(45deg);
85
- opacity: 0;
86
- }
87
- to {
88
- transform: scale(1) rotate(45deg);
89
- opacity: 1;
90
- }`,MS=ui`
91
- 0% {
92
- height: 0;
93
- width: 0;
94
- opacity: 0;
95
- }
96
- 40% {
97
- height: 0;
98
- width: 6px;
99
- opacity: 1;
100
- }
101
- 100% {
102
- opacity: 1;
103
- height: 10px;
104
- }`,OS=is("div")`
105
- width: 20px;
106
- opacity: 0;
107
- height: 20px;
108
- border-radius: 10px;
109
- background: ${t=>t.primary||"#61d345"};
110
- position: relative;
111
- transform: rotate(45deg);
112
-
113
- animation: ${PS} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
114
- forwards;
115
- animation-delay: 100ms;
116
- &:after {
117
- content: '';
118
- box-sizing: border-box;
119
- animation: ${MS} 0.2s ease-out forwards;
120
- opacity: 0;
121
- animation-delay: 200ms;
122
- position: absolute;
123
- border-right: 2px solid;
124
- border-bottom: 2px solid;
125
- border-color: ${t=>t.secondary||"#fff"};
126
- bottom: 6px;
127
- left: 6px;
128
- height: 10px;
129
- width: 6px;
130
- }
131
- `,kS=is("div")`
132
- position: absolute;
133
- `,DS=is("div")`
134
- position: relative;
135
- display: flex;
136
- justify-content: center;
137
- align-items: center;
138
- min-width: 20px;
139
- min-height: 20px;
140
- `,NS=ui`
141
- from {
142
- transform: scale(0.6);
143
- opacity: 0.4;
144
- }
145
- to {
146
- transform: scale(1);
147
- opacity: 1;
148
- }`,LS=is("div")`
149
- position: relative;
150
- transform: scale(0.6);
151
- opacity: 0.4;
152
- min-width: 20px;
153
- animation: ${NS} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
154
- forwards;
155
- `,BS=({toast:t})=>{let{icon:e,type:r,iconTheme:i}=t;return e!==void 0?typeof e=="string"?E.createElement(LS,null,e):e:r==="blank"?null:E.createElement(DS,null,E.createElement(RS,{...i}),r!=="loading"&&E.createElement(kS,null,r==="error"?E.createElement(CS,{...i}):E.createElement(OS,{...i})))},FS=t=>`
156
- 0% {transform: translate3d(0,${t*-200}%,0) scale(.6); opacity:.5;}
157
- 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
158
- `,US=t=>`
159
- 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
160
- 100% {transform: translate3d(0,${t*-150}%,-1px) scale(.6); opacity:0;}
161
- `,jS="0%{opacity:0;} 100%{opacity:1;}",$S="0%{opacity:1;} 100%{opacity:0;}",GS=is("div")`
162
- display: flex;
163
- align-items: center;
164
- background: #fff;
165
- color: #363636;
166
- line-height: 1.3;
167
- will-change: transform;
168
- box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
169
- max-width: 350px;
170
- pointer-events: auto;
171
- padding: 8px 10px;
172
- border-radius: 8px;
173
- `,zS=is("div")`
174
- display: flex;
175
- justify-content: center;
176
- margin: 4px 10px;
177
- color: inherit;
178
- flex: 1 1 auto;
179
- white-space: pre-line;
180
- `,HS=(t,e)=>{let r=t.includes("top")?1:-1,[i,s]=wb()?[jS,$S]:[FS(r),US(r)];return{animation:e?`${ui(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ui(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},VS=E.memo(({toast:t,position:e,style:r,children:i})=>{let s=t.height?HS(t.position||e||"top-center",t.visible):{opacity:0},n=E.createElement(BS,{toast:t}),a=E.createElement(zS,{...t.ariaProps},Lc(t.message,t));return E.createElement(GS,{className:t.className,style:{...s,...r,...t.style}},typeof i=="function"?i({icon:n,message:a}):E.createElement(E.Fragment,null,n,a))});dS(E.createElement);var WS=({id:t,className:e,style:r,onHeightUpdate:i,children:s})=>{let n=E.useCallback(a=>{if(a){let o=()=>{let l=a.getBoundingClientRect().height;i(t,l)};o(),new MutationObserver(o).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[t,i]);return E.createElement("div",{ref:n,className:e,style:r},s)},XS=(t,e)=>{let r=t.includes("top"),i=r?{top:0}:{bottom:0},s=t.includes("center")?{justifyContent:"center"}:t.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:wb()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(r?1:-1)}px)`,...i,...s}},YS=Eh`
181
- z-index: 9999;
182
- > * {
183
- pointer-events: auto;
184
- }
185
- `,_l=16,qS=({reverseOrder:t,position:e="top-center",toastOptions:r,gutter:i,children:s,containerStyle:n,containerClassName:a})=>{let{toasts:o,handlers:l}=ES(r);return E.createElement("div",{style:{position:"fixed",zIndex:9999,top:_l,left:_l,right:_l,bottom:_l,pointerEvents:"none",...n},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},o.map(c=>{let h=c.position||e,f=l.calculateOffset(c,{reverseOrder:t,gutter:i,defaultPosition:e}),u=XS(h,f);return E.createElement(WS,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?YS:"",style:u},c.type==="custom"?Lc(c.message,c):s?s(c):E.createElement(VS,{toast:c,position:h}))}))},Sa=Mt;function ZS(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function wl(t){return t instanceof Element||t instanceof ZS(t).Element}const vo=Math.min,zt=Math.max,Bc=Math.round,El=Math.floor,Ki=t=>({x:t,y:t}),KS={left:"right",right:"left",bottom:"top",top:"bottom"},QS={start:"end",end:"start"};function Sh(t,e){return typeof t=="function"?t(e):t}function Gs(t){return t.split("-")[0]}function sl(t){return t.split("-")[1]}function JS(t){return t==="x"?"y":"x"}function Eb(t){return t==="y"?"height":"width"}function Th(t){return["top","bottom"].includes(Gs(t))?"y":"x"}function Sb(t){return JS(Th(t))}function eT(t,e,r){r===void 0&&(r=!1);const i=sl(t),s=Sb(t),n=Eb(s);let a=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=Fc(a)),[a,Fc(a)]}function tT(t){const e=Fc(t);return[Yd(t),e,Yd(e)]}function Yd(t){return t.replace(/start|end/g,e=>QS[e])}function rT(t,e,r){const i=["left","right"],s=["right","left"],n=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return r?e?s:i:e?i:s;case"left":case"right":return e?n:a;default:return[]}}function iT(t,e,r,i){const s=sl(t);let n=rT(Gs(t),r==="start",i);return s&&(n=n.map(a=>a+"-"+s),e&&(n=n.concat(n.map(Yd)))),n}function Fc(t){return t.replace(/left|right|bottom|top/g,e=>KS[e])}function sT(t){return{top:0,right:0,bottom:0,left:0,...t}}function nT(t){return typeof t!="number"?sT(t):{top:t,right:t,bottom:t,left:t}}function Uc(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function qm(t,e,r){let{reference:i,floating:s}=t;const n=Th(e),a=Sb(e),o=Eb(a),l=Gs(e),c=n==="y",h=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,u=i[o]/2-s[o]/2;let d;switch(l){case"top":d={x:h,y:i.y-s.height};break;case"bottom":d={x:h,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-s.width,y:f};break;default:d={x:i.x,y:i.y}}switch(sl(e)){case"start":d[a]-=u*(r&&c?-1:1);break;case"end":d[a]+=u*(r&&c?-1:1);break}return d}const aT=async(t,e,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:n=[],platform:a}=r,o=n.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:f}=qm(c,i,l),u=i,d={},p=0;for(let m=0;m<o.length;m++){const{name:g,fn:y}=o[m],{x:_,y:v,data:b,reset:w}=await y({x:h,y:f,initialPlacement:i,placement:u,strategy:s,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:e}});h=_??h,f=v??f,d={...d,[g]:{...d[g],...b}},w&&p<=50&&(p++,typeof w=="object"&&(w.placement&&(u=w.placement),w.rects&&(c=w.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):w.rects),{x:h,y:f}=qm(c,u,l)),m=-1)}return{x:h,y:f,placement:u,strategy:s,middlewareData:d}};async function Tb(t,e){var r;e===void 0&&(e={});const{x:i,y:s,platform:n,rects:a,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:d=0}=Sh(e,t),p=nT(d),g=o[u?f==="floating"?"reference":"floating":f],y=Uc(await n.getClippingRect({element:(r=await(n.isElement==null?void 0:n.isElement(g)))==null||r?g:g.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:l})),_=f==="floating"?{...a.floating,x:i,y:s}:a.reference,v=await(n.getOffsetParent==null?void 0:n.getOffsetParent(o.floating)),b=await(n.isElement==null?void 0:n.isElement(v))?await(n.getScale==null?void 0:n.getScale(v))||{x:1,y:1}:{x:1,y:1},w=Uc(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:l}):_);return{top:(y.top-w.top+p.top)/b.y,bottom:(w.bottom-y.bottom+p.bottom)/b.y,left:(y.left-w.left+p.left)/b.x,right:(w.right-y.right+p.right)/b.x}}const oT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,i;const{placement:s,middlewareData:n,rects:a,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=Sh(t,e);if((r=n.arrow)!=null&&r.alignmentOffset)return{};const y=Gs(s),_=Gs(o)===o,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=u||(_||!m?[Fc(o)]:tT(o));!u&&p!=="none"&&b.push(...iT(o,m,p,v));const w=[o,...b],A=await Tb(e,g),S=[];let C=((i=n.flip)==null?void 0:i.overflows)||[];if(h&&S.push(A[y]),f){const k=eT(s,a,v);S.push(A[k[0]],A[k[1]])}if(C=[...C,{placement:s,overflows:S}],!S.every(k=>k<=0)){var T,M;const k=(((T=n.flip)==null?void 0:T.index)||0)+1,P=w[k];if(P)return{data:{index:k,overflows:C},reset:{placement:P}};let R=(M=C.filter(O=>O.overflows[0]<=0).sort((O,L)=>O.overflows[1]-L.overflows[1])[0])==null?void 0:M.placement;if(!R)switch(d){case"bestFit":{var I;const O=(I=C.map(L=>[L.placement,L.overflows.filter(N=>N>0).reduce((N,B)=>N+B,0)]).sort((L,N)=>L[1]-N[1])[0])==null?void 0:I[0];O&&(R=O);break}case"initialPlacement":R=o;break}if(s!==R)return{reset:{placement:R}}}return{}}}};async function lT(t,e){const{placement:r,platform:i,elements:s}=t,n=await(i.isRTL==null?void 0:i.isRTL(s.floating)),a=Gs(r),o=sl(r),l=Th(r)==="y",c=["left","top"].includes(a)?-1:1,h=n&&l?-1:1,f=Sh(e,t);let{mainAxis:u,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return o&&typeof p=="number"&&(d=o==="end"?p*-1:p),l?{x:d*h,y:u*c}:{x:u*c,y:d*h}}const cT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,i;const{x:s,y:n,placement:a,middlewareData:o}=e,l=await lT(e,t);return a===((r=o.offset)==null?void 0:r.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:s+l.x,y:n+l.y,data:{...l,placement:a}}}}},hT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:i,platform:s,elements:n}=e,{apply:a=()=>{},...o}=Sh(t,e),l=await Tb(e,o),c=Gs(r),h=sl(r),f=Th(r)==="y",{width:u,height:d}=i.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=h===(await(s.isRTL==null?void 0:s.isRTL(n.floating))?"start":"end")?"left":"right"):(m=c,p=h==="end"?"top":"bottom");const g=d-l[p],y=u-l[m],_=!e.middlewareData.shift;let v=g,b=y;if(f){const A=u-l.left-l.right;b=h||_?vo(y,A):A}else{const A=d-l.top-l.bottom;v=h||_?vo(g,A):A}if(_&&!h){const A=zt(l.left,0),S=zt(l.right,0),C=zt(l.top,0),T=zt(l.bottom,0);f?b=u-2*(A!==0||S!==0?A+S:zt(l.left,l.right)):v=d-2*(C!==0||T!==0?C+T:zt(l.top,l.bottom))}await a({...e,availableWidth:b,availableHeight:v});const w=await s.getDimensions(n.floating);return u!==w.width||d!==w.height?{reset:{rects:!0}}:{}}}};function Qi(t){return Ab(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function mi(t){var e;return(e=(Ab(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ab(t){return t instanceof Node||t instanceof Dt(t).Node}function di(t){return t instanceof Element||t instanceof Dt(t).Element}function $r(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function Zm(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function nl(t){const{overflow:e,overflowX:r,overflowY:i,display:s}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(s)}function uT(t){return["table","td","th"].includes(Qi(t))}function Cp(t){const e=Ip(),r=Zt(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(r.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(r.contain||"").includes(i))}function Cb(t){let e=Jn(t);for(;$r(e)&&!Ah(e);){if(Cp(e))return e;e=Jn(e)}return null}function Ip(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ah(t){return["html","body","#document"].includes(Qi(t))}function Zt(t){return Dt(t).getComputedStyle(t)}function Ch(t){return di(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Jn(t){if(Qi(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Zm(t)&&t.host||mi(t);return Zm(e)?e.host:e}function Ib(t){const e=Jn(t);return Ah(e)?t.ownerDocument?t.ownerDocument.body:t.body:$r(e)&&nl(e)?e:Ib(e)}function yo(t,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=Ib(t),n=s===((i=t.ownerDocument)==null?void 0:i.body),a=Dt(s);return n?e.concat(a,a.visualViewport||[],nl(s)?s:[],a.frameElement&&r?yo(a.frameElement):[]):e.concat(s,yo(s,[],r))}function Rb(t){const e=Zt(t);let r=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=$r(t),n=s?t.offsetWidth:r,a=s?t.offsetHeight:i,o=Bc(r)!==n||Bc(i)!==a;return o&&(r=n,i=a),{width:r,height:i,$:o}}function Rp(t){return di(t)?t:t.contextElement}function Tn(t){const e=Rp(t);if(!$r(e))return Ki(1);const r=e.getBoundingClientRect(),{width:i,height:s,$:n}=Rb(e);let a=(n?Bc(r.width):r.width)/i,o=(n?Bc(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const dT=Ki(0);function Pb(t){const e=Dt(t);return!Ip()||!e.visualViewport?dT:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function fT(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Dt(t)?!1:e}function zs(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),n=Rp(t);let a=Ki(1);e&&(i?di(i)&&(a=Tn(i)):a=Tn(t));const o=fT(n,r,i)?Pb(n):Ki(0);let l=(s.left+o.x)/a.x,c=(s.top+o.y)/a.y,h=s.width/a.x,f=s.height/a.y;if(n){const u=Dt(n),d=i&&di(i)?Dt(i):i;let p=u.frameElement;for(;p&&i&&d!==u;){const m=Tn(p),g=p.getBoundingClientRect(),y=Zt(p),_=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,v=g.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,h*=m.x,f*=m.y,l+=_,c+=v,p=Dt(p).frameElement}}return Uc({width:h,height:f,x:l,y:c})}const pT=[":popover-open",":modal"];function Mb(t){let e=!1,r=0,i=0;function s(n){try{e=e||t.matches(n)}catch{}}if(pT.forEach(n=>{s(n)}),e){const n=Cb(t);if(n){const a=n.getBoundingClientRect();r=a.x,i=a.y}}return[e,r,i]}function mT(t){let{elements:e,rect:r,offsetParent:i,strategy:s}=t;const n=mi(i),[a]=e?Mb(e.floating):[!1];if(i===n||a)return r;let o={scrollLeft:0,scrollTop:0},l=Ki(1);const c=Ki(0),h=$r(i);if((h||!h&&s!=="fixed")&&((Qi(i)!=="body"||nl(n))&&(o=Ch(i)),$r(i))){const f=zs(i);l=Tn(i),c.x=f.x+i.clientLeft,c.y=f.y+i.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-o.scrollLeft*l.x+c.x,y:r.y*l.y-o.scrollTop*l.y+c.y}}function gT(t){return Array.from(t.getClientRects())}function Ob(t){return zs(mi(t)).left+Ch(t).scrollLeft}function vT(t){const e=mi(t),r=Ch(t),i=t.ownerDocument.body,s=zt(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=zt(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-r.scrollLeft+Ob(t);const o=-r.scrollTop;return Zt(i).direction==="rtl"&&(a+=zt(e.clientWidth,i.clientWidth)-s),{width:s,height:n,x:a,y:o}}function yT(t,e){const r=Dt(t),i=mi(t),s=r.visualViewport;let n=i.clientWidth,a=i.clientHeight,o=0,l=0;if(s){n=s.width,a=s.height;const c=Ip();(!c||c&&e==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:n,height:a,x:o,y:l}}function bT(t,e){const r=zs(t,!0,e==="fixed"),i=r.top+t.clientTop,s=r.left+t.clientLeft,n=$r(t)?Tn(t):Ki(1),a=t.clientWidth*n.x,o=t.clientHeight*n.y,l=s*n.x,c=i*n.y;return{width:a,height:o,x:l,y:c}}function Km(t,e,r){let i;if(e==="viewport")i=yT(t,r);else if(e==="document")i=vT(mi(t));else if(di(e))i=bT(e,r);else{const s=Pb(t);i={...e,x:e.x-s.x,y:e.y-s.y}}return Uc(i)}function kb(t,e){const r=Jn(t);return r===e||!di(r)||Ah(r)?!1:Zt(r).position==="fixed"||kb(r,e)}function xT(t,e){const r=e.get(t);if(r)return r;let i=yo(t,[],!1).filter(o=>di(o)&&Qi(o)!=="body"),s=null;const n=Zt(t).position==="fixed";let a=n?Jn(t):t;for(;di(a)&&!Ah(a);){const o=Zt(a),l=Cp(a);!l&&o.position==="fixed"&&(s=null),(n?!l&&!s:!l&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||nl(a)&&!l&&kb(t,a))?i=i.filter(h=>h!==a):s=o,a=Jn(a)}return e.set(t,i),i}function _T(t){let{element:e,boundary:r,rootBoundary:i,strategy:s}=t;const a=[...r==="clippingAncestors"?xT(e,this._c):[].concat(r),i],o=a[0],l=a.reduce((c,h)=>{const f=Km(e,h,s);return c.top=zt(f.top,c.top),c.right=vo(f.right,c.right),c.bottom=vo(f.bottom,c.bottom),c.left=zt(f.left,c.left),c},Km(e,o,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function wT(t){const{width:e,height:r}=Rb(t);return{width:e,height:r}}function ET(t,e,r,i){const s=$r(e),n=mi(e),a=r==="fixed",o=zs(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const c=Ki(0);if(s||!s&&!a)if((Qi(e)!=="body"||nl(n))&&(l=Ch(e)),s){const m=zs(e,!0,a,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else n&&(c.x=Ob(n));let h=o.left+l.scrollLeft-c.x,f=o.top+l.scrollTop-c.y;const[u,d,p]=Mb(i);return u&&(h+=d,f+=p,s&&(h+=e.clientLeft,f+=e.clientTop)),{x:h,y:f,width:o.width,height:o.height}}function Qm(t,e){return!$r(t)||Zt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Db(t,e){const r=Dt(t);if(!$r(t))return r;let i=Qm(t,e);for(;i&&uT(i)&&Zt(i).position==="static";)i=Qm(i,e);return i&&(Qi(i)==="html"||Qi(i)==="body"&&Zt(i).position==="static"&&!Cp(i))?r:i||Cb(t)||r}const ST=async function(t){const e=this.getOffsetParent||Db,r=this.getDimensions;return{reference:ET(t.reference,await e(t.floating),t.strategy,t.floating),floating:{x:0,y:0,...await r(t.floating)}}};function TT(t){return Zt(t).direction==="rtl"}const AT={convertOffsetParentRelativeRectToViewportRelativeRect:mT,getDocumentElement:mi,getClippingRect:_T,getOffsetParent:Db,getElementRects:ST,getClientRects:gT,getDimensions:wT,getScale:Tn,isElement:di,isRTL:TT};function CT(t,e){let r=null,i;const s=mi(t);function n(){var o;clearTimeout(i),(o=r)==null||o.disconnect(),r=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),n();const{left:c,top:h,width:f,height:u}=t.getBoundingClientRect();if(o||e(),!f||!u)return;const d=El(h),p=El(s.clientWidth-(c+f)),m=El(s.clientHeight-(h+u)),g=El(c),_={rootMargin:-d+"px "+-p+"px "+-m+"px "+-g+"px",threshold:zt(0,vo(1,l))||1};let v=!0;function b(w){const A=w[0].intersectionRatio;if(A!==l){if(!v)return a();A?a(!1,A):i=setTimeout(()=>{a(!1,1e-7)},100)}v=!1}try{r=new IntersectionObserver(b,{..._,root:s.ownerDocument})}catch{r=new IntersectionObserver(b,_)}r.observe(t)}return a(!0),n}function IT(t,e,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Rp(t),h=s||n?[...c?yo(c):[],...yo(e)]:[];h.forEach(y=>{s&&y.addEventListener("scroll",r,{passive:!0}),n&&y.addEventListener("resize",r)});const f=c&&o?CT(c,r):null;let u=-1,d=null;a&&(d=new ResizeObserver(y=>{let[_]=y;_&&_.target===c&&d&&(d.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(e)})),r()}),c&&!l&&d.observe(c),d.observe(e));let p,m=l?zs(t):null;l&&g();function g(){const y=zs(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&r(),m=y,p=requestAnimationFrame(g)}return r(),()=>{var y;h.forEach(_=>{s&&_.removeEventListener("scroll",r),n&&_.removeEventListener("resize",r)}),f==null||f(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(p)}}const RT=oT,PT=hT,MT=(t,e,r)=>{const i=new Map,s={platform:AT,...r},n={...s.platform,_c:i};return aT(t,e,{...s,platform:n})};var gc=typeof document<"u"?E.useLayoutEffect:E.useEffect;function jc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,i,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(i=r;i--!==0;)if(!jc(t[i],e[i]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(e,s[i]))return!1;for(i=r;i--!==0;){const n=s[i];if(!(n==="_owner"&&t.$$typeof)&&!jc(t[n],e[n]))return!1}return!0}return t!==t&&e!==e}function Nb(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Jm(t,e){const r=Nb(t);return Math.round(e*r)/r}function eg(t){const e=E.useRef(t);return gc(()=>{e.current=t}),e}function OT(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:n,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=t,[h,f]=E.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[u,d]=E.useState(i);jc(u,i)||d(i);const[p,m]=E.useState(null),[g,y]=E.useState(null),_=E.useCallback(N=>{N!==A.current&&(A.current=N,m(N))},[]),v=E.useCallback(N=>{N!==S.current&&(S.current=N,y(N))},[]),b=n||p,w=a||g,A=E.useRef(null),S=E.useRef(null),C=E.useRef(h),T=l!=null,M=eg(l),I=eg(s),k=E.useCallback(()=>{if(!A.current||!S.current)return;const N={placement:e,strategy:r,middleware:u};I.current&&(N.platform=I.current),MT(A.current,S.current,N).then(B=>{const U={...B,isPositioned:!0};P.current&&!jc(C.current,U)&&(C.current=U,rs.flushSync(()=>{f(U)}))})},[u,e,r,I]);gc(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[c]);const P=E.useRef(!1);gc(()=>(P.current=!0,()=>{P.current=!1}),[]),gc(()=>{if(b&&(A.current=b),w&&(S.current=w),b&&w){if(M.current)return M.current(b,w,k);k()}},[b,w,k,M,T]);const R=E.useMemo(()=>({reference:A,floating:S,setReference:_,setFloating:v}),[_,v]),O=E.useMemo(()=>({reference:b,floating:w}),[b,w]),L=E.useMemo(()=>{const N={position:r,left:0,top:0};if(!O.floating)return N;const B=Jm(O.floating,h.x),U=Jm(O.floating,h.y);return o?{...N,transform:"translate("+B+"px, "+U+"px)",...Nb(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:B,top:U}},[r,o,O.floating,h.x,h.y]);return E.useMemo(()=>({...h,update:k,refs:R,elements:O,floatingStyles:L}),[h,k,R,O,L])}var Lb=typeof document<"u"?E.useLayoutEffect:E.useEffect;let uu=!1,kT=0;const tg=()=>"floating-ui-"+kT++;function DT(){const[t,e]=E.useState(()=>uu?tg():void 0);return Lb(()=>{t==null&&e(tg())},[]),E.useEffect(()=>{uu||(uu=!0)},[]),t}const NT=Zy.useId,LT=NT||DT;function BT(){const t=new Map;return{emit(e,r){var i;(i=t.get(e))==null||i.forEach(s=>s(r))},on(e,r){t.set(e,[...t.get(e)||[],r])},off(e,r){var i;t.set(e,((i=t.get(e))==null?void 0:i.filter(s=>s!==r))||[])}}}const FT=E.createContext(null),UT=()=>E.useContext(FT),jT=Zy.useInsertionEffect,$T=jT||(t=>t());function GT(t){const e=E.useRef(()=>{});return $T(()=>{e.current=t}),E.useCallback(function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e.current==null?void 0:e.current(...i)},[])}function zT(t){var e;t===void 0&&(t={});const{open:r=!1,onOpenChange:i,nodeId:s}=t,[n,a]=E.useState(null),o=((e=t.elements)==null?void 0:e.reference)||n,l=OT(t),c=UT(),h=GT((b,w)=>{b&&(u.current.openEvent=w),i==null||i(b,w)}),f=E.useRef(null),u=E.useRef({}),d=E.useState(()=>BT())[0],p=LT(),m=E.useCallback(b=>{const w=wl(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),contextElement:b}:b;l.refs.setReference(w)},[l.refs]),g=E.useCallback(b=>{(wl(b)||b===null)&&(f.current=b,a(b)),(wl(l.refs.reference.current)||l.refs.reference.current===null||b!==null&&!wl(b))&&l.refs.setReference(b)},[l.refs]),y=E.useMemo(()=>({...l.refs,setReference:g,setPositionReference:m,domReference:f}),[l.refs,g,m]),_=E.useMemo(()=>({...l.elements,domReference:o}),[l.elements,o]),v=E.useMemo(()=>({...l,refs:y,elements:_,dataRef:u,nodeId:s,floatingId:p,events:d,open:r,onOpenChange:h}),[l,s,p,d,r,h,y,_]);return Lb(()=>{const b=c==null?void 0:c.nodesRef.current.find(w=>w.id===s);b&&(b.context=v)}),E.useMemo(()=>({...l,context:v,refs:y,elements:_}),[l,y,_,v])}var HT=Object.defineProperty,VT=(t,e)=>{for(var r in e)HT(t,r,{get:e[r],enumerable:!0})},dr={};VT(dr,{assign:()=>YT,colors:()=>Vi,createStringInterpolator:()=>Lp,skipAnimation:()=>zb,to:()=>Gb,willAdvance:()=>Bp});var Pp=ol(),fe=t=>al(t,Pp),Mp=ol();fe.write=t=>al(t,Mp);var Ih=ol();fe.onStart=t=>al(t,Ih);var Op=ol();fe.onFrame=t=>al(t,Op);var kp=ol();fe.onFinish=t=>al(t,kp);var An=[];fe.setTimeout=(t,e)=>{const r=fe.now()+e,i=()=>{const n=An.findIndex(a=>a.cancel==i);~n&&An.splice(n,1),Bi-=~n?1:0},s={time:r,handler:t,cancel:i};return An.splice(Bb(r),0,s),Bi+=1,Fb(),s};var Bb=t=>~(~An.findIndex(e=>e.time>t)||~An.length);fe.cancel=t=>{Ih.delete(t),Op.delete(t),kp.delete(t),Pp.delete(t),Mp.delete(t)};fe.sync=t=>{qd=!0,fe.batchedUpdates(t),qd=!1};fe.throttle=t=>{let e;function r(){try{t(...e)}finally{e=null}}function i(...s){e=s,fe.onStart(r)}return i.handler=t,i.cancel=()=>{Ih.delete(r),e=null},i};var Dp=typeof window<"u"?window.requestAnimationFrame:()=>{};fe.use=t=>Dp=t;fe.now=typeof performance<"u"?()=>performance.now():Date.now;fe.batchedUpdates=t=>t();fe.catch=console.error;fe.frameLoop="always";fe.advance=()=>{fe.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):jb()};var Li=-1,Bi=0,qd=!1;function al(t,e){qd?(e.delete(t),t(0)):(e.add(t),Fb())}function Fb(){Li<0&&(Li=0,fe.frameLoop!=="demand"&&Dp(Ub))}function WT(){Li=-1}function Ub(){~Li&&(Dp(Ub),fe.batchedUpdates(jb))}function jb(){const t=Li;Li=fe.now();const e=Bb(Li);if(e&&($b(An.splice(0,e),r=>r.handler()),Bi-=e),!Bi){WT();return}Ih.flush(),Pp.flush(t?Math.min(64,Li-t):16.667),Op.flush(),Mp.flush(),kp.flush()}function ol(){let t=new Set,e=t;return{add(r){Bi+=e==t&&!t.has(r)?1:0,t.add(r)},delete(r){return Bi-=e==t&&t.has(r)?1:0,t.delete(r)},flush(r){e.size&&(t=new Set,Bi-=e.size,$b(e,i=>i(r)&&t.add(i)),Bi+=t.size,e=t)}}}function $b(t,e){t.forEach(r=>{try{e(r)}catch(i){fe.catch(i)}})}function Zd(){}var XT=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),$={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function ti(t,e){if($.arr(t)){if(!$.arr(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return t===e}var ce=(t,e)=>t.forEach(e);function Gr(t,e,r){if($.arr(t)){for(let i=0;i<t.length;i++)e.call(r,t[i],`${i}`);return}for(const i in t)t.hasOwnProperty(i)&&e.call(r,t[i],i)}var ut=t=>$.und(t)?[]:$.arr(t)?t:[t];function Za(t,e){if(t.size){const r=Array.from(t);t.clear(),ce(r,e)}}var Fa=(t,...e)=>Za(t,r=>r(...e)),Np=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Lp,Gb,Vi=null,zb=!1,Bp=Zd,YT=t=>{t.to&&(Gb=t.to),t.now&&(fe.now=t.now),t.colors!==void 0&&(Vi=t.colors),t.skipAnimation!=null&&(zb=t.skipAnimation),t.createStringInterpolator&&(Lp=t.createStringInterpolator),t.requestAnimationFrame&&fe.use(t.requestAnimationFrame),t.batchedUpdates&&(fe.batchedUpdates=t.batchedUpdates),t.willAdvance&&(Bp=t.willAdvance),t.frameLoop&&(fe.frameLoop=t.frameLoop)},Ka=new Set,Vt=[],du=[],$c=0,Rh={get idle(){return!Ka.size&&!Vt.length},start(t){$c>t.priority?(Ka.add(t),fe.onStart(qT)):(Hb(t),fe(Kd))},advance:Kd,sort(t){if($c)fe.onFrame(()=>Rh.sort(t));else{const e=Vt.indexOf(t);~e&&(Vt.splice(e,1),Vb(t))}},clear(){Vt=[],Ka.clear()}};function qT(){Ka.forEach(Hb),Ka.clear(),fe(Kd)}function Hb(t){Vt.includes(t)||Vb(t)}function Vb(t){Vt.splice(ZT(Vt,e=>e.priority>t.priority),0,t)}function Kd(t){const e=du;for(let r=0;r<Vt.length;r++){const i=Vt[r];$c=i.priority,i.idle||(Bp(i),i.advance(t),i.idle||e.push(i))}return $c=0,du=Vt,du.length=0,Vt=e,Vt.length>0}function ZT(t,e){const r=t.findIndex(e);return r<0?t.length:r}var KT=(t,e,r)=>Math.min(Math.max(r,t),e),QT={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},lr="[-+]?\\d*\\.?\\d+",Gc=lr+"%";function Ph(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var JT=new RegExp("rgb"+Ph(lr,lr,lr)),eA=new RegExp("rgba"+Ph(lr,lr,lr,lr)),tA=new RegExp("hsl"+Ph(lr,Gc,Gc)),rA=new RegExp("hsla"+Ph(lr,Gc,Gc,lr)),iA=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,sA=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nA=/^#([0-9a-fA-F]{6})$/,aA=/^#([0-9a-fA-F]{8})$/;function oA(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=nA.exec(t))?parseInt(e[1]+"ff",16)>>>0:Vi&&Vi[t]!==void 0?Vi[t]:(e=JT.exec(t))?(on(e[1])<<24|on(e[2])<<16|on(e[3])<<8|255)>>>0:(e=eA.exec(t))?(on(e[1])<<24|on(e[2])<<16|on(e[3])<<8|sg(e[4]))>>>0:(e=iA.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=aA.exec(t))?parseInt(e[1],16)>>>0:(e=sA.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=tA.exec(t))?(rg(ig(e[1]),Sl(e[2]),Sl(e[3]))|255)>>>0:(e=rA.exec(t))?(rg(ig(e[1]),Sl(e[2]),Sl(e[3]))|sg(e[4]))>>>0:null}function fu(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function rg(t,e,r){const i=r<.5?r*(1+e):r+e-r*e,s=2*r-i,n=fu(s,i,t+1/3),a=fu(s,i,t),o=fu(s,i,t-1/3);return Math.round(n*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function on(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function ig(t){return(parseFloat(t)%360+360)%360/360}function sg(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function Sl(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function ng(t){let e=oA(t);if(e===null)return t;e=e||0;const r=(e&4278190080)>>>24,i=(e&16711680)>>>16,s=(e&65280)>>>8,n=(e&255)/255;return`rgba(${r}, ${i}, ${s}, ${n})`}var bo=(t,e,r)=>{if($.fun(t))return t;if($.arr(t))return bo({range:t,output:e,extrapolate:r});if($.str(t.output[0]))return Lp(t);const i=t,s=i.output,n=i.range||[0,1],a=i.extrapolateLeft||i.extrapolate||"extend",o=i.extrapolateRight||i.extrapolate||"extend",l=i.easing||(c=>c);return c=>{const h=cA(c,n);return lA(c,n[h],n[h+1],s[h],s[h+1],l,a,o,i.map)}};function lA(t,e,r,i,s,n,a,o,l){let c=l?l(t):t;if(c<e){if(a==="identity")return c;a==="clamp"&&(c=e)}if(c>r){if(o==="identity")return c;o==="clamp"&&(c=r)}return i===s?i:e===r?t<=e?i:s:(e===-1/0?c=-c:r===1/0?c=c-e:c=(c-e)/(r-e),c=n(c),i===-1/0?c=-c:s===1/0?c=c+i:c=c*(s-i)+i,c)}function cA(t,e){for(var r=1;r<e.length-1&&!(e[r]>=t);++r);return r-1}var hA=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,s=e==="end"?Math.floor(i):Math.ceil(i);return KT(0,1,s/t)},zc=1.70158,Tl=zc*1.525,ag=zc+1,og=2*Math.PI/3,lg=2*Math.PI/4.5,Al=t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,uA={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:Math.pow(2,10*t-10),easeOutExpo:t=>t===1?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>ag*t*t*t-zc*t*t,easeOutBack:t=>1+ag*Math.pow(t-1,3)+zc*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*((Tl+1)*2*t-Tl)/2:(Math.pow(2*t-2,2)*((Tl+1)*(t*2-2)+Tl)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-Math.pow(2,10*t-10)*Math.sin((t*10-10.75)*og),easeOutElastic:t=>t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*og)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*lg))/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*lg)/2+1,easeInBounce:t=>1-Al(1-t),easeOutBounce:Al,easeInOutBounce:t=>t<.5?(1-Al(1-2*t))/2:(1+Al(2*t-1))/2,steps:hA},xo=Symbol.for("FluidValue.get"),ea=Symbol.for("FluidValue.observers"),Ht=t=>!!(t&&t[xo]),yt=t=>t&&t[xo]?t[xo]():t,cg=t=>t[ea]||null;function dA(t,e){t.eventObserved?t.eventObserved(e):t(e)}function _o(t,e){const r=t[ea];r&&r.forEach(i=>{dA(i,e)})}var Wb=class{constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");fA(this,t)}},fA=(t,e)=>Xb(t,xo,e);function pa(t,e){if(t[xo]){let r=t[ea];r||Xb(t,ea,r=new Set),r.has(e)||(r.add(e),t.observerAdded&&t.observerAdded(r.size,e))}return e}function wo(t,e){const r=t[ea];if(r&&r.has(e)){const i=r.size-1;i?r.delete(e):t[ea]=null,t.observerRemoved&&t.observerRemoved(i,e)}}var Xb=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),vc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,pA=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,hg=new RegExp(`(${vc.source})(%|[a-z]+)`,"i"),mA=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Mh=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Yb=t=>{const[e,r]=gA(t);if(!e||Np())return t;const i=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(i)return i.trim();if(r&&r.startsWith("--")){const s=window.getComputedStyle(document.documentElement).getPropertyValue(r);return s||t}else{if(r&&Mh.test(r))return Yb(r);if(r)return r}return t},gA=t=>{const e=Mh.exec(t);if(!e)return[,];const[,r,i]=e;return[r,i]},pu,vA=(t,e,r,i,s)=>`rgba(${Math.round(e)}, ${Math.round(r)}, ${Math.round(i)}, ${s})`,qb=t=>{pu||(pu=Vi?new RegExp(`(${Object.keys(Vi).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(n=>yt(n).replace(Mh,Yb).replace(pA,ng).replace(pu,ng)),r=e.map(n=>n.match(vc).map(Number)),s=r[0].map((n,a)=>r.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(n=>bo({...t,output:n}));return n=>{var l;const a=!hg.test(e[0])&&((l=e.find(c=>hg.test(c)))==null?void 0:l.replace(vc,""));let o=0;return e[0].replace(vc,()=>`${s[o++](n)}${a||""}`).replace(mA,vA)}},Fp="react-spring: ",Zb=t=>{const e=t;let r=!1;if(typeof e!="function")throw new TypeError(`${Fp}once requires a function parameter`);return(...i)=>{r||(e(...i),r=!0)}},yA=Zb(console.warn);function bA(){yA(`${Fp}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var xA=Zb(console.warn);function _A(){xA(`${Fp}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Oh(t){return $.str(t)&&(t[0]=="#"||/\d/.test(t)||!Np()&&Mh.test(t)||t in(Vi||{}))}var Es=Np()?E.useEffect:E.useLayoutEffect,wA=()=>{const t=E.useRef(!1);return Es(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function Up(){const t=E.useState()[1],e=wA();return()=>{e.current&&t(Math.random())}}function EA(t,e){const[r]=E.useState(()=>({inputs:e,result:t()})),i=E.useRef(),s=i.current;let n=s;return n?e&&n.inputs&&SA(e,n.inputs)||(n={inputs:e,result:t()}):n=r,E.useEffect(()=>{i.current=n,s==r&&(r.inputs=r.result=void 0)},[n]),n.result}function SA(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}var jp=t=>E.useEffect(t,TA),TA=[];function Qd(t){const e=E.useRef();return E.useEffect(()=>{e.current=t}),e.current}var Eo=Symbol.for("Animated:node"),AA=t=>!!t&&t[Eo]===t,Ar=t=>t&&t[Eo],$p=(t,e)=>XT(t,Eo,e),kh=t=>t&&t[Eo]&&t[Eo].getPayload(),Kb=class{constructor(){$p(this,this)}getPayload(){return this.payload||[]}},ll=class extends Kb{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,$.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new ll(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return $.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,$.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},So=class extends ll{constructor(t){super(0),this._string=null,this._toString=bo({output:[t,t]})}static create(t){return new So(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if($.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=bo({output:[this.getValue(),t]})),this._value=0,super.reset()}},Hc={dependencies:null},Dh=class extends Kb{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Gr(this.source,(r,i)=>{AA(r)?e[i]=r.getValue(t):Ht(r)?e[i]=yt(r):t||(e[i]=r)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&ce(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Gr(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){Hc.dependencies&&Ht(t)&&Hc.dependencies.add(t);const e=kh(t);e&&ce(e,r=>this.add(r))}},Qb=class extends Dh{constructor(t){super(t)}static create(t){return new Qb(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((r,i)=>r.setValue(t[i])).some(Boolean):(super.setValue(t.map(CA)),!0)}};function CA(t){return(Oh(t)?So:ll).create(t)}function Jd(t){const e=Ar(t);return e?e.constructor:$.arr(t)?Qb:Oh(t)?So:ll}var ug=(t,e)=>{const r=!$.fun(t)||t.prototype&&t.prototype.isReactComponent;return E.forwardRef((i,s)=>{const n=E.useRef(null),a=r&&E.useCallback(p=>{n.current=PA(s,p)},[s]),[o,l]=RA(i,e),c=Up(),h=()=>{const p=n.current;if(r&&!p)return;(p?e.applyAnimatedValues(p,o.getValue(!0)):!1)===!1&&c()},f=new IA(h,l),u=E.useRef();Es(()=>(u.current=f,ce(l,p=>pa(p,f)),()=>{u.current&&(ce(u.current.deps,p=>wo(p,u.current)),fe.cancel(u.current.update))})),E.useEffect(h,[]),jp(()=>()=>{const p=u.current;ce(p.deps,m=>wo(m,p))});const d=e.getComponentProps(o.getValue());return E.createElement(t,{...d,ref:a})})},IA=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&fe.write(this.update)}};function RA(t,e){const r=new Set;return Hc.dependencies=r,t.style&&(t={...t,style:e.createAnimatedStyle(t.style)}),t=new Dh(t),Hc.dependencies=null,[t,r]}function PA(t,e){return t&&($.fun(t)?t(e):t.current=e),e}var dg=Symbol.for("AnimatedComponent"),MA=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:r=s=>new Dh(s),getComponentProps:i=s=>s}={})=>{const s={applyAnimatedValues:e,createAnimatedStyle:r,getComponentProps:i},n=a=>{const o=fg(a)||"Anonymous";return $.str(a)?a=n[a]||(n[a]=ug(a,s)):a=a[dg]||(a[dg]=ug(a,s)),a.displayName=`Animated(${o})`,a};return Gr(t,(a,o)=>{$.arr(t)&&(o=fg(a)),n[o]=n(a)}),{animated:n}},fg=t=>$.str(t)?t:t&&$.str(t.displayName)?t.displayName:$.fun(t)&&t.name||null;function bt(t,...e){return $.fun(t)?t(...e):t}var Qa=(t,e)=>t===!0||!!(e&&t&&($.fun(t)?t(e):ut(t).includes(e))),Jb=(t,e)=>$.obj(t)?e&&t[e]:t,ex=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,OA=t=>t,Nh=(t,e=OA)=>{let r=kA;t.default&&t.default!==!0&&(t=t.default,r=Object.keys(t));const i={};for(const s of r){const n=e(t[s],s);$.und(n)||(i[s]=n)}return i},kA=["config","onProps","onStart","onChange","onPause","onResume","onRest"],DA={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function NA(t){const e={};let r=0;if(Gr(t,(i,s)=>{DA[s]||(e[s]=i,r++)}),r)return e}function Gp(t){const e=NA(t);if(e){const r={to:e};return Gr(t,(i,s)=>s in e||(r[s]=i)),r}return{...t}}function To(t){return t=yt(t),$.arr(t)?t.map(To):Oh(t)?dr.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function tx(t){for(const e in t)return!0;return!1}function ef(t){return $.fun(t)||$.arr(t)&&$.obj(t[0])}function tf(t,e){var r;(r=t.ref)==null||r.delete(t),e==null||e.delete(t)}function rx(t,e){var r;e&&t.ref!==e&&((r=t.ref)==null||r.delete(t),e.add(t),t.ref=e)}var LA={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},rf={...LA.default,mass:1,damping:1,easing:uA.linear,clamp:!1},BA=class{constructor(){this.velocity=0,Object.assign(this,rf)}};function FA(t,e,r){r&&(r={...r},pg(r,e),e={...r,...e}),pg(t,e),Object.assign(t,e);for(const a in rf)t[a]==null&&(t[a]=rf[a]);let{frequency:i,damping:s}=t;const{mass:n}=t;return $.und(i)||(i<.01&&(i=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/i,2)*n,t.friction=4*Math.PI*s*n/i),t}function pg(t,e){if(!$.und(e.decay))t.duration=void 0;else{const r=!$.und(e.tension)||!$.und(e.friction);(r||!$.und(e.frequency)||!$.und(e.damping)||!$.und(e.mass))&&(t.duration=void 0,t.decay=void 0),r&&(t.frequency=void 0)}}var mg=[],UA=class{constructor(){this.changed=!1,this.values=mg,this.toValues=null,this.fromValues=mg,this.config=new BA,this.immediate=!1}};function ix(t,{key:e,props:r,defaultProps:i,state:s,actions:n}){return new Promise((a,o)=>{let l,c,h=Qa(r.cancel??(i==null?void 0:i.cancel),e);if(h)d();else{$.und(r.pause)||(s.paused=Qa(r.pause,e));let p=i==null?void 0:i.pause;p!==!0&&(p=s.paused||Qa(p,e)),l=bt(r.delay||0,e),p?(s.resumeQueue.add(u),n.pause()):(n.resume(),u())}function f(){s.resumeQueue.add(u),s.timeouts.delete(c),c.cancel(),l=c.time-fe.now()}function u(){l>0&&!dr.skipAnimation?(s.delayed=!0,c=fe.setTimeout(d,l),s.pauseQueue.add(f),s.timeouts.add(c)):d()}function d(){s.delayed&&(s.delayed=!1),s.pauseQueue.delete(f),s.timeouts.delete(c),t<=(s.cancelId||0)&&(h=!0);try{n.start({...r,callId:t,cancel:h},a)}catch(p){o(p)}}})}var zp=(t,e)=>e.length==1?e[0]:e.some(r=>r.cancelled)?Cn(t.get()):e.every(r=>r.noop)?sx(t.get()):ar(t.get(),e.every(r=>r.finished)),sx=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),ar=(t,e,r=!1)=>({value:t,finished:e,cancelled:r}),Cn=t=>({value:t,cancelled:!0,finished:!1});function nx(t,e,r,i){const{callId:s,parentId:n,onRest:a}=e,{asyncTo:o,promise:l}=r;return!n&&t===o&&!e.reset?l:r.promise=(async()=>{r.asyncId=s,r.asyncTo=t;const c=Nh(e,(g,y)=>y==="onRest"?void 0:g);let h,f;const u=new Promise((g,y)=>(h=g,f=y)),d=g=>{const y=s<=(r.cancelId||0)&&Cn(i)||s!==r.asyncId&&ar(i,!1);if(y)throw g.result=y,f(g),g},p=(g,y)=>{const _=new gg,v=new vg;return(async()=>{if(dr.skipAnimation)throw Ao(r),v.result=ar(i,!1),f(v),v;d(_);const b=$.obj(g)?{...g}:{...y,to:g};b.parentId=s,Gr(c,(A,S)=>{$.und(b[S])&&(b[S]=A)});const w=await i.start(b);return d(_),r.paused&&await new Promise(A=>{r.resumeQueue.add(A)}),w})()};let m;if(dr.skipAnimation)return Ao(r),ar(i,!1);try{let g;$.arr(t)?g=(async y=>{for(const _ of y)await p(_)})(t):g=Promise.resolve(t(p,i.stop.bind(i))),await Promise.all([g.then(h),u]),m=ar(i.get(),!0,!1)}catch(g){if(g instanceof gg)m=g.result;else if(g instanceof vg)m=g.result;else throw g}finally{s==r.asyncId&&(r.asyncId=n,r.asyncTo=n?o:void 0,r.promise=n?l:void 0)}return $.fun(a)&&fe.batchedUpdates(()=>{a(m,i,i.item)}),m})()}function Ao(t,e){Za(t.timeouts,r=>r.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var gg=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},vg=class extends Error{constructor(){super("SkipAnimationSignal")}},sf=t=>t instanceof Hp,jA=1,Hp=class extends Wb{constructor(){super(...arguments),this.id=jA++,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Ar(this);return t&&t.getValue()}to(...t){return dr.to(this,t)}interpolate(...t){return bA(),dr.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){_o(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||Rh.sort(this),_o(this,{type:"priority",parent:this,priority:t})}},Hs=Symbol.for("SpringPhase"),ax=1,nf=2,af=4,mu=t=>(t[Hs]&ax)>0,yi=t=>(t[Hs]&nf)>0,Ta=t=>(t[Hs]&af)>0,yg=(t,e)=>e?t[Hs]|=nf|ax:t[Hs]&=~nf,bg=(t,e)=>e?t[Hs]|=af:t[Hs]&=~af,$A=class extends Hp{constructor(t,e){if(super(),this.animation=new UA,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!$.und(t)||!$.und(e)){const r=$.obj(t)?{...t}:{...e,from:t};$.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(yi(this)||this._state.asyncTo)||Ta(this)}get goal(){return yt(this.animation.to)}get velocity(){const t=Ar(this);return t instanceof ll?t.lastVelocity||0:t.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return mu(this)}get isAnimating(){return yi(this)}get isPaused(){return Ta(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,r=!1;const i=this.animation;let{toValues:s}=i;const{config:n}=i,a=kh(i.to);!a&&Ht(i.to)&&(s=ut(yt(i.to))),i.values.forEach((c,h)=>{if(c.done)return;const f=c.constructor==So?1:a?a[h].lastPosition:s[h];let u=i.immediate,d=f;if(!u){if(d=c.lastPosition,n.tension<=0){c.done=!0;return}let p=c.elapsedTime+=t;const m=i.fromValues[h],g=c.v0!=null?c.v0:c.v0=$.arr(n.velocity)?n.velocity[h]:n.velocity;let y;const _=n.precision||(m==f?.005:Math.min(1,Math.abs(f-m)*.001));if($.und(n.duration))if(n.decay){const v=n.decay===!0?.998:n.decay,b=Math.exp(-(1-v)*p);d=m+g/(1-v)*(1-b),u=Math.abs(c.lastPosition-d)<=_,y=g*b}else{y=c.lastVelocity==null?g:c.lastVelocity;const v=n.restVelocity||_/10,b=n.clamp?0:n.bounce,w=!$.und(b),A=m==f?c.v0>0:m<f;let S,C=!1;const T=1,M=Math.ceil(t/T);for(let I=0;I<M&&(S=Math.abs(y)>v,!(!S&&(u=Math.abs(f-d)<=_,u)));++I){w&&(C=d==f||d>f==A,C&&(y=-y*b,d=f));const k=-n.tension*1e-6*(d-f),P=-n.friction*.001*y,R=(k+P)/n.mass;y=y+R*T,d=d+y*T}}else{let v=1;n.duration>0&&(this._memoizedDuration!==n.duration&&(this._memoizedDuration=n.duration,c.durationProgress>0&&(c.elapsedTime=n.duration*c.durationProgress,p=c.elapsedTime+=t)),v=(n.progress||0)+p/this._memoizedDuration,v=v>1?1:v<0?0:v,c.durationProgress=v),d=m+n.easing(v)*(f-m),y=(d-c.lastPosition)/t,u=v==1}c.lastVelocity=y,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}a&&!a[h].done&&(u=!1),u?c.done=!0:e=!1,c.setValue(d,n.round)&&(r=!0)});const o=Ar(this),l=o.getValue();if(e){const c=yt(i.to);(l!==c||r)&&!n.decay?(o.setValue(c),this._onChange(c)):r&&n.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(t){return fe.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yi(this)){const{to:t,config:e}=this.animation;fe.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let r;return $.und(t)?(r=this.queue||[],this.queue=[]):r=[$.obj(t)?t:{...e,to:t}],Promise.all(r.map(i=>this._update(i))).then(i=>zp(this,i))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),Ao(this._state,t&&this._lastCallId),fe.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:r,from:i}=t;r=$.obj(r)?r[e]:r,(r==null||ef(r))&&(r=void 0),i=$.obj(i)?i[e]:i,i==null&&(i=void 0);const s={to:r,from:i};return mu(this)||(t.reverse&&([r,i]=[i,r]),i=yt(i),$.und(i)?Ar(this)||this._set(r):this._set(i)),s}_update({...t},e){const{key:r,defaultProps:i}=this;t.default&&Object.assign(i,Nh(t,(a,o)=>/^on/.test(o)?Jb(a,r):a)),_g(this,t,"onProps"),Ca(this,"onProps",t,this);const s=this._prepareNode(t);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const n=this._state;return ix(++this._lastCallId,{key:r,props:t,defaultProps:i,state:n,actions:{pause:()=>{Ta(this)||(bg(this,!0),Fa(n.pauseQueue),Ca(this,"onPause",ar(this,Aa(this,this.animation.to)),this))},resume:()=>{Ta(this)&&(bg(this,!1),yi(this)&&this._resume(),Fa(n.resumeQueue),Ca(this,"onResume",ar(this,Aa(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(t.loop&&a.finished&&!(e&&a.noop)){const o=ox(t);if(o)return this._update(o,!0)}return a})}_merge(t,e,r){if(e.cancel)return this.stop(!0),r(Cn(this));const i=!$.und(t.to),s=!$.und(t.from);if(i||s)if(e.callId>this._lastToId)this._lastToId=e.callId;else return r(Cn(this));const{key:n,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:h=l,from:f=c}=t;s&&!i&&(!e.default||$.und(h))&&(h=f),e.reverse&&([h,f]=[f,h]);const u=!ti(f,c);u&&(o.from=f),f=yt(f);const d=!ti(h,l);d&&this._focus(h);const p=ef(e.to),{config:m}=o,{decay:g,velocity:y}=m;(i||s)&&(m.velocity=0),e.config&&!p&&FA(m,bt(e.config,n),e.config!==a.config?bt(a.config,n):void 0);let _=Ar(this);if(!_||$.und(h))return r(ar(this,!0));const v=$.und(e.reset)?s&&!e.default:!$.und(f)&&Qa(e.reset,n),b=v?f:this.get(),w=To(h),A=$.num(w)||$.arr(w)||Oh(w),S=!p&&(!A||Qa(a.immediate||e.immediate,n));if(d){const I=Jd(h);if(I!==_.constructor)if(S)_=this._set(w);else throw Error(`Cannot animate between ${_.constructor.name} and ${I.name}, as the "to" prop suggests`)}const C=_.constructor;let T=Ht(h),M=!1;if(!T){const I=v||!mu(this)&&u;(d||I)&&(M=ti(To(b),w),T=!M),(!ti(o.immediate,S)&&!S||!ti(m.decay,g)||!ti(m.velocity,y))&&(T=!0)}if(M&&yi(this)&&(o.changed&&!v?T=!0:T||this._stop(l)),!p&&((T||Ht(l))&&(o.values=_.getPayload(),o.toValues=Ht(h)?null:C==So?[1]:ut(w)),o.immediate!=S&&(o.immediate=S,!S&&!v&&this._set(l)),T)){const{onRest:I}=o;ce(zA,P=>_g(this,e,P));const k=ar(this,Aa(this,l));Fa(this._pendingCalls,k),this._pendingCalls.add(r),o.changed&&fe.batchedUpdates(()=>{var P;o.changed=!v,I==null||I(k,this),v?bt(a.onRest,k):(P=o.onStart)==null||P.call(o,k,this)})}v&&this._set(b),p?r(nx(e.to,e,this._state,this)):T?this._start():yi(this)&&!d?this._pendingCalls.add(r):r(sx(b))}_focus(t){const e=this.animation;t!==e.to&&(cg(this)&&this._detach(),e.to=t,cg(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Ht(e)&&(pa(e,this),sf(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Ht(t)&&wo(t,this)}_set(t,e=!0){const r=yt(t);if(!$.und(r)){const i=Ar(this);if(!i||!ti(r,i.getValue())){const s=Jd(r);!i||i.constructor!=s?$p(this,s.create(r)):i.setValue(r),i&&fe.batchedUpdates(()=>{this._onChange(r,e)})}}return Ar(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,Ca(this,"onStart",ar(this,Aa(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),bt(this.animation.onChange,t,this)),bt(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Ar(this).reset(yt(t.to)),t.immediate||(t.fromValues=t.values.map(e=>e.lastPosition)),yi(this)||(yg(this,!0),Ta(this)||this._resume())}_resume(){dr.skipAnimation?this.finish():Rh.start(this)}_stop(t,e){if(yi(this)){yg(this,!1);const r=this.animation;ce(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),_o(this,{type:"idle",parent:this});const i=e?Cn(this.get()):ar(this.get(),Aa(this,t??r.to));Fa(this._pendingCalls,i),r.changed&&(r.changed=!1,Ca(this,"onRest",i,this))}}};function Aa(t,e){const r=To(e),i=To(t.get());return ti(i,r)}function ox(t,e=t.loop,r=t.to){const i=bt(e);if(i){const s=i!==!0&&Gp(i),n=(s||t).reverse,a=!s||s.reset;return Co({...t,loop:e,default:!1,pause:void 0,to:!n||ef(r)?r:void 0,from:a?t.from:void 0,reset:a,...s})}}function Co(t){const{to:e,from:r}=t=Gp(t),i=new Set;return $.obj(e)&&xg(e,i),$.obj(r)&&xg(r,i),t.keys=i.size?Array.from(i):null,t}function GA(t){const e=Co(t);return $.und(e.default)&&(e.default=Nh(e)),e}function xg(t,e){Gr(t,(r,i)=>r!=null&&e.add(i))}var zA=["onStart","onRest","onChange","onPause","onResume"];function _g(t,e,r){t.animation[r]=e[r]!==ex(e,r)?Jb(e[r],t.key):void 0}function Ca(t,e,...r){var i,s,n,a;(s=(i=t.animation)[e])==null||s.call(i,...r),(a=(n=t.defaultProps)[e])==null||a.call(n,...r)}var HA=["onStart","onChange","onRest"],VA=1,lx=class{constructor(t,e){this.id=VA++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,r)=>t[r]=e.get()),t}set(t){for(const e in t){const r=t[e];$.und(r)||this.springs[e].set(r)}}update(t){return t&&this.queue.push(Co(t)),this}start(t){let{queue:e}=this;return t?e=ut(t).map(Co):this.queue=[],this._flush?this._flush(this,e):(fx(this,e),of(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const r=this.springs;ce(ut(e),i=>r[i].stop(!!t))}else Ao(this._state,this._lastAsyncId),this.each(r=>r.stop(!!t));return this}pause(t){if($.und(t))this.start({pause:!0});else{const e=this.springs;ce(ut(t),r=>e[r].pause())}return this}resume(t){if($.und(t))this.start({pause:!1});else{const e=this.springs;ce(ut(t),r=>e[r].resume())}return this}each(t){Gr(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:r}=this._events,i=this._active.size>0,s=this._changed.size>0;(i&&!this._started||s&&!this._started)&&(this._started=!0,Za(t,([o,l])=>{l.value=this.get(),o(l,this,this._item)}));const n=!i&&this._started,a=s||n&&r.size?this.get():null;s&&e.size&&Za(e,([o,l])=>{l.value=a,o(l,this,this._item)}),n&&(this._started=!1,Za(r,([o,l])=>{l.value=a,o(l,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;fe.onFrame(this._onFrame)}};function of(t,e){return Promise.all(e.map(r=>cx(t,r))).then(r=>zp(t,r))}async function cx(t,e,r){const{keys:i,to:s,from:n,loop:a,onRest:o,onResolve:l}=e,c=$.obj(e.default)&&e.default;a&&(e.loop=!1),s===!1&&(e.to=null),n===!1&&(e.from=null);const h=$.arr(s)||$.fun(s)?s:void 0;h?(e.to=void 0,e.onRest=void 0,c&&(c.onRest=void 0)):ce(HA,m=>{const g=e[m];if($.fun(g)){const y=t._events[m];e[m]=({finished:_,cancelled:v})=>{const b=y.get(g);b?(_||(b.finished=!1),v&&(b.cancelled=!0)):y.set(g,{value:null,finished:_||!1,cancelled:v||!1})},c&&(c[m]=e[m])}});const f=t._state;e.pause===!f.paused?(f.paused=e.pause,Fa(e.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(e.pause=!0);const u=(i||Object.keys(t.springs)).map(m=>t.springs[m].start(e)),d=e.cancel===!0||ex(e,"cancel")===!0;(h||d&&f.asyncId)&&u.push(ix(++t._lastAsyncId,{props:e,state:f,actions:{pause:Zd,resume:Zd,start(m,g){d?(Ao(f,t._lastAsyncId),g(Cn(t))):(m.onRest=o,g(nx(h,m,f,t)))}}})),f.paused&&await new Promise(m=>{f.resumeQueue.add(m)});const p=zp(t,await Promise.all(u));if(a&&p.finished&&!(r&&p.noop)){const m=ox(e,a,s);if(m)return fx(t,[m]),cx(t,m,!0)}return l&&fe.batchedUpdates(()=>l(p,t,t.item)),p}function lf(t,e){const r={...t.springs};return e&&ce(ut(e),i=>{$.und(i.keys)&&(i=Co(i)),$.obj(i.to)||(i={...i,to:void 0}),dx(r,i,s=>ux(s))}),hx(t,r),r}function hx(t,e){Gr(e,(r,i)=>{t.springs[i]||(t.springs[i]=r,pa(r,t))})}function ux(t,e){const r=new $A;return r.key=t,e&&pa(r,e),r}function dx(t,e,r){e.keys&&ce(e.keys,i=>{(t[i]||(t[i]=r(i)))._prepareNode(e)})}function fx(t,e){ce(e,r=>{dx(t.springs,r,i=>ux(i,t))})}var cl=({children:t,...e})=>{const r=E.useContext(Vc),i=e.pause||!!r.pause,s=e.immediate||!!r.immediate;e=EA(()=>({pause:i,immediate:s}),[i,s]);const{Provider:n}=Vc;return E.createElement(n,{value:e},t)},Vc=WA(cl,{});cl.Provider=Vc.Provider;cl.Consumer=Vc.Consumer;function WA(t,e){return Object.assign(t,E.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var px=()=>{const t=[],e=function(i){_A();const s=[];return ce(t,(n,a)=>{if($.und(i))s.push(n.start());else{const o=r(i,n,a);o&&s.push(n.start(o))}}),s};e.current=t,e.add=function(i){t.includes(i)||t.push(i)},e.delete=function(i){const s=t.indexOf(i);~s&&t.splice(s,1)},e.pause=function(){return ce(t,i=>i.pause(...arguments)),this},e.resume=function(){return ce(t,i=>i.resume(...arguments)),this},e.set=function(i){ce(t,(s,n)=>{const a=$.fun(i)?i(n,s):i;a&&s.set(a)})},e.start=function(i){const s=[];return ce(t,(n,a)=>{if($.und(i))s.push(n.start());else{const o=this._getProps(i,n,a);o&&s.push(n.start(o))}}),s},e.stop=function(){return ce(t,i=>i.stop(...arguments)),this},e.update=function(i){return ce(t,(s,n)=>s.update(this._getProps(i,s,n))),this};const r=function(i,s,n){return $.fun(i)?i(n,s):i};return e._getProps=r,e};function XA(t,e,r){const i=$.fun(e)&&e;i&&!r&&(r=[]);const s=E.useMemo(()=>i||arguments.length==3?px():void 0,[]),n=E.useRef(0),a=Up(),o=E.useMemo(()=>({ctrls:[],queue:[],flush(y,_){const v=lf(y,_);return n.current>0&&!o.queue.length&&!Object.keys(v).some(w=>!y.springs[w])?of(y,_):new Promise(w=>{hx(y,v),o.queue.push(()=>{w(of(y,_))}),a()})}}),[]),l=E.useRef([...o.ctrls]),c=[],h=Qd(t)||0;E.useMemo(()=>{ce(l.current.slice(t,h),y=>{tf(y,s),y.stop(!0)}),l.current.length=t,f(h,t)},[t]),E.useMemo(()=>{f(0,Math.min(h,t))},r);function f(y,_){for(let v=y;v<_;v++){const b=l.current[v]||(l.current[v]=new lx(null,o.flush)),w=i?i(v,b):e[v];w&&(c[v]=GA(w))}}const u=l.current.map((y,_)=>lf(y,c[_])),d=E.useContext(cl),p=Qd(d),m=d!==p&&tx(d);Es(()=>{n.current++,o.ctrls=l.current;const{queue:y}=o;y.length&&(o.queue=[],ce(y,_=>_())),ce(l.current,(_,v)=>{s==null||s.add(_),m&&_.start({default:d});const b=c[v];b&&(rx(_,b.ref),_.ref?_.queue.push(b):_.start(b))})}),jp(()=>()=>{ce(o.ctrls,y=>y.stop(!0))});const g=u.map(y=>({...y}));return s?[g,s]:g}function e8(t,e){const r=$.fun(t),[[i],s]=XA(1,r?t:[t],r?e||[]:e);return r||arguments.length==2?[i,s]:i}function mx(t,e,r){const i=$.fun(e)&&e,{reset:s,sort:n,trail:a=0,expires:o=!0,exitBeforeEnter:l=!1,onDestroyed:c,ref:h,config:f}=i?i():e,u=E.useMemo(()=>i||arguments.length==3?px():void 0,[]),d=ut(t),p=[],m=E.useRef(null),g=s?null:m.current;Es(()=>{m.current=p}),jp(()=>(ce(p,R=>{u==null||u.add(R.ctrl),R.ctrl.ref=u}),()=>{ce(m.current,R=>{R.expired&&clearTimeout(R.expirationId),tf(R.ctrl,u),R.ctrl.stop(!0)})}));const y=qA(d,i?i():e,g),_=s&&m.current||[];Es(()=>ce(_,({ctrl:R,item:O,key:L})=>{tf(R,u),bt(c,O,L)}));const v=[];if(g&&ce(g,(R,O)=>{R.expired?(clearTimeout(R.expirationId),_.push(R)):(O=v[O]=y.indexOf(R.key),~O&&(p[O]=R))}),ce(d,(R,O)=>{p[O]||(p[O]={key:y[O],item:R,phase:"mount",ctrl:new lx},p[O].ctrl.item=R)}),v.length){let R=-1;const{leave:O}=i?i():e;ce(v,(L,N)=>{const B=g[N];~L?(R=p.indexOf(B),p[R]={...B,item:d[L]}):O&&p.splice(++R,0,B)})}$.fun(n)&&p.sort((R,O)=>n(R.item,O.item));let b=-a;const w=Up(),A=Nh(e),S=new Map,C=E.useRef(new Map),T=E.useRef(!1);ce(p,(R,O)=>{const L=R.key,N=R.phase,B=i?i():e;let U,F;const j=bt(B.delay||0,L);if(N=="mount")U=B.enter,F="enter";else{const ee=y.indexOf(L)<0;if(N!="leave")if(ee)U=B.leave,F="leave";else if(U=B.update)F="update";else return;else if(!ee)U=B.enter,F="enter";else return}if(U=bt(U,R.item,O),U=$.obj(U)?Gp(U):{to:U},!U.config){const ee=f||A.config;U.config=bt(ee,R.item,O,F)}b+=a;const z={...A,delay:j+b,ref:h,immediate:B.immediate,reset:!1,...U};if(F=="enter"&&$.und(z.from)){const ee=i?i():e,ne=$.und(ee.initial)||g?ee.from:ee.initial;z.from=bt(ne,R.item,O)}const{onResolve:q}=z;z.onResolve=ee=>{bt(q,ee);const ne=m.current,se=ne.find(pe=>pe.key===L);if(se&&!(ee.cancelled&&se.phase!="update")&&se.ctrl.idle){const pe=ne.every(ge=>ge.ctrl.idle);if(se.phase=="leave"){const ge=bt(o,se.item);if(ge!==!1){const ae=ge===!0?0:ge;if(se.expired=!0,!pe&&ae>0){ae<=2147483647&&(se.expirationId=setTimeout(w,ae));return}}}pe&&ne.some(ge=>ge.expired)&&(C.current.delete(se),l&&(T.current=!0),w())}};const J=lf(R.ctrl,z);F==="leave"&&l?C.current.set(R,{phase:F,springs:J,payload:z}):S.set(R,{phase:F,springs:J,payload:z})});const M=E.useContext(cl),I=Qd(M),k=M!==I&&tx(M);Es(()=>{k&&ce(p,R=>{R.ctrl.start({default:M})})},[M]),ce(S,(R,O)=>{if(C.current.size){const L=p.findIndex(N=>N.key===O.key);p.splice(L,1)}}),Es(()=>{ce(C.current.size?C.current:S,({phase:R,payload:O},L)=>{const{ctrl:N}=L;L.phase=R,u==null||u.add(N),k&&R=="enter"&&N.start({default:M}),O&&(rx(N,O.ref),(N.ref||u)&&!T.current?N.update(O):(N.start(O),T.current&&(T.current=!1)))})},s?void 0:r);const P=R=>E.createElement(E.Fragment,null,p.map((O,L)=>{const{springs:N}=S.get(O)||O.ctrl,B=R({...N},O.item,O,L);return B&&B.type?E.createElement(B.type,{...B.props,key:$.str(O.key)||$.num(O.key)?O.key:O.ctrl.id,ref:B.ref}):B}));return u?[P,u]:P}var YA=1;function qA(t,{key:e,keys:r=e},i){if(r===null){const s=new Set;return t.map(n=>{const a=i&&i.find(o=>o.item===n&&o.phase!=="leave"&&!s.has(o));return a?(s.add(a),a.key):YA++})}return $.und(r)?t:$.fun(r)?t.map(r):ut(r)}var ZA=class extends Hp{constructor(t,e){super(),this.source=t,this.idle=!0,this._active=new Set,this.calc=bo(...e);const r=this._get(),i=Jd(r);$p(this,i.create(r))}advance(t){const e=this._get(),r=this.get();ti(e,r)||(Ar(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&wg(this._active)&&gu(this)}_get(){const t=$.arr(this.source)?this.source.map(yt):ut(yt(this.source));return this.calc(...t)}_start(){this.idle&&!wg(this._active)&&(this.idle=!1,ce(kh(this),t=>{t.done=!1}),dr.skipAnimation?(fe.batchedUpdates(()=>this.advance()),gu(this)):Rh.start(this))}_attach(){let t=1;ce(ut(this.source),e=>{Ht(e)&&pa(e,this),sf(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){ce(ut(this.source),t=>{Ht(t)&&wo(t,this)}),this._active.clear(),gu(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=ut(this.source).reduce((e,r)=>Math.max(e,(sf(r)?r.priority:0)+1),0))}};function KA(t){return t.idle!==!1}function wg(t){return!t.size||Array.from(t).every(KA)}function gu(t){t.idle||(t.idle=!0,ce(kh(t),e=>{e.done=!0}),_o(t,{type:"idle",parent:t}))}dr.assign({createStringInterpolator:qb,to:(t,e)=>new ZA(t,e)});var gx=/^--/;function QA(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!gx.test(t)&&!(Ja.hasOwnProperty(t)&&Ja[t])?e+"px":(""+e).trim()}var Eg={};function JA(t,e){if(!t.nodeType||!t.setAttribute)return!1;const r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:i,children:s,scrollTop:n,scrollLeft:a,viewBox:o,...l}=e,c=Object.values(l),h=Object.keys(l).map(f=>r||t.hasAttribute(f)?f:Eg[f]||(Eg[f]=f.replace(/([A-Z])/g,u=>"-"+u.toLowerCase())));s!==void 0&&(t.textContent=s);for(const f in i)if(i.hasOwnProperty(f)){const u=QA(f,i[f]);gx.test(f)?t.style.setProperty(f,u):t.style[f]=u}h.forEach((f,u)=>{t.setAttribute(f,c[u])}),n!==void 0&&(t.scrollTop=n),a!==void 0&&(t.scrollLeft=a),o!==void 0&&t.setAttribute("viewBox",o)}var Ja={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eC=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),tC=["Webkit","Ms","Moz","O"];Ja=Object.keys(Ja).reduce((t,e)=>(tC.forEach(r=>t[eC(r,e)]=t[e]),t),Ja);var rC=/^(matrix|translate|scale|rotate|skew)/,iC=/^(translate)/,sC=/^(rotate|skew)/,vu=(t,e)=>$.num(t)&&t!==0?t+e:t,yc=(t,e)=>$.arr(t)?t.every(r=>yc(r,e)):$.num(t)?t===e:parseFloat(t)===e,nC=class extends Dh{constructor({x:t,y:e,z:r,...i}){const s=[],n=[];(t||e||r)&&(s.push([t||0,e||0,r||0]),n.push(a=>[`translate3d(${a.map(o=>vu(o,"px")).join(",")})`,yc(a,0)])),Gr(i,(a,o)=>{if(o==="transform")s.push([a||""]),n.push(l=>[l,l===""]);else if(rC.test(o)){if(delete i[o],$.und(a))return;const l=iC.test(o)?"px":sC.test(o)?"deg":"";s.push(ut(a)),n.push(o==="rotate3d"?([c,h,f,u])=>[`rotate3d(${c},${h},${f},${vu(u,l)})`,yc(u,0)]:c=>[`${o}(${c.map(h=>vu(h,l)).join(",")})`,yc(c,o.startsWith("scale")?1:0)])}}),s.length&&(i.transform=new aC(s,n)),super(i)}},aC=class extends Wb{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return ce(this.inputs,(r,i)=>{const s=yt(r[0]),[n,a]=this.transforms[i]($.arr(s)?s:r.map(yt));t+=" "+n,e=e&&a}),e?"none":t}observerAdded(t){t==1&&ce(this.inputs,e=>ce(e,r=>Ht(r)&&pa(r,this)))}observerRemoved(t){t==0&&ce(this.inputs,e=>ce(e,r=>Ht(r)&&wo(r,this)))}eventObserved(t){t.type=="change"&&(this._value=null),_o(this,t)}},oC=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];dr.assign({batchedUpdates:rs.unstable_batchedUpdates,createStringInterpolator:qb,colors:QT});var lC=MA(oC,{applyAnimatedValues:JA,createAnimatedStyle:t=>new nC(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),cf=lC.animated,Sg=function(e){return e.reduce(function(r,i){var s=i[0],n=i[1];return r[s]=n,r},{})},Tg=typeof window<"u"&&window.document&&window.document.createElement?E.useLayoutEffect:E.useEffect,wt="top",Kt="bottom",Qt="right",Et="left",Vp="auto",hl=[wt,Kt,Qt,Et],ta="start",Io="end",cC="clippingParents",vx="viewport",Ia="popper",hC="reference",Ag=hl.reduce(function(t,e){return t.concat([e+"-"+ta,e+"-"+Io])},[]),yx=[].concat(hl,[Vp]).reduce(function(t,e){return t.concat([e,e+"-"+ta,e+"-"+Io])},[]),uC="beforeRead",dC="read",fC="afterRead",pC="beforeMain",mC="main",gC="afterMain",vC="beforeWrite",yC="write",bC="afterWrite",xC=[uC,dC,fC,pC,mC,gC,vC,yC,bC];function zr(t){return t?(t.nodeName||"").toLowerCase():null}function Nt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vs(t){var e=Nt(t).Element;return t instanceof e||t instanceof Element}function qt(t){var e=Nt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Wp(t){if(typeof ShadowRoot>"u")return!1;var e=Nt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function _C(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var i=e.styles[r]||{},s=e.attributes[r]||{},n=e.elements[r];!qt(n)||!zr(n)||(Object.assign(n.style,i),Object.keys(s).forEach(function(a){var o=s[a];o===!1?n.removeAttribute(a):n.setAttribute(a,o===!0?"":o)}))})}function wC(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(i){var s=e.elements[i],n=e.attributes[i]||{},a=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:r[i]),o=a.reduce(function(l,c){return l[c]="",l},{});!qt(s)||!zr(s)||(Object.assign(s.style,o),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}const EC={name:"applyStyles",enabled:!0,phase:"write",fn:_C,effect:wC,requires:["computeStyles"]};function Lr(t){return t.split("-")[0]}var Ls=Math.max,Wc=Math.min,ra=Math.round;function hf(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function bx(){return!/^((?!chrome|android).)*safari/i.test(hf())}function ia(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var i=t.getBoundingClientRect(),s=1,n=1;e&&qt(t)&&(s=t.offsetWidth>0&&ra(i.width)/t.offsetWidth||1,n=t.offsetHeight>0&&ra(i.height)/t.offsetHeight||1);var a=Vs(t)?Nt(t):window,o=a.visualViewport,l=!bx()&&r,c=(i.left+(l&&o?o.offsetLeft:0))/s,h=(i.top+(l&&o?o.offsetTop:0))/n,f=i.width/s,u=i.height/n;return{width:f,height:u,top:h,right:c+f,bottom:h+u,left:c,x:c,y:h}}function Xp(t){var e=ia(t),r=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function xx(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Wp(r)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function fi(t){return Nt(t).getComputedStyle(t)}function SC(t){return["table","td","th"].indexOf(zr(t))>=0}function ss(t){return((Vs(t)?t.ownerDocument:t.document)||window.document).documentElement}function Lh(t){return zr(t)==="html"?t:t.assignedSlot||t.parentNode||(Wp(t)?t.host:null)||ss(t)}function Cg(t){return!qt(t)||fi(t).position==="fixed"?null:t.offsetParent}function TC(t){var e=/firefox/i.test(hf()),r=/Trident/i.test(hf());if(r&&qt(t)){var i=fi(t);if(i.position==="fixed")return null}var s=Lh(t);for(Wp(s)&&(s=s.host);qt(s)&&["html","body"].indexOf(zr(s))<0;){var n=fi(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function ul(t){for(var e=Nt(t),r=Cg(t);r&&SC(r)&&fi(r).position==="static";)r=Cg(r);return r&&(zr(r)==="html"||zr(r)==="body"&&fi(r).position==="static")?e:r||TC(t)||e}function Yp(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function eo(t,e,r){return Ls(t,Wc(e,r))}function AC(t,e,r){var i=eo(t,e,r);return i>r?r:i}function _x(){return{top:0,right:0,bottom:0,left:0}}function wx(t){return Object.assign({},_x(),t)}function Ex(t,e){return e.reduce(function(r,i){return r[i]=t,r},{})}var CC=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,wx(typeof e!="number"?e:Ex(e,hl))};function IC(t){var e,r=t.state,i=t.name,s=t.options,n=r.elements.arrow,a=r.modifiersData.popperOffsets,o=Lr(r.placement),l=Yp(o),c=[Et,Qt].indexOf(o)>=0,h=c?"height":"width";if(!(!n||!a)){var f=CC(s.padding,r),u=Xp(n),d=l==="y"?wt:Et,p=l==="y"?Kt:Qt,m=r.rects.reference[h]+r.rects.reference[l]-a[l]-r.rects.popper[h],g=a[l]-r.rects.reference[l],y=ul(n),_=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,v=m/2-g/2,b=f[d],w=_-u[h]-f[p],A=_/2-u[h]/2+v,S=eo(b,A,w),C=l;r.modifiersData[i]=(e={},e[C]=S,e.centerOffset=S-A,e)}}function RC(t){var e=t.state,r=t.options,i=r.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||xx(e.elements.popper,s)&&(e.elements.arrow=s))}const PC={name:"arrow",enabled:!0,phase:"main",fn:IC,effect:RC,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function sa(t){return t.split("-")[1]}var MC={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OC(t,e){var r=t.x,i=t.y,s=e.devicePixelRatio||1;return{x:ra(r*s)/s||0,y:ra(i*s)/s||0}}function Ig(t){var e,r=t.popper,i=t.popperRect,s=t.placement,n=t.variation,a=t.offsets,o=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,f=t.isFixed,u=a.x,d=u===void 0?0:u,p=a.y,m=p===void 0?0:p,g=typeof h=="function"?h({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var y=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),v=Et,b=wt,w=window;if(c){var A=ul(r),S="clientHeight",C="clientWidth";if(A===Nt(r)&&(A=ss(r),fi(A).position!=="static"&&o==="absolute"&&(S="scrollHeight",C="scrollWidth")),A=A,s===wt||(s===Et||s===Qt)&&n===Io){b=Kt;var T=f&&A===w&&w.visualViewport?w.visualViewport.height:A[S];m-=T-i.height,m*=l?1:-1}if(s===Et||(s===wt||s===Kt)&&n===Io){v=Qt;var M=f&&A===w&&w.visualViewport?w.visualViewport.width:A[C];d-=M-i.width,d*=l?1:-1}}var I=Object.assign({position:o},c&&MC),k=h===!0?OC({x:d,y:m},Nt(r)):{x:d,y:m};if(d=k.x,m=k.y,l){var P;return Object.assign({},I,(P={},P[b]=_?"0":"",P[v]=y?"0":"",P.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",P))}return Object.assign({},I,(e={},e[b]=_?m+"px":"",e[v]=y?d+"px":"",e.transform="",e))}function kC(t){var e=t.state,r=t.options,i=r.gpuAcceleration,s=i===void 0?!0:i,n=r.adaptive,a=n===void 0?!0:n,o=r.roundOffsets,l=o===void 0?!0:o,c={placement:Lr(e.placement),variation:sa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ig(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ig(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const DC={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kC,data:{}};var Cl={passive:!0};function NC(t){var e=t.state,r=t.instance,i=t.options,s=i.scroll,n=s===void 0?!0:s,a=i.resize,o=a===void 0?!0:a,l=Nt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&c.forEach(function(h){h.addEventListener("scroll",r.update,Cl)}),o&&l.addEventListener("resize",r.update,Cl),function(){n&&c.forEach(function(h){h.removeEventListener("scroll",r.update,Cl)}),o&&l.removeEventListener("resize",r.update,Cl)}}const LC={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:NC,data:{}};var BC={left:"right",right:"left",bottom:"top",top:"bottom"};function bc(t){return t.replace(/left|right|bottom|top/g,function(e){return BC[e]})}var FC={start:"end",end:"start"};function Rg(t){return t.replace(/start|end/g,function(e){return FC[e]})}function qp(t){var e=Nt(t),r=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:r,scrollTop:i}}function Zp(t){return ia(ss(t)).left+qp(t).scrollLeft}function UC(t,e){var r=Nt(t),i=ss(t),s=r.visualViewport,n=i.clientWidth,a=i.clientHeight,o=0,l=0;if(s){n=s.width,a=s.height;var c=bx();(c||!c&&e==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:n,height:a,x:o+Zp(t),y:l}}function jC(t){var e,r=ss(t),i=qp(t),s=(e=t.ownerDocument)==null?void 0:e.body,n=Ls(r.scrollWidth,r.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=Ls(r.scrollHeight,r.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),o=-i.scrollLeft+Zp(t),l=-i.scrollTop;return fi(s||r).direction==="rtl"&&(o+=Ls(r.clientWidth,s?s.clientWidth:0)-n),{width:n,height:a,x:o,y:l}}function Kp(t){var e=fi(t),r=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+s+i)}function Sx(t){return["html","body","#document"].indexOf(zr(t))>=0?t.ownerDocument.body:qt(t)&&Kp(t)?t:Sx(Lh(t))}function to(t,e){var r;e===void 0&&(e=[]);var i=Sx(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),n=Nt(i),a=s?[n].concat(n.visualViewport||[],Kp(i)?i:[]):i,o=e.concat(a);return s?o:o.concat(to(Lh(a)))}function uf(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $C(t,e){var r=ia(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function Pg(t,e,r){return e===vx?uf(UC(t,r)):Vs(e)?$C(e,r):uf(jC(ss(t)))}function GC(t){var e=to(Lh(t)),r=["absolute","fixed"].indexOf(fi(t).position)>=0,i=r&&qt(t)?ul(t):t;return Vs(i)?e.filter(function(s){return Vs(s)&&xx(s,i)&&zr(s)!=="body"}):[]}function zC(t,e,r,i){var s=e==="clippingParents"?GC(t):[].concat(e),n=[].concat(s,[r]),a=n[0],o=n.reduce(function(l,c){var h=Pg(t,c,i);return l.top=Ls(h.top,l.top),l.right=Wc(h.right,l.right),l.bottom=Wc(h.bottom,l.bottom),l.left=Ls(h.left,l.left),l},Pg(t,a,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Tx(t){var e=t.reference,r=t.element,i=t.placement,s=i?Lr(i):null,n=i?sa(i):null,a=e.x+e.width/2-r.width/2,o=e.y+e.height/2-r.height/2,l;switch(s){case wt:l={x:a,y:e.y-r.height};break;case Kt:l={x:a,y:e.y+e.height};break;case Qt:l={x:e.x+e.width,y:o};break;case Et:l={x:e.x-r.width,y:o};break;default:l={x:e.x,y:e.y}}var c=s?Yp(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(n){case ta:l[c]=l[c]-(e[h]/2-r[h]/2);break;case Io:l[c]=l[c]+(e[h]/2-r[h]/2);break}}return l}function Ro(t,e){e===void 0&&(e={});var r=e,i=r.placement,s=i===void 0?t.placement:i,n=r.strategy,a=n===void 0?t.strategy:n,o=r.boundary,l=o===void 0?cC:o,c=r.rootBoundary,h=c===void 0?vx:c,f=r.elementContext,u=f===void 0?Ia:f,d=r.altBoundary,p=d===void 0?!1:d,m=r.padding,g=m===void 0?0:m,y=wx(typeof g!="number"?g:Ex(g,hl)),_=u===Ia?hC:Ia,v=t.rects.popper,b=t.elements[p?_:u],w=zC(Vs(b)?b:b.contextElement||ss(t.elements.popper),l,h,a),A=ia(t.elements.reference),S=Tx({reference:A,element:v,strategy:"absolute",placement:s}),C=uf(Object.assign({},v,S)),T=u===Ia?C:A,M={top:w.top-T.top+y.top,bottom:T.bottom-w.bottom+y.bottom,left:w.left-T.left+y.left,right:T.right-w.right+y.right},I=t.modifiersData.offset;if(u===Ia&&I){var k=I[s];Object.keys(M).forEach(function(P){var R=[Qt,Kt].indexOf(P)>=0?1:-1,O=[wt,Kt].indexOf(P)>=0?"y":"x";M[P]+=k[O]*R})}return M}function HC(t,e){e===void 0&&(e={});var r=e,i=r.placement,s=r.boundary,n=r.rootBoundary,a=r.padding,o=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?yx:l,h=sa(i),f=h?o?Ag:Ag.filter(function(p){return sa(p)===h}):hl,u=f.filter(function(p){return c.indexOf(p)>=0});u.length===0&&(u=f);var d=u.reduce(function(p,m){return p[m]=Ro(t,{placement:m,boundary:s,rootBoundary:n,padding:a})[Lr(m)],p},{});return Object.keys(d).sort(function(p,m){return d[p]-d[m]})}function VC(t){if(Lr(t)===Vp)return[];var e=bc(t);return[Rg(t),e,Rg(e)]}function WC(t){var e=t.state,r=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var s=r.mainAxis,n=s===void 0?!0:s,a=r.altAxis,o=a===void 0?!0:a,l=r.fallbackPlacements,c=r.padding,h=r.boundary,f=r.rootBoundary,u=r.altBoundary,d=r.flipVariations,p=d===void 0?!0:d,m=r.allowedAutoPlacements,g=e.options.placement,y=Lr(g),_=y===g,v=l||(_||!p?[bc(g)]:VC(g)),b=[g].concat(v).reduce(function(J,ee){return J.concat(Lr(ee)===Vp?HC(e,{placement:ee,boundary:h,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):ee)},[]),w=e.rects.reference,A=e.rects.popper,S=new Map,C=!0,T=b[0],M=0;M<b.length;M++){var I=b[M],k=Lr(I),P=sa(I)===ta,R=[wt,Kt].indexOf(k)>=0,O=R?"width":"height",L=Ro(e,{placement:I,boundary:h,rootBoundary:f,altBoundary:u,padding:c}),N=R?P?Qt:Et:P?Kt:wt;w[O]>A[O]&&(N=bc(N));var B=bc(N),U=[];if(n&&U.push(L[k]<=0),o&&U.push(L[N]<=0,L[B]<=0),U.every(function(J){return J})){T=I,C=!1;break}S.set(I,U)}if(C)for(var F=p?3:1,j=function(ee){var ne=b.find(function(se){var pe=S.get(se);if(pe)return pe.slice(0,ee).every(function(ge){return ge})});if(ne)return T=ne,"break"},z=F;z>0;z--){var q=j(z);if(q==="break")break}e.placement!==T&&(e.modifiersData[i]._skip=!0,e.placement=T,e.reset=!0)}}const XC={name:"flip",enabled:!0,phase:"main",fn:WC,requiresIfExists:["offset"],data:{_skip:!1}};function Mg(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function Og(t){return[wt,Qt,Kt,Et].some(function(e){return t[e]>=0})}function YC(t){var e=t.state,r=t.name,i=e.rects.reference,s=e.rects.popper,n=e.modifiersData.preventOverflow,a=Ro(e,{elementContext:"reference"}),o=Ro(e,{altBoundary:!0}),l=Mg(a,i),c=Mg(o,s,n),h=Og(l),f=Og(c);e.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":f})}const qC={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:YC};function ZC(t,e,r){var i=Lr(t),s=[Et,wt].indexOf(i)>=0?-1:1,n=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,a=n[0],o=n[1];return a=a||0,o=(o||0)*s,[Et,Qt].indexOf(i)>=0?{x:o,y:a}:{x:a,y:o}}function KC(t){var e=t.state,r=t.options,i=t.name,s=r.offset,n=s===void 0?[0,0]:s,a=yx.reduce(function(h,f){return h[f]=ZC(f,e.rects,n),h},{}),o=a[e.placement],l=o.x,c=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}const QC={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:KC};function JC(t){var e=t.state,r=t.name;e.modifiersData[r]=Tx({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const e2={name:"popperOffsets",enabled:!0,phase:"read",fn:JC,data:{}};function t2(t){return t==="x"?"y":"x"}function r2(t){var e=t.state,r=t.options,i=t.name,s=r.mainAxis,n=s===void 0?!0:s,a=r.altAxis,o=a===void 0?!1:a,l=r.boundary,c=r.rootBoundary,h=r.altBoundary,f=r.padding,u=r.tether,d=u===void 0?!0:u,p=r.tetherOffset,m=p===void 0?0:p,g=Ro(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:h}),y=Lr(e.placement),_=sa(e.placement),v=!_,b=Yp(y),w=t2(b),A=e.modifiersData.popperOffsets,S=e.rects.reference,C=e.rects.popper,T=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,M=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),I=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(A){if(n){var P,R=b==="y"?wt:Et,O=b==="y"?Kt:Qt,L=b==="y"?"height":"width",N=A[b],B=N+g[R],U=N-g[O],F=d?-C[L]/2:0,j=_===ta?S[L]:C[L],z=_===ta?-C[L]:-S[L],q=e.elements.arrow,J=d&&q?Xp(q):{width:0,height:0},ee=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:_x(),ne=ee[R],se=ee[O],pe=eo(0,S[L],J[L]),ge=v?S[L]/2-F-pe-ne-M.mainAxis:j-pe-ne-M.mainAxis,ae=v?-S[L]/2+F+pe+se+M.mainAxis:z+pe+se+M.mainAxis,he=e.elements.arrow&&ul(e.elements.arrow),ye=he?b==="y"?he.clientTop||0:he.clientLeft||0:0,Ee=(P=I==null?void 0:I[b])!=null?P:0,Ue=N+ge-Ee-ye,qe=N+ae-Ee,Tt=eo(d?Wc(B,Ue):B,N,d?Ls(U,qe):U);A[b]=Tt,k[b]=Tt-N}if(o){var mr,gr=b==="x"?wt:Et,ou=b==="x"?Kt:Qt,vr=A[w],hs=w==="y"?"height":"width",gt=vr+g[gr],Xr=vr-g[ou],gi=[wt,Et].indexOf(y)!==-1,ve=(mr=I==null?void 0:I[w])!=null?mr:0,Te=gi?gt:vr-S[hs]-C[hs]-ve+M.altAxis,oe=gi?vr+S[hs]+C[hs]-ve-M.altAxis:Xr,Pe=d&&gi?AC(Te,vr,oe):eo(d?Te:gt,vr,d?oe:Xr);A[w]=Pe,k[w]=Pe-vr}e.modifiersData[i]=k}}const i2={name:"preventOverflow",enabled:!0,phase:"main",fn:r2,requiresIfExists:["offset"]};function s2(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function n2(t){return t===Nt(t)||!qt(t)?qp(t):s2(t)}function a2(t){var e=t.getBoundingClientRect(),r=ra(e.width)/t.offsetWidth||1,i=ra(e.height)/t.offsetHeight||1;return r!==1||i!==1}function o2(t,e,r){r===void 0&&(r=!1);var i=qt(e),s=qt(e)&&a2(e),n=ss(e),a=ia(t,s,r),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!r)&&((zr(e)!=="body"||Kp(n))&&(o=n2(e)),qt(e)?(l=ia(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):n&&(l.x=Zp(n))),{x:a.left+o.scrollLeft-l.x,y:a.top+o.scrollTop-l.y,width:a.width,height:a.height}}function l2(t){var e=new Map,r=new Set,i=[];t.forEach(function(n){e.set(n.name,n)});function s(n){r.add(n.name);var a=[].concat(n.requires||[],n.requiresIfExists||[]);a.forEach(function(o){if(!r.has(o)){var l=e.get(o);l&&s(l)}}),i.push(n)}return t.forEach(function(n){r.has(n.name)||s(n)}),i}function c2(t){var e=l2(t);return xC.reduce(function(r,i){return r.concat(e.filter(function(s){return s.phase===i}))},[])}function h2(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function u2(t){var e=t.reduce(function(r,i){var s=r[i.name];return r[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,r},{});return Object.keys(e).map(function(r){return e[r]})}var kg={placement:"bottom",modifiers:[],strategy:"absolute"};function Dg(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function d2(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,i=r===void 0?[]:r,s=e.defaultOptions,n=s===void 0?kg:s;return function(o,l,c){c===void 0&&(c=n);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},kg,n),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},f=[],u=!1,d={state:h,setOptions:function(y){var _=typeof y=="function"?y(h.options):y;m(),h.options=Object.assign({},n,h.options,_),h.scrollParents={reference:Vs(o)?to(o):o.contextElement?to(o.contextElement):[],popper:to(l)};var v=c2(u2([].concat(i,h.options.modifiers)));return h.orderedModifiers=v.filter(function(b){return b.enabled}),p(),d.update()},forceUpdate:function(){if(!u){var y=h.elements,_=y.reference,v=y.popper;if(Dg(_,v)){h.rects={reference:o2(_,ul(v),h.options.strategy==="fixed"),popper:Xp(v)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(M){return h.modifiersData[M.name]=Object.assign({},M.data)});for(var b=0;b<h.orderedModifiers.length;b++){if(h.reset===!0){h.reset=!1,b=-1;continue}var w=h.orderedModifiers[b],A=w.fn,S=w.options,C=S===void 0?{}:S,T=w.name;typeof A=="function"&&(h=A({state:h,options:C,name:T,instance:d})||h)}}}},update:h2(function(){return new Promise(function(g){d.forceUpdate(),g(h)})}),destroy:function(){m(),u=!0}};if(!Dg(o,l))return d;d.setOptions(c).then(function(g){!u&&c.onFirstUpdate&&c.onFirstUpdate(g)});function p(){h.orderedModifiers.forEach(function(g){var y=g.name,_=g.options,v=_===void 0?{}:_,b=g.effect;if(typeof b=="function"){var w=b({state:h,name:y,instance:d,options:v}),A=function(){};f.push(w||A)}})}function m(){f.forEach(function(g){return g()}),f=[]}return d}}var f2=[LC,e2,DC,EC,QC,XC,i2,PC,qC],p2=d2({defaultModifiers:f2}),m2=typeof Element<"u",g2=typeof Map=="function",v2=typeof Set=="function",y2=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xc(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(i=r;i--!==0;)if(!xc(t[i],e[i]))return!1;return!0}var n;if(g2&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n=t.entries();!(i=n.next()).done;)if(!e.has(i.value[0]))return!1;for(n=t.entries();!(i=n.next()).done;)if(!xc(i.value[1],e.get(i.value[0])))return!1;return!0}if(v2&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n=t.entries();!(i=n.next()).done;)if(!e.has(i.value[0]))return!1;return!0}if(y2&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(i=r;i--!==0;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;if(m2&&t instanceof Element)return!1;for(i=r;i--!==0;)if(!((s[i]==="_owner"||s[i]==="__v"||s[i]==="__o")&&t.$$typeof)&&!xc(t[s[i]],e[s[i]]))return!1;return!0}return t!==t&&e!==e}var b2=function(e,r){try{return xc(e,r)}catch(i){if((i.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw i}};const x2=Js(b2);var _2=[],w2=function(e,r,i){i===void 0&&(i={});var s=E.useRef(null),n={onFirstUpdate:i.onFirstUpdate,placement:i.placement||"bottom",strategy:i.strategy||"absolute",modifiers:i.modifiers||_2},a=E.useState({styles:{popper:{position:n.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=a[0],l=a[1],c=E.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(d){var p=d.state,m=Object.keys(p.elements);rs.flushSync(function(){l({styles:Sg(m.map(function(g){return[g,p.styles[g]||{}]})),attributes:Sg(m.map(function(g){return[g,p.attributes[g]]}))})})},requires:["computeStyles"]}},[]),h=E.useMemo(function(){var u={onFirstUpdate:n.onFirstUpdate,placement:n.placement,strategy:n.strategy,modifiers:[].concat(n.modifiers,[c,{name:"applyStyles",enabled:!1}])};return x2(s.current,u)?s.current||u:(s.current=u,u)},[n.onFirstUpdate,n.placement,n.strategy,n.modifiers,c]),f=E.useRef();return Tg(function(){f.current&&f.current.setOptions(h)},[h]),Tg(function(){if(!(e==null||r==null)){var u=i.createPopper||p2,d=u(e,r,h);return f.current=d,function(){d.destroy(),f.current=null}}},[e,r,i.createPopper]),{state:f.current?f.current.state:null,styles:o.styles,attributes:o.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}};const E2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M19.935 17.51q1.088 0 1.868.792.78.794.78 1.898 0 1.106-.78 1.898-.78.793-1.844.793t-1.869-.793a2.52 2.52 0 0 1-.78-1.922q0-.432.19-.936l-3.997-2.931q-1.16 1.2-2.79 1.2-1.633 0-2.791-1.176-1.16-1.177-1.183-2.86 0-.215.071-.624l-3.168-1.057a1.25 1.25 0 0 1-.852.337q-.567 0-.946-.385a1.32 1.32 0 0 1-.378-.96q0-.578.378-.938.38-.36.946-.384.474 0 .804.312.33.313.45.745l3.192 1.08a3.8 3.8 0 0 1 1.443-1.56 3.84 3.84 0 0 1 2.033-.577q1.23 0 2.27.745l4.706-4.781q-.378-.72-.378-1.321 0-1.106.78-1.898.78-.793 1.869-.793t1.844.793q.758.792.78 1.898a2.42 2.42 0 0 1-.78 1.873q-.804.77-1.868.793-.616 0-1.3-.408l-4.707 4.805q.734 1.056.733 2.306 0 .888-.402 1.753l3.997 2.907q.78-.624 1.679-.624"})]}),S2=E2,T2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M22.996 13.153q0 2.09-.873 3.987a10.6 10.6 0 0 1-2.336 3.292q-1.462 1.393-3.516 2.21t-4.26.817-4.287-.817-3.49-2.21a12.3 12.3 0 0 1-2.362-3.291A8.1 8.1 0 0 1 1 13.153q0-2.451 1.155-4.589t3.234-3.627q.616-.433 1.386-.337t1.181.673q.462.553.36 1.273-.104.72-.72 1.13a7 7 0 0 0-2.155 2.426 6.38 6.38 0 0 0-.18 5.717 7 7 0 0 0 1.566 2.186q.975.913 2.335 1.466a7.5 7.5 0 0 0 2.85.552 7.3 7.3 0 0 0 2.823-.552 8.3 8.3 0 0 0 2.36-1.466 6.04 6.04 0 0 0 1.567-2.186q.538-1.274.564-2.666 0-1.635-.77-3.051T16.4 7.675a1.75 1.75 0 0 1-.719-1.129q-.128-.697.36-1.273.436-.577 1.206-.673t1.36.337q2.079 1.466 3.234 3.627a9.6 9.6 0 0 1 1.155 4.589M13.833 2.846v8.6q0 .698-.54 1.202-.538.505-1.283.505t-1.309-.505q-.564-.505-.539-1.201v-8.6q0-.697.54-1.202.538-.504 1.308-.504t1.284.504.539 1.201"})]}),Ng=T2,A2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M20.584 13.536v7.458q0 .42-.294.699a1.06 1.06 0 0 1-.667.307H13.91v-5.978h-3.817V22H4.383a.85.85 0 0 1-.668-.307 1.16 1.16 0 0 1-.293-.699v-7.569l8.567-7.375 8.568 7.375q.027.027.027.111m3.31-1.09-.908 1.146a.54.54 0 0 1-.32.168h-.054a.6.6 0 0 1-.32-.084L11.989 4.682 1.687 13.676a.5.5 0 0 1-.347.084.54.54 0 0 1-.32-.168l-.935-1.145a.52.52 0 0 1-.08-.363.6.6 0 0 1 .16-.335l10.703-9.33q.48-.42 1.121-.419.64 0 1.148.419l3.63 3.156V2.56q0-.224.133-.363a.46.46 0 0 1 .347-.14h2.856q.214 0 .347.14a.5.5 0 0 1 .134.363v6.34l3.256 2.85q.16.111.16.335 0 .223-.107.363"})]}),C2=A2,I2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M1.898 22.555c-.072-.145-.096-1.37-.048-2.691l.048-2.402h5.261v5.26l-2.595.049c-1.994.048-2.594 0-2.666-.216m7.76 0c-.049-.145-.073-1.37-.049-2.691l.072-2.402h5.238v5.26l-2.571.049c-2.018.048-2.595 0-2.69-.216m7.759 0c-.048-.145-.072-1.37-.048-2.691l.072-2.402h5.237v5.26l-2.57.049c-1.994.048-2.595 0-2.691-.216m-15.52-7.76c-.071-.168-.095-1.37-.047-2.69l.048-2.403h5.261v5.261l-2.595.048c-1.994.048-2.594 0-2.666-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.238v5.261l-2.571.048c-2.018.048-2.595 0-2.69-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.237v5.261l-2.57.048c-1.994.048-2.595 0-2.691-.216M1.897 7.011c-.071-.144-.095-1.345-.047-2.666l.048-2.402h5.261V7.18l-2.595.072c-1.994.048-2.594 0-2.666-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.238V7.18l-2.571.072c-2.018.048-2.595 0-2.69-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.237V7.18l-2.57.072c-1.994.048-2.595 0-2.691-.24"})]}),Lg=I2,R2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12M7.123 7.667C8.276 5.958 9.745 5 12.013 5 14.425 5 17 6.941 17 9.5c0 2.113-1.377 2.932-2.418 3.552-.633.376-1.142.68-1.142 1.154v.169a.693.693 0 0 1-.682.703h-2.06a.693.693 0 0 1-.681-.703v-.287c0-1.768 1.269-2.5 2.266-3.075l.073-.042c.863-.499 1.392-.838 1.392-1.499 0-.874-1.082-1.454-1.956-1.454-1.112 0-1.64.53-2.351 1.449a.67.67 0 0 1-.945.121L7.27 8.63a.72.72 0 0 1-.147-.963M9.76 17.97c0-1.12.883-2.03 1.969-2.03 1.085 0 1.968.91 1.968 2.03S12.814 20 11.73 20c-1.086 0-1.969-.91-1.969-2.03",clipRule:"evenodd"})]}),P2=R2,M2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"m.5 21.257 7.46-8.216 4.052 2.403 4.052-2.403 7.46 8.216zm0-2.738V8.573l5.848 3.531zm0-12.084V3.048h23.024v3.387l-11.512 6.847zm17.176 5.67 5.848-3.532v9.946z"})]}),Bg=M2,O2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M13.07 13.07V6.54h-2.14v6.53zm0 4.4v-2.2h-2.14v2.2zM24 12l-2.65 3.01.35 4.04-3.93.86-2.04 3.48L12 21.8l-3.73 1.6-2.04-3.42-3.93-.92.35-4.04L0 12l2.65-3.06-.35-3.99 3.93-.86L8.27.6 12 2.2 15.73.6l2.04 3.48 3.93.86L21.34 9z"})]}),k2=O2,D2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M11.685 2C8.66 2 6.7 3.277 5.164 5.556A.96.96 0 0 0 5.36 6.84l1.634 1.278a.89.89 0 0 0 1.26-.162c.95-1.226 1.653-1.932 3.136-1.932 1.165 0 2.607.773 2.607 1.939 0 .88-.705 1.333-1.856 1.998-1.342.776-3.118 1.742-3.118 4.157v.382c0 .518.407.938.909.938h2.746c.502 0 .91-.42.91-.938v-.226c0-1.674 4.745-1.743 4.745-6.274 0-3.412-3.432-6-6.648-6m-.38 14.588c-1.447 0-2.625 1.214-2.625 2.706S9.858 22 11.305 22s2.624-1.214 2.624-2.706-1.177-2.706-2.624-2.706"})]}),N2=D2,L2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.051 12.366a456 456 0 0 1-2.746-1.822A6.5 6.5 0 0 1 .74 9.067q-.737-.94-.737-1.745a2.7 2.7 0 0 1 .141-.905c.098-.286.242-.542.424-.752Q1.12 5 2.15 5h19.7c.541-.016 1.071.195 1.507.6q.636.6.636 1.446 0 1.01-.657 1.93a6.2 6.2 0 0 1-1.632 1.567q-5.037 3.338-6.267 4.156l-.242.167-.323.222q-.436.303-.724.487-.288.183-.696.415a4 4 0 0 1-.77.345 2.2 2.2 0 0 1-.67.115h-.026a2.2 2.2 0 0 1-.67-.116 4 4 0 0 1-.77-.344q-.41-.23-.697-.415a30 30 0 0 1-.723-.487q-.433-.3-.565-.389-1.215-.817-3.51-2.334m10.943 3.962q2.276-1.578 6.667-4.416c.478-.306.927-.68 1.339-1.113v10.16q0 .845-.63 1.446c-.437.405-.97.614-1.512.594H2.149c-.545.02-1.08-.192-1.52-.601C.21 21.996 0 21.52 0 20.95V10.8c.416.437.871.81 1.356 1.113q4.848 3.148 6.656 4.416.768.537 1.243.837a7.7 7.7 0 0 0 1.265.614c.475.198.97.303 1.47.313h.026c.5-.01.995-.115 1.47-.313a7.7 7.7 0 0 0 1.265-.614q.48-.3 1.243-.837",clipRule:"evenodd"})]}),B2=L2,F2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("g",{clipPath:"url(#one-profile_svg__a)",children:x.jsx("path",{fill:"currentColor",d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 4.65a4.26 4.26 0 1 1 0 8.51 4.26 4.26 0 0 1 0-8.51m0 16.64a9.27 9.27 0 0 1-7.09-3.3 5.4 5.4 0 0 1 4.77-2.9c.11 0 .23.03.34.06.63.2 1.29.33 1.98.33.7 0 1.35-.13 1.98-.33.11-.03.23-.05.34-.05a5.4 5.4 0 0 1 4.77 2.89 9.27 9.27 0 0 1-7.09 3.3"})}),x.jsx("defs",{children:x.jsx("clipPath",{id:"one-profile_svg__a",children:x.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),Ax=F2,U2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M1.27 11.552a7.75 7.75 0 0 1 0-4.156Q1.84 5.33 3.42 3.792a7.9 7.9 0 0 1 2.716-1.777q1.53-.6 3.161-.6 1.605 0 3.136.6 1.53.6 2.716 1.777a7.9 7.9 0 0 1 1.902 2.86 7.8 7.8 0 0 1 .518 3.29 7.65 7.65 0 0 1-.889 3.171q.692.192 1.21.697l4.297 4.156q.864.84.864 2.042t-.864 2.042-2.099.841-2.099-.84l-4.272-4.18a2.42 2.42 0 0 1-.74-1.178 8.3 8.3 0 0 1-3.68.84q-1.63 0-3.16-.6a8.1 8.1 0 0 1-2.717-1.753 7.85 7.85 0 0 1-2.149-3.628m2.495-2.066q0 2.235 1.605 3.796 1.63 1.56 3.926 1.561 2.272 0 3.877-1.561 1.605-1.562 1.63-3.796t-1.63-3.796q-1.63-1.585-3.877-1.585-2.272 0-3.926 1.585-1.605 1.561-1.605 3.796"})]}),j2=U2,$2=({title:t,titleId:e,...r})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":e,...r,children:[t?x.jsx("title",{id:e,children:t}):null,x.jsx("path",{fill:"currentColor",d:"M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z"})]}),G2=$2;function Fg(t){return t!==null&&typeof t=="object"&&"constructor"in t&&t.constructor===Object}function Qp(t,e){t===void 0&&(t={}),e===void 0&&(e={}),Object.keys(e).forEach(r=>{typeof t[r]>"u"?t[r]=e[r]:Fg(e[r])&&Fg(t[r])&&Object.keys(e[r]).length>0&&Qp(t[r],e[r])})}const Cx={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function tn(){const t=typeof document<"u"?document:{};return Qp(t,Cx),t}const z2={document:Cx,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(t){return typeof setTimeout>"u"?(t(),null):setTimeout(t,0)},cancelAnimationFrame(t){typeof setTimeout>"u"||clearTimeout(t)}};function Lt(){const t=typeof window<"u"?window:{};return Qp(t,z2),t}function H2(t){const e=t;Object.keys(e).forEach(r=>{try{e[r]=null}catch{}try{delete e[r]}catch{}})}function df(t,e){return e===void 0&&(e=0),setTimeout(t,e)}function Xc(){return Date.now()}function V2(t){const e=Lt();let r;return e.getComputedStyle&&(r=e.getComputedStyle(t,null)),!r&&t.currentStyle&&(r=t.currentStyle),r||(r=t.style),r}function W2(t,e){e===void 0&&(e="x");const r=Lt();let i,s,n;const a=V2(t);return r.WebKitCSSMatrix?(s=a.transform||a.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(o=>o.replace(",",".")).join(", ")),n=new r.WebKitCSSMatrix(s==="none"?"":s)):(n=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),i=n.toString().split(",")),e==="x"&&(r.WebKitCSSMatrix?s=n.m41:i.length===16?s=parseFloat(i[12]):s=parseFloat(i[4])),e==="y"&&(r.WebKitCSSMatrix?s=n.m42:i.length===16?s=parseFloat(i[13]):s=parseFloat(i[5])),s||0}function Il(t){return typeof t=="object"&&t!==null&&t.constructor&&Object.prototype.toString.call(t).slice(8,-1)==="Object"}function X2(t){return typeof window<"u"&&typeof window.HTMLElement<"u"?t instanceof HTMLElement:t&&(t.nodeType===1||t.nodeType===11)}function Pt(){const t=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let r=1;r<arguments.length;r+=1){const i=r<0||arguments.length<=r?void 0:arguments[r];if(i!=null&&!X2(i)){const s=Object.keys(Object(i)).filter(n=>e.indexOf(n)<0);for(let n=0,a=s.length;n<a;n+=1){const o=s[n],l=Object.getOwnPropertyDescriptor(i,o);l!==void 0&&l.enumerable&&(Il(t[o])&&Il(i[o])?i[o].__swiper__?t[o]=i[o]:Pt(t[o],i[o]):!Il(t[o])&&Il(i[o])?(t[o]={},i[o].__swiper__?t[o]=i[o]:Pt(t[o],i[o])):t[o]=i[o])}}}return t}function Rl(t,e,r){t.style.setProperty(e,r)}function Ix(t){let{swiper:e,targetPosition:r,side:i}=t;const s=Lt(),n=-e.translate;let a=null,o;const l=e.params.speed;e.wrapperEl.style.scrollSnapType="none",s.cancelAnimationFrame(e.cssModeFrameID);const c=r>n?"next":"prev",h=(u,d)=>c==="next"&&u>=d||c==="prev"&&u<=d,f=()=>{o=new Date().getTime(),a===null&&(a=o);const u=Math.max(Math.min((o-a)/l,1),0),d=.5-Math.cos(u*Math.PI)/2;let p=n+d*(r-n);if(h(p,r)&&(p=r),e.wrapperEl.scrollTo({[i]:p}),h(p,r)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[i]:p})}),s.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=s.requestAnimationFrame(f)};f()}function Dr(t,e){return e===void 0&&(e=""),[...t.children].filter(r=>r.matches(e))}function Rx(t,e){e===void 0&&(e=[]);const r=document.createElement(t);return r.classList.add(...Array.isArray(e)?e:[e]),r}function Y2(t,e){const r=[];for(;t.previousElementSibling;){const i=t.previousElementSibling;e?i.matches(e)&&r.push(i):r.push(i),t=i}return r}function q2(t,e){const r=[];for(;t.nextElementSibling;){const i=t.nextElementSibling;e?i.matches(e)&&r.push(i):r.push(i),t=i}return r}function Fi(t,e){return Lt().getComputedStyle(t,null).getPropertyValue(e)}function Yc(t){let e=t,r;if(e){for(r=0;(e=e.previousSibling)!==null;)e.nodeType===1&&(r+=1);return r}}function Px(t,e){const r=[];let i=t.parentElement;for(;i;)e?i.matches(e)&&r.push(i):r.push(i),i=i.parentElement;return r}function ff(t,e,r){const i=Lt();return r?t[e==="width"?"offsetWidth":"offsetHeight"]+parseFloat(i.getComputedStyle(t,null).getPropertyValue(e==="width"?"margin-right":"margin-top"))+parseFloat(i.getComputedStyle(t,null).getPropertyValue(e==="width"?"margin-left":"margin-bottom")):t.offsetWidth}function Z2(t,e,r,i){return t.params.createElements&&Object.keys(i).forEach(s=>{if(!r[s]&&r.auto===!0){let n=Dr(t.el,`.${i[s]}`)[0];n||(n=Rx("div",i[s]),n.className=i[s],t.el.append(n)),r[s]=n,e[s]=n}}),r}function Ra(t){return t===void 0&&(t=""),`.${t.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function K2(t){let{swiper:e,extendParams:r,on:i,emit:s}=t;const n="swiper-pagination";r({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:_=>_,formatFractionTotal:_=>_,bulletClass:`${n}-bullet`,bulletActiveClass:`${n}-bullet-active`,modifierClass:`${n}-`,currentClass:`${n}-current`,totalClass:`${n}-total`,hiddenClass:`${n}-hidden`,progressbarFillClass:`${n}-progressbar-fill`,progressbarOppositeClass:`${n}-progressbar-opposite`,clickableClass:`${n}-clickable`,lockClass:`${n}-lock`,horizontalClass:`${n}-horizontal`,verticalClass:`${n}-vertical`,paginationDisabledClass:`${n}-disabled`}}),e.pagination={el:null,bullets:[]};let a,o=0;const l=_=>(Array.isArray(_)?_:[_]).filter(v=>!!v);function c(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function h(_,v){const{bulletActiveClass:b}=e.params.pagination;_&&(_=_[`${v==="prev"?"previous":"next"}ElementSibling`],_&&(_.classList.add(`${b}-${v}`),_=_[`${v==="prev"?"previous":"next"}ElementSibling`],_&&_.classList.add(`${b}-${v}-${v}`)))}function f(_){const v=_.target.closest(Ra(e.params.pagination.bulletClass));if(!v)return;_.preventDefault();const b=Yc(v)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===b)return;const w=e.getSlideIndexByData(b),A=e.getSlideIndexByData(e.realIndex);w>e.slides.length-e.loopedSlides&&e.loopFix({direction:w>A?"next":"prev",activeSlideIndex:w,slideTo:!1}),e.slideToLoop(b)}else e.slideTo(b)}function u(){const _=e.rtl,v=e.params.pagination;if(c())return;let b=e.pagination.el;b=l(b);let w,A;const S=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,C=e.params.loop?Math.ceil(S/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(A=e.previousRealIndex||0,w=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):typeof e.snapIndex<"u"?(w=e.snapIndex,A=e.previousSnapIndex):(A=e.previousIndex||0,w=e.activeIndex||0),v.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const T=e.pagination.bullets;let M,I,k;if(v.dynamicBullets&&(a=ff(T[0],e.isHorizontal()?"width":"height",!0),b.forEach(P=>{P.style[e.isHorizontal()?"width":"height"]=`${a*(v.dynamicMainBullets+4)}px`}),v.dynamicMainBullets>1&&A!==void 0&&(o+=w-(A||0),o>v.dynamicMainBullets-1?o=v.dynamicMainBullets-1:o<0&&(o=0)),M=Math.max(w-o,0),I=M+(Math.min(T.length,v.dynamicMainBullets)-1),k=(I+M)/2),T.forEach(P=>{const R=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(O=>`${v.bulletActiveClass}${O}`)].map(O=>typeof O=="string"&&O.includes(" ")?O.split(" "):O).flat();P.classList.remove(...R)}),b.length>1)T.forEach(P=>{const R=Yc(P);R===w?P.classList.add(...v.bulletActiveClass.split(" ")):e.isElement&&P.setAttribute("part","bullet"),v.dynamicBullets&&(R>=M&&R<=I&&P.classList.add(...`${v.bulletActiveClass}-main`.split(" ")),R===M&&h(P,"prev"),R===I&&h(P,"next"))});else{const P=T[w];if(P&&P.classList.add(...v.bulletActiveClass.split(" ")),e.isElement&&T.forEach((R,O)=>{R.setAttribute("part",O===w?"bullet-active":"bullet")}),v.dynamicBullets){const R=T[M],O=T[I];for(let L=M;L<=I;L+=1)T[L]&&T[L].classList.add(...`${v.bulletActiveClass}-main`.split(" "));h(R,"prev"),h(O,"next")}}if(v.dynamicBullets){const P=Math.min(T.length,v.dynamicMainBullets+4),R=(a*P-a)/2-k*a,O=_?"right":"left";T.forEach(L=>{L.style[e.isHorizontal()?O:"top"]=`${R}px`})}}b.forEach((T,M)=>{if(v.type==="fraction"&&(T.querySelectorAll(Ra(v.currentClass)).forEach(I=>{I.textContent=v.formatFractionCurrent(w+1)}),T.querySelectorAll(Ra(v.totalClass)).forEach(I=>{I.textContent=v.formatFractionTotal(C)})),v.type==="progressbar"){let I;v.progressbarOpposite?I=e.isHorizontal()?"vertical":"horizontal":I=e.isHorizontal()?"horizontal":"vertical";const k=(w+1)/C;let P=1,R=1;I==="horizontal"?P=k:R=k,T.querySelectorAll(Ra(v.progressbarFillClass)).forEach(O=>{O.style.transform=`translate3d(0,0,0) scaleX(${P}) scaleY(${R})`,O.style.transitionDuration=`${e.params.speed}ms`})}v.type==="custom"&&v.renderCustom?(T.innerHTML=v.renderCustom(e,w+1,C),M===0&&s("paginationRender",T)):(M===0&&s("paginationRender",T),s("paginationUpdate",T)),e.params.watchOverflow&&e.enabled&&T.classList[e.isLocked?"add":"remove"](v.lockClass)})}function d(){const _=e.params.pagination;if(c())return;const v=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length;let b=e.pagination.el;b=l(b);let w="";if(_.type==="bullets"){let A=e.params.loop?Math.ceil(v/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&A>v&&(A=v);for(let S=0;S<A;S+=1)_.renderBullet?w+=_.renderBullet.call(e,S,_.bulletClass):w+=`<${_.bulletElement} ${e.isElement?'part="bullet"':""} class="${_.bulletClass}"></${_.bulletElement}>`}_.type==="fraction"&&(_.renderFraction?w=_.renderFraction.call(e,_.currentClass,_.totalClass):w=`<span class="${_.currentClass}"></span> / <span class="${_.totalClass}"></span>`),_.type==="progressbar"&&(_.renderProgressbar?w=_.renderProgressbar.call(e,_.progressbarFillClass):w=`<span class="${_.progressbarFillClass}"></span>`),e.pagination.bullets=[],b.forEach(A=>{_.type!=="custom"&&(A.innerHTML=w||""),_.type==="bullets"&&e.pagination.bullets.push(...A.querySelectorAll(Ra(_.bulletClass)))}),_.type!=="custom"&&s("paginationRender",b[0])}function p(){e.params.pagination=Z2(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const _=e.params.pagination;if(!_.el)return;let v;typeof _.el=="string"&&e.isElement&&(v=e.el.querySelector(_.el)),!v&&typeof _.el=="string"&&(v=[...document.querySelectorAll(_.el)]),v||(v=_.el),!(!v||v.length===0)&&(e.params.uniqueNavElements&&typeof _.el=="string"&&Array.isArray(v)&&v.length>1&&(v=[...e.el.querySelectorAll(_.el)],v.length>1&&(v=v.filter(b=>Px(b,".swiper")[0]===e.el)[0])),Array.isArray(v)&&v.length===1&&(v=v[0]),Object.assign(e.pagination,{el:v}),v=l(v),v.forEach(b=>{_.type==="bullets"&&_.clickable&&b.classList.add(_.clickableClass),b.classList.add(_.modifierClass+_.type),b.classList.add(e.isHorizontal()?_.horizontalClass:_.verticalClass),_.type==="bullets"&&_.dynamicBullets&&(b.classList.add(`${_.modifierClass}${_.type}-dynamic`),o=0,_.dynamicMainBullets<1&&(_.dynamicMainBullets=1)),_.type==="progressbar"&&_.progressbarOpposite&&b.classList.add(_.progressbarOppositeClass),_.clickable&&b.addEventListener("click",f),e.enabled||b.classList.add(_.lockClass)}))}function m(){const _=e.params.pagination;if(c())return;let v=e.pagination.el;v&&(v=l(v),v.forEach(b=>{b.classList.remove(_.hiddenClass),b.classList.remove(_.modifierClass+_.type),b.classList.remove(e.isHorizontal()?_.horizontalClass:_.verticalClass),_.clickable&&b.removeEventListener("click",f)})),e.pagination.bullets&&e.pagination.bullets.forEach(b=>b.classList.remove(..._.bulletActiveClass.split(" ")))}i("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const _=e.params.pagination;let{el:v}=e.pagination;v=l(v),v.forEach(b=>{b.classList.remove(_.horizontalClass,_.verticalClass),b.classList.add(e.isHorizontal()?_.horizontalClass:_.verticalClass)})}),i("init",()=>{e.params.pagination.enabled===!1?y():(p(),d(),u())}),i("activeIndexChange",()=>{typeof e.snapIndex>"u"&&u()}),i("snapIndexChange",()=>{u()}),i("snapGridLengthChange",()=>{d(),u()}),i("destroy",()=>{m()}),i("enable disable",()=>{let{el:_}=e.pagination;_&&(_=l(_),_.forEach(v=>v.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass)))}),i("lock unlock",()=>{u()}),i("click",(_,v)=>{const b=v.target,w=l(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&w&&w.length>0&&!b.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&b===e.navigation.nextEl||e.navigation.prevEl&&b===e.navigation.prevEl))return;const A=w[0].classList.contains(e.params.pagination.hiddenClass);s(A===!0?"paginationShow":"paginationHide"),w.forEach(S=>S.classList.toggle(e.params.pagination.hiddenClass))}});const g=()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:_}=e.pagination;_&&(_=l(_),_.forEach(v=>v.classList.remove(e.params.pagination.paginationDisabledClass))),p(),d(),u()},y=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:_}=e.pagination;_&&(_=l(_),_.forEach(v=>v.classList.add(e.params.pagination.paginationDisabledClass))),m()};Object.assign(e.pagination,{enable:g,disable:y,render:d,update:u,init:p,destroy:m})}let yu;function Q2(){const t=Lt(),e=tn();return{smoothScroll:e.documentElement&&e.documentElement.style&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in t||t.DocumentTouch&&e instanceof t.DocumentTouch)}}function Mx(){return yu||(yu=Q2()),yu}let bu;function J2(t){let{userAgent:e}=t===void 0?{}:t;const r=Mx(),i=Lt(),s=i.navigator.platform,n=e||i.navigator.userAgent,a={ios:!1,android:!1},o=i.screen.width,l=i.screen.height,c=n.match(/(Android);?[\s\/]+([\d.]+)?/);let h=n.match(/(iPad).*OS\s([\d_]+)/);const f=n.match(/(iPod)(.*OS\s([\d_]+))?/),u=!h&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/),d=s==="Win32";let p=s==="MacIntel";const m=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!h&&p&&r.touch&&m.indexOf(`${o}x${l}`)>=0&&(h=n.match(/(Version)\/([\d.]+)/),h||(h=[0,1,"13_0_0"]),p=!1),c&&!d&&(a.os="android",a.android=!0),(h||u||f)&&(a.os="ios",a.ios=!0),a}function eI(t){return t===void 0&&(t={}),bu||(bu=J2(t)),bu}let xu;function tI(){const t=Lt();let e=!1;function r(){const i=t.navigator.userAgent.toLowerCase();return i.indexOf("safari")>=0&&i.indexOf("chrome")<0&&i.indexOf("android")<0}if(r()){const i=String(t.navigator.userAgent);if(i.includes("Version/")){const[s,n]=i.split("Version/")[1].split(" ")[0].split(".").map(a=>Number(a));e=s<16||s===16&&n<2}}return{isSafari:e||r(),needPerspectiveFix:e,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(t.navigator.userAgent)}}function rI(){return xu||(xu=tI()),xu}function iI(t){let{swiper:e,on:r,emit:i}=t;const s=Lt();let n=null,a=null;const o=()=>{!e||e.destroyed||!e.initialized||(i("beforeResize"),i("resize"))},l=()=>{!e||e.destroyed||!e.initialized||(n=new ResizeObserver(f=>{a=s.requestAnimationFrame(()=>{const{width:u,height:d}=e;let p=u,m=d;f.forEach(g=>{let{contentBoxSize:y,contentRect:_,target:v}=g;v&&v!==e.el||(p=_?_.width:(y[0]||y).inlineSize,m=_?_.height:(y[0]||y).blockSize)}),(p!==u||m!==d)&&o()})}),n.observe(e.el))},c=()=>{a&&s.cancelAnimationFrame(a),n&&n.unobserve&&e.el&&(n.unobserve(e.el),n=null)},h=()=>{!e||e.destroyed||!e.initialized||i("orientationchange")};r("init",()=>{if(e.params.resizeObserver&&typeof s.ResizeObserver<"u"){l();return}s.addEventListener("resize",o),s.addEventListener("orientationchange",h)}),r("destroy",()=>{c(),s.removeEventListener("resize",o),s.removeEventListener("orientationchange",h)})}function sI(t){let{swiper:e,extendParams:r,on:i,emit:s}=t;const n=[],a=Lt(),o=function(h,f){f===void 0&&(f={});const u=a.MutationObserver||a.WebkitMutationObserver,d=new u(p=>{if(e.__preventObserver__)return;if(p.length===1){s("observerUpdate",p[0]);return}const m=function(){s("observerUpdate",p[0])};a.requestAnimationFrame?a.requestAnimationFrame(m):a.setTimeout(m,0)});d.observe(h,{attributes:typeof f.attributes>"u"?!0:f.attributes,childList:typeof f.childList>"u"?!0:f.childList,characterData:typeof f.characterData>"u"?!0:f.characterData}),n.push(d)},l=()=>{if(e.params.observer){if(e.params.observeParents){const h=Px(e.hostEl);for(let f=0;f<h.length;f+=1)o(h[f])}o(e.hostEl,{childList:e.params.observeSlideChildren}),o(e.wrapperEl,{attributes:!1})}},c=()=>{n.forEach(h=>{h.disconnect()}),n.splice(0,n.length)};r({observer:!1,observeParents:!1,observeSlideChildren:!1}),i("init",l),i("destroy",c)}var nI={on(t,e,r){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;const s=r?"unshift":"push";return t.split(" ").forEach(n=>{i.eventsListeners[n]||(i.eventsListeners[n]=[]),i.eventsListeners[n][s](e)}),i},once(t,e,r){const i=this;if(!i.eventsListeners||i.destroyed||typeof e!="function")return i;function s(){i.off(t,s),s.__emitterProxy&&delete s.__emitterProxy;for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];e.apply(i,a)}return s.__emitterProxy=e,i.on(t,s,r)},onAny(t,e){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const i=e?"unshift":"push";return r.eventsAnyListeners.indexOf(t)<0&&r.eventsAnyListeners[i](t),r},offAny(t){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsAnyListeners)return e;const r=e.eventsAnyListeners.indexOf(t);return r>=0&&e.eventsAnyListeners.splice(r,1),e},off(t,e){const r=this;return!r.eventsListeners||r.destroyed||!r.eventsListeners||t.split(" ").forEach(i=>{typeof e>"u"?r.eventsListeners[i]=[]:r.eventsListeners[i]&&r.eventsListeners[i].forEach((s,n)=>{(s===e||s.__emitterProxy&&s.__emitterProxy===e)&&r.eventsListeners[i].splice(n,1)})}),r},emit(){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let e,r,i;for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];return typeof n[0]=="string"||Array.isArray(n[0])?(e=n[0],r=n.slice(1,n.length),i=t):(e=n[0].events,r=n[0].data,i=n[0].context||t),r.unshift(i),(Array.isArray(e)?e:e.split(" ")).forEach(l=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(c=>{c.apply(i,[l,...r])}),t.eventsListeners&&t.eventsListeners[l]&&t.eventsListeners[l].forEach(c=>{c.apply(i,r)})}),t}};function aI(){const t=this;let e,r;const i=t.el;typeof t.params.width<"u"&&t.params.width!==null?e=t.params.width:e=i.clientWidth,typeof t.params.height<"u"&&t.params.height!==null?r=t.params.height:r=i.clientHeight,!(e===0&&t.isHorizontal()||r===0&&t.isVertical())&&(e=e-parseInt(Fi(i,"padding-left")||0,10)-parseInt(Fi(i,"padding-right")||0,10),r=r-parseInt(Fi(i,"padding-top")||0,10)-parseInt(Fi(i,"padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(r)&&(r=0),Object.assign(t,{width:e,height:r,size:t.isHorizontal()?e:r}))}function oI(){const t=this;function e(I){return t.isHorizontal()?I:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[I]}function r(I,k){return parseFloat(I.getPropertyValue(e(k))||0)}const i=t.params,{wrapperEl:s,slidesEl:n,size:a,rtlTranslate:o,wrongRTL:l}=t,c=t.virtual&&i.virtual.enabled,h=c?t.virtual.slides.length:t.slides.length,f=Dr(n,`.${t.params.slideClass}, swiper-slide`),u=c?t.virtual.slides.length:f.length;let d=[];const p=[],m=[];let g=i.slidesOffsetBefore;typeof g=="function"&&(g=i.slidesOffsetBefore.call(t));let y=i.slidesOffsetAfter;typeof y=="function"&&(y=i.slidesOffsetAfter.call(t));const _=t.snapGrid.length,v=t.slidesGrid.length;let b=i.spaceBetween,w=-g,A=0,S=0;if(typeof a>"u")return;typeof b=="string"&&b.indexOf("%")>=0?b=parseFloat(b.replace("%",""))/100*a:typeof b=="string"&&(b=parseFloat(b)),t.virtualSize=-b,f.forEach(I=>{o?I.style.marginLeft="":I.style.marginRight="",I.style.marginBottom="",I.style.marginTop=""}),i.centeredSlides&&i.cssMode&&(Rl(s,"--swiper-centered-offset-before",""),Rl(s,"--swiper-centered-offset-after",""));const C=i.grid&&i.grid.rows>1&&t.grid;C&&t.grid.initSlides(u);let T;const M=i.slidesPerView==="auto"&&i.breakpoints&&Object.keys(i.breakpoints).filter(I=>typeof i.breakpoints[I].slidesPerView<"u").length>0;for(let I=0;I<u;I+=1){T=0;let k;if(f[I]&&(k=f[I]),C&&t.grid.updateSlide(I,k,u,e),!(f[I]&&Fi(k,"display")==="none")){if(i.slidesPerView==="auto"){M&&(f[I].style[e("width")]="");const P=getComputedStyle(k),R=k.style.transform,O=k.style.webkitTransform;if(R&&(k.style.transform="none"),O&&(k.style.webkitTransform="none"),i.roundLengths)T=t.isHorizontal()?ff(k,"width",!0):ff(k,"height",!0);else{const L=r(P,"width"),N=r(P,"padding-left"),B=r(P,"padding-right"),U=r(P,"margin-left"),F=r(P,"margin-right"),j=P.getPropertyValue("box-sizing");if(j&&j==="border-box")T=L+U+F;else{const{clientWidth:z,offsetWidth:q}=k;T=L+N+B+U+F+(q-z)}}R&&(k.style.transform=R),O&&(k.style.webkitTransform=O),i.roundLengths&&(T=Math.floor(T))}else T=(a-(i.slidesPerView-1)*b)/i.slidesPerView,i.roundLengths&&(T=Math.floor(T)),f[I]&&(f[I].style[e("width")]=`${T}px`);f[I]&&(f[I].swiperSlideSize=T),m.push(T),i.centeredSlides?(w=w+T/2+A/2+b,A===0&&I!==0&&(w=w-a/2-b),I===0&&(w=w-a/2-b),Math.abs(w)<1/1e3&&(w=0),i.roundLengths&&(w=Math.floor(w)),S%i.slidesPerGroup===0&&d.push(w),p.push(w)):(i.roundLengths&&(w=Math.floor(w)),(S-Math.min(t.params.slidesPerGroupSkip,S))%t.params.slidesPerGroup===0&&d.push(w),p.push(w),w=w+T+b),t.virtualSize+=T+b,A=T,S+=1}}if(t.virtualSize=Math.max(t.virtualSize,a)+y,o&&l&&(i.effect==="slide"||i.effect==="coverflow")&&(s.style.width=`${t.virtualSize+b}px`),i.setWrapperSize&&(s.style[e("width")]=`${t.virtualSize+b}px`),C&&t.grid.updateWrapperSize(T,d,e),!i.centeredSlides){const I=[];for(let k=0;k<d.length;k+=1){let P=d[k];i.roundLengths&&(P=Math.floor(P)),d[k]<=t.virtualSize-a&&I.push(P)}d=I,Math.floor(t.virtualSize-a)-Math.floor(d[d.length-1])>1&&d.push(t.virtualSize-a)}if(c&&i.loop){const I=m[0]+b;if(i.slidesPerGroup>1){const k=Math.ceil((t.virtual.slidesBefore+t.virtual.slidesAfter)/i.slidesPerGroup),P=I*i.slidesPerGroup;for(let R=0;R<k;R+=1)d.push(d[d.length-1]+P)}for(let k=0;k<t.virtual.slidesBefore+t.virtual.slidesAfter;k+=1)i.slidesPerGroup===1&&d.push(d[d.length-1]+I),p.push(p[p.length-1]+I),t.virtualSize+=I}if(d.length===0&&(d=[0]),b!==0){const I=t.isHorizontal()&&o?"marginLeft":e("marginRight");f.filter((k,P)=>!i.cssMode||i.loop?!0:P!==f.length-1).forEach(k=>{k.style[I]=`${b}px`})}if(i.centeredSlides&&i.centeredSlidesBounds){let I=0;m.forEach(P=>{I+=P+(b||0)}),I-=b;const k=I-a;d=d.map(P=>P<=0?-g:P>k?k+y:P)}if(i.centerInsufficientSlides){let I=0;if(m.forEach(k=>{I+=k+(b||0)}),I-=b,I<a){const k=(a-I)/2;d.forEach((P,R)=>{d[R]=P-k}),p.forEach((P,R)=>{p[R]=P+k})}}if(Object.assign(t,{slides:f,snapGrid:d,slidesGrid:p,slidesSizesGrid:m}),i.centeredSlides&&i.cssMode&&!i.centeredSlidesBounds){Rl(s,"--swiper-centered-offset-before",`${-d[0]}px`),Rl(s,"--swiper-centered-offset-after",`${t.size/2-m[m.length-1]/2}px`);const I=-t.snapGrid[0],k=-t.slidesGrid[0];t.snapGrid=t.snapGrid.map(P=>P+I),t.slidesGrid=t.slidesGrid.map(P=>P+k)}if(u!==h&&t.emit("slidesLengthChange"),d.length!==_&&(t.params.watchOverflow&&t.checkOverflow(),t.emit("snapGridLengthChange")),p.length!==v&&t.emit("slidesGridLengthChange"),i.watchSlidesProgress&&t.updateSlidesOffset(),!c&&!i.cssMode&&(i.effect==="slide"||i.effect==="fade")){const I=`${i.containerModifierClass}backface-hidden`,k=t.el.classList.contains(I);u<=i.maxBackfaceHiddenSlides?k||t.el.classList.add(I):k&&t.el.classList.remove(I)}}function lI(t){const e=this,r=[],i=e.virtual&&e.params.virtual.enabled;let s=0,n;typeof t=="number"?e.setTransition(t):t===!0&&e.setTransition(e.params.speed);const a=o=>i?e.slides[e.getSlideIndexByData(o)]:e.slides[o];if(e.params.slidesPerView!=="auto"&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach(o=>{r.push(o)});else for(n=0;n<Math.ceil(e.params.slidesPerView);n+=1){const o=e.activeIndex+n;if(o>e.slides.length&&!i)break;r.push(a(o))}else r.push(a(e.activeIndex));for(n=0;n<r.length;n+=1)if(typeof r[n]<"u"){const o=r[n].offsetHeight;s=o>s?o:s}(s||s===0)&&(e.wrapperEl.style.height=`${s}px`)}function cI(){const t=this,e=t.slides,r=t.isElement?t.isHorizontal()?t.wrapperEl.offsetLeft:t.wrapperEl.offsetTop:0;for(let i=0;i<e.length;i+=1)e[i].swiperSlideOffset=(t.isHorizontal()?e[i].offsetLeft:e[i].offsetTop)-r-t.cssOverflowAdjustment()}function hI(t){t===void 0&&(t=this&&this.translate||0);const e=this,r=e.params,{slides:i,rtlTranslate:s,snapGrid:n}=e;if(i.length===0)return;typeof i[0].swiperSlideOffset>"u"&&e.updateSlidesOffset();let a=-t;s&&(a=t),i.forEach(l=>{l.classList.remove(r.slideVisibleClass)}),e.visibleSlidesIndexes=[],e.visibleSlides=[];let o=r.spaceBetween;typeof o=="string"&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*e.size:typeof o=="string"&&(o=parseFloat(o));for(let l=0;l<i.length;l+=1){const c=i[l];let h=c.swiperSlideOffset;r.cssMode&&r.centeredSlides&&(h-=i[0].swiperSlideOffset);const f=(a+(r.centeredSlides?e.minTranslate():0)-h)/(c.swiperSlideSize+o),u=(a-n[0]+(r.centeredSlides?e.minTranslate():0)-h)/(c.swiperSlideSize+o),d=-(a-h),p=d+e.slidesSizesGrid[l];(d>=0&&d<e.size-1||p>1&&p<=e.size||d<=0&&p>=e.size)&&(e.visibleSlides.push(c),e.visibleSlidesIndexes.push(l),i[l].classList.add(r.slideVisibleClass)),c.progress=s?-f:f,c.originalProgress=s?-u:u}}function uI(t){const e=this;if(typeof t>"u"){const h=e.rtlTranslate?-1:1;t=e&&e.translate&&e.translate*h||0}const r=e.params,i=e.maxTranslate()-e.minTranslate();let{progress:s,isBeginning:n,isEnd:a,progressLoop:o}=e;const l=n,c=a;if(i===0)s=0,n=!0,a=!0;else{s=(t-e.minTranslate())/i;const h=Math.abs(t-e.minTranslate())<1,f=Math.abs(t-e.maxTranslate())<1;n=h||s<=0,a=f||s>=1,h&&(s=0),f&&(s=1)}if(r.loop){const h=e.getSlideIndexByData(0),f=e.getSlideIndexByData(e.slides.length-1),u=e.slidesGrid[h],d=e.slidesGrid[f],p=e.slidesGrid[e.slidesGrid.length-1],m=Math.abs(t);m>=u?o=(m-u)/p:o=(m+p-d)/p,o>1&&(o-=1)}Object.assign(e,{progress:s,progressLoop:o,isBeginning:n,isEnd:a}),(r.watchSlidesProgress||r.centeredSlides&&r.autoHeight)&&e.updateSlidesProgress(t),n&&!l&&e.emit("reachBeginning toEdge"),a&&!c&&e.emit("reachEnd toEdge"),(l&&!n||c&&!a)&&e.emit("fromEdge"),e.emit("progress",s)}function dI(){const t=this,{slides:e,params:r,slidesEl:i,activeIndex:s}=t,n=t.virtual&&r.virtual.enabled,a=l=>Dr(i,`.${r.slideClass}${l}, swiper-slide${l}`)[0];e.forEach(l=>{l.classList.remove(r.slideActiveClass,r.slideNextClass,r.slidePrevClass)});let o;if(n)if(r.loop){let l=s-t.virtual.slidesBefore;l<0&&(l=t.virtual.slides.length+l),l>=t.virtual.slides.length&&(l-=t.virtual.slides.length),o=a(`[data-swiper-slide-index="${l}"]`)}else o=a(`[data-swiper-slide-index="${s}"]`);else o=e[s];if(o){o.classList.add(r.slideActiveClass);let l=q2(o,`.${r.slideClass}, swiper-slide`)[0];r.loop&&!l&&(l=e[0]),l&&l.classList.add(r.slideNextClass);let c=Y2(o,`.${r.slideClass}, swiper-slide`)[0];r.loop&&!c===0&&(c=e[e.length-1]),c&&c.classList.add(r.slidePrevClass)}t.emitSlidesClasses()}const _c=(t,e)=>{if(!t||t.destroyed||!t.params)return;const r=()=>t.isElement?"swiper-slide":`.${t.params.slideClass}`,i=e.closest(r());if(i){const s=i.querySelector(`.${t.params.lazyPreloaderClass}`);s&&s.remove()}},_u=(t,e)=>{if(!t.slides[e])return;const r=t.slides[e].querySelector('[loading="lazy"]');r&&r.removeAttribute("loading")},pf=t=>{if(!t||t.destroyed||!t.params)return;let e=t.params.lazyPreloadPrevNext;const r=t.slides.length;if(!r||!e||e<0)return;e=Math.min(e,r);const i=t.params.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(t.params.slidesPerView),s=t.activeIndex;if(t.params.grid&&t.params.grid.rows>1){const a=s,o=[a-e];o.push(...Array.from({length:e}).map((l,c)=>a+i+c)),t.slides.forEach((l,c)=>{o.includes(l.column)&&_u(t,c)});return}const n=s+i-1;if(t.params.rewind||t.params.loop)for(let a=s-e;a<=n+e;a+=1){const o=(a%r+r)%r;(o<s||o>n)&&_u(t,o)}else for(let a=Math.max(s-e,0);a<=Math.min(n+e,r-1);a+=1)a!==s&&(a>n||a<s)&&_u(t,a)};function fI(t){const{slidesGrid:e,params:r}=t,i=t.rtlTranslate?t.translate:-t.translate;let s;for(let n=0;n<e.length;n+=1)typeof e[n+1]<"u"?i>=e[n]&&i<e[n+1]-(e[n+1]-e[n])/2?s=n:i>=e[n]&&i<e[n+1]&&(s=n+1):i>=e[n]&&(s=n);return r.normalizeSlideIndex&&(s<0||typeof s>"u")&&(s=0),s}function pI(t){const e=this,r=e.rtlTranslate?e.translate:-e.translate,{snapGrid:i,params:s,activeIndex:n,realIndex:a,snapIndex:o}=e;let l=t,c;const h=u=>{let d=u-e.virtual.slidesBefore;return d<0&&(d=e.virtual.slides.length+d),d>=e.virtual.slides.length&&(d-=e.virtual.slides.length),d};if(typeof l>"u"&&(l=fI(e)),i.indexOf(r)>=0)c=i.indexOf(r);else{const u=Math.min(s.slidesPerGroupSkip,l);c=u+Math.floor((l-u)/s.slidesPerGroup)}if(c>=i.length&&(c=i.length-1),l===n){c!==o&&(e.snapIndex=c,e.emit("snapIndexChange")),e.params.loop&&e.virtual&&e.params.virtual.enabled&&(e.realIndex=h(l));return}let f;e.virtual&&s.virtual.enabled&&s.loop?f=h(l):e.slides[l]?f=parseInt(e.slides[l].getAttribute("data-swiper-slide-index")||l,10):f=l,Object.assign(e,{previousSnapIndex:o,snapIndex:c,previousRealIndex:a,realIndex:f,previousIndex:n,activeIndex:l}),e.initialized&&pf(e),e.emit("activeIndexChange"),e.emit("snapIndexChange"),a!==f&&e.emit("realIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&e.emit("slideChange")}function mI(t){const e=this,r=e.params,i=t.closest(`.${r.slideClass}, swiper-slide`);let s=!1,n;if(i){for(let a=0;a<e.slides.length;a+=1)if(e.slides[a]===i){s=!0,n=a;break}}if(i&&s)e.clickedSlide=i,e.virtual&&e.params.virtual.enabled?e.clickedIndex=parseInt(i.getAttribute("data-swiper-slide-index"),10):e.clickedIndex=n;else{e.clickedSlide=void 0,e.clickedIndex=void 0;return}r.slideToClickedSlide&&e.clickedIndex!==void 0&&e.clickedIndex!==e.activeIndex&&e.slideToClickedSlide()}var gI={updateSize:aI,updateSlides:oI,updateAutoHeight:lI,updateSlidesOffset:cI,updateSlidesProgress:hI,updateProgress:uI,updateSlidesClasses:dI,updateActiveIndex:pI,updateClickedSlide:mI};function vI(t){t===void 0&&(t=this.isHorizontal()?"x":"y");const e=this,{params:r,rtlTranslate:i,translate:s,wrapperEl:n}=e;if(r.virtualTranslate)return i?-s:s;if(r.cssMode)return s;let a=W2(n,t);return a+=e.cssOverflowAdjustment(),i&&(a=-a),a||0}function yI(t,e){const r=this,{rtlTranslate:i,params:s,wrapperEl:n,progress:a}=r;let o=0,l=0;const c=0;r.isHorizontal()?o=i?-t:t:l=t,s.roundLengths&&(o=Math.floor(o),l=Math.floor(l)),r.previousTranslate=r.translate,r.translate=r.isHorizontal()?o:l,s.cssMode?n[r.isHorizontal()?"scrollLeft":"scrollTop"]=r.isHorizontal()?-o:-l:s.virtualTranslate||(r.isHorizontal()?o-=r.cssOverflowAdjustment():l-=r.cssOverflowAdjustment(),n.style.transform=`translate3d(${o}px, ${l}px, ${c}px)`);let h;const f=r.maxTranslate()-r.minTranslate();f===0?h=0:h=(t-r.minTranslate())/f,h!==a&&r.updateProgress(t),r.emit("setTranslate",r.translate,e)}function bI(){return-this.snapGrid[0]}function xI(){return-this.snapGrid[this.snapGrid.length-1]}function _I(t,e,r,i,s){t===void 0&&(t=0),e===void 0&&(e=this.params.speed),r===void 0&&(r=!0),i===void 0&&(i=!0);const n=this,{params:a,wrapperEl:o}=n;if(n.animating&&a.preventInteractionOnTransition)return!1;const l=n.minTranslate(),c=n.maxTranslate();let h;if(i&&t>l?h=l:i&&t<c?h=c:h=t,n.updateProgress(h),a.cssMode){const f=n.isHorizontal();if(e===0)o[f?"scrollLeft":"scrollTop"]=-h;else{if(!n.support.smoothScroll)return Ix({swiper:n,targetPosition:-h,side:f?"left":"top"}),!0;o.scrollTo({[f?"left":"top"]:-h,behavior:"smooth"})}return!0}return e===0?(n.setTransition(0),n.setTranslate(h),r&&(n.emit("beforeTransitionStart",e,s),n.emit("transitionEnd"))):(n.setTransition(e),n.setTranslate(h),r&&(n.emit("beforeTransitionStart",e,s),n.emit("transitionStart")),n.animating||(n.animating=!0,n.onTranslateToWrapperTransitionEnd||(n.onTranslateToWrapperTransitionEnd=function(u){!n||n.destroyed||u.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onTranslateToWrapperTransitionEnd),n.onTranslateToWrapperTransitionEnd=null,delete n.onTranslateToWrapperTransitionEnd,r&&n.emit("transitionEnd"))}),n.wrapperEl.addEventListener("transitionend",n.onTranslateToWrapperTransitionEnd))),!0}var wI={getTranslate:vI,setTranslate:yI,minTranslate:bI,maxTranslate:xI,translateTo:_I};function EI(t,e){const r=this;r.params.cssMode||(r.wrapperEl.style.transitionDuration=`${t}ms`),r.emit("setTransition",t,e)}function Ox(t){let{swiper:e,runCallbacks:r,direction:i,step:s}=t;const{activeIndex:n,previousIndex:a}=e;let o=i;if(o||(n>a?o="next":n<a?o="prev":o="reset"),e.emit(`transition${s}`),r&&n!==a){if(o==="reset"){e.emit(`slideResetTransition${s}`);return}e.emit(`slideChangeTransition${s}`),o==="next"?e.emit(`slideNextTransition${s}`):e.emit(`slidePrevTransition${s}`)}}function SI(t,e){t===void 0&&(t=!0);const r=this,{params:i}=r;i.cssMode||(i.autoHeight&&r.updateAutoHeight(),Ox({swiper:r,runCallbacks:t,direction:e,step:"Start"}))}function TI(t,e){t===void 0&&(t=!0);const r=this,{params:i}=r;r.animating=!1,!i.cssMode&&(r.setTransition(0),Ox({swiper:r,runCallbacks:t,direction:e,step:"End"}))}var AI={setTransition:EI,transitionStart:SI,transitionEnd:TI};function CI(t,e,r,i,s){t===void 0&&(t=0),e===void 0&&(e=this.params.speed),r===void 0&&(r=!0),typeof t=="string"&&(t=parseInt(t,10));const n=this;let a=t;a<0&&(a=0);const{params:o,snapGrid:l,slidesGrid:c,previousIndex:h,activeIndex:f,rtlTranslate:u,wrapperEl:d,enabled:p}=n;if(n.animating&&o.preventInteractionOnTransition||!p&&!i&&!s)return!1;const m=Math.min(n.params.slidesPerGroupSkip,a);let g=m+Math.floor((a-m)/n.params.slidesPerGroup);g>=l.length&&(g=l.length-1);const y=-l[g];if(o.normalizeSlideIndex)for(let v=0;v<c.length;v+=1){const b=-Math.floor(y*100),w=Math.floor(c[v]*100),A=Math.floor(c[v+1]*100);typeof c[v+1]<"u"?b>=w&&b<A-(A-w)/2?a=v:b>=w&&b<A&&(a=v+1):b>=w&&(a=v)}if(n.initialized&&a!==f&&(!n.allowSlideNext&&(u?y>n.translate&&y>n.minTranslate():y<n.translate&&y<n.minTranslate())||!n.allowSlidePrev&&y>n.translate&&y>n.maxTranslate()&&(f||0)!==a))return!1;a!==(h||0)&&r&&n.emit("beforeSlideChangeStart"),n.updateProgress(y);let _;if(a>f?_="next":a<f?_="prev":_="reset",u&&-y===n.translate||!u&&y===n.translate)return n.updateActiveIndex(a),o.autoHeight&&n.updateAutoHeight(),n.updateSlidesClasses(),o.effect!=="slide"&&n.setTranslate(y),_!=="reset"&&(n.transitionStart(r,_),n.transitionEnd(r,_)),!1;if(o.cssMode){const v=n.isHorizontal(),b=u?y:-y;if(e===0){const w=n.virtual&&n.params.virtual.enabled;w&&(n.wrapperEl.style.scrollSnapType="none",n._immediateVirtual=!0),w&&!n._cssModeVirtualInitialSet&&n.params.initialSlide>0?(n._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{d[v?"scrollLeft":"scrollTop"]=b})):d[v?"scrollLeft":"scrollTop"]=b,w&&requestAnimationFrame(()=>{n.wrapperEl.style.scrollSnapType="",n._immediateVirtual=!1})}else{if(!n.support.smoothScroll)return Ix({swiper:n,targetPosition:b,side:v?"left":"top"}),!0;d.scrollTo({[v?"left":"top"]:b,behavior:"smooth"})}return!0}return n.setTransition(e),n.setTranslate(y),n.updateActiveIndex(a),n.updateSlidesClasses(),n.emit("beforeTransitionStart",e,i),n.transitionStart(r,_),e===0?n.transitionEnd(r,_):n.animating||(n.animating=!0,n.onSlideToWrapperTransitionEnd||(n.onSlideToWrapperTransitionEnd=function(b){!n||n.destroyed||b.target===this&&(n.wrapperEl.removeEventListener("transitionend",n.onSlideToWrapperTransitionEnd),n.onSlideToWrapperTransitionEnd=null,delete n.onSlideToWrapperTransitionEnd,n.transitionEnd(r,_))}),n.wrapperEl.addEventListener("transitionend",n.onSlideToWrapperTransitionEnd)),!0}function II(t,e,r,i){t===void 0&&(t=0),e===void 0&&(e=this.params.speed),r===void 0&&(r=!0),typeof t=="string"&&(t=parseInt(t,10));const s=this;let n=t;return s.params.loop&&(s.virtual&&s.params.virtual.enabled?n=n+s.virtual.slidesBefore:n=s.getSlideIndexByData(n)),s.slideTo(n,e,r,i)}function RI(t,e,r){t===void 0&&(t=this.params.speed),e===void 0&&(e=!0);const i=this,{enabled:s,params:n,animating:a}=i;if(!s)return i;let o=n.slidesPerGroup;n.slidesPerView==="auto"&&n.slidesPerGroup===1&&n.slidesPerGroupAuto&&(o=Math.max(i.slidesPerViewDynamic("current",!0),1));const l=i.activeIndex<n.slidesPerGroupSkip?1:o,c=i.virtual&&n.virtual.enabled;if(n.loop){if(a&&!c&&n.loopPreventsSliding)return!1;i.loopFix({direction:"next"}),i._clientLeft=i.wrapperEl.clientLeft}return n.rewind&&i.isEnd?i.slideTo(0,t,e,r):i.slideTo(i.activeIndex+l,t,e,r)}function PI(t,e,r){t===void 0&&(t=this.params.speed),e===void 0&&(e=!0);const i=this,{params:s,snapGrid:n,slidesGrid:a,rtlTranslate:o,enabled:l,animating:c}=i;if(!l)return i;const h=i.virtual&&s.virtual.enabled;if(s.loop){if(c&&!h&&s.loopPreventsSliding)return!1;i.loopFix({direction:"prev"}),i._clientLeft=i.wrapperEl.clientLeft}const f=o?i.translate:-i.translate;function u(y){return y<0?-Math.floor(Math.abs(y)):Math.floor(y)}const d=u(f),p=n.map(y=>u(y));let m=n[p.indexOf(d)-1];if(typeof m>"u"&&s.cssMode){let y;n.forEach((_,v)=>{d>=_&&(y=v)}),typeof y<"u"&&(m=n[y>0?y-1:y])}let g=0;if(typeof m<"u"&&(g=a.indexOf(m),g<0&&(g=i.activeIndex-1),s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(g=g-i.slidesPerViewDynamic("previous",!0)+1,g=Math.max(g,0))),s.rewind&&i.isBeginning){const y=i.params.virtual&&i.params.virtual.enabled&&i.virtual?i.virtual.slides.length-1:i.slides.length-1;return i.slideTo(y,t,e,r)}return i.slideTo(g,t,e,r)}function MI(t,e,r){t===void 0&&(t=this.params.speed),e===void 0&&(e=!0);const i=this;return i.slideTo(i.activeIndex,t,e,r)}function OI(t,e,r,i){t===void 0&&(t=this.params.speed),e===void 0&&(e=!0),i===void 0&&(i=.5);const s=this;let n=s.activeIndex;const a=Math.min(s.params.slidesPerGroupSkip,n),o=a+Math.floor((n-a)/s.params.slidesPerGroup),l=s.rtlTranslate?s.translate:-s.translate;if(l>=s.snapGrid[o]){const c=s.snapGrid[o],h=s.snapGrid[o+1];l-c>(h-c)*i&&(n+=s.params.slidesPerGroup)}else{const c=s.snapGrid[o-1],h=s.snapGrid[o];l-c<=(h-c)*i&&(n-=s.params.slidesPerGroup)}return n=Math.max(n,0),n=Math.min(n,s.slidesGrid.length-1),s.slideTo(n,t,e,r)}function kI(){const t=this,{params:e,slidesEl:r}=t,i=e.slidesPerView==="auto"?t.slidesPerViewDynamic():e.slidesPerView;let s=t.clickedIndex,n;const a=t.isElement?"swiper-slide":`.${e.slideClass}`;if(e.loop){if(t.animating)return;n=parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?s<t.loopedSlides-i/2||s>t.slides.length-t.loopedSlides+i/2?(t.loopFix(),s=t.getSlideIndex(Dr(r,`${a}[data-swiper-slide-index="${n}"]`)[0]),df(()=>{t.slideTo(s)})):t.slideTo(s):s>t.slides.length-i?(t.loopFix(),s=t.getSlideIndex(Dr(r,`${a}[data-swiper-slide-index="${n}"]`)[0]),df(()=>{t.slideTo(s)})):t.slideTo(s)}else t.slideTo(s)}var DI={slideTo:CI,slideToLoop:II,slideNext:RI,slidePrev:PI,slideReset:MI,slideToClosest:OI,slideToClickedSlide:kI};function NI(t){const e=this,{params:r,slidesEl:i}=e;if(!r.loop||e.virtual&&e.params.virtual.enabled)return;Dr(i,`.${r.slideClass}, swiper-slide`).forEach((n,a)=>{n.setAttribute("data-swiper-slide-index",a)}),e.loopFix({slideRealIndex:t,direction:r.centeredSlides?void 0:"next"})}function LI(t){let{slideRealIndex:e,slideTo:r=!0,direction:i,setTranslate:s,activeSlideIndex:n,byController:a,byMousewheel:o}=t===void 0?{}:t;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:c,allowSlidePrev:h,allowSlideNext:f,slidesEl:u,params:d}=l;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&d.virtual.enabled){r&&(!d.centeredSlides&&l.snapIndex===0?l.slideTo(l.virtual.slides.length,0,!1,!0):d.centeredSlides&&l.snapIndex<d.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0)),l.allowSlidePrev=h,l.allowSlideNext=f,l.emit("loopFix");return}const p=d.slidesPerView==="auto"?l.slidesPerViewDynamic():Math.ceil(parseFloat(d.slidesPerView,10));let m=d.loopedSlides||p;m%d.slidesPerGroup!==0&&(m+=d.slidesPerGroup-m%d.slidesPerGroup),l.loopedSlides=m;const g=[],y=[];let _=l.activeIndex;typeof n>"u"?n=l.getSlideIndex(l.slides.filter(S=>S.classList.contains(d.slideActiveClass))[0]):_=n;const v=i==="next"||!i,b=i==="prev"||!i;let w=0,A=0;if(n<m){w=Math.max(m-n,d.slidesPerGroup);for(let S=0;S<m-n;S+=1){const C=S-Math.floor(S/c.length)*c.length;g.push(c.length-C-1)}}else if(n>l.slides.length-m*2){A=Math.max(n-(l.slides.length-m*2),d.slidesPerGroup);for(let S=0;S<A;S+=1){const C=S-Math.floor(S/c.length)*c.length;y.push(C)}}if(b&&g.forEach(S=>{l.slides[S].swiperLoopMoveDOM=!0,u.prepend(l.slides[S]),l.slides[S].swiperLoopMoveDOM=!1}),v&&y.forEach(S=>{l.slides[S].swiperLoopMoveDOM=!0,u.append(l.slides[S]),l.slides[S].swiperLoopMoveDOM=!1}),l.recalcSlides(),d.slidesPerView==="auto"&&l.updateSlides(),d.watchSlidesProgress&&l.updateSlidesOffset(),r){if(g.length>0&&b)if(typeof e>"u"){const S=l.slidesGrid[_],T=l.slidesGrid[_+w]-S;o?l.setTranslate(l.translate-T):(l.slideTo(_+w,0,!1,!0),s&&(l.touches[l.isHorizontal()?"startX":"startY"]+=T,l.touchEventsData.currentTranslate=l.translate))}else s&&(l.slideToLoop(e,0,!1,!0),l.touchEventsData.currentTranslate=l.translate);else if(y.length>0&&v)if(typeof e>"u"){const S=l.slidesGrid[_],T=l.slidesGrid[_-A]-S;o?l.setTranslate(l.translate-T):(l.slideTo(_-A,0,!1,!0),s&&(l.touches[l.isHorizontal()?"startX":"startY"]+=T,l.touchEventsData.currentTranslate=l.translate))}else l.slideToLoop(e,0,!1,!0)}if(l.allowSlidePrev=h,l.allowSlideNext=f,l.controller&&l.controller.control&&!a){const S={slideRealIndex:e,slideTo:!1,direction:i,setTranslate:s,activeSlideIndex:n,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach(C=>{!C.destroyed&&C.params.loop&&C.loopFix(S)}):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix(S)}l.emit("loopFix")}function BI(){const t=this,{params:e,slidesEl:r}=t;if(!e.loop||t.virtual&&t.params.virtual.enabled)return;t.recalcSlides();const i=[];t.slides.forEach(s=>{const n=typeof s.swiperSlideIndex>"u"?s.getAttribute("data-swiper-slide-index")*1:s.swiperSlideIndex;i[n]=s}),t.slides.forEach(s=>{s.removeAttribute("data-swiper-slide-index")}),i.forEach(s=>{r.append(s)}),t.recalcSlides(),t.slideTo(t.realIndex,0)}var FI={loopCreate:NI,loopFix:LI,loopDestroy:BI};function UI(t){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const r=e.params.touchEventsTarget==="container"?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),r.style.cursor="move",r.style.cursor=t?"grabbing":"grab",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1})}function jI(){const t=this;t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.isElement&&(t.__preventObserver__=!0),t[t.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1}))}var $I={setGrabCursor:UI,unsetGrabCursor:jI};function GI(t,e){e===void 0&&(e=this);function r(i){if(!i||i===tn()||i===Lt())return null;i.assignedSlot&&(i=i.assignedSlot);const s=i.closest(t);return!s&&!i.getRootNode?null:s||r(i.getRootNode().host)}return r(e)}function zI(t){const e=this,r=tn(),i=Lt(),s=e.touchEventsData;s.evCache.push(t);const{params:n,touches:a,enabled:o}=e;if(!o||!n.simulateTouch&&t.pointerType==="mouse"||e.animating&&n.preventInteractionOnTransition)return;!e.animating&&n.cssMode&&n.loop&&e.loopFix();let l=t;l.originalEvent&&(l=l.originalEvent);let c=l.target;if(n.touchEventsTarget==="wrapper"&&!e.wrapperEl.contains(c)||"which"in l&&l.which===3||"button"in l&&l.button>0||s.isTouched&&s.isMoved)return;const h=!!n.noSwipingClass&&n.noSwipingClass!=="",f=t.composedPath?t.composedPath():t.path;h&&l.target&&l.target.shadowRoot&&f&&(c=f[0]);const u=n.noSwipingSelector?n.noSwipingSelector:`.${n.noSwipingClass}`,d=!!(l.target&&l.target.shadowRoot);if(n.noSwiping&&(d?GI(u,c):c.closest(u))){e.allowClick=!0;return}if(n.swipeHandler&&!c.closest(n.swipeHandler))return;a.currentX=l.pageX,a.currentY=l.pageY;const p=a.currentX,m=a.currentY,g=n.edgeSwipeDetection||n.iOSEdgeSwipeDetection,y=n.edgeSwipeThreshold||n.iOSEdgeSwipeThreshold;if(g&&(p<=y||p>=i.innerWidth-y))if(g==="prevent")t.preventDefault();else return;Object.assign(s,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=p,a.startY=m,s.touchStartTime=Xc(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,n.threshold>0&&(s.allowThresholdMove=!1);let _=!0;c.matches(s.focusableElements)&&(_=!1,c.nodeName==="SELECT"&&(s.isTouched=!1)),r.activeElement&&r.activeElement.matches(s.focusableElements)&&r.activeElement!==c&&r.activeElement.blur();const v=_&&e.allowTouchMove&&n.touchStartPreventDefault;(n.touchStartForcePreventDefault||v)&&!c.isContentEditable&&l.preventDefault(),n.freeMode&&n.freeMode.enabled&&e.freeMode&&e.animating&&!n.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",l)}function HI(t){const e=tn(),r=this,i=r.touchEventsData,{params:s,touches:n,rtlTranslate:a,enabled:o}=r;if(!o||!s.simulateTouch&&t.pointerType==="mouse")return;let l=t;if(l.originalEvent&&(l=l.originalEvent),!i.isTouched){i.startMoving&&i.isScrolling&&r.emit("touchMoveOpposite",l);return}const c=i.evCache.findIndex(A=>A.pointerId===l.pointerId);c>=0&&(i.evCache[c]=l);const h=i.evCache.length>1?i.evCache[0]:l,f=h.pageX,u=h.pageY;if(l.preventedByNestedSwiper){n.startX=f,n.startY=u;return}if(!r.allowTouchMove){l.target.matches(i.focusableElements)||(r.allowClick=!1),i.isTouched&&(Object.assign(n,{startX:f,startY:u,prevX:r.touches.currentX,prevY:r.touches.currentY,currentX:f,currentY:u}),i.touchStartTime=Xc());return}if(s.touchReleaseOnEdges&&!s.loop){if(r.isVertical()){if(u<n.startY&&r.translate<=r.maxTranslate()||u>n.startY&&r.translate>=r.minTranslate()){i.isTouched=!1,i.isMoved=!1;return}}else if(f<n.startX&&r.translate<=r.maxTranslate()||f>n.startX&&r.translate>=r.minTranslate())return}if(e.activeElement&&l.target===e.activeElement&&l.target.matches(i.focusableElements)){i.isMoved=!0,r.allowClick=!1;return}if(i.allowTouchCallbacks&&r.emit("touchMove",l),l.targetTouches&&l.targetTouches.length>1)return;n.currentX=f,n.currentY=u;const d=n.currentX-n.startX,p=n.currentY-n.startY;if(r.params.threshold&&Math.sqrt(d**2+p**2)<r.params.threshold)return;if(typeof i.isScrolling>"u"){let A;r.isHorizontal()&&n.currentY===n.startY||r.isVertical()&&n.currentX===n.startX?i.isScrolling=!1:d*d+p*p>=25&&(A=Math.atan2(Math.abs(p),Math.abs(d))*180/Math.PI,i.isScrolling=r.isHorizontal()?A>s.touchAngle:90-A>s.touchAngle)}if(i.isScrolling&&r.emit("touchMoveOpposite",l),typeof i.startMoving>"u"&&(n.currentX!==n.startX||n.currentY!==n.startY)&&(i.startMoving=!0),i.isScrolling||r.zoom&&r.params.zoom&&r.params.zoom.enabled&&i.evCache.length>1){i.isTouched=!1;return}if(!i.startMoving)return;r.allowClick=!1,!s.cssMode&&l.cancelable&&l.preventDefault(),s.touchMoveStopPropagation&&!s.nested&&l.stopPropagation();let m=r.isHorizontal()?d:p,g=r.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;s.oneWayMovement&&(m=Math.abs(m)*(a?1:-1),g=Math.abs(g)*(a?1:-1)),n.diff=m,m*=s.touchRatio,a&&(m=-m,g=-g);const y=r.touchesDirection;r.swipeDirection=m>0?"prev":"next",r.touchesDirection=g>0?"prev":"next";const _=r.params.loop&&!s.cssMode;if(!i.isMoved){if(_&&r.loopFix({direction:r.swipeDirection}),i.startTranslate=r.getTranslate(),r.setTransition(0),r.animating){const A=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});r.wrapperEl.dispatchEvent(A)}i.allowMomentumBounce=!1,s.grabCursor&&(r.allowSlideNext===!0||r.allowSlidePrev===!0)&&r.setGrabCursor(!0),r.emit("sliderFirstMove",l)}let v;i.isMoved&&y!==r.touchesDirection&&_&&Math.abs(m)>=1&&(r.loopFix({direction:r.swipeDirection,setTranslate:!0}),v=!0),r.emit("sliderMove",l),i.isMoved=!0,i.currentTranslate=m+i.startTranslate;let b=!0,w=s.resistanceRatio;if(s.touchReleaseOnEdges&&(w=0),m>0?(_&&!v&&i.currentTranslate>(s.centeredSlides?r.minTranslate()-r.size/2:r.minTranslate())&&r.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>r.minTranslate()&&(b=!1,s.resistance&&(i.currentTranslate=r.minTranslate()-1+(-r.minTranslate()+i.startTranslate+m)**w))):m<0&&(_&&!v&&i.currentTranslate<(s.centeredSlides?r.maxTranslate()+r.size/2:r.maxTranslate())&&r.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:r.slides.length-(s.slidesPerView==="auto"?r.slidesPerViewDynamic():Math.ceil(parseFloat(s.slidesPerView,10)))}),i.currentTranslate<r.maxTranslate()&&(b=!1,s.resistance&&(i.currentTranslate=r.maxTranslate()+1-(r.maxTranslate()-i.startTranslate-m)**w))),b&&(l.preventedByNestedSwiper=!0),!r.allowSlideNext&&r.swipeDirection==="next"&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!r.allowSlidePrev&&r.swipeDirection==="prev"&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),!r.allowSlidePrev&&!r.allowSlideNext&&(i.currentTranslate=i.startTranslate),s.threshold>0)if(Math.abs(m)>s.threshold||i.allowThresholdMove){if(!i.allowThresholdMove){i.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,i.currentTranslate=i.startTranslate,n.diff=r.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY;return}}else{i.currentTranslate=i.startTranslate;return}!s.followFinger||s.cssMode||((s.freeMode&&s.freeMode.enabled&&r.freeMode||s.watchSlidesProgress)&&(r.updateActiveIndex(),r.updateSlidesClasses()),s.freeMode&&s.freeMode.enabled&&r.freeMode&&r.freeMode.onTouchMove(),r.updateProgress(i.currentTranslate),r.setTranslate(i.currentTranslate))}function VI(t){const e=this,r=e.touchEventsData,i=r.evCache.findIndex(v=>v.pointerId===t.pointerId);if(i>=0&&r.evCache.splice(i,1),["pointercancel","pointerout","pointerleave"].includes(t.type)&&!(t.type==="pointercancel"&&(e.browser.isSafari||e.browser.isWebView)))return;const{params:s,touches:n,rtlTranslate:a,slidesGrid:o,enabled:l}=e;if(!l||!s.simulateTouch&&t.pointerType==="mouse")return;let c=t;if(c.originalEvent&&(c=c.originalEvent),r.allowTouchCallbacks&&e.emit("touchEnd",c),r.allowTouchCallbacks=!1,!r.isTouched){r.isMoved&&s.grabCursor&&e.setGrabCursor(!1),r.isMoved=!1,r.startMoving=!1;return}s.grabCursor&&r.isMoved&&r.isTouched&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!1);const h=Xc(),f=h-r.touchStartTime;if(e.allowClick){const v=c.path||c.composedPath&&c.composedPath();e.updateClickedSlide(v&&v[0]||c.target),e.emit("tap click",c),f<300&&h-r.lastClickTime<300&&e.emit("doubleTap doubleClick",c)}if(r.lastClickTime=Xc(),df(()=>{e.destroyed||(e.allowClick=!0)}),!r.isTouched||!r.isMoved||!e.swipeDirection||n.diff===0||r.currentTranslate===r.startTranslate){r.isTouched=!1,r.isMoved=!1,r.startMoving=!1;return}r.isTouched=!1,r.isMoved=!1,r.startMoving=!1;let u;if(s.followFinger?u=a?e.translate:-e.translate:u=-r.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled){e.freeMode.onTouchEnd({currentPos:u});return}let d=0,p=e.slidesSizesGrid[0];for(let v=0;v<o.length;v+=v<s.slidesPerGroupSkip?1:s.slidesPerGroup){const b=v<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;typeof o[v+b]<"u"?u>=o[v]&&u<o[v+b]&&(d=v,p=o[v+b]-o[v]):u>=o[v]&&(d=v,p=o[o.length-1]-o[o.length-2])}let m=null,g=null;s.rewind&&(e.isBeginning?g=s.virtual&&s.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(m=0));const y=(u-o[d])/p,_=d<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;if(f>s.longSwipesMs){if(!s.longSwipes){e.slideTo(e.activeIndex);return}e.swipeDirection==="next"&&(y>=s.longSwipesRatio?e.slideTo(s.rewind&&e.isEnd?m:d+_):e.slideTo(d)),e.swipeDirection==="prev"&&(y>1-s.longSwipesRatio?e.slideTo(d+_):g!==null&&y<0&&Math.abs(y)>s.longSwipesRatio?e.slideTo(g):e.slideTo(d))}else{if(!s.shortSwipes){e.slideTo(e.activeIndex);return}e.navigation&&(c.target===e.navigation.nextEl||c.target===e.navigation.prevEl)?c.target===e.navigation.nextEl?e.slideTo(d+_):e.slideTo(d):(e.swipeDirection==="next"&&e.slideTo(m!==null?m:d+_),e.swipeDirection==="prev"&&e.slideTo(g!==null?g:d))}}function Ug(){const t=this,{params:e,el:r}=t;if(r&&r.offsetWidth===0)return;e.breakpoints&&t.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:s,snapGrid:n}=t,a=t.virtual&&t.params.virtual.enabled;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses();const o=a&&e.loop;(e.slidesPerView==="auto"||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides&&!o?t.slideTo(t.slides.length-1,0,!1,!0):t.params.loop&&!a?t.slideToLoop(t.realIndex,0,!1,!0):t.slideTo(t.activeIndex,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&(clearTimeout(t.autoplay.resizeTimeout),t.autoplay.resizeTimeout=setTimeout(()=>{t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.resume()},500)),t.allowSlidePrev=s,t.allowSlideNext=i,t.params.watchOverflow&&n!==t.snapGrid&&t.checkOverflow()}function WI(t){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation())))}function XI(){const t=this,{wrapperEl:e,rtlTranslate:r,enabled:i}=t;if(!i)return;t.previousTranslate=t.translate,t.isHorizontal()?t.translate=-e.scrollLeft:t.translate=-e.scrollTop,t.translate===0&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();let s;const n=t.maxTranslate()-t.minTranslate();n===0?s=0:s=(t.translate-t.minTranslate())/n,s!==t.progress&&t.updateProgress(r?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}function YI(t){const e=this;_c(e,t.target),!(e.params.cssMode||e.params.slidesPerView!=="auto"&&!e.params.autoHeight)&&e.update()}let jg=!1;function qI(){}const kx=(t,e)=>{const r=tn(),{params:i,el:s,wrapperEl:n,device:a}=t,o=!!i.nested,l=e==="on"?"addEventListener":"removeEventListener",c=e;s[l]("pointerdown",t.onTouchStart,{passive:!1}),r[l]("pointermove",t.onTouchMove,{passive:!1,capture:o}),r[l]("pointerup",t.onTouchEnd,{passive:!0}),r[l]("pointercancel",t.onTouchEnd,{passive:!0}),r[l]("pointerout",t.onTouchEnd,{passive:!0}),r[l]("pointerleave",t.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&s[l]("click",t.onClick,!0),i.cssMode&&n[l]("scroll",t.onScroll),i.updateOnWindowResize?t[c](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",Ug,!0):t[c]("observerUpdate",Ug,!0),s[l]("load",t.onLoad,{capture:!0})};function ZI(){const t=this,e=tn(),{params:r}=t;t.onTouchStart=zI.bind(t),t.onTouchMove=HI.bind(t),t.onTouchEnd=VI.bind(t),r.cssMode&&(t.onScroll=XI.bind(t)),t.onClick=WI.bind(t),t.onLoad=YI.bind(t),jg||(e.addEventListener("touchstart",qI),jg=!0),kx(t,"on")}function KI(){kx(this,"off")}var QI={attachEvents:ZI,detachEvents:KI};const $g=(t,e)=>t.grid&&e.grid&&e.grid.rows>1;function JI(){const t=this,{realIndex:e,initialized:r,params:i,el:s}=t,n=i.breakpoints;if(!n||n&&Object.keys(n).length===0)return;const a=t.getBreakpoint(n,t.params.breakpointsBase,t.el);if(!a||t.currentBreakpoint===a)return;const l=(a in n?n[a]:void 0)||t.originalParams,c=$g(t,i),h=$g(t,l),f=i.enabled;c&&!h?(s.classList.remove(`${i.containerModifierClass}grid`,`${i.containerModifierClass}grid-column`),t.emitContainerClasses()):!c&&h&&(s.classList.add(`${i.containerModifierClass}grid`),(l.grid.fill&&l.grid.fill==="column"||!l.grid.fill&&i.grid.fill==="column")&&s.classList.add(`${i.containerModifierClass}grid-column`),t.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(m=>{if(typeof l[m]>"u")return;const g=i[m]&&i[m].enabled,y=l[m]&&l[m].enabled;g&&!y&&t[m].disable(),!g&&y&&t[m].enable()});const u=l.direction&&l.direction!==i.direction,d=i.loop&&(l.slidesPerView!==i.slidesPerView||u);u&&r&&t.changeDirection(),Pt(t.params,l);const p=t.params.enabled;Object.assign(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),f&&!p?t.disable():!f&&p&&t.enable(),t.currentBreakpoint=a,t.emit("_beforeBreakpoint",l),d&&r&&(t.loopDestroy(),t.loopCreate(e),t.updateSlides()),t.emit("breakpoint",l)}function eR(t,e,r){if(e===void 0&&(e="window"),!t||e==="container"&&!r)return;let i=!1;const s=Lt(),n=e==="window"?s.innerHeight:r.clientHeight,a=Object.keys(t).map(o=>{if(typeof o=="string"&&o.indexOf("@")===0){const l=parseFloat(o.substr(1));return{value:n*l,point:o}}return{value:o,point:o}});a.sort((o,l)=>parseInt(o.value,10)-parseInt(l.value,10));for(let o=0;o<a.length;o+=1){const{point:l,value:c}=a[o];e==="window"?s.matchMedia(`(min-width: ${c}px)`).matches&&(i=l):c<=r.clientWidth&&(i=l)}return i||"max"}var tR={setBreakpoint:JI,getBreakpoint:eR};function rR(t,e){const r=[];return t.forEach(i=>{typeof i=="object"?Object.keys(i).forEach(s=>{i[s]&&r.push(e+s)}):typeof i=="string"&&r.push(e+i)}),r}function iR(){const t=this,{classNames:e,params:r,rtl:i,el:s,device:n}=t,a=rR(["initialized",r.direction,{"free-mode":t.params.freeMode&&r.freeMode.enabled},{autoheight:r.autoHeight},{rtl:i},{grid:r.grid&&r.grid.rows>1},{"grid-column":r.grid&&r.grid.rows>1&&r.grid.fill==="column"},{android:n.android},{ios:n.ios},{"css-mode":r.cssMode},{centered:r.cssMode&&r.centeredSlides},{"watch-progress":r.watchSlidesProgress}],r.containerModifierClass);e.push(...a),s.classList.add(...e),t.emitContainerClasses()}function sR(){const t=this,{el:e,classNames:r}=t;e.classList.remove(...r),t.emitContainerClasses()}var nR={addClasses:iR,removeClasses:sR};function aR(){const t=this,{isLocked:e,params:r}=t,{slidesOffsetBefore:i}=r;if(i){const s=t.slides.length-1,n=t.slidesGrid[s]+t.slidesSizesGrid[s]+i*2;t.isLocked=t.size>n}else t.isLocked=t.snapGrid.length===1;r.allowSlideNext===!0&&(t.allowSlideNext=!t.isLocked),r.allowSlidePrev===!0&&(t.allowSlidePrev=!t.isLocked),e&&e!==t.isLocked&&(t.isEnd=!1),e!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock")}var oR={checkOverflow:aR},mf={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function lR(t,e){return function(i){i===void 0&&(i={});const s=Object.keys(i)[0],n=i[s];if(typeof n!="object"||n===null){Pt(e,i);return}if(["navigation","pagination","scrollbar"].indexOf(s)>=0&&t[s]===!0&&(t[s]={auto:!0}),!(s in t&&"enabled"in n)){Pt(e,i);return}t[s]===!0&&(t[s]={enabled:!0}),typeof t[s]=="object"&&!("enabled"in t[s])&&(t[s].enabled=!0),t[s]||(t[s]={enabled:!1}),Pt(e,i)}}const wu={eventsEmitter:nI,update:gI,translate:wI,transition:AI,slide:DI,loop:FI,grabCursor:$I,events:QI,breakpoints:tR,checkOverflow:oR,classes:nR},Eu={};let Jp=class Jr{constructor(){let e,r;for(var i=arguments.length,s=new Array(i),n=0;n<i;n++)s[n]=arguments[n];s.length===1&&s[0].constructor&&Object.prototype.toString.call(s[0]).slice(8,-1)==="Object"?r=s[0]:[e,r]=s,r||(r={}),r=Pt({},r),e&&!r.el&&(r.el=e);const a=tn();if(r.el&&typeof r.el=="string"&&a.querySelectorAll(r.el).length>1){const h=[];return a.querySelectorAll(r.el).forEach(f=>{const u=Pt({},r,{el:f});h.push(new Jr(u))}),h}const o=this;o.__swiper__=!0,o.support=Mx(),o.device=eI({userAgent:r.userAgent}),o.browser=rI(),o.eventsListeners={},o.eventsAnyListeners=[],o.modules=[...o.__modules__],r.modules&&Array.isArray(r.modules)&&o.modules.push(...r.modules);const l={};o.modules.forEach(h=>{h({params:r,swiper:o,extendParams:lR(r,l),on:o.on.bind(o),once:o.once.bind(o),off:o.off.bind(o),emit:o.emit.bind(o)})});const c=Pt({},mf,l);return o.params=Pt({},c,Eu,r),o.originalParams=Pt({},o.params),o.passedParams=Pt({},r),o.params&&o.params.on&&Object.keys(o.params.on).forEach(h=>{o.on(h,o.params.on[h])}),o.params&&o.params.onAny&&o.onAny(o.params.onAny),Object.assign(o,{enabled:o.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return o.params.direction==="horizontal"},isVertical(){return o.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:o.params.allowSlideNext,allowSlidePrev:o.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:o.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:o.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),o.emit("_swiper"),o.params.init&&o.init(),o}getSlideIndex(e){const{slidesEl:r,params:i}=this,s=Dr(r,`.${i.slideClass}, swiper-slide`),n=Yc(s[0]);return Yc(e)-n}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter(r=>r.getAttribute("data-swiper-slide-index")*1===e)[0])}recalcSlides(){const e=this,{slidesEl:r,params:i}=e;e.slides=Dr(r,`.${i.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,r){const i=this;e=Math.min(Math.max(e,0),1);const s=i.minTranslate(),a=(i.maxTranslate()-s)*e+s;i.translateTo(a,typeof r>"u"?0:r),i.updateActiveIndex(),i.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const r=e.el.className.split(" ").filter(i=>i.indexOf("swiper")===0||i.indexOf(e.params.containerModifierClass)===0);e.emit("_containerClasses",r.join(" "))}getSlideClasses(e){const r=this;return r.destroyed?"":e.className.split(" ").filter(i=>i.indexOf("swiper-slide")===0||i.indexOf(r.params.slideClass)===0).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const r=[];e.slides.forEach(i=>{const s=e.getSlideClasses(i);r.push({slideEl:i,classNames:s}),e.emit("_slideClass",i,s)}),e.emit("_slideClasses",r)}slidesPerViewDynamic(e,r){e===void 0&&(e="current"),r===void 0&&(r=!1);const i=this,{params:s,slides:n,slidesGrid:a,slidesSizesGrid:o,size:l,activeIndex:c}=i;let h=1;if(s.centeredSlides){let f=n[c]?n[c].swiperSlideSize:0,u;for(let d=c+1;d<n.length;d+=1)n[d]&&!u&&(f+=n[d].swiperSlideSize,h+=1,f>l&&(u=!0));for(let d=c-1;d>=0;d-=1)n[d]&&!u&&(f+=n[d].swiperSlideSize,h+=1,f>l&&(u=!0))}else if(e==="current")for(let f=c+1;f<n.length;f+=1)(r?a[f]+o[f]-a[c]<l:a[f]-a[c]<l)&&(h+=1);else for(let f=c-1;f>=0;f-=1)a[c]-a[f]<l&&(h+=1);return h}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:r,params:i}=e;i.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(a=>{a.complete&&_c(e,a)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function s(){const a=e.rtlTranslate?e.translate*-1:e.translate,o=Math.min(Math.max(a,e.maxTranslate()),e.minTranslate());e.setTranslate(o),e.updateActiveIndex(),e.updateSlidesClasses()}let n;if(i.freeMode&&i.freeMode.enabled&&!i.cssMode)s(),i.autoHeight&&e.updateAutoHeight();else{if((i.slidesPerView==="auto"||i.slidesPerView>1)&&e.isEnd&&!i.centeredSlides){const a=e.virtual&&i.virtual.enabled?e.virtual.slides:e.slides;n=e.slideTo(a.length-1,0,!1,!0)}else n=e.slideTo(e.activeIndex,0,!1,!0);n||s()}i.watchOverflow&&r!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,r){r===void 0&&(r=!0);const i=this,s=i.params.direction;return e||(e=s==="horizontal"?"vertical":"horizontal"),e===s||e!=="horizontal"&&e!=="vertical"||(i.el.classList.remove(`${i.params.containerModifierClass}${s}`),i.el.classList.add(`${i.params.containerModifierClass}${e}`),i.emitContainerClasses(),i.params.direction=e,i.slides.forEach(n=>{e==="vertical"?n.style.width="":n.style.height=""}),i.emit("changeDirection"),r&&i.update()),i}changeLanguageDirection(e){const r=this;r.rtl&&e==="rtl"||!r.rtl&&e==="ltr"||(r.rtl=e==="rtl",r.rtlTranslate=r.params.direction==="horizontal"&&r.rtl,r.rtl?(r.el.classList.add(`${r.params.containerModifierClass}rtl`),r.el.dir="rtl"):(r.el.classList.remove(`${r.params.containerModifierClass}rtl`),r.el.dir="ltr"),r.update())}mount(e){const r=this;if(r.mounted)return!0;let i=e||r.params.el;if(typeof i=="string"&&(i=document.querySelector(i)),!i)return!1;i.swiper=r,i.parentNode&&i.parentNode.host&&i.parentNode.host.nodeName==="SWIPER-CONTAINER"&&(r.isElement=!0);const s=()=>`.${(r.params.wrapperClass||"").trim().split(" ").join(".")}`;let a=i&&i.shadowRoot&&i.shadowRoot.querySelector?i.shadowRoot.querySelector(s()):Dr(i,s())[0];return!a&&r.params.createElements&&(a=Rx("div",r.params.wrapperClass),i.append(a),Dr(i,`.${r.params.slideClass}`).forEach(o=>{a.append(o)})),Object.assign(r,{el:i,wrapperEl:a,slidesEl:r.isElement&&!i.parentNode.host.slideSlots?i.parentNode.host:a,hostEl:r.isElement?i.parentNode.host:i,mounted:!0,rtl:i.dir.toLowerCase()==="rtl"||Fi(i,"direction")==="rtl",rtlTranslate:r.params.direction==="horizontal"&&(i.dir.toLowerCase()==="rtl"||Fi(i,"direction")==="rtl"),wrongRTL:Fi(a,"display")==="-webkit-box"}),!0}init(e){const r=this;return r.initialized||r.mount(e)===!1||(r.emit("beforeInit"),r.params.breakpoints&&r.setBreakpoint(),r.addClasses(),r.updateSize(),r.updateSlides(),r.params.watchOverflow&&r.checkOverflow(),r.params.grabCursor&&r.enabled&&r.setGrabCursor(),r.params.loop&&r.virtual&&r.params.virtual.enabled?r.slideTo(r.params.initialSlide+r.virtual.slidesBefore,0,r.params.runCallbacksOnInit,!1,!0):r.slideTo(r.params.initialSlide,0,r.params.runCallbacksOnInit,!1,!0),r.params.loop&&r.loopCreate(),r.attachEvents(),[...r.el.querySelectorAll('[loading="lazy"]')].forEach(s=>{s.complete?_c(r,s):s.addEventListener("load",n=>{_c(r,n.target)})}),pf(r),r.initialized=!0,pf(r),r.emit("init"),r.emit("afterInit")),r}destroy(e,r){e===void 0&&(e=!0),r===void 0&&(r=!0);const i=this,{params:s,el:n,wrapperEl:a,slides:o}=i;return typeof i.params>"u"||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),s.loop&&i.loopDestroy(),r&&(i.removeClasses(),n.removeAttribute("style"),a.removeAttribute("style"),o&&o.length&&o.forEach(l=>{l.classList.remove(s.slideVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),l.removeAttribute("style"),l.removeAttribute("data-swiper-slide-index")})),i.emit("destroy"),Object.keys(i.eventsListeners).forEach(l=>{i.off(l)}),e!==!1&&(i.el.swiper=null,H2(i)),i.destroyed=!0),null}static extendDefaults(e){Pt(Eu,e)}static get extendedDefaults(){return Eu}static get defaults(){return mf}static installModule(e){Jr.prototype.__modules__||(Jr.prototype.__modules__=[]);const r=Jr.prototype.__modules__;typeof e=="function"&&r.indexOf(e)<0&&r.push(e)}static use(e){return Array.isArray(e)?(e.forEach(r=>Jr.installModule(r)),Jr):(Jr.installModule(e),Jr)}};Object.keys(wu).forEach(t=>{Object.keys(wu[t]).forEach(e=>{Jp.prototype[e]=wu[t][e]})});Jp.use([iI,sI]);const Dx=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Ws(t){return typeof t=="object"&&t!==null&&t.constructor&&Object.prototype.toString.call(t).slice(8,-1)==="Object"}function Bs(t,e){const r=["__proto__","constructor","prototype"];Object.keys(e).filter(i=>r.indexOf(i)<0).forEach(i=>{typeof t[i]>"u"?t[i]=e[i]:Ws(e[i])&&Ws(t[i])&&Object.keys(e[i]).length>0?e[i].__swiper__?t[i]=e[i]:Bs(t[i],e[i]):t[i]=e[i]})}function Nx(t){return t===void 0&&(t={}),t.navigation&&typeof t.navigation.nextEl>"u"&&typeof t.navigation.prevEl>"u"}function Lx(t){return t===void 0&&(t={}),t.pagination&&typeof t.pagination.el>"u"}function Bx(t){return t===void 0&&(t={}),t.scrollbar&&typeof t.scrollbar.el>"u"}function Fx(t){t===void 0&&(t="");const e=t.split(" ").map(i=>i.trim()).filter(i=>!!i),r=[];return e.forEach(i=>{r.indexOf(i)<0&&r.push(i)}),r.join(" ")}function cR(t){return t===void 0&&(t=""),t?t.includes("swiper-wrapper")?t:`swiper-wrapper ${t}`:"swiper-wrapper"}function hR(t){let{swiper:e,slides:r,passedParams:i,changedParams:s,nextEl:n,prevEl:a,scrollbarEl:o,paginationEl:l}=t;const c=s.filter(T=>T!=="children"&&T!=="direction"&&T!=="wrapperClass"),{params:h,pagination:f,navigation:u,scrollbar:d,virtual:p,thumbs:m}=e;let g,y,_,v,b,w,A,S;s.includes("thumbs")&&i.thumbs&&i.thumbs.swiper&&h.thumbs&&!h.thumbs.swiper&&(g=!0),s.includes("controller")&&i.controller&&i.controller.control&&h.controller&&!h.controller.control&&(y=!0),s.includes("pagination")&&i.pagination&&(i.pagination.el||l)&&(h.pagination||h.pagination===!1)&&f&&!f.el&&(_=!0),s.includes("scrollbar")&&i.scrollbar&&(i.scrollbar.el||o)&&(h.scrollbar||h.scrollbar===!1)&&d&&!d.el&&(v=!0),s.includes("navigation")&&i.navigation&&(i.navigation.prevEl||a)&&(i.navigation.nextEl||n)&&(h.navigation||h.navigation===!1)&&u&&!u.prevEl&&!u.nextEl&&(b=!0);const C=T=>{e[T]&&(e[T].destroy(),T==="navigation"?(e.isElement&&(e[T].prevEl.remove(),e[T].nextEl.remove()),h[T].prevEl=void 0,h[T].nextEl=void 0,e[T].prevEl=void 0,e[T].nextEl=void 0):(e.isElement&&e[T].el.remove(),h[T].el=void 0,e[T].el=void 0))};s.includes("loop")&&e.isElement&&(h.loop&&!i.loop?w=!0:!h.loop&&i.loop?A=!0:S=!0),c.forEach(T=>{if(Ws(h[T])&&Ws(i[T]))Bs(h[T],i[T]),(T==="navigation"||T==="pagination"||T==="scrollbar")&&"enabled"in i[T]&&!i[T].enabled&&C(T);else{const M=i[T];(M===!0||M===!1)&&(T==="navigation"||T==="pagination"||T==="scrollbar")?M===!1&&C(T):h[T]=i[T]}}),c.includes("controller")&&!y&&e.controller&&e.controller.control&&h.controller&&h.controller.control&&(e.controller.control=h.controller.control),s.includes("children")&&r&&p&&h.virtual.enabled&&(p.slides=r,p.update(!0)),s.includes("children")&&r&&h.loop&&(S=!0),g&&m.init()&&m.update(!0),y&&(e.controller.control=h.controller.control),_&&(e.isElement&&(!l||typeof l=="string")&&(l=document.createElement("div"),l.classList.add("swiper-pagination"),e.el.appendChild(l)),l&&(h.pagination.el=l),f.init(),f.render(),f.update()),v&&(e.isElement&&(!o||typeof o=="string")&&(o=document.createElement("div"),o.classList.add("swiper-scrollbar"),e.el.appendChild(o)),o&&(h.scrollbar.el=o),d.init(),d.updateSize(),d.setTranslate()),b&&(e.isElement&&((!n||typeof n=="string")&&(n=document.createElement("div"),n.classList.add("swiper-button-next"),n.innerHTML=e.hostEl.nextButtonSvg,e.el.appendChild(n)),(!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-button-prev"),n.innerHTML=e.hostEl.prevButtonSvg,e.el.appendChild(a))),n&&(h.navigation.nextEl=n),a&&(h.navigation.prevEl=a),u.init(),u.update()),s.includes("allowSlideNext")&&(e.allowSlideNext=i.allowSlideNext),s.includes("allowSlidePrev")&&(e.allowSlidePrev=i.allowSlidePrev),s.includes("direction")&&e.changeDirection(i.direction,!1),(w||S)&&e.loopDestroy(),(A||S)&&e.loopCreate(),e.update()}function uR(t,e){t===void 0&&(t={}),e===void 0&&(e=!0);const r={on:{}},i={},s={};Bs(r,mf),r._emitClasses=!0,r.init=!1;const n={},a=Dx.map(l=>l.replace(/_/,"")),o=Object.assign({},t);return Object.keys(o).forEach(l=>{typeof t[l]>"u"||(a.indexOf(l)>=0?Ws(t[l])?(r[l]={},s[l]={},Bs(r[l],t[l]),Bs(s[l],t[l])):(r[l]=t[l],s[l]=t[l]):l.search(/on[A-Z]/)===0&&typeof t[l]=="function"?e?i[`${l[2].toLowerCase()}${l.substr(3)}`]=t[l]:r.on[`${l[2].toLowerCase()}${l.substr(3)}`]=t[l]:n[l]=t[l])}),["navigation","pagination","scrollbar"].forEach(l=>{r[l]===!0&&(r[l]={}),r[l]===!1&&delete r[l]}),{params:r,passedParams:s,rest:n,events:i}}function dR(t,e){let{el:r,nextEl:i,prevEl:s,paginationEl:n,scrollbarEl:a,swiper:o}=t;Nx(e)&&i&&s&&(o.params.navigation.nextEl=i,o.originalParams.navigation.nextEl=i,o.params.navigation.prevEl=s,o.originalParams.navigation.prevEl=s),Lx(e)&&n&&(o.params.pagination.el=n,o.originalParams.pagination.el=n),Bx(e)&&a&&(o.params.scrollbar.el=a,o.originalParams.scrollbar.el=a),o.init(r)}function fR(t,e,r,i,s){const n=[];if(!e)return n;const a=l=>{n.indexOf(l)<0&&n.push(l)};if(r&&i){const l=i.map(s),c=r.map(s);l.join("")!==c.join("")&&a("children"),i.length!==r.length&&a("children")}return Dx.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in t&&l in e)if(Ws(t[l])&&Ws(e[l])){const c=Object.keys(t[l]),h=Object.keys(e[l]);c.length!==h.length?a(l):(c.forEach(f=>{t[l][f]!==e[l][f]&&a(l)}),h.forEach(f=>{t[l][f]!==e[l][f]&&a(l)}))}else t[l]!==e[l]&&a(l)}),n}const pR=t=>{!t||t.destroyed||!t.params.virtual||t.params.virtual&&!t.params.virtual.enabled||(t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),t.parallax&&t.params.parallax&&t.params.parallax.enabled&&t.parallax.setTranslate())};function qc(){return qc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},qc.apply(this,arguments)}function Ux(t){return t.type&&t.type.displayName&&t.type.displayName.includes("SwiperSlide")}function jx(t){const e=[];return Ve.Children.toArray(t).forEach(r=>{Ux(r)?e.push(r):r.props&&r.props.children&&jx(r.props.children).forEach(i=>e.push(i))}),e}function mR(t){const e=[],r={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return Ve.Children.toArray(t).forEach(i=>{if(Ux(i))e.push(i);else if(i.props&&i.props.slot&&r[i.props.slot])r[i.props.slot].push(i);else if(i.props&&i.props.children){const s=jx(i.props.children);s.length>0?s.forEach(n=>e.push(n)):r["container-end"].push(i)}else r["container-end"].push(i)}),{slides:e,slots:r}}function gR(t,e,r){if(!r)return null;const i=h=>{let f=h;return h<0?f=e.length+h:f>=e.length&&(f=f-e.length),f},s=t.isHorizontal()?{[t.rtlTranslate?"right":"left"]:`${r.offset}px`}:{top:`${r.offset}px`},{from:n,to:a}=r,o=t.params.loop?-e.length:0,l=t.params.loop?e.length*2:e.length,c=[];for(let h=o;h<l;h+=1)h>=n&&h<=a&&c.push(e[i(h)]);return c.map((h,f)=>Ve.cloneElement(h,{swiper:t,style:s,key:`slide-${f}`}))}function ro(t,e){return typeof window>"u"?E.useEffect(t,e):E.useLayoutEffect(t,e)}const Gg=E.createContext(null),vR=E.createContext(null),$x=E.forwardRef(function(t,e){let{className:r,tag:i="div",wrapperTag:s="div",children:n,onSwiper:a,...o}=t===void 0?{}:t,l=!1;const[c,h]=E.useState("swiper"),[f,u]=E.useState(null),[d,p]=E.useState(!1),m=E.useRef(!1),g=E.useRef(null),y=E.useRef(null),_=E.useRef(null),v=E.useRef(null),b=E.useRef(null),w=E.useRef(null),A=E.useRef(null),S=E.useRef(null),{params:C,passedParams:T,rest:M,events:I}=uR(o),{slides:k,slots:P}=mR(n),R=()=>{p(!d)};Object.assign(C.on,{_containerClasses(U,F){h(F)}});const O=()=>{Object.assign(C.on,I),l=!0;const U={...C};if(delete U.wrapperClass,y.current=new Jp(U),y.current.virtual&&y.current.params.virtual.enabled){y.current.virtual.slides=k;const F={cache:!1,slides:k,renderExternal:u,renderExternalUpdate:!1};Bs(y.current.params.virtual,F),Bs(y.current.originalParams.virtual,F)}};g.current||O(),y.current&&y.current.on("_beforeBreakpoint",R);const L=()=>{l||!I||!y.current||Object.keys(I).forEach(U=>{y.current.on(U,I[U])})},N=()=>{!I||!y.current||Object.keys(I).forEach(U=>{y.current.off(U,I[U])})};E.useEffect(()=>()=>{y.current&&y.current.off("_beforeBreakpoint",R)}),E.useEffect(()=>{!m.current&&y.current&&(y.current.emitSlidesClasses(),m.current=!0)}),ro(()=>{if(e&&(e.current=g.current),!!g.current)return y.current.destroyed&&O(),dR({el:g.current,nextEl:b.current,prevEl:w.current,paginationEl:A.current,scrollbarEl:S.current,swiper:y.current},C),a&&a(y.current),()=>{y.current&&!y.current.destroyed&&y.current.destroy(!0,!1)}},[]),ro(()=>{L();const U=fR(T,_.current,k,v.current,F=>F.key);return _.current=T,v.current=k,U.length&&y.current&&!y.current.destroyed&&hR({swiper:y.current,slides:k,passedParams:T,changedParams:U,nextEl:b.current,prevEl:w.current,scrollbarEl:S.current,paginationEl:A.current}),()=>{N()}}),ro(()=>{pR(y.current)},[f]);function B(){return C.virtual?gR(y.current,k,f):k.map((U,F)=>Ve.cloneElement(U,{swiper:y.current,swiperSlideIndex:F}))}return Ve.createElement(i,qc({ref:g,className:Fx(`${c}${r?` ${r}`:""}`)},M),Ve.createElement(vR.Provider,{value:y.current},P["container-start"],Ve.createElement(s,{className:cR(C.wrapperClass)},P["wrapper-start"],B(),P["wrapper-end"]),Nx(C)&&Ve.createElement(Ve.Fragment,null,Ve.createElement("div",{ref:w,className:"swiper-button-prev"}),Ve.createElement("div",{ref:b,className:"swiper-button-next"})),Bx(C)&&Ve.createElement("div",{ref:S,className:"swiper-scrollbar"}),Lx(C)&&Ve.createElement("div",{ref:A,className:"swiper-pagination"}),P["container-end"]))});$x.displayName="Swiper";const Gx=E.forwardRef(function(t,e){let{tag:r="div",children:i,className:s="",swiper:n,zoom:a,lazy:o,virtualIndex:l,swiperSlideIndex:c,...h}=t===void 0?{}:t;const f=E.useRef(null),[u,d]=E.useState("swiper-slide"),[p,m]=E.useState(!1);function g(b,w,A){w===f.current&&d(A)}ro(()=>{if(typeof c<"u"&&(f.current.swiperSlideIndex=c),e&&(e.current=f.current),!(!f.current||!n)){if(n.destroyed){u!=="swiper-slide"&&d("swiper-slide");return}return n.on("_slideClass",g),()=>{n&&n.off("_slideClass",g)}}}),ro(()=>{n&&f.current&&!n.destroyed&&d(n.getSlideClasses(f.current))},[n]);const y={isActive:u.indexOf("swiper-slide-active")>=0,isVisible:u.indexOf("swiper-slide-visible")>=0,isPrev:u.indexOf("swiper-slide-prev")>=0,isNext:u.indexOf("swiper-slide-next")>=0},_=()=>typeof i=="function"?i(y):i,v=()=>{m(!0)};return Ve.createElement(r,qc({ref:f,className:Fx(`${u}${s?` ${s}`:""}`),"data-swiper-slide-index":l,onLoad:v},h),a&&Ve.createElement(Gg.Provider,{value:y},Ve.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof a=="number"?a:void 0},_(),o&&!p&&Ve.createElement("div",{className:"swiper-lazy-preloader"}))),!a&&Ve.createElement(Gg.Provider,{value:y},_(),o&&!p&&Ve.createElement("div",{className:"swiper-lazy-preloader"})))});Gx.displayName="SwiperSlide";var em={},tm={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0;var e;(function(i){i.Root="root",i.Text="text",i.Directive="directive",i.Comment="comment",i.Script="script",i.Style="style",i.Tag="tag",i.CDATA="cdata",i.Doctype="doctype"})(e=t.ElementType||(t.ElementType={}));function r(i){return i.type===e.Tag||i.type===e.Script||i.type===e.Style}t.isTag=r,t.Root=e.Root,t.Text=e.Text,t.Directive=e.Directive,t.Comment=e.Comment,t.Script=e.Script,t.Style=e.Style,t.Tag=e.Tag,t.CDATA=e.CDATA,t.Doctype=e.Doctype})(tm);var be={},ns=Be&&Be.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(i[n]=s[n])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),io=Be&&Be.__assign||function(){return io=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},io.apply(this,arguments)};Object.defineProperty(be,"__esModule",{value:!0});be.cloneNode=be.hasChildren=be.isDocument=be.isDirective=be.isComment=be.isText=be.isCDATA=be.isTag=be.Element=be.Document=be.CDATA=be.NodeWithChildren=be.ProcessingInstruction=be.Comment=be.Text=be.DataNode=be.Node=void 0;var St=tm,rm=function(){function t(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),t.prototype.cloneNode=function(e){return e===void 0&&(e=!1),im(this,e)},t}();be.Node=rm;var Bh=function(t){ns(e,t);function e(r){var i=t.call(this)||this;return i.data=r,i}return Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),e}(rm);be.DataNode=Bh;var zx=function(t){ns(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=St.ElementType.Text,r}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),e}(Bh);be.Text=zx;var Hx=function(t){ns(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=St.ElementType.Comment,r}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),e}(Bh);be.Comment=Hx;var Vx=function(t){ns(e,t);function e(r,i){var s=t.call(this,i)||this;return s.name=r,s.type=St.ElementType.Directive,s}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),e}(Bh);be.ProcessingInstruction=Vx;var Fh=function(t){ns(e,t);function e(r){var i=t.call(this)||this;return i.children=r,i}return Object.defineProperty(e.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),e}(rm);be.NodeWithChildren=Fh;var Wx=function(t){ns(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=St.ElementType.CDATA,r}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),e}(Fh);be.CDATA=Wx;var Xx=function(t){ns(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=St.ElementType.Root,r}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),e}(Fh);be.Document=Xx;var Yx=function(t){ns(e,t);function e(r,i,s,n){s===void 0&&(s=[]),n===void 0&&(n=r==="script"?St.ElementType.Script:r==="style"?St.ElementType.Style:St.ElementType.Tag);var a=t.call(this,s)||this;return a.name=r,a.attribs=i,a.type=n,a}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(i){var s,n;return{name:i,value:r.attribs[i],namespace:(s=r["x-attribsNamespace"])===null||s===void 0?void 0:s[i],prefix:(n=r["x-attribsPrefix"])===null||n===void 0?void 0:n[i]}})},enumerable:!1,configurable:!0}),e}(Fh);be.Element=Yx;function qx(t){return(0,St.isTag)(t)}be.isTag=qx;function Zx(t){return t.type===St.ElementType.CDATA}be.isCDATA=Zx;function Kx(t){return t.type===St.ElementType.Text}be.isText=Kx;function Qx(t){return t.type===St.ElementType.Comment}be.isComment=Qx;function Jx(t){return t.type===St.ElementType.Directive}be.isDirective=Jx;function e_(t){return t.type===St.ElementType.Root}be.isDocument=e_;function yR(t){return Object.prototype.hasOwnProperty.call(t,"children")}be.hasChildren=yR;function im(t,e){e===void 0&&(e=!1);var r;if(Kx(t))r=new zx(t.data);else if(Qx(t))r=new Hx(t.data);else if(qx(t)){var i=e?Su(t.children):[],s=new Yx(t.name,io({},t.attribs),i);i.forEach(function(l){return l.parent=s}),t.namespace!=null&&(s.namespace=t.namespace),t["x-attribsNamespace"]&&(s["x-attribsNamespace"]=io({},t["x-attribsNamespace"])),t["x-attribsPrefix"]&&(s["x-attribsPrefix"]=io({},t["x-attribsPrefix"])),r=s}else if(Zx(t)){var i=e?Su(t.children):[],n=new Wx(i);i.forEach(function(c){return c.parent=n}),r=n}else if(e_(t)){var i=e?Su(t.children):[],a=new Xx(i);i.forEach(function(c){return c.parent=a}),t["x-mode"]&&(a["x-mode"]=t["x-mode"]),r=a}else if(Jx(t)){var o=new Vx(t.name,t.data);t["x-name"]!=null&&(o["x-name"]=t["x-name"],o["x-publicId"]=t["x-publicId"],o["x-systemId"]=t["x-systemId"]),r=o}else throw new Error("Not implemented yet: ".concat(t.type));return r.startIndex=t.startIndex,r.endIndex=t.endIndex,t.sourceCodeLocation!=null&&(r.sourceCodeLocation=t.sourceCodeLocation),r}be.cloneNode=im;function Su(t){for(var e=t.map(function(i){return im(i,!0)}),r=1;r<e.length;r++)e[r].prev=e[r-1],e[r-1].next=e[r];return e}(function(t){var e=Be&&Be.__createBinding||(Object.create?function(o,l,c,h){h===void 0&&(h=c);var f=Object.getOwnPropertyDescriptor(l,c);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(o,h,f)}:function(o,l,c,h){h===void 0&&(h=c),o[h]=l[c]}),r=Be&&Be.__exportStar||function(o,l){for(var c in o)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&e(l,o,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=tm,s=be;r(be,t);var n={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=function(){function o(l,c,h){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof c=="function"&&(h=c,c=n),typeof l=="object"&&(c=l,l=void 0),this.callback=l??null,this.options=c??n,this.elementCB=h??null}return o.prototype.onparserinit=function(l){this.parser=l},o.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},o.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},o.prototype.onerror=function(l){this.handleCallback(l)},o.prototype.onclosetag=function(){this.lastNode=null;var l=this.tagStack.pop();this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(l)},o.prototype.onopentag=function(l,c){var h=this.options.xmlMode?i.ElementType.Tag:void 0,f=new s.Element(l,c,void 0,h);this.addNode(f),this.tagStack.push(f)},o.prototype.ontext=function(l){var c=this.lastNode;if(c&&c.type===i.ElementType.Text)c.data+=l,this.options.withEndIndices&&(c.endIndex=this.parser.endIndex);else{var h=new s.Text(l);this.addNode(h),this.lastNode=h}},o.prototype.oncomment=function(l){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=l;return}var c=new s.Comment(l);this.addNode(c),this.lastNode=c},o.prototype.oncommentend=function(){this.lastNode=null},o.prototype.oncdatastart=function(){var l=new s.Text(""),c=new s.CDATA([l]);this.addNode(c),l.parent=c,this.lastNode=l},o.prototype.oncdataend=function(){this.lastNode=null},o.prototype.onprocessinginstruction=function(l,c){var h=new s.ProcessingInstruction(l,c);this.addNode(h)},o.prototype.handleCallback=function(l){if(typeof this.callback=="function")this.callback(l,this.dom);else if(l)throw l},o.prototype.addNode=function(l){var c=this.tagStack[this.tagStack.length-1],h=c.children[c.children.length-1];this.options.withStartIndices&&(l.startIndex=this.parser.startIndex),this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),c.children.push(l),h&&(l.prev=h,h.next=l),l.parent=c,this.lastNode=null},o}();t.DomHandler=a,t.default=a})(em);var zg="html",Hg="head",Pl="body",bR=/<([a-zA-Z]+[0-9]?)/,Vg=/<head[^]*>/i,Wg=/<body[^]*>/i,Zc=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},gf=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},Xg=typeof window=="object"&&window.DOMParser;if(typeof Xg=="function"){var xR=new Xg,_R="text/html";gf=function(t,e){return e&&(t="<"+e+">"+t+"</"+e+">"),xR.parseFromString(t,_R)},Zc=gf}if(typeof document=="object"&&document.implementation){var Ml=document.implementation.createHTMLDocument();Zc=function(t,e){if(e){var r=Ml.documentElement.querySelector(e);return r.innerHTML=t,Ml}return Ml.documentElement.innerHTML=t,Ml}}var Tu=typeof document=="object"?document.createElement("template"):{},vf;Tu.content&&(vf=function(t){return Tu.innerHTML=t,Tu.content.childNodes});function wR(t){var e,r=t.match(bR);r&&r[1]&&(e=r[1].toLowerCase());var i,s,n;switch(e){case zg:return i=gf(t),Vg.test(t)||(s=i.querySelector(Hg),s&&s.parentNode.removeChild(s)),Wg.test(t)||(s=i.querySelector(Pl),s&&s.parentNode.removeChild(s)),i.querySelectorAll(zg);case Hg:case Pl:return i=Zc(t),n=i.querySelectorAll(e),Wg.test(t)&&Vg.test(t)?n[0].parentNode.childNodes:n;default:return vf?vf(t):(s=Zc(t,Pl).querySelector(Pl),s.childNodes)}}var ER=wR,sm={},t_={};t_.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];var Uh=em,SR=t_,Yg=SR.CASE_SENSITIVE_TAG_NAMES,TR=Uh.Comment,AR=Uh.Element,CR=Uh.ProcessingInstruction,IR=Uh.Text,r_={},Au;for(var Cu=0,RR=Yg.length;Cu<RR;Cu++)Au=Yg[Cu],r_[Au.toLowerCase()]=Au;function PR(t){return r_[t]}function i_(t){for(var e={},r,i=0,s=t.length;i<s;i++)r=t[i],e[r.name]=r.value;return e}function MR(t){t=t.toLowerCase();var e=PR(t);return e||t}function s_(t,e,r){e=e||null;for(var i=[],s,n=0,a=t.length;n<a;n++){var o=t[n],l;switch(o.nodeType){case 1:s=MR(o.nodeName),l=new AR(s,i_(o.attributes)),l.children=s_(s==="template"?o.content.childNodes:o.childNodes,l);break;case 3:l=new IR(o.nodeValue);break;case 8:l=new TR(o.nodeValue);break;default:continue}var c=i[n-1]||null;c&&(c.next=l),l.parent=e,l.prev=c,l.next=null,i.push(l)}return r&&(l=new CR(r.substring(0,r.indexOf(" ")).toLowerCase(),r),l.next=i[0]||null,l.parent=e,i.unshift(l),i[1]&&(i[1].prev=i[0])),i}sm.formatAttributes=i_;sm.formatDOM=s_;var OR=ER,kR=sm,DR=kR.formatDOM,NR=/<(![a-zA-Z\s]+)>/;function LR(t){if(typeof t!="string")throw new TypeError("First argument must be a string");if(t==="")return[];var e=t.match(NR),r;return e&&e[1]&&(r=e[1]),DR(OR(t),null,r)}var BR=LR,er={},jh={},FR=0;jh.SAME=FR;var UR=1;jh.CAMELCASE=UR;jh.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(er,"__esModule",{value:!0});function jR(t,e){return $R(t)||GR(t,e)||zR(t,e)||HR()}function $R(t){if(Array.isArray(t))return t}function GR(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var i=[],s=!0,n=!1,a,o;try{for(r=r.call(t);!(s=(a=r.next()).done)&&(i.push(a.value),!(e&&i.length===e));s=!0);}catch(l){n=!0,o=l}finally{try{!s&&r.return!=null&&r.return()}finally{if(n)throw o}}return i}}function zR(t,e){if(t){if(typeof t=="string")return qg(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qg(t,e)}}function qg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function HR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
186
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n_=0,as=1,$h=2,Gh=3,nm=4,a_=5,o_=6;function VR(t){return st.hasOwnProperty(t)?st[t]:null}function pt(t,e,r,i,s,n,a){this.acceptsBooleans=e===$h||e===Gh||e===nm,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=n,this.removeEmptyString=a}var st={},WR=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];WR.forEach(function(t){st[t]=new pt(t,n_,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=jR(t,2),r=e[0],i=e[1];st[r]=new pt(r,as,!1,i,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){st[t]=new pt(t,$h,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){st[t]=new pt(t,$h,!1,t,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(t){st[t]=new pt(t,Gh,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){st[t]=new pt(t,Gh,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){st[t]=new pt(t,nm,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){st[t]=new pt(t,o_,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){st[t]=new pt(t,a_,!1,t.toLowerCase(),null,!1,!1)});var am=/[\-\:]([a-z])/g,om=function(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(t){var e=t.replace(am,om);st[e]=new pt(e,as,!1,t,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(t){var e=t.replace(am,om);st[e]=new pt(e,as,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(am,om);st[e]=new pt(e,as,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){st[t]=new pt(t,as,!1,t.toLowerCase(),null,!1,!1)});var XR="xlinkHref";st[XR]=new pt("xlinkHref",as,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){st[t]=new pt(t,as,!1,t.toLowerCase(),null,!0,!0)});var lm=jh,YR=lm.CAMELCASE,qR=lm.SAME,Zg=lm.possibleStandardNames,ZR=":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",KR=ZR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",QR=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+KR+"]*$")),JR=Object.keys(Zg).reduce(function(t,e){var r=Zg[e];return r===qR?t[e]=e:r===YR?t[e.toLowerCase()]=e:t[e]=r,t},{});er.BOOLEAN=Gh;er.BOOLEANISH_STRING=$h;er.NUMERIC=a_;er.OVERLOADED_BOOLEAN=nm;er.POSITIVE_NUMERIC=o_;er.RESERVED=n_;er.STRING=as;er.getPropertyInfo=VR;er.isCustomAttribute=QR;er.possibleStandardNames=JR;var l_={},cm={exports:{}},Kg=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,eP=/\n/g,tP=/^\s*/,rP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,iP=/^:\s*/,sP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,nP=/^[;\s]*/,aP=/^\s+|\s+$/g,oP=`
187
- `,Qg="/",Jg="*",xs="",lP="comment",cP="declaration",hP=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var r=1,i=1;function s(p){var m=p.match(eP);m&&(r+=m.length);var g=p.lastIndexOf(oP);i=~g?p.length-g:i+p.length}function n(){var p={line:r,column:i};return function(m){return m.position=new a(p),c(),m}}function a(p){this.start=p,this.end={line:r,column:i},this.source=e.source}a.prototype.content=t;function o(p){var m=new Error(e.source+":"+r+":"+i+": "+p);if(m.reason=p,m.filename=e.source,m.line=r,m.column=i,m.source=t,!e.silent)throw m}function l(p){var m=p.exec(t);if(m){var g=m[0];return s(g),t=t.slice(g.length),m}}function c(){l(tP)}function h(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=n();if(!(Qg!=t.charAt(0)||Jg!=t.charAt(1))){for(var m=2;xs!=t.charAt(m)&&(Jg!=t.charAt(m)||Qg!=t.charAt(m+1));)++m;if(m+=2,xs===t.charAt(m-1))return o("End of comment missing");var g=t.slice(2,m-2);return i+=2,s(g),t=t.slice(m),i+=2,p({type:lP,comment:g})}}function u(){var p=n(),m=l(rP);if(m){if(f(),!l(iP))return o("property missing ':'");var g=l(sP),y=p({type:cP,property:e0(m[0].replace(Kg,xs)),value:g?e0(g[0].replace(Kg,xs)):xs});return l(nP),y}}function d(){var p=[];h(p);for(var m;m=u();)m!==!1&&(p.push(m),h(p));return p}return c(),d()};function e0(t){return t?t.replace(aP,xs):xs}var uP=hP;function c_(t,e){var r=null;if(!t||typeof t!="string")return r;for(var i,s=uP(t),n=typeof e=="function",a,o,l=0,c=s.length;l<c;l++)i=s[l],a=i.property,o=i.value,n?e(a,o,i):o&&(r||(r={}),r[a]=o);return r}cm.exports=c_;cm.exports.default=c_;var dP=cm.exports,zh={};zh.__esModule=!0;zh.camelCase=void 0;var fP=/^--[a-zA-Z0-9-]+$/,pP=/-([a-z])/g,mP=/^[^-]+$/,gP=/^-(webkit|moz|ms|o|khtml)-/,vP=/^-(ms)-/,yP=function(t){return!t||mP.test(t)||fP.test(t)},bP=function(t,e){return e.toUpperCase()},t0=function(t,e){return"".concat(e,"-")},xP=function(t,e){return e===void 0&&(e={}),yP(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(vP,t0):t=t.replace(gP,t0),t.replace(pP,bP))};zh.camelCase=xP;(function(t){var e=Be&&Be.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};t.__esModule=!0;var r=e(dP),i=zh;function s(n,a){var o={};return!n||typeof n!="string"||(0,r.default)(n,function(l,c){l&&c&&(o[(0,i.camelCase)(l,a)]=c)}),o}t.default=s})(l_);var _P=E,wP=l_.default;function EP(t,e){if(!t||typeof t!="object")throw new TypeError("First argument must be an object");var r=typeof e=="function",i={},s={};for(var n in t){var a=t[n];if(r&&(i=e(n,a),i&&i.length===2)){s[i[0]]=i[1];continue}typeof a=="string"&&(s[a]=n)}return s}var SP=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function TP(t,e){return t.indexOf("-")===-1?e&&typeof e.is=="string":!SP.has(t)}var AP={reactCompat:!0};function CP(t,e){if(t!=null)try{e.style=wP(t,AP)}catch{e.style={}}}var IP=_P.version.split(".")[0]>=16,h_=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function RP(t){return!h_.has(t.name)}function PP(t){return t}var u_={PRESERVE_CUSTOM_ATTRIBUTES:IP,ELEMENTS_WITH_NO_TEXT_CHILDREN:h_,invertObject:EP,isCustomComponent:TP,setStyleProp:CP,canTextBeChildOfNode:RP,returnFirstArg:PP},Ua=er,r0=u_,MP=["checked","value"],OP=["input","select","textarea"],kP={reset:!0,submit:!0},d_=function(e,r){e=e||{};var i,s,n,a,o,l={},c=e.type&&kP[e.type];for(i in e){if(n=e[i],Ua.isCustomAttribute(i)){l[i]=n;continue}if(s=i.toLowerCase(),a=i0(s),a){switch(o=Ua.getPropertyInfo(a),MP.indexOf(a)!==-1&&OP.indexOf(r)!==-1&&!c&&(a=i0("default"+s)),l[a]=n,o&&o.type){case Ua.BOOLEAN:l[a]=!0;break;case Ua.OVERLOADED_BOOLEAN:n===""&&(l[a]=!0);break}continue}r0.PRESERVE_CUSTOM_ATTRIBUTES&&(l[i]=n)}return r0.setStyleProp(e.style,l),l};function i0(t){return Ua.possibleStandardNames[t]}var DP=E,NP=d_,Po=u_,LP=Po.setStyleProp,BP=Po.canTextBeChildOfNode;function f_(t,e){e=e||{};for(var r=e.library||DP,i=r.cloneElement,s=r.createElement,n=r.isValidElement,a=[],o,l,c=typeof e.replace=="function",h=e.transform||Po.returnFirstArg,f,u,d,p=e.trim,m=0,g=t.length;m<g;m++){if(o=t[m],c&&(f=e.replace(o),n(f))){g>1&&(f=i(f,{key:f.key||m})),a.push(h(f,o,m));continue}if(o.type==="text"){if(l=!o.data.trim().length,l&&o.parent&&!BP(o.parent)||p&&l)continue;a.push(h(o.data,o,m));continue}switch(u=o.attribs,FP(o)?LP(u.style,u):u&&(u=NP(u,o.name)),d=null,o.type){case"script":case"style":o.children[0]&&(u.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":o.name==="textarea"&&o.children[0]?u.defaultValue=o.children[0].data:o.children&&o.children.length&&(d=f_(o.children,e));break;default:continue}g>1&&(u.key=m),a.push(h(s(o.name,u,d),o,m))}return a.length===1?a[0]:a}function FP(t){return Po.PRESERVE_CUSTOM_ATTRIBUTES&&t.type==="tag"&&Po.isCustomComponent(t.name,t.attribs)}var UP=f_,Hh=em,wn=BR,jP=d_,p_=UP;wn=typeof wn.default=="function"?wn.default:wn;var $P={lowerCaseAttributeNames:!1};function Hr(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");return t===""?[]:(e=e||{},p_(wn(t,e.htmlparser2||$P),e))}Hr.domToReact=p_;Hr.htmlToDOM=wn;Hr.attributesToProps=jP;Hr.Comment=Hh.Comment;Hr.Element=Hh.Element;Hr.ProcessingInstruction=Hh.ProcessingInstruction;Hr.Text=Hh.Text;var GP=Hr;Hr.default=Hr;const os=Js(GP);var Ol=os.domToReact;os.htmlToDOM;var Iu=os.attributesToProps;os.Comment;os.Element;os.ProcessingInstruction;os.Text;/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const zP=4,s0=0,n0=1,HP=2;function ma(t){let e=t.length;for(;--e>=0;)t[e]=0}const VP=0,m_=1,WP=2,XP=3,YP=258,hm=29,dl=256,Mo=dl+1+hm,In=30,um=19,g_=2*Mo+1,Ss=15,Ru=16,qP=7,dm=256,v_=16,y_=17,b_=18,yf=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),wc=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ZP=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),x_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KP=512,ri=new Array((Mo+2)*2);ma(ri);const so=new Array(In*2);ma(so);const Oo=new Array(KP);ma(Oo);const ko=new Array(YP-XP+1);ma(ko);const fm=new Array(hm);ma(fm);const Kc=new Array(In);ma(Kc);function Pu(t,e,r,i,s){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=s,this.has_stree=t&&t.length}let __,w_,E_;function Mu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const S_=t=>t<256?Oo[t]:Oo[256+(t>>>7)],Do=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},xt=(t,e,r)=>{t.bi_valid>Ru-r?(t.bi_buf|=e<<t.bi_valid&65535,Do(t,t.bi_buf),t.bi_buf=e>>Ru-t.bi_valid,t.bi_valid+=r-Ru):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},kr=(t,e,r)=>{xt(t,r[e*2],r[e*2+1])},T_=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},QP=t=>{t.bi_valid===16?(Do(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},JP=(t,e)=>{const r=e.dyn_tree,i=e.max_code,s=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let c,h,f,u,d,p,m=0;for(u=0;u<=Ss;u++)t.bl_count[u]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<g_;c++)h=t.heap[c],u=r[r[h*2+1]*2+1]+1,u>l&&(u=l,m++),r[h*2+1]=u,!(h>i)&&(t.bl_count[u]++,d=0,h>=o&&(d=a[h-o]),p=r[h*2],t.opt_len+=p*(u+d),n&&(t.static_len+=p*(s[h*2+1]+d)));if(m!==0){do{for(u=l-1;t.bl_count[u]===0;)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[l]--,m-=2}while(m>0);for(u=l;u!==0;u--)for(h=t.bl_count[u];h!==0;)f=t.heap[--c],!(f>i)&&(r[f*2+1]!==u&&(t.opt_len+=(u-r[f*2+1])*r[f*2],r[f*2+1]=u),h--)}},A_=(t,e,r)=>{const i=new Array(Ss+1);let s=0,n,a;for(n=1;n<=Ss;n++)s=s+r[n-1]<<1,i[n]=s;for(a=0;a<=e;a++){let o=t[a*2+1];o!==0&&(t[a*2]=T_(i[o]++,o))}},eM=()=>{let t,e,r,i,s;const n=new Array(Ss+1);for(r=0,i=0;i<hm-1;i++)for(fm[i]=r,t=0;t<1<<yf[i];t++)ko[r++]=i;for(ko[r-1]=i,s=0,i=0;i<16;i++)for(Kc[i]=s,t=0;t<1<<wc[i];t++)Oo[s++]=i;for(s>>=7;i<In;i++)for(Kc[i]=s<<7,t=0;t<1<<wc[i]-7;t++)Oo[256+s++]=i;for(e=0;e<=Ss;e++)n[e]=0;for(t=0;t<=143;)ri[t*2+1]=8,t++,n[8]++;for(;t<=255;)ri[t*2+1]=9,t++,n[9]++;for(;t<=279;)ri[t*2+1]=7,t++,n[7]++;for(;t<=287;)ri[t*2+1]=8,t++,n[8]++;for(A_(ri,Mo+1,n),t=0;t<In;t++)so[t*2+1]=5,so[t*2]=T_(t,5);__=new Pu(ri,yf,dl+1,Mo,Ss),w_=new Pu(so,wc,0,In,Ss),E_=new Pu(new Array(0),ZP,0,um,qP)},C_=t=>{let e;for(e=0;e<Mo;e++)t.dyn_ltree[e*2]=0;for(e=0;e<In;e++)t.dyn_dtree[e*2]=0;for(e=0;e<um;e++)t.bl_tree[e*2]=0;t.dyn_ltree[dm*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},I_=t=>{t.bi_valid>8?Do(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},a0=(t,e,r,i)=>{const s=e*2,n=r*2;return t[s]<t[n]||t[s]===t[n]&&i[e]<=i[r]},Ou=(t,e,r)=>{const i=t.heap[r];let s=r<<1;for(;s<=t.heap_len&&(s<t.heap_len&&a0(e,t.heap[s+1],t.heap[s],t.depth)&&s++,!a0(e,i,t.heap[s],t.depth));)t.heap[r]=t.heap[s],r=s,s<<=1;t.heap[r]=i},o0=(t,e,r)=>{let i,s,n=0,a,o;if(t.sym_next!==0)do i=t.pending_buf[t.sym_buf+n++]&255,i+=(t.pending_buf[t.sym_buf+n++]&255)<<8,s=t.pending_buf[t.sym_buf+n++],i===0?kr(t,s,e):(a=ko[s],kr(t,a+dl+1,e),o=yf[a],o!==0&&(s-=fm[a],xt(t,s,o)),i--,a=S_(i),kr(t,a,r),o=wc[a],o!==0&&(i-=Kc[a],xt(t,i,o)));while(n<t.sym_next);kr(t,dm,e)},bf=(t,e)=>{const r=e.dyn_tree,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,n=e.stat_desc.elems;let a,o,l=-1,c;for(t.heap_len=0,t.heap_max=g_,a=0;a<n;a++)r[a*2]!==0?(t.heap[++t.heap_len]=l=a,t.depth[a]=0):r[a*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=l<2?++l:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,s&&(t.static_len-=i[c*2+1]);for(e.max_code=l,a=t.heap_len>>1;a>=1;a--)Ou(t,r,a);c=n;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Ou(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=o,r[c*2]=r[a*2]+r[o*2],t.depth[c]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1,r[a*2+1]=r[o*2+1]=c,t.heap[1]=c++,Ou(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],JP(t,e),A_(r,l,t.bl_count)},l0=(t,e,r)=>{let i,s=-1,n,a=e[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)n=a,a=e[(i+1)*2+1],!(++o<l&&n===a)&&(o<c?t.bl_tree[n*2]+=o:n!==0?(n!==s&&t.bl_tree[n*2]++,t.bl_tree[v_*2]++):o<=10?t.bl_tree[y_*2]++:t.bl_tree[b_*2]++,o=0,s=n,a===0?(l=138,c=3):n===a?(l=6,c=3):(l=7,c=4))},c0=(t,e,r)=>{let i,s=-1,n,a=e[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=r;i++)if(n=a,a=e[(i+1)*2+1],!(++o<l&&n===a)){if(o<c)do kr(t,n,t.bl_tree);while(--o!==0);else n!==0?(n!==s&&(kr(t,n,t.bl_tree),o--),kr(t,v_,t.bl_tree),xt(t,o-3,2)):o<=10?(kr(t,y_,t.bl_tree),xt(t,o-3,3)):(kr(t,b_,t.bl_tree),xt(t,o-11,7));o=0,s=n,a===0?(l=138,c=3):n===a?(l=6,c=3):(l=7,c=4)}},tM=t=>{let e;for(l0(t,t.dyn_ltree,t.l_desc.max_code),l0(t,t.dyn_dtree,t.d_desc.max_code),bf(t,t.bl_desc),e=um-1;e>=3&&t.bl_tree[x_[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},rM=(t,e,r,i)=>{let s;for(xt(t,e-257,5),xt(t,r-1,5),xt(t,i-4,4),s=0;s<i;s++)xt(t,t.bl_tree[x_[s]*2+1],3);c0(t,t.dyn_ltree,e-1),c0(t,t.dyn_dtree,r-1)},iM=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return s0;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return n0;for(r=32;r<dl;r++)if(t.dyn_ltree[r*2]!==0)return n0;return s0};let h0=!1;const sM=t=>{h0||(eM(),h0=!0),t.l_desc=new Mu(t.dyn_ltree,__),t.d_desc=new Mu(t.dyn_dtree,w_),t.bl_desc=new Mu(t.bl_tree,E_),t.bi_buf=0,t.bi_valid=0,C_(t)},R_=(t,e,r,i)=>{xt(t,(VP<<1)+(i?1:0),3),I_(t),Do(t,r),Do(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},nM=t=>{xt(t,m_<<1,3),kr(t,dm,ri),QP(t)},aM=(t,e,r,i)=>{let s,n,a=0;t.level>0?(t.strm.data_type===HP&&(t.strm.data_type=iM(t)),bf(t,t.l_desc),bf(t,t.d_desc),a=tM(t),s=t.opt_len+3+7>>>3,n=t.static_len+3+7>>>3,n<=s&&(s=n)):s=n=r+5,r+4<=s&&e!==-1?R_(t,e,r,i):t.strategy===zP||n===s?(xt(t,(m_<<1)+(i?1:0),3),o0(t,ri,so)):(xt(t,(WP<<1)+(i?1:0),3),rM(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),o0(t,t.dyn_ltree,t.dyn_dtree)),C_(t),i&&I_(t)},oM=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(ko[r]+dl+1)*2]++,t.dyn_dtree[S_(e)*2]++),t.sym_next===t.sym_end);var lM=sM,cM=R_,hM=aM,uM=oM,dM=nM,fM={_tr_init:lM,_tr_stored_block:cM,_tr_flush_block:hM,_tr_tally:uM,_tr_align:dM};const pM=(t,e,r,i)=>{let s=t&65535|0,n=t>>>16&65535|0,a=0;for(;r!==0;){a=r>2e3?2e3:r,r-=a;do s=s+e[i++]|0,n=n+s|0;while(--a);s%=65521,n%=65521}return s|n<<16|0};var No=pM;const mM=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},gM=new Uint32Array(mM()),vM=(t,e,r,i)=>{const s=gM,n=i+r;t^=-1;for(let a=i;a<n;a++)t=t>>>8^s[(t^e[a])&255];return t^-1};var Je=vM,Lo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Vh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:yM,_tr_stored_block:xf,_tr_flush_block:bM,_tr_tally:Wi,_tr_align:xM}=fM,{Z_NO_FLUSH:Xi,Z_PARTIAL_FLUSH:_M,Z_FULL_FLUSH:wM,Z_FINISH:Wt,Z_BLOCK:u0,Z_OK:rt,Z_STREAM_END:d0,Z_STREAM_ERROR:Br,Z_DATA_ERROR:EM,Z_BUF_ERROR:ku,Z_DEFAULT_COMPRESSION:SM,Z_FILTERED:TM,Z_HUFFMAN_ONLY:kl,Z_RLE:AM,Z_FIXED:CM,Z_DEFAULT_STRATEGY:IM,Z_UNKNOWN:RM,Z_DEFLATED:Wh}=Vh,PM=9,MM=15,OM=8,kM=29,DM=256,_f=DM+1+kM,NM=30,LM=19,BM=2*_f+1,FM=15,we=3,Ui=258,Fr=Ui+we+1,UM=32,na=42,pm=57,wf=69,Ef=73,Sf=91,Tf=103,Ts=113,ja=666,dt=1,ga=2,Xs=3,va=4,jM=3,As=(t,e)=>(t.msg=Lo[e],e),f0=t=>t*2-(t>4?9:0),Ai=t=>{let e=t.length;for(;--e>=0;)t[e]=0},$M=t=>{let e,r,i,s=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=s?r-s:0;while(--e);e=s,i=e;do r=t.prev[--i],t.prev[i]=r>=s?r-s:0;while(--e)};let GM=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Yi=GM;const Ct=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},Ot=(t,e)=>{bM(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Ct(t.strm)},Ie=(t,e)=>{t.pending_buf[t.pending++]=e},Pa=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Af=(t,e,r,i)=>{let s=t.avail_in;return s>i&&(s=i),s===0?0:(t.avail_in-=s,e.set(t.input.subarray(t.next_in,t.next_in+s),r),t.state.wrap===1?t.adler=No(t.adler,e,s,r):t.state.wrap===2&&(t.adler=Je(t.adler,e,s,r)),t.next_in+=s,t.total_in+=s,s)},P_=(t,e)=>{let r=t.max_chain_length,i=t.strstart,s,n,a=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-Fr?t.strstart-(t.w_size-Fr):0,c=t.window,h=t.w_mask,f=t.prev,u=t.strstart+Ui;let d=c[i+a-1],p=c[i+a];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(s=e,!(c[s+a]!==p||c[s+a-1]!==d||c[s]!==c[i]||c[++s]!==c[i+1])){i+=2,s++;do;while(c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&i<u);if(n=Ui-(u-i),i=u-Ui,n>a){if(t.match_start=e,a=n,n>=o)break;d=c[i+a-1],p=c[i+a]}}while((e=f[e&h])>l&&--r!==0);return a<=t.lookahead?a:t.lookahead},aa=t=>{const e=t.w_size;let r,i,s;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Fr)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),$M(t),i+=e),t.strm.avail_in===0)break;if(r=Af(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=r,t.lookahead+t.insert>=we)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=Yi(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=Yi(t,t.ins_h,t.window[s+we-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<we)););}while(t.lookahead<Fr&&t.strm.avail_in!==0)},M_=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,i,s,n,a=0,o=t.strm.avail_in;do{if(i=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n||(n=t.strm.avail_out-n,s=t.strstart-t.block_start,i>s+t.strm.avail_in&&(i=s+t.strm.avail_in),i>n&&(i=n),i<r&&(i===0&&e!==Wt||e===Xi||i!==s+t.strm.avail_in)))break;a=e===Wt&&i===s+t.strm.avail_in?1:0,xf(t,0,0,a),t.pending_buf[t.pending-4]=i,t.pending_buf[t.pending-3]=i>>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,Ct(t.strm),s&&(s>i&&(s=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+s),t.strm.next_out),t.strm.next_out+=s,t.strm.avail_out-=s,t.strm.total_out+=s,t.block_start+=s,i-=s),i&&(Af(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(a===0);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),a?va:e!==Xi&&e!==Wt&&t.strm.avail_in===0&&t.strstart===t.block_start?ga:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(Af(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,r=n>t.w_size?t.w_size:n,s=t.strstart-t.block_start,(s>=r||(s||e===Wt)&&e!==Xi&&t.strm.avail_in===0&&s<=n)&&(i=s>n?n:s,a=e===Wt&&t.strm.avail_in===0&&i===s?1:0,xf(t,t.block_start,i,a),t.block_start+=i,Ct(t.strm)),a?Xs:dt)},Du=(t,e)=>{let r,i;for(;;){if(t.lookahead<Fr){if(aa(t),t.lookahead<Fr&&e===Xi)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=we&&(t.ins_h=Yi(t,t.ins_h,t.window[t.strstart+we-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Fr&&(t.match_length=P_(t,r)),t.match_length>=we)if(i=Wi(t,t.strstart-t.match_start,t.match_length-we),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=we){t.match_length--;do t.strstart++,t.ins_h=Yi(t,t.ins_h,t.window[t.strstart+we-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Yi(t,t.ins_h,t.window[t.strstart+1]);else i=Wi(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Ot(t,!1),t.strm.avail_out===0))return dt}return t.insert=t.strstart<we-1?t.strstart:we-1,e===Wt?(Ot(t,!0),t.strm.avail_out===0?Xs:va):t.sym_next&&(Ot(t,!1),t.strm.avail_out===0)?dt:ga},ln=(t,e)=>{let r,i,s;for(;;){if(t.lookahead<Fr){if(aa(t),t.lookahead<Fr&&e===Xi)return dt;if(t.lookahead===0)break}if(r=0,t.lookahead>=we&&(t.ins_h=Yi(t,t.ins_h,t.window[t.strstart+we-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=we-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Fr&&(t.match_length=P_(t,r),t.match_length<=5&&(t.strategy===TM||t.match_length===we&&t.strstart-t.match_start>4096)&&(t.match_length=we-1)),t.prev_length>=we&&t.match_length<=t.prev_length){s=t.strstart+t.lookahead-we,i=Wi(t,t.strstart-1-t.prev_match,t.prev_length-we),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=s&&(t.ins_h=Yi(t,t.ins_h,t.window[t.strstart+we-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=we-1,t.strstart++,i&&(Ot(t,!1),t.strm.avail_out===0))return dt}else if(t.match_available){if(i=Wi(t,0,t.window[t.strstart-1]),i&&Ot(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return dt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Wi(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<we-1?t.strstart:we-1,e===Wt?(Ot(t,!0),t.strm.avail_out===0?Xs:va):t.sym_next&&(Ot(t,!1),t.strm.avail_out===0)?dt:ga},zM=(t,e)=>{let r,i,s,n;const a=t.window;for(;;){if(t.lookahead<=Ui){if(aa(t),t.lookahead<=Ui&&e===Xi)return dt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=we&&t.strstart>0&&(s=t.strstart-1,i=a[s],i===a[++s]&&i===a[++s]&&i===a[++s])){n=t.strstart+Ui;do;while(i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&i===a[++s]&&s<n);t.match_length=Ui-(n-s),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=we?(r=Wi(t,1,t.match_length-we),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Wi(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Ot(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Wt?(Ot(t,!0),t.strm.avail_out===0?Xs:va):t.sym_next&&(Ot(t,!1),t.strm.avail_out===0)?dt:ga},HM=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(aa(t),t.lookahead===0)){if(e===Xi)return dt;break}if(t.match_length=0,r=Wi(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Ot(t,!1),t.strm.avail_out===0))return dt}return t.insert=0,e===Wt?(Ot(t,!0),t.strm.avail_out===0?Xs:va):t.sym_next&&(Ot(t,!1),t.strm.avail_out===0)?dt:ga};function xr(t,e,r,i,s){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=s}const $a=[new xr(0,0,0,0,M_),new xr(4,4,8,4,Du),new xr(4,5,16,8,Du),new xr(4,6,32,32,Du),new xr(4,4,16,16,ln),new xr(8,16,32,32,ln),new xr(8,16,128,128,ln),new xr(8,32,128,256,ln),new xr(32,128,258,1024,ln),new xr(32,258,258,4096,ln)],VM=t=>{t.window_size=2*t.w_size,Ai(t.head),t.max_lazy_match=$a[t.level].max_lazy,t.good_match=$a[t.level].good_length,t.nice_match=$a[t.level].nice_length,t.max_chain_length=$a[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=we-1,t.match_available=0,t.ins_h=0};function WM(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Wh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(BM*2),this.dyn_dtree=new Uint16Array((2*NM+1)*2),this.bl_tree=new Uint16Array((2*LM+1)*2),Ai(this.dyn_ltree),Ai(this.dyn_dtree),Ai(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(FM+1),this.heap=new Uint16Array(2*_f+1),Ai(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*_f+1),Ai(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const fl=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==na&&e.status!==pm&&e.status!==wf&&e.status!==Ef&&e.status!==Sf&&e.status!==Tf&&e.status!==Ts&&e.status!==ja?1:0},O_=t=>{if(fl(t))return As(t,Br);t.total_in=t.total_out=0,t.data_type=RM;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?pm:e.wrap?na:Ts,t.adler=e.wrap===2?0:1,e.last_flush=-2,yM(e),rt},k_=t=>{const e=O_(t);return e===rt&&VM(t.state),e},XM=(t,e)=>fl(t)||t.state.wrap!==2?Br:(t.state.gzhead=e,rt),D_=(t,e,r,i,s,n)=>{if(!t)return Br;let a=1;if(e===SM&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>PM||r!==Wh||i<8||i>15||e<0||e>9||n<0||n>CM||i===8&&a!==1)return As(t,Br);i===8&&(i=9);const o=new WM;return t.state=o,o.strm=t,o.status=na,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=s+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+we-1)/we),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<s+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=n,o.method=r,k_(t)},YM=(t,e)=>D_(t,e,Wh,MM,OM,IM),qM=(t,e)=>{if(fl(t)||e>u0||e<0)return t?As(t,Br):Br;const r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===ja&&e!==Wt)return As(t,t.avail_out===0?ku:Br);const i=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Ct(t),t.avail_out===0)return r.last_flush=-1,rt}else if(t.avail_in===0&&f0(e)<=f0(i)&&e!==Wt)return As(t,ku);if(r.status===ja&&t.avail_in!==0)return As(t,ku);if(r.status===na&&r.wrap===0&&(r.status=Ts),r.status===na){let s=Wh+(r.w_bits-8<<4)<<8,n=-1;if(r.strategy>=kl||r.level<2?n=0:r.level<6?n=1:r.level===6?n=2:n=3,s|=n<<6,r.strstart!==0&&(s|=UM),s+=31-s%31,Pa(r,s),r.strstart!==0&&(Pa(r,t.adler>>>16),Pa(r,t.adler&65535)),t.adler=1,r.status=Ts,Ct(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===pm){if(t.adler=0,Ie(r,31),Ie(r,139),Ie(r,8),r.gzhead)Ie(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Ie(r,r.gzhead.time&255),Ie(r,r.gzhead.time>>8&255),Ie(r,r.gzhead.time>>16&255),Ie(r,r.gzhead.time>>24&255),Ie(r,r.level===9?2:r.strategy>=kl||r.level<2?4:0),Ie(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Ie(r,r.gzhead.extra.length&255),Ie(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=wf;else if(Ie(r,0),Ie(r,0),Ie(r,0),Ie(r,0),Ie(r,0),Ie(r,r.level===9?2:r.strategy>=kl||r.level<2?4:0),Ie(r,jM),r.status=Ts,Ct(t),r.pending!==0)return r.last_flush=-1,rt}if(r.status===wf){if(r.gzhead.extra){let s=r.pending,n=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let o=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>s&&(t.adler=Je(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex+=o,Ct(t),r.pending!==0)return r.last_flush=-1,rt;s=0,n-=o}let a=new Uint8Array(r.gzhead.extra);r.pending_buf.set(a.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>s&&(t.adler=Je(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex=0}r.status=Ef}if(r.status===Ef){if(r.gzhead.name){let s=r.pending,n;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>s&&(t.adler=Je(t.adler,r.pending_buf,r.pending-s,s)),Ct(t),r.pending!==0)return r.last_flush=-1,rt;s=0}r.gzindex<r.gzhead.name.length?n=r.gzhead.name.charCodeAt(r.gzindex++)&255:n=0,Ie(r,n)}while(n!==0);r.gzhead.hcrc&&r.pending>s&&(t.adler=Je(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex=0}r.status=Sf}if(r.status===Sf){if(r.gzhead.comment){let s=r.pending,n;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>s&&(t.adler=Je(t.adler,r.pending_buf,r.pending-s,s)),Ct(t),r.pending!==0)return r.last_flush=-1,rt;s=0}r.gzindex<r.gzhead.comment.length?n=r.gzhead.comment.charCodeAt(r.gzindex++)&255:n=0,Ie(r,n)}while(n!==0);r.gzhead.hcrc&&r.pending>s&&(t.adler=Je(t.adler,r.pending_buf,r.pending-s,s))}r.status=Tf}if(r.status===Tf){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Ct(t),r.pending!==0))return r.last_flush=-1,rt;Ie(r,t.adler&255),Ie(r,t.adler>>8&255),t.adler=0}if(r.status=Ts,Ct(t),r.pending!==0)return r.last_flush=-1,rt}if(t.avail_in!==0||r.lookahead!==0||e!==Xi&&r.status!==ja){let s=r.level===0?M_(r,e):r.strategy===kl?HM(r,e):r.strategy===AM?zM(r,e):$a[r.level].func(r,e);if((s===Xs||s===va)&&(r.status=ja),s===dt||s===Xs)return t.avail_out===0&&(r.last_flush=-1),rt;if(s===ga&&(e===_M?xM(r):e!==u0&&(xf(r,0,0,!1),e===wM&&(Ai(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Ct(t),t.avail_out===0))return r.last_flush=-1,rt}return e!==Wt?rt:r.wrap<=0?d0:(r.wrap===2?(Ie(r,t.adler&255),Ie(r,t.adler>>8&255),Ie(r,t.adler>>16&255),Ie(r,t.adler>>24&255),Ie(r,t.total_in&255),Ie(r,t.total_in>>8&255),Ie(r,t.total_in>>16&255),Ie(r,t.total_in>>24&255)):(Pa(r,t.adler>>>16),Pa(r,t.adler&65535)),Ct(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?rt:d0)},ZM=t=>{if(fl(t))return Br;const e=t.state.status;return t.state=null,e===Ts?As(t,EM):rt},KM=(t,e)=>{let r=e.length;if(fl(t))return Br;const i=t.state,s=i.wrap;if(s===2||s===1&&i.status!==na||i.lookahead)return Br;if(s===1&&(t.adler=No(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){s===0&&(Ai(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(e.subarray(r-i.w_size,r),0),e=l,r=i.w_size}const n=t.avail_in,a=t.next_in,o=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,aa(i);i.lookahead>=we;){let l=i.strstart,c=i.lookahead-(we-1);do i.ins_h=Yi(i,i.ins_h,i.window[l+we-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--c);i.strstart=l,i.lookahead=we-1,aa(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=we-1,i.match_available=0,t.next_in=a,t.input=o,t.avail_in=n,i.wrap=s,rt};var QM=YM,JM=D_,eO=k_,tO=O_,rO=XM,iO=qM,sO=ZM,nO=KM,aO="pako deflate (from Nodeca project)",no={deflateInit:QM,deflateInit2:JM,deflateReset:eO,deflateResetKeep:tO,deflateSetHeader:rO,deflate:iO,deflateEnd:sO,deflateSetDictionary:nO,deflateInfo:aO};const oO=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var lO=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const i in r)oO(r,i)&&(t[i]=r[i])}}return t},cO=t=>{let e=0;for(let i=0,s=t.length;i<s;i++)e+=t[i].length;const r=new Uint8Array(e);for(let i=0,s=0,n=t.length;i<n;i++){let a=t[i];r.set(a,s),s+=a.length}return r},Xh={assign:lO,flattenChunks:cO};let N_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{N_=!1}const Bo=new Uint8Array(256);for(let t=0;t<256;t++)Bo[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Bo[254]=Bo[254]=1;var hO=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,i,s,n,a=t.length,o=0;for(s=0;s<a;s++)r=t.charCodeAt(s),(r&64512)===55296&&s+1<a&&(i=t.charCodeAt(s+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),s++)),o+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(o),n=0,s=0;n<o;s++)r=t.charCodeAt(s),(r&64512)===55296&&s+1<a&&(i=t.charCodeAt(s+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),s++)),r<128?e[n++]=r:r<2048?(e[n++]=192|r>>>6,e[n++]=128|r&63):r<65536?(e[n++]=224|r>>>12,e[n++]=128|r>>>6&63,e[n++]=128|r&63):(e[n++]=240|r>>>18,e[n++]=128|r>>>12&63,e[n++]=128|r>>>6&63,e[n++]=128|r&63);return e};const uO=(t,e)=>{if(e<65534&&t.subarray&&N_)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r};var dO=(t,e)=>{const r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let i,s;const n=new Array(r*2);for(s=0,i=0;i<r;){let a=t[i++];if(a<128){n[s++]=a;continue}let o=Bo[a];if(o>4){n[s++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i<r;)a=a<<6|t[i++]&63,o--;if(o>1){n[s++]=65533;continue}a<65536?n[s++]=a:(a-=65536,n[s++]=55296|a>>10&1023,n[s++]=56320|a&1023)}return uO(n,s)},fO=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Bo[t[r]]>e?r:e},Fo={string2buf:hO,buf2string:dO,utf8border:fO};function pO(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var L_=pO;const B_=Object.prototype.toString,{Z_NO_FLUSH:mO,Z_SYNC_FLUSH:gO,Z_FULL_FLUSH:vO,Z_FINISH:yO,Z_OK:Qc,Z_STREAM_END:bO,Z_DEFAULT_COMPRESSION:xO,Z_DEFAULT_STRATEGY:_O,Z_DEFLATED:wO}=Vh;function mm(t){this.options=Xh.assign({level:xO,method:wO,chunkSize:16384,windowBits:15,memLevel:8,strategy:_O},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new L_,this.strm.avail_out=0;let r=no.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Qc)throw new Error(Lo[r]);if(e.header&&no.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=Fo.string2buf(e.dictionary):B_.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=no.deflateSetDictionary(this.strm,i),r!==Qc)throw new Error(Lo[r]);this._dict_set=!0}}mm.prototype.push=function(t,e){const r=this.strm,i=this.options.chunkSize;let s,n;if(this.ended)return!1;for(e===~~e?n=e:n=e===!0?yO:mO,typeof t=="string"?r.input=Fo.string2buf(t):B_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===gO||n===vO)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(s=no.deflate(r,n),s===bO)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),s=no.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Qc;if(r.avail_out===0){this.onData(r.output);continue}if(n>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};mm.prototype.onData=function(t){this.chunks.push(t)};mm.prototype.onEnd=function(t){t===Qc&&(this.result=Xh.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const Dl=16209,EO=16191;var SO=function(e,r){let i,s,n,a,o,l,c,h,f,u,d,p,m,g,y,_,v,b,w,A,S,C,T,M;const I=e.state;i=e.next_in,T=e.input,s=i+(e.avail_in-5),n=e.next_out,M=e.output,a=n-(r-e.avail_out),o=n+(e.avail_out-257),l=I.dmax,c=I.wsize,h=I.whave,f=I.wnext,u=I.window,d=I.hold,p=I.bits,m=I.lencode,g=I.distcode,y=(1<<I.lenbits)-1,_=(1<<I.distbits)-1;e:do{p<15&&(d+=T[i++]<<p,p+=8,d+=T[i++]<<p,p+=8),v=m[d&y];t:for(;;){if(b=v>>>24,d>>>=b,p-=b,b=v>>>16&255,b===0)M[n++]=v&65535;else if(b&16){w=v&65535,b&=15,b&&(p<b&&(d+=T[i++]<<p,p+=8),w+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=T[i++]<<p,p+=8,d+=T[i++]<<p,p+=8),v=g[d&_];r:for(;;){if(b=v>>>24,d>>>=b,p-=b,b=v>>>16&255,b&16){if(A=v&65535,b&=15,p<b&&(d+=T[i++]<<p,p+=8,p<b&&(d+=T[i++]<<p,p+=8)),A+=d&(1<<b)-1,A>l){e.msg="invalid distance too far back",I.mode=Dl;break e}if(d>>>=b,p-=b,b=n-a,A>b){if(b=A-b,b>h&&I.sane){e.msg="invalid distance too far back",I.mode=Dl;break e}if(S=0,C=u,f===0){if(S+=c-b,b<w){w-=b;do M[n++]=u[S++];while(--b);S=n-A,C=M}}else if(f<b){if(S+=c+f-b,b-=f,b<w){w-=b;do M[n++]=u[S++];while(--b);if(S=0,f<w){b=f,w-=b;do M[n++]=u[S++];while(--b);S=n-A,C=M}}}else if(S+=f-b,b<w){w-=b;do M[n++]=u[S++];while(--b);S=n-A,C=M}for(;w>2;)M[n++]=C[S++],M[n++]=C[S++],M[n++]=C[S++],w-=3;w&&(M[n++]=C[S++],w>1&&(M[n++]=C[S++]))}else{S=n-A;do M[n++]=M[S++],M[n++]=M[S++],M[n++]=M[S++],w-=3;while(w>2);w&&(M[n++]=M[S++],w>1&&(M[n++]=M[S++]))}}else if(b&64){e.msg="invalid distance code",I.mode=Dl;break e}else{v=g[(v&65535)+(d&(1<<b)-1)];continue r}break}}else if(b&64)if(b&32){I.mode=EO;break e}else{e.msg="invalid literal/length code",I.mode=Dl;break e}else{v=m[(v&65535)+(d&(1<<b)-1)];continue t}break}}while(i<s&&n<o);w=p>>3,i-=w,p-=w<<3,d&=(1<<p)-1,e.next_in=i,e.next_out=n,e.avail_in=i<s?5+(s-i):5-(i-s),e.avail_out=n<o?257+(o-n):257-(n-o),I.hold=d,I.bits=p};const cn=15,p0=852,m0=592,g0=0,Nu=1,v0=2,TO=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),AO=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),CO=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),IO=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),RO=(t,e,r,i,s,n,a,o)=>{const l=o.bits;let c=0,h=0,f=0,u=0,d=0,p=0,m=0,g=0,y=0,_=0,v,b,w,A,S,C=null,T;const M=new Uint16Array(cn+1),I=new Uint16Array(cn+1);let k=null,P,R,O;for(c=0;c<=cn;c++)M[c]=0;for(h=0;h<i;h++)M[e[r+h]]++;for(d=l,u=cn;u>=1&&M[u]===0;u--);if(d>u&&(d=u),u===0)return s[n++]=1<<24|64<<16|0,s[n++]=1<<24|64<<16|0,o.bits=1,0;for(f=1;f<u&&M[f]===0;f++);for(d<f&&(d=f),g=1,c=1;c<=cn;c++)if(g<<=1,g-=M[c],g<0)return-1;if(g>0&&(t===g0||u!==1))return-1;for(I[1]=0,c=1;c<cn;c++)I[c+1]=I[c]+M[c];for(h=0;h<i;h++)e[r+h]!==0&&(a[I[e[r+h]]++]=h);if(t===g0?(C=k=a,T=20):t===Nu?(C=TO,k=AO,T=257):(C=CO,k=IO,T=0),_=0,h=0,c=f,S=n,p=d,m=0,w=-1,y=1<<d,A=y-1,t===Nu&&y>p0||t===v0&&y>m0)return 1;for(;;){P=c-m,a[h]+1<T?(R=0,O=a[h]):a[h]>=T?(R=k[a[h]-T],O=C[a[h]-T]):(R=96,O=0),v=1<<c-m,b=1<<p,f=b;do b-=v,s[S+(_>>m)+b]=P<<24|R<<16|O|0;while(b!==0);for(v=1<<c-1;_&v;)v>>=1;if(v!==0?(_&=v-1,_+=v):_=0,h++,--M[c]===0){if(c===u)break;c=e[r+a[h]]}if(c>d&&(_&A)!==w){for(m===0&&(m=d),S+=f,p=c-m,g=1<<p;p+m<u&&(g-=M[p+m],!(g<=0));)p++,g<<=1;if(y+=1<<p,t===Nu&&y>p0||t===v0&&y>m0)return 1;w=_&A,s[w]=d<<24|p<<16|S-n|0}}return _!==0&&(s[S+_]=c-m<<24|64<<16|0),o.bits=d,0};var ao=RO;const PO=0,F_=1,U_=2,{Z_FINISH:y0,Z_BLOCK:MO,Z_TREES:Nl,Z_OK:Ys,Z_STREAM_END:OO,Z_NEED_DICT:kO,Z_STREAM_ERROR:Jt,Z_DATA_ERROR:j_,Z_MEM_ERROR:$_,Z_BUF_ERROR:DO,Z_DEFLATED:b0}=Vh,Yh=16180,x0=16181,_0=16182,w0=16183,E0=16184,S0=16185,T0=16186,A0=16187,C0=16188,I0=16189,Jc=16190,qr=16191,Lu=16192,R0=16193,Bu=16194,P0=16195,M0=16196,O0=16197,k0=16198,Ll=16199,Bl=16200,D0=16201,N0=16202,L0=16203,B0=16204,F0=16205,Fu=16206,U0=16207,j0=16208,De=16209,G_=16210,z_=16211,NO=852,LO=592,BO=15,FO=BO,$0=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function UO(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const rn=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Yh||e.mode>z_?1:0},H_=t=>{if(rn(t))return Jt;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Yh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(NO),e.distcode=e.distdyn=new Int32Array(LO),e.sane=1,e.back=-1,Ys},V_=t=>{if(rn(t))return Jt;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,H_(t)},W_=(t,e)=>{let r;if(rn(t))return Jt;const i=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Jt:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,V_(t))},X_=(t,e)=>{if(!t)return Jt;const r=new UO;t.state=r,r.strm=t,r.window=null,r.mode=Yh;const i=W_(t,e);return i!==Ys&&(t.state=null),i},jO=t=>X_(t,FO);let G0=!0,Uu,ju;const $O=t=>{if(G0){Uu=new Int32Array(512),ju=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ao(F_,t.lens,0,288,Uu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ao(U_,t.lens,0,32,ju,0,t.work,{bits:5}),G0=!1}t.lencode=Uu,t.lenbits=9,t.distcode=ju,t.distbits=5},Y_=(t,e,r,i)=>{let s;const n=t.state;return n.window===null&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),i>=n.wsize?(n.window.set(e.subarray(r-n.wsize,r),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>i&&(s=i),n.window.set(e.subarray(r-i,r-i+s),n.wnext),i-=s,i?(n.window.set(e.subarray(r-i,r),0),n.wnext=i,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0},GO=(t,e)=>{let r,i,s,n,a,o,l,c,h,f,u,d,p,m,g=0,y,_,v,b,w,A,S,C;const T=new Uint8Array(4);let M,I;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(rn(t)||!t.output||!t.input&&t.avail_in!==0)return Jt;r=t.state,r.mode===qr&&(r.mode=Lu),a=t.next_out,s=t.output,l=t.avail_out,n=t.next_in,i=t.input,o=t.avail_in,c=r.hold,h=r.bits,f=o,u=l,C=Ys;e:for(;;)switch(r.mode){case Yh:if(r.wrap===0){r.mode=Lu;break}for(;h<16;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,T[0]=c&255,T[1]=c>>>8&255,r.check=Je(r.check,T,2,0),c=0,h=0,r.mode=x0;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=De;break}if((c&15)!==b0){t.msg="unknown compression method",r.mode=De;break}if(c>>>=4,h-=4,S=(c&15)+8,r.wbits===0&&(r.wbits=S),S>15||S>r.wbits){t.msg="invalid window size",r.mode=De;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?I0:qr,c=0,h=0;break;case x0:for(;h<16;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(r.flags=c,(r.flags&255)!==b0){t.msg="unknown compression method",r.mode=De;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=De;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,r.check=Je(r.check,T,2,0)),c=0,h=0,r.mode=_0;case _0:for(;h<32;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,T[2]=c>>>16&255,T[3]=c>>>24&255,r.check=Je(r.check,T,4,0)),c=0,h=0,r.mode=w0;case w0:for(;h<16;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,r.check=Je(r.check,T,2,0)),c=0,h=0,r.mode=E0;case E0:if(r.flags&1024){for(;h<16;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,r.check=Je(r.check,T,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=S0;case S0:if(r.flags&1024&&(d=r.length,d>o&&(d=o),d&&(r.head&&(S=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(n,n+d),S)),r.flags&512&&r.wrap&4&&(r.check=Je(r.check,i,d,n)),o-=d,n+=d,r.length-=d),r.length))break e;r.length=0,r.mode=T0;case T0:if(r.flags&2048){if(o===0)break e;d=0;do S=i[n+d++],r.head&&S&&r.length<65536&&(r.head.name+=String.fromCharCode(S));while(S&&d<o);if(r.flags&512&&r.wrap&4&&(r.check=Je(r.check,i,d,n)),o-=d,n+=d,S)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=A0;case A0:if(r.flags&4096){if(o===0)break e;d=0;do S=i[n+d++],r.head&&S&&r.length<65536&&(r.head.comment+=String.fromCharCode(S));while(S&&d<o);if(r.flags&512&&r.wrap&4&&(r.check=Je(r.check,i,d,n)),o-=d,n+=d,S)break e}else r.head&&(r.head.comment=null);r.mode=C0;case C0:if(r.flags&512){for(;h<16;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=De;break}c=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=qr;break;case I0:for(;h<32;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}t.adler=r.check=$0(c),c=0,h=0,r.mode=Jc;case Jc:if(r.havedict===0)return t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=o,r.hold=c,r.bits=h,kO;t.adler=r.check=1,r.mode=qr;case qr:if(e===MO||e===Nl)break e;case Lu:if(r.last){c>>>=h&7,h-=h&7,r.mode=Fu;break}for(;h<3;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}switch(r.last=c&1,c>>>=1,h-=1,c&3){case 0:r.mode=R0;break;case 1:if($O(r),r.mode=Ll,e===Nl){c>>>=2,h-=2;break e}break;case 2:r.mode=M0;break;case 3:t.msg="invalid block type",r.mode=De}c>>>=2,h-=2;break;case R0:for(c>>>=h&7,h-=h&7;h<32;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=De;break}if(r.length=c&65535,c=0,h=0,r.mode=Bu,e===Nl)break e;case Bu:r.mode=P0;case P0:if(d=r.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break e;s.set(i.subarray(n,n+d),a),o-=d,n+=d,l-=d,a+=d,r.length-=d;break}r.mode=qr;break;case M0:for(;h<14;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(r.nlen=(c&31)+257,c>>>=5,h-=5,r.ndist=(c&31)+1,c>>>=5,h-=5,r.ncode=(c&15)+4,c>>>=4,h-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=De;break}r.have=0,r.mode=O0;case O0:for(;r.have<r.ncode;){for(;h<3;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}r.lens[k[r.have++]]=c&7,c>>>=3,h-=3}for(;r.have<19;)r.lens[k[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,M={bits:r.lenbits},C=ao(PO,r.lens,0,19,r.lencode,0,r.work,M),r.lenbits=M.bits,C){t.msg="invalid code lengths set",r.mode=De;break}r.have=0,r.mode=k0;case k0:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[c&(1<<r.lenbits)-1],y=g>>>24,_=g>>>16&255,v=g&65535,!(y<=h);){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(v<16)c>>>=y,h-=y,r.lens[r.have++]=v;else{if(v===16){for(I=y+2;h<I;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(c>>>=y,h-=y,r.have===0){t.msg="invalid bit length repeat",r.mode=De;break}S=r.lens[r.have-1],d=3+(c&3),c>>>=2,h-=2}else if(v===17){for(I=y+3;h<I;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}c>>>=y,h-=y,S=0,d=3+(c&7),c>>>=3,h-=3}else{for(I=y+7;h<I;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}c>>>=y,h-=y,S=0,d=11+(c&127),c>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=De;break}for(;d--;)r.lens[r.have++]=S}}if(r.mode===De)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=De;break}if(r.lenbits=9,M={bits:r.lenbits},C=ao(F_,r.lens,0,r.nlen,r.lencode,0,r.work,M),r.lenbits=M.bits,C){t.msg="invalid literal/lengths set",r.mode=De;break}if(r.distbits=6,r.distcode=r.distdyn,M={bits:r.distbits},C=ao(U_,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,M),r.distbits=M.bits,C){t.msg="invalid distances set",r.mode=De;break}if(r.mode=Ll,e===Nl)break e;case Ll:r.mode=Bl;case Bl:if(o>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=o,r.hold=c,r.bits=h,SO(t,u),a=t.next_out,s=t.output,l=t.avail_out,n=t.next_in,i=t.input,o=t.avail_in,c=r.hold,h=r.bits,r.mode===qr&&(r.back=-1);break}for(r.back=0;g=r.lencode[c&(1<<r.lenbits)-1],y=g>>>24,_=g>>>16&255,v=g&65535,!(y<=h);){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(_&&!(_&240)){for(b=y,w=_,A=v;g=r.lencode[A+((c&(1<<b+w)-1)>>b)],y=g>>>24,_=g>>>16&255,v=g&65535,!(b+y<=h);){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}c>>>=b,h-=b,r.back+=b}if(c>>>=y,h-=y,r.back+=y,r.length=v,_===0){r.mode=F0;break}if(_&32){r.back=-1,r.mode=qr;break}if(_&64){t.msg="invalid literal/length code",r.mode=De;break}r.extra=_&15,r.mode=D0;case D0:if(r.extra){for(I=r.extra;h<I;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=N0;case N0:for(;g=r.distcode[c&(1<<r.distbits)-1],y=g>>>24,_=g>>>16&255,v=g&65535,!(y<=h);){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(!(_&240)){for(b=y,w=_,A=v;g=r.distcode[A+((c&(1<<b+w)-1)>>b)],y=g>>>24,_=g>>>16&255,v=g&65535,!(b+y<=h);){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}c>>>=b,h-=b,r.back+=b}if(c>>>=y,h-=y,r.back+=y,_&64){t.msg="invalid distance code",r.mode=De;break}r.offset=v,r.extra=_&15,r.mode=L0;case L0:if(r.extra){for(I=r.extra;h<I;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=De;break}r.mode=B0;case B0:if(l===0)break e;if(d=u-l,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=De;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=s,p=a-r.offset,d=r.length;d>l&&(d=l),l-=d,r.length-=d;do s[a++]=m[p++];while(--d);r.length===0&&(r.mode=Bl);break;case F0:if(l===0)break e;s[a++]=r.length,l--,r.mode=Bl;break;case Fu:if(r.wrap){for(;h<32;){if(o===0)break e;o--,c|=i[n++]<<h,h+=8}if(u-=l,t.total_out+=u,r.total+=u,r.wrap&4&&u&&(t.adler=r.check=r.flags?Je(r.check,s,u,a-u):No(r.check,s,u,a-u)),u=l,r.wrap&4&&(r.flags?c:$0(c))!==r.check){t.msg="incorrect data check",r.mode=De;break}c=0,h=0}r.mode=U0;case U0:if(r.wrap&&r.flags){for(;h<32;){if(o===0)break e;o--,c+=i[n++]<<h,h+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=De;break}c=0,h=0}r.mode=j0;case j0:C=OO;break e;case De:C=j_;break e;case G_:return $_;case z_:default:return Jt}return t.next_out=a,t.avail_out=l,t.next_in=n,t.avail_in=o,r.hold=c,r.bits=h,(r.wsize||u!==t.avail_out&&r.mode<De&&(r.mode<Fu||e!==y0))&&Y_(t,t.output,t.next_out,u-t.avail_out),f-=t.avail_in,u-=t.avail_out,t.total_in+=f,t.total_out+=u,r.total+=u,r.wrap&4&&u&&(t.adler=r.check=r.flags?Je(r.check,s,u,t.next_out-u):No(r.check,s,u,t.next_out-u)),t.data_type=r.bits+(r.last?64:0)+(r.mode===qr?128:0)+(r.mode===Ll||r.mode===Bu?256:0),(f===0&&u===0||e===y0)&&C===Ys&&(C=DO),C},zO=t=>{if(rn(t))return Jt;let e=t.state;return e.window&&(e.window=null),t.state=null,Ys},HO=(t,e)=>{if(rn(t))return Jt;const r=t.state;return r.wrap&2?(r.head=e,e.done=!1,Ys):Jt},VO=(t,e)=>{const r=e.length;let i,s,n;return rn(t)||(i=t.state,i.wrap!==0&&i.mode!==Jc)?Jt:i.mode===Jc&&(s=1,s=No(s,e,r,0),s!==i.check)?j_:(n=Y_(t,e,r,r),n?(i.mode=G_,$_):(i.havedict=1,Ys))};var WO=V_,XO=W_,YO=H_,qO=jO,ZO=X_,KO=GO,QO=zO,JO=HO,ek=VO,tk="pako inflate (from Nodeca project)",ii={inflateReset:WO,inflateReset2:XO,inflateResetKeep:YO,inflateInit:qO,inflateInit2:ZO,inflate:KO,inflateEnd:QO,inflateGetHeader:JO,inflateSetDictionary:ek,inflateInfo:tk};function rk(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var ik=rk;const q_=Object.prototype.toString,{Z_NO_FLUSH:sk,Z_FINISH:nk,Z_OK:Uo,Z_STREAM_END:$u,Z_NEED_DICT:Gu,Z_STREAM_ERROR:ak,Z_DATA_ERROR:z0,Z_MEM_ERROR:ok}=Vh;function gm(t){this.options=Xh.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new L_,this.strm.avail_out=0;let r=ii.inflateInit2(this.strm,e.windowBits);if(r!==Uo)throw new Error(Lo[r]);if(this.header=new ik,ii.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Fo.string2buf(e.dictionary):q_.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=ii.inflateSetDictionary(this.strm,e.dictionary),r!==Uo)))throw new Error(Lo[r])}gm.prototype.push=function(t,e){const r=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let n,a,o;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?nk:sk,q_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),n=ii.inflate(r,a),n===Gu&&s&&(n=ii.inflateSetDictionary(r,s),n===Uo?n=ii.inflate(r,a):n===z0&&(n=Gu));r.avail_in>0&&n===$u&&r.state.wrap>0&&t[r.next_in]!==0;)ii.inflateReset(r),n=ii.inflate(r,a);switch(n){case ak:case z0:case Gu:case ok:return this.onEnd(n),this.ended=!0,!1}if(o=r.avail_out,r.next_out&&(r.avail_out===0||n===$u))if(this.options.to==="string"){let l=Fo.utf8border(r.output,r.next_out),c=r.next_out-l,h=Fo.buf2string(r.output,l);r.next_out=c,r.avail_out=i-c,c&&r.output.set(r.output.subarray(l,l+c),0),this.onData(h)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(n===Uo&&o===0)){if(n===$u)return n=ii.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};gm.prototype.onData=function(t){this.chunks.push(t)};gm.prototype.onEnd=function(t){t===Uo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Xh.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Z_={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Be,function(){var r=1e3,i=6e4,s=36e5,n="millisecond",a="second",o="minute",l="hour",c="day",h="week",f="month",u="quarter",d="year",p="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var O=["th","st","nd","rd"],L=R%100;return"["+R+(O[(L-20)%10]||O[L]||O[0])+"]"}},v=function(R,O,L){var N=String(R);return!N||N.length>=O?R:""+Array(O+1-N.length).join(L)+R},b={s:v,z:function(R){var O=-R.utcOffset(),L=Math.abs(O),N=Math.floor(L/60),B=L%60;return(O<=0?"+":"-")+v(N,2,"0")+":"+v(B,2,"0")},m:function R(O,L){if(O.date()<L.date())return-R(L,O);var N=12*(L.year()-O.year())+(L.month()-O.month()),B=O.clone().add(N,f),U=L-B<0,F=O.clone().add(N+(U?-1:1),f);return+(-(N+(L-B)/(U?B-F:F-B))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:f,y:d,w:h,d:c,D:p,h:l,m:o,s:a,ms:n,Q:u}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},w="en",A={};A[w]=_;var S="$isDayjsObject",C=function(R){return R instanceof k||!(!R||!R[S])},T=function R(O,L,N){var B;if(!O)return w;if(typeof O=="string"){var U=O.toLowerCase();A[U]&&(B=U),L&&(A[U]=L,B=U);var F=O.split("-");if(!B&&F.length>1)return R(F[0])}else{var j=O.name;A[j]=O,B=j}return!N&&B&&(w=B),B||!N&&w},M=function(R,O){if(C(R))return R.clone();var L=typeof O=="object"?O:{};return L.date=R,L.args=arguments,new k(L)},I=b;I.l=T,I.i=C,I.w=function(R,O){return M(R,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var k=function(){function R(L){this.$L=T(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[S]=!0}var O=R.prototype;return O.parse=function(L){this.$d=function(N){var B=N.date,U=N.utc;if(B===null)return new Date(NaN);if(I.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var F=B.match(g);if(F){var j=F[2]-1||0,z=(F[7]||"0").substring(0,3);return U?new Date(Date.UTC(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)):new Date(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,z)}}return new Date(B)}(L),this.init()},O.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},O.$utils=function(){return I},O.isValid=function(){return this.$d.toString()!==m},O.isSame=function(L,N){var B=M(L);return this.startOf(N)<=B&&B<=this.endOf(N)},O.isAfter=function(L,N){return M(L)<this.startOf(N)},O.isBefore=function(L,N){return this.endOf(N)<M(L)},O.$g=function(L,N,B){return I.u(L)?this[N]:this.set(B,L)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(L,N){var B=this,U=!!I.u(N)||N,F=I.p(L),j=function(ge,ae){var he=I.w(B.$u?Date.UTC(B.$y,ae,ge):new Date(B.$y,ae,ge),B);return U?he:he.endOf(c)},z=function(ge,ae){return I.w(B.toDate()[ge].apply(B.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(ae)),B)},q=this.$W,J=this.$M,ee=this.$D,ne="set"+(this.$u?"UTC":"");switch(F){case d:return U?j(1,0):j(31,11);case f:return U?j(1,J):j(0,J+1);case h:var se=this.$locale().weekStart||0,pe=(q<se?q+7:q)-se;return j(U?ee-pe:ee+(6-pe),J);case c:case p:return z(ne+"Hours",0);case l:return z(ne+"Minutes",1);case o:return z(ne+"Seconds",2);case a:return z(ne+"Milliseconds",3);default:return this.clone()}},O.endOf=function(L){return this.startOf(L,!1)},O.$set=function(L,N){var B,U=I.p(L),F="set"+(this.$u?"UTC":""),j=(B={},B[c]=F+"Date",B[p]=F+"Date",B[f]=F+"Month",B[d]=F+"FullYear",B[l]=F+"Hours",B[o]=F+"Minutes",B[a]=F+"Seconds",B[n]=F+"Milliseconds",B)[U],z=U===c?this.$D+(N-this.$W):N;if(U===f||U===d){var q=this.clone().set(p,1);q.$d[j](z),q.init(),this.$d=q.set(p,Math.min(this.$D,q.daysInMonth())).$d}else j&&this.$d[j](z);return this.init(),this},O.set=function(L,N){return this.clone().$set(L,N)},O.get=function(L){return this[I.p(L)]()},O.add=function(L,N){var B,U=this;L=Number(L);var F=I.p(N),j=function(J){var ee=M(U);return I.w(ee.date(ee.date()+Math.round(J*L)),U)};if(F===f)return this.set(f,this.$M+L);if(F===d)return this.set(d,this.$y+L);if(F===c)return j(1);if(F===h)return j(7);var z=(B={},B[o]=i,B[l]=s,B[a]=r,B)[F]||1,q=this.$d.getTime()+L*z;return I.w(q,this)},O.subtract=function(L,N){return this.add(-1*L,N)},O.format=function(L){var N=this,B=this.$locale();if(!this.isValid())return B.invalidDate||m;var U=L||"YYYY-MM-DDTHH:mm:ssZ",F=I.z(this),j=this.$H,z=this.$m,q=this.$M,J=B.weekdays,ee=B.months,ne=B.meridiem,se=function(ae,he,ye,Ee){return ae&&(ae[he]||ae(N,U))||ye[he].slice(0,Ee)},pe=function(ae){return I.s(j%12||12,ae,"0")},ge=ne||function(ae,he,ye){var Ee=ae<12?"AM":"PM";return ye?Ee.toLowerCase():Ee};return U.replace(y,function(ae,he){return he||function(ye){switch(ye){case"YY":return String(N.$y).slice(-2);case"YYYY":return I.s(N.$y,4,"0");case"M":return q+1;case"MM":return I.s(q+1,2,"0");case"MMM":return se(B.monthsShort,q,ee,3);case"MMMM":return se(ee,q);case"D":return N.$D;case"DD":return I.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return se(B.weekdaysMin,N.$W,J,2);case"ddd":return se(B.weekdaysShort,N.$W,J,3);case"dddd":return J[N.$W];case"H":return String(j);case"HH":return I.s(j,2,"0");case"h":return pe(1);case"hh":return pe(2);case"a":return ge(j,z,!0);case"A":return ge(j,z,!1);case"m":return String(z);case"mm":return I.s(z,2,"0");case"s":return String(N.$s);case"ss":return I.s(N.$s,2,"0");case"SSS":return I.s(N.$ms,3,"0");case"Z":return F}return null}(ae)||F.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(L,N,B){var U,F=this,j=I.p(N),z=M(L),q=(z.utcOffset()-this.utcOffset())*i,J=this-z,ee=function(){return I.m(F,z)};switch(j){case d:U=ee()/12;break;case f:U=ee();break;case u:U=ee()/3;break;case h:U=(J-q)/6048e5;break;case c:U=(J-q)/864e5;break;case l:U=J/s;break;case o:U=J/i;break;case a:U=J/r;break;default:U=J}return B?U:I.a(U)},O.daysInMonth=function(){return this.endOf(f).$D},O.$locale=function(){return A[this.$L]},O.locale=function(L,N){if(!L)return this.$L;var B=this.clone(),U=T(L,N,!0);return U&&(B.$L=U),B},O.clone=function(){return I.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},R}(),P=k.prototype;return M.prototype=P,[["$ms",n],["$s",a],["$m",o],["$H",l],["$W",c],["$M",f],["$y",d],["$D",p]].forEach(function(R){P[R[1]]=function(O){return this.$g(O,R[0],R[1])}}),M.extend=function(R,O){return R.$i||(R(O,k,M),R.$i=!0),M},M.locale=T,M.isDayjs=C,M.unix=function(R){return M(1e3*R)},M.en=A[w],M.Ls=A,M.p={},M})})(Z_);var ya=Z_.exports;const K_=Js(ya);var Q_={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Be,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d\d/,n=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},l=function(m){return(m=+m)+(m>68?1900:2e3)},c=function(m){return function(g){this[m]=+g}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(g){if(!g||g==="Z")return 0;var y=g.match(/([+-]|\d\d)/g),_=60*y[1]+(+y[2]||0);return _===0?0:y[0]==="+"?-_:_}(m)}],f=function(m){var g=o[m];return g&&(g.indexOf?g:g.s.concat(g.f))},u=function(m,g){var y,_=o.meridiem;if(_){for(var v=1;v<=24;v+=1)if(m.indexOf(_(v,0,g))>-1){y=v>12;break}}else y=m===(g?"pm":"PM");return y},d={A:[a,function(m){this.afternoon=u(m,!1)}],a:[a,function(m){this.afternoon=u(m,!0)}],S:[/\d/,function(m){this.milliseconds=100*+m}],SS:[s,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[n,c("seconds")],ss:[n,c("seconds")],m:[n,c("minutes")],mm:[n,c("minutes")],H:[n,c("hours")],h:[n,c("hours")],HH:[n,c("hours")],hh:[n,c("hours")],D:[n,c("day")],DD:[s,c("day")],Do:[a,function(m){var g=o.ordinal,y=m.match(/\d+/);if(this.day=y[0],g)for(var _=1;_<=31;_+=1)g(_).replace(/\[|\]/g,"")===m&&(this.day=_)}],M:[n,c("month")],MM:[s,c("month")],MMM:[a,function(m){var g=f("months"),y=(f("monthsShort")||g.map(function(_){return _.slice(0,3)})).indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(m){var g=f("months").indexOf(m)+1;if(g<1)throw new Error;this.month=g%12||g}],Y:[/[+-]?\d+/,c("year")],YY:[s,function(m){this.year=l(m)}],YYYY:[/\d{4}/,c("year")],Z:h,ZZ:h};function p(m){var g,y;g=m,y=o&&o.formats;for(var _=(m=g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(T,M,I){var k=I&&I.toUpperCase();return M||y[I]||r[I]||y[k].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(P,R,O){return R||O.slice(1)})})).match(i),v=_.length,b=0;b<v;b+=1){var w=_[b],A=d[w],S=A&&A[0],C=A&&A[1];_[b]=C?{regex:S,parser:C}:w.replace(/^\[|\]$/g,"")}return function(T){for(var M={},I=0,k=0;I<v;I+=1){var P=_[I];if(typeof P=="string")k+=P.length;else{var R=P.regex,O=P.parser,L=T.slice(k),N=R.exec(L)[0];O.call(M,N),T=T.replace(N,"")}}return function(B){var U=B.afternoon;if(U!==void 0){var F=B.hours;U?F<12&&(B.hours+=12):F===12&&(B.hours=0),delete B.afternoon}}(M),M}}return function(m,g,y){y.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(l=m.parseTwoDigitYear);var _=g.prototype,v=_.parse;_.parse=function(b){var w=b.date,A=b.utc,S=b.args;this.$u=A;var C=S[1];if(typeof C=="string"){var T=S[2]===!0,M=S[3]===!0,I=T||M,k=S[2];M&&(k=S[2]),o=this.$locale(),!T&&k&&(o=y.Ls[k]),this.$d=function(L,N,B){try{if(["x","X"].indexOf(N)>-1)return new Date((N==="X"?1e3:1)*L);var U=p(N)(L),F=U.year,j=U.month,z=U.day,q=U.hours,J=U.minutes,ee=U.seconds,ne=U.milliseconds,se=U.zone,pe=new Date,ge=z||(F||j?1:pe.getDate()),ae=F||pe.getFullYear(),he=0;F&&!j||(he=j>0?j-1:pe.getMonth());var ye=q||0,Ee=J||0,Ue=ee||0,qe=ne||0;return se?new Date(Date.UTC(ae,he,ge,ye,Ee,Ue,qe+60*se.offset*1e3)):B?new Date(Date.UTC(ae,he,ge,ye,Ee,Ue,qe)):new Date(ae,he,ge,ye,Ee,Ue,qe)}catch{return new Date("")}}(w,C,A),this.init(),k&&k!==!0&&(this.$L=this.locale(k).$L),I&&w!=this.format(C)&&(this.$d=new Date("")),o={}}else if(C instanceof Array)for(var P=C.length,R=1;R<=P;R+=1){S[1]=C[R-1];var O=y.apply(this,S);if(O.isValid()){this.$d=O.$d,this.$L=O.$L,this.init();break}R===P&&(this.$d=new Date(""))}else v.call(this,b)}}})})(Q_);var lk=Q_.exports;const ck=Js(lk);var J_={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Be,function(){return function(r,i,s){r=r||{};var n=i.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(c,h,f,u){return n.fromToBase(c,h,f,u)}s.en.relativeTime=a,n.fromToBase=function(c,h,f,u,d){for(var p,m,g,y=f.$locale().relativeTime||a,_=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],v=_.length,b=0;b<v;b+=1){var w=_[b];w.d&&(p=u?s(c).diff(f,w.d,!0):f.diff(c,w.d,!0));var A=(r.rounding||Math.round)(Math.abs(p));if(g=p>0,A<=w.r||!w.r){A<=1&&b>0&&(w=_[b-1]);var S=y[w.l];d&&(A=d(""+A)),m=typeof S=="string"?S.replace("%d",A):S(A,h,w.l,g);break}}if(h)return m;var C=g?y.future:y.past;return typeof C=="function"?C(m):C.replace("%s",m)},n.to=function(c,h){return o(c,h,this,!0)},n.from=function(c,h){return o(c,h,this)};var l=function(c){return c.$u?s.utc():s()};n.toNow=function(c){return this.to(l(this),c)},n.fromNow=function(c){return this.from(l(this),c)}}})})(J_);var hk=J_.exports;const uk=Js(hk);var dk={exports:{}};(function(t,e){(function(r,i){t.exports=i(ya)})(Be,function(r){function i(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var s=i(r),n={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function a(l,c,h){var f=n[h];return Array.isArray(f)&&(f=f[c?0:1]),f.replace("%d",l)}var o={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(l){return l+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a}};return s.default.locale(o,null,!0),o})})(dk);var fk={exports:{}};(function(t,e){(function(r,i){t.exports=i(ya)})(Be,function(r){function i(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var s=i(r),n={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return a+"º"}};return s.default.locale(n,null,!0),n})})(fk);var pk={exports:{}};(function(t,e){(function(r,i){t.exports=i(ya)})(Be,function(r){function i(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var s=i(r),n={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(a){return a+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return s.default.locale(n,null,!0),n})})(pk);var mk={exports:{}};(function(t,e){(function(r,i){t.exports=i(ya)})(Be,function(r){function i(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var s=i(r),n={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return""+a+(a===1?"er":"")}};return s.default.locale(n,null,!0),n})})(mk);var gk={exports:{}};(function(t,e){(function(r,i){t.exports=i(ya)})(Be,function(r){function i(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var s=i(r),n={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(a){return a+"º"}};return s.default.locale(n,null,!0),n})})(gk);var sn=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(sn||{}),e1=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(e1||{}),Cf=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(Cf||{}),ie=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(ie||{}),Nr=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(Nr||{}),G=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(G||{}),Rn=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(Rn||{}),te=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(te||{}),W=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(W||{}),ai=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(ai||{}),qi=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(qi||{}),Vr=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(Vr||{}),_t=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(_t||{}),Mr=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(Mr||{}),vm=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(vm||{}),Xt=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(Xt||{}),He=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(He||{}),$e=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))($e||{}),Ur=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(Ur||{});const vk={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},X={ADAPTER:vk,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var zu=/iPhone/i,H0=/iPod/i,V0=/iPad/i,W0=/\biOS-universal(?:.+)Mac\b/i,Hu=/\bAndroid(?:.+)Mobile\b/i,X0=/Android/i,hn=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Fl=/Silk/i,Zr=/Windows Phone/i,Y0=/\bWindows(?:.+)ARM\b/i,q0=/BlackBerry/i,Z0=/BB10/i,K0=/Opera Mini/i,Q0=/\b(CriOS|Chrome)(?:.+)Mobile/i,J0=/Mobile(?:.+)Firefox\b/i,ev=function(t){return typeof t<"u"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function yk(t){return function(e){return e.test(t)}}function tv(t){var e={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var r=e.userAgent,i=r.split("[FBAN");typeof i[1]<"u"&&(r=i[0]),i=r.split("Twitter"),typeof i[1]<"u"&&(r=i[0]);var s=yk(r),n={apple:{phone:s(zu)&&!s(Zr),ipod:s(H0),tablet:!s(zu)&&(s(V0)||ev(e))&&!s(Zr),universal:s(W0),device:(s(zu)||s(H0)||s(V0)||s(W0)||ev(e))&&!s(Zr)},amazon:{phone:s(hn),tablet:!s(hn)&&s(Fl),device:s(hn)||s(Fl)},android:{phone:!s(Zr)&&s(hn)||!s(Zr)&&s(Hu),tablet:!s(Zr)&&!s(hn)&&!s(Hu)&&(s(Fl)||s(X0)),device:!s(Zr)&&(s(hn)||s(Fl)||s(Hu)||s(X0))||s(/\bokhttp\b/i)},windows:{phone:s(Zr),tablet:s(Y0),device:s(Zr)||s(Y0)},other:{blackberry:s(q0),blackberry10:s(Z0),opera:s(K0),firefox:s(J0),chrome:s(Q0),device:s(q0)||s(Z0)||s(K0)||s(J0)||s(Q0)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const bk=tv.default??tv,oi=bk(globalThis.navigator);X.RETINA_PREFIX=/@([0-9\.]+)x/;X.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var t1={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function s(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function n(l,c,h,f,u){if(typeof h!="function")throw new TypeError("The listener must be a function");var d=new s(h,f||l,u),p=r?r+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new i:delete l._events[c]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],h,f;if(this._eventsCount===0)return c;for(f in h=this._events)e.call(h,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},o.prototype.listeners=function(c){var h=r?r+c:c,f=this._events[h];if(!f)return[];if(f.fn)return[f.fn];for(var u=0,d=f.length,p=new Array(d);u<d;u++)p[u]=f[u].fn;return p},o.prototype.listenerCount=function(c){var h=r?r+c:c,f=this._events[h];return f?f.fn?1:f.length:0},o.prototype.emit=function(c,h,f,u,d,p){var m=r?r+c:c;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,_,v;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,h),!0;case 3:return g.fn.call(g.context,h,f),!0;case 4:return g.fn.call(g.context,h,f,u),!0;case 5:return g.fn.call(g.context,h,f,u,d),!0;case 6:return g.fn.call(g.context,h,f,u,d,p),!0}for(v=1,_=new Array(y-1);v<y;v++)_[v-1]=arguments[v];g.fn.apply(g.context,_)}else{var b=g.length,w;for(v=0;v<b;v++)switch(g[v].once&&this.removeListener(c,g[v].fn,void 0,!0),y){case 1:g[v].fn.call(g[v].context);break;case 2:g[v].fn.call(g[v].context,h);break;case 3:g[v].fn.call(g[v].context,h,f);break;case 4:g[v].fn.call(g[v].context,h,f,u);break;default:if(!_)for(w=1,_=new Array(y-1);w<y;w++)_[w-1]=arguments[w];g[v].fn.apply(g[v].context,_)}}return!0},o.prototype.on=function(c,h,f){return n(this,c,h,f,!1)},o.prototype.once=function(c,h,f){return n(this,c,h,f,!0)},o.prototype.removeListener=function(c,h,f,u){var d=r?r+c:c;if(!this._events[d])return this;if(!h)return a(this,d),this;var p=this._events[d];if(p.fn)p.fn===h&&(!u||p.once)&&(!f||p.context===f)&&a(this,d);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==h||u&&!p[m].once||f&&p[m].context!==f)&&g.push(p[m]);g.length?this._events[d]=g.length===1?g[0]:g:a(this,d)}return this},o.prototype.removeAllListeners=function(c){var h;return c?(h=r?r+c:c,this._events[h]&&a(this,h)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(t1);var xk=t1.exports;const pl=Js(xk);var ym={exports:{}};ym.exports=qh;ym.exports.default=qh;function qh(t,e,r){r=r||2;var i=e&&e.length,s=i?e[0]*r:t.length,n=r1(t,0,s,r,!0),a=[];if(!n||n.next===n.prev)return a;var o,l,c,h,f,u,d;if(i&&(n=Tk(t,e,n,r)),t.length>80*r){o=c=t[0],l=h=t[1];for(var p=r;p<s;p+=r)f=t[p],u=t[p+1],f<o&&(o=f),u<l&&(l=u),f>c&&(c=f),u>h&&(h=u);d=Math.max(c-o,h-l),d=d!==0?32767/d:0}return jo(n,a,r,o,l,d,0),a}function r1(t,e,r,i,s){var n,a;if(s===Pf(t,e,r,i)>0)for(n=e;n<r;n+=i)a=rv(n,t[n],t[n+1],a);else for(n=r-i;n>=e;n-=i)a=rv(n,t[n],t[n+1],a);return a&&Zh(a,a.next)&&(Go(a),a=a.next),a}function qs(t,e){if(!t)return t;e||(e=t);var r=t,i;do if(i=!1,!r.steiner&&(Zh(r,r.next)||Le(r.prev,r,r.next)===0)){if(Go(r),r=e=r.prev,r===r.next)break;i=!0}else r=r.next;while(i||r!==e);return e}function jo(t,e,r,i,s,n,a){if(t){!a&&n&&Pk(t,i,s,n);for(var o=t,l,c;t.prev!==t.next;){if(l=t.prev,c=t.next,n?wk(t,i,s,n):_k(t)){e.push(l.i/r|0),e.push(t.i/r|0),e.push(c.i/r|0),Go(t),t=c.next,o=c.next;continue}if(t=c,t===o){a?a===1?(t=Ek(qs(t),e,r),jo(t,e,r,i,s,n,2)):a===2&&Sk(t,e,r,i,s,n):jo(qs(t),e,r,i,s,n,1);break}}}}function _k(t){var e=t.prev,r=t,i=t.next;if(Le(e,r,i)>=0)return!1;for(var s=e.x,n=r.x,a=i.x,o=e.y,l=r.y,c=i.y,h=s<n?s<a?s:a:n<a?n:a,f=o<l?o<c?o:c:l<c?l:c,u=s>n?s>a?s:a:n>a?n:a,d=o>l?o>c?o:c:l>c?l:c,p=i.next;p!==e;){if(p.x>=h&&p.x<=u&&p.y>=f&&p.y<=d&&En(s,o,n,l,a,c,p.x,p.y)&&Le(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function wk(t,e,r,i){var s=t.prev,n=t,a=t.next;if(Le(s,n,a)>=0)return!1;for(var o=s.x,l=n.x,c=a.x,h=s.y,f=n.y,u=a.y,d=o<l?o<c?o:c:l<c?l:c,p=h<f?h<u?h:u:f<u?f:u,m=o>l?o>c?o:c:l>c?l:c,g=h>f?h>u?h:u:f>u?f:u,y=If(d,p,e,r,i),_=If(m,g,e,r,i),v=t.prevZ,b=t.nextZ;v&&v.z>=y&&b&&b.z<=_;){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==a&&En(o,h,l,f,c,u,v.x,v.y)&&Le(v.prev,v,v.next)>=0||(v=v.prevZ,b.x>=d&&b.x<=m&&b.y>=p&&b.y<=g&&b!==s&&b!==a&&En(o,h,l,f,c,u,b.x,b.y)&&Le(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;v&&v.z>=y;){if(v.x>=d&&v.x<=m&&v.y>=p&&v.y<=g&&v!==s&&v!==a&&En(o,h,l,f,c,u,v.x,v.y)&&Le(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=_;){if(b.x>=d&&b.x<=m&&b.y>=p&&b.y<=g&&b!==s&&b!==a&&En(o,h,l,f,c,u,b.x,b.y)&&Le(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Ek(t,e,r){var i=t;do{var s=i.prev,n=i.next.next;!Zh(s,n)&&i1(s,i,i.next,n)&&$o(s,n)&&$o(n,s)&&(e.push(s.i/r|0),e.push(i.i/r|0),e.push(n.i/r|0),Go(i),Go(i.next),i=t=n),i=i.next}while(i!==t);return qs(i)}function Sk(t,e,r,i,s,n){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&kk(a,o)){var l=s1(a,o);a=qs(a,a.next),l=qs(l,l.next),jo(a,e,r,i,s,n,0),jo(l,e,r,i,s,n,0);return}o=o.next}a=a.next}while(a!==t)}function Tk(t,e,r,i){var s=[],n,a,o,l,c;for(n=0,a=e.length;n<a;n++)o=e[n]*i,l=n<a-1?e[n+1]*i:t.length,c=r1(t,o,l,i,!1),c===c.next&&(c.steiner=!0),s.push(Ok(c));for(s.sort(Ak),n=0;n<s.length;n++)r=Ck(s[n],r);return r}function Ak(t,e){return t.x-e.x}function Ck(t,e){var r=Ik(t,e);if(!r)return e;var i=s1(r,t);return qs(i,i.next),qs(r,r.next)}function Ik(t,e){var r=e,i=t.x,s=t.y,n=-1/0,a;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var o=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=i&&o>n&&(n=o,a=r.x<r.next.x?r:r.next,o===i))return a}r=r.next}while(r!==e);if(!a)return null;var l=a,c=a.x,h=a.y,f=1/0,u;r=a;do i>=r.x&&r.x>=c&&i!==r.x&&En(s<h?i:n,s,c,h,s<h?n:i,s,r.x,r.y)&&(u=Math.abs(s-r.y)/(i-r.x),$o(r,t)&&(u<f||u===f&&(r.x>a.x||r.x===a.x&&Rk(a,r)))&&(a=r,f=u)),r=r.next;while(r!==l);return a}function Rk(t,e){return Le(t.prev,t,e.prev)<0&&Le(e.next,t,t.next)<0}function Pk(t,e,r,i){var s=t;do s.z===0&&(s.z=If(s.x,s.y,e,r,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,Mk(s)}function Mk(t){var e,r,i,s,n,a,o,l,c=1;do{for(r=t,t=null,n=null,a=0;r;){for(a++,i=r,o=0,e=0;e<c&&(o++,i=i.nextZ,!!i);e++);for(l=c;o>0||l>0&&i;)o!==0&&(l===0||!i||r.z<=i.z)?(s=r,r=r.nextZ,o--):(s=i,i=i.nextZ,l--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;r=i}n.nextZ=null,c*=2}while(a>1);return t}function If(t,e,r,i,s){return t=(t-r)*s|0,e=(e-i)*s|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Ok(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function En(t,e,r,i,s,n,a,o){return(s-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(i-o)>=(r-a)*(e-o)&&(r-a)*(n-o)>=(s-a)*(i-o)}function kk(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Dk(t,e)&&($o(t,e)&&$o(e,t)&&Nk(t,e)&&(Le(t.prev,t,e.prev)||Le(t,e.prev,e))||Zh(t,e)&&Le(t.prev,t,t.next)>0&&Le(e.prev,e,e.next)>0)}function Le(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Zh(t,e){return t.x===e.x&&t.y===e.y}function i1(t,e,r,i){var s=jl(Le(t,e,r)),n=jl(Le(t,e,i)),a=jl(Le(r,i,t)),o=jl(Le(r,i,e));return!!(s!==n&&a!==o||s===0&&Ul(t,r,e)||n===0&&Ul(t,i,e)||a===0&&Ul(r,t,i)||o===0&&Ul(r,e,i))}function Ul(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function jl(t){return t>0?1:t<0?-1:0}function Dk(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&i1(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function $o(t,e){return Le(t.prev,t,t.next)<0?Le(t,e,t.next)>=0&&Le(t,t.prev,e)>=0:Le(t,e,t.prev)<0||Le(t,t.next,e)<0}function Nk(t,e){var r=t,i=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do r.y>n!=r.next.y>n&&r.next.y!==r.y&&s<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function s1(t,e){var r=new Rf(t.i,t.x,t.y),i=new Rf(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=s,s.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function rv(t,e,r,i){var s=new Rf(t,e,r);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Go(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Rf(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}qh.deviation=function(t,e,r,i){var s=e&&e.length,n=s?e[0]*r:t.length,a=Math.abs(Pf(t,0,n,r));if(s)for(var o=0,l=e.length;o<l;o++){var c=e[o]*r,h=o<l-1?e[o+1]*r:t.length;a-=Math.abs(Pf(t,c,h,r))}var f=0;for(o=0;o<i.length;o+=3){var u=i[o]*r,d=i[o+1]*r,p=i[o+2]*r;f+=Math.abs((t[u]-t[p])*(t[d+1]-t[u+1])-(t[u]-t[d])*(t[p+1]-t[u+1]))}return a===0&&f===0?0:Math.abs((f-a)/a)};function Pf(t,e,r,i){for(var s=0,n=e,a=r-i;n<r;n+=i)s+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return s}qh.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,s=0;s<t.length;s++){for(var n=0;n<t[s].length;n++)for(var a=0;a<e;a++)r.vertices.push(t[s][n][a]);s>0&&(i+=t[s-1].length,r.holes.push(i))}return r};var Lk=ym.exports;const Bk=Js(Lk);var eh={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */eh.exports;(function(t,e){(function(r){var i=e&&!e.nodeType&&e,s=t&&!t.nodeType&&t,n=typeof Be=="object"&&Be;(n.global===n||n.window===n||n.self===n)&&(r=n);var a,o=2147483647,l=36,c=1,h=26,f=38,u=700,d=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=l-c,w=Math.floor,A=String.fromCharCode,S;function C(F){throw new RangeError(v[F])}function T(F,j){for(var z=F.length,q=[];z--;)q[z]=j(F[z]);return q}function M(F,j){var z=F.split("@"),q="";z.length>1&&(q=z[0]+"@",F=z[1]),F=F.replace(_,".");var J=F.split("."),ee=T(J,j).join(".");return q+ee}function I(F){for(var j=[],z=0,q=F.length,J,ee;z<q;)J=F.charCodeAt(z++),J>=55296&&J<=56319&&z<q?(ee=F.charCodeAt(z++),(ee&64512)==56320?j.push(((J&1023)<<10)+(ee&1023)+65536):(j.push(J),z--)):j.push(J);return j}function k(F){return T(F,function(j){var z="";return j>65535&&(j-=65536,z+=A(j>>>10&1023|55296),j=56320|j&1023),z+=A(j),z}).join("")}function P(F){return F-48<10?F-22:F-65<26?F-65:F-97<26?F-97:l}function R(F,j){return F+22+75*(F<26)-((j!=0)<<5)}function O(F,j,z){var q=0;for(F=z?w(F/u):F>>1,F+=w(F/j);F>b*h>>1;q+=l)F=w(F/b);return w(q+(b+1)*F/(F+f))}function L(F){var j=[],z=F.length,q,J=0,ee=p,ne=d,se,pe,ge,ae,he,ye,Ee,Ue,qe;for(se=F.lastIndexOf(m),se<0&&(se=0),pe=0;pe<se;++pe)F.charCodeAt(pe)>=128&&C("not-basic"),j.push(F.charCodeAt(pe));for(ge=se>0?se+1:0;ge<z;){for(ae=J,he=1,ye=l;ge>=z&&C("invalid-input"),Ee=P(F.charCodeAt(ge++)),(Ee>=l||Ee>w((o-J)/he))&&C("overflow"),J+=Ee*he,Ue=ye<=ne?c:ye>=ne+h?h:ye-ne,!(Ee<Ue);ye+=l)qe=l-Ue,he>w(o/qe)&&C("overflow"),he*=qe;q=j.length+1,ne=O(J-ae,q,ae==0),w(J/q)>o-ee&&C("overflow"),ee+=w(J/q),J%=q,j.splice(J++,0,ee)}return k(j)}function N(F){var j,z,q,J,ee,ne,se,pe,ge,ae,he,ye=[],Ee,Ue,qe,Tt;for(F=I(F),Ee=F.length,j=p,z=0,ee=d,ne=0;ne<Ee;++ne)he=F[ne],he<128&&ye.push(A(he));for(q=J=ye.length,J&&ye.push(m);q<Ee;){for(se=o,ne=0;ne<Ee;++ne)he=F[ne],he>=j&&he<se&&(se=he);for(Ue=q+1,se-j>w((o-z)/Ue)&&C("overflow"),z+=(se-j)*Ue,j=se,ne=0;ne<Ee;++ne)if(he=F[ne],he<j&&++z>o&&C("overflow"),he==j){for(pe=z,ge=l;ae=ge<=ee?c:ge>=ee+h?h:ge-ee,!(pe<ae);ge+=l)Tt=pe-ae,qe=l-ae,ye.push(A(R(ae+Tt%qe,0))),pe=w(Tt/qe);ye.push(A(R(pe,0))),ee=O(z,Ue,q==J),z=0,++q}++z,++j}return ye.join("")}function B(F){return M(F,function(j){return g.test(j)?L(j.slice(4).toLowerCase()):j})}function U(F){return M(F,function(j){return y.test(j)?"xn--"+N(j):j})}if(a={version:"1.4.1",ucs2:{decode:I,encode:k},decode:L,encode:N,toASCII:U,toUnicode:B},i&&s)if(t.exports==i)s.exports=a;else for(S in a)a.hasOwnProperty(S)&&(i[S]=a[S]);else r.punycode=a})(Be)})(eh,eh.exports);var Fk=eh.exports,Uk=Error,jk=EvalError,$k=RangeError,Gk=ReferenceError,n1=SyntaxError,ml=TypeError,zk=URIError,Hk=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;e[r]=s;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var n=Object.getOwnPropertySymbols(e);if(n.length!==1||n[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,r);if(a.value!==s||a.enumerable!==!0)return!1}return!0},iv=typeof Symbol<"u"&&Symbol,Vk=Hk,Wk=function(){return typeof iv!="function"||typeof Symbol!="function"||typeof iv("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Vk()},sv={foo:{}},Xk=Object,Yk=function(){return{__proto__:sv}.foo===sv.foo&&!({__proto__:null}instanceof Xk)},qk="Function.prototype.bind called on incompatible ",Zk=Object.prototype.toString,Kk=Math.max,Qk="[object Function]",nv=function(e,r){for(var i=[],s=0;s<e.length;s+=1)i[s]=e[s];for(var n=0;n<r.length;n+=1)i[n+e.length]=r[n];return i},Jk=function(e,r){for(var i=[],s=r||0,n=0;s<e.length;s+=1,n+=1)i[n]=e[s];return i},e3=function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r},t3=function(e){var r=this;if(typeof r!="function"||Zk.apply(r)!==Qk)throw new TypeError(qk+r);for(var i=Jk(arguments,1),s,n=function(){if(this instanceof s){var h=r.apply(this,nv(i,arguments));return Object(h)===h?h:this}return r.apply(e,nv(i,arguments))},a=Kk(0,r.length-i.length),o=[],l=0;l<a;l++)o[l]="$"+l;if(s=Function("binder","return function ("+e3(o,",")+"){ return binder.apply(this,arguments); }")(n),r.prototype){var c=function(){};c.prototype=r.prototype,s.prototype=new c,c.prototype=null}return s},r3=t3,bm=Function.prototype.bind||r3,i3=Function.prototype.call,s3=Object.prototype.hasOwnProperty,n3=bm,a3=n3.call(i3,s3),_e,o3=Uk,l3=jk,c3=$k,h3=Gk,oa=n1,Pn=ml,u3=zk,a1=Function,Vu=function(t){try{return a1('"use strict"; return ('+t+").constructor;")()}catch{}},Fs=Object.getOwnPropertyDescriptor;if(Fs)try{Fs({},"")}catch{Fs=null}var Wu=function(){throw new Pn},d3=Fs?function(){try{return arguments.callee,Wu}catch{try{return Fs(arguments,"callee").get}catch{return Wu}}}():Wu,un=Wk(),f3=Yk(),Qe=Object.getPrototypeOf||(f3?function(t){return t.__proto__}:null),mn={},p3=typeof Uint8Array>"u"||!Qe?_e:Qe(Uint8Array),Us={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?_e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?_e:ArrayBuffer,"%ArrayIteratorPrototype%":un&&Qe?Qe([][Symbol.iterator]()):_e,"%AsyncFromSyncIteratorPrototype%":_e,"%AsyncFunction%":mn,"%AsyncGenerator%":mn,"%AsyncGeneratorFunction%":mn,"%AsyncIteratorPrototype%":mn,"%Atomics%":typeof Atomics>"u"?_e:Atomics,"%BigInt%":typeof BigInt>"u"?_e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?_e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?_e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?_e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o3,"%eval%":eval,"%EvalError%":l3,"%Float32Array%":typeof Float32Array>"u"?_e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?_e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?_e:FinalizationRegistry,"%Function%":a1,"%GeneratorFunction%":mn,"%Int8Array%":typeof Int8Array>"u"?_e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?_e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?_e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":un&&Qe?Qe(Qe([][Symbol.iterator]())):_e,"%JSON%":typeof JSON=="object"?JSON:_e,"%Map%":typeof Map>"u"?_e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!un||!Qe?_e:Qe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?_e:Promise,"%Proxy%":typeof Proxy>"u"?_e:Proxy,"%RangeError%":c3,"%ReferenceError%":h3,"%Reflect%":typeof Reflect>"u"?_e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?_e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!un||!Qe?_e:Qe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?_e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":un&&Qe?Qe(""[Symbol.iterator]()):_e,"%Symbol%":un?Symbol:_e,"%SyntaxError%":oa,"%ThrowTypeError%":d3,"%TypedArray%":p3,"%TypeError%":Pn,"%Uint8Array%":typeof Uint8Array>"u"?_e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?_e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?_e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?_e:Uint32Array,"%URIError%":u3,"%WeakMap%":typeof WeakMap>"u"?_e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?_e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?_e:WeakSet};if(Qe)try{null.error}catch(t){var m3=Qe(Qe(t));Us["%Error.prototype%"]=m3}var g3=function t(e){var r;if(e==="%AsyncFunction%")r=Vu("async function () {}");else if(e==="%GeneratorFunction%")r=Vu("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Vu("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Qe&&(r=Qe(s.prototype))}return Us[e]=r,r},av={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gl=bm,th=a3,v3=gl.call(Function.call,Array.prototype.concat),y3=gl.call(Function.apply,Array.prototype.splice),ov=gl.call(Function.call,String.prototype.replace),rh=gl.call(Function.call,String.prototype.slice),b3=gl.call(Function.call,RegExp.prototype.exec),x3=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_3=/\\(\\)?/g,w3=function(e){var r=rh(e,0,1),i=rh(e,-1);if(r==="%"&&i!=="%")throw new oa("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new oa("invalid intrinsic syntax, expected opening `%`");var s=[];return ov(e,x3,function(n,a,o,l){s[s.length]=o?ov(l,_3,"$1"):a||n}),s},E3=function(e,r){var i=e,s;if(th(av,i)&&(s=av[i],i="%"+s[0]+"%"),th(Us,i)){var n=Us[i];if(n===mn&&(n=g3(i)),typeof n>"u"&&!r)throw new Pn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:s,name:i,value:n}}throw new oa("intrinsic "+e+" does not exist!")},nn=function(e,r){if(typeof e!="string"||e.length===0)throw new Pn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Pn('"allowMissing" argument must be a boolean');if(b3(/^%?[^%]*%?$/,e)===null)throw new oa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=w3(e),s=i.length>0?i[0]:"",n=E3("%"+s+"%",r),a=n.name,o=n.value,l=!1,c=n.alias;c&&(s=c[0],y3(i,v3([0,1],c)));for(var h=1,f=!0;h<i.length;h+=1){var u=i[h],d=rh(u,0,1),p=rh(u,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new oa("property names with quotes must have matching quotes");if((u==="constructor"||!f)&&(l=!0),s+="."+u,a="%"+s+"%",th(Us,a))o=Us[a];else if(o!=null){if(!(u in o)){if(!r)throw new Pn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Fs&&h+1>=i.length){var m=Fs(o,u);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[u]}else f=th(o,u),o=o[u];f&&!l&&(Us[a]=o)}}return o},o1={exports:{}},S3=nn,Mf=S3("%Object.defineProperty%",!0),Of=function(){if(Mf)try{return Mf({},"a",{value:1}),!0}catch{return!1}return!1};Of.hasArrayLengthDefineBug=function(){if(!Of())return null;try{return Mf([],"length",{value:1}).length!==1}catch{return!0}};var l1=Of,T3=nn,Ec=T3("%Object.getOwnPropertyDescriptor%",!0);if(Ec)try{Ec([],"length")}catch{Ec=null}var c1=Ec,A3=l1(),C3=nn,oo=A3&&C3("%Object.defineProperty%",!0);if(oo)try{oo({},"a",{value:1})}catch{oo=!1}var I3=n1,dn=ml,lv=c1,R3=function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new dn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new dn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new dn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new dn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new dn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new dn("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!lv&&lv(e,r);if(oo)oo(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:s===null&&l?l.enumerable:!s,value:i,writable:n===null&&l?l.writable:!n});else if(o||!s&&!n&&!a)e[r]=i;else throw new I3("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},P3=nn,cv=R3,M3=l1(),hv=c1,uv=ml,O3=P3("%Math.floor%"),k3=function(e,r){if(typeof e!="function")throw new uv("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||O3(r)!==r)throw new uv("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],s=!0,n=!0;if("length"in e&&hv){var a=hv(e,"length");a&&!a.configurable&&(s=!1),a&&!a.writable&&(n=!1)}return(s||n||!i)&&(M3?cv(e,"length",r,!0,!0):cv(e,"length",r)),e};(function(t){var e=bm,r=nn,i=k3,s=ml,n=r("%Function.prototype.apply%"),a=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(a,n),l=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}t.exports=function(u){if(typeof u!="function")throw new s("a function is required");var d=o(e,a,arguments);return i(d,1+c(0,u.length-(arguments.length-1)),!0)};var h=function(){return o(e,n,arguments)};l?l(t.exports,"apply",{value:h}):t.exports.apply=h})(o1);var D3=o1.exports,h1=nn,u1=D3,N3=u1(h1("String.prototype.indexOf")),L3=function(e,r){var i=h1(e,!!r);return typeof i=="function"&&N3(e,".prototype.")>-1?u1(i):i};const B3={},F3=Object.freeze(Object.defineProperty({__proto__:null,default:B3},Symbol.toStringTag,{value:"Module"})),U3=uE(F3);var xm=typeof Map=="function"&&Map.prototype,Xu=Object.getOwnPropertyDescriptor&&xm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ih=xm&&Xu&&typeof Xu.get=="function"?Xu.get:null,dv=xm&&Map.prototype.forEach,_m=typeof Set=="function"&&Set.prototype,Yu=Object.getOwnPropertyDescriptor&&_m?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,sh=_m&&Yu&&typeof Yu.get=="function"?Yu.get:null,fv=_m&&Set.prototype.forEach,j3=typeof WeakMap=="function"&&WeakMap.prototype,lo=j3?WeakMap.prototype.has:null,$3=typeof WeakSet=="function"&&WeakSet.prototype,co=$3?WeakSet.prototype.has:null,G3=typeof WeakRef=="function"&&WeakRef.prototype,pv=G3?WeakRef.prototype.deref:null,z3=Boolean.prototype.valueOf,H3=Object.prototype.toString,V3=Function.prototype.toString,W3=String.prototype.match,wm=String.prototype.slice,ji=String.prototype.replace,X3=String.prototype.toUpperCase,mv=String.prototype.toLowerCase,d1=RegExp.prototype.test,gv=Array.prototype.concat,Or=Array.prototype.join,Y3=Array.prototype.slice,vv=Math.floor,kf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,qu=Object.getOwnPropertySymbols,Df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,la=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ct=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===la||!0)?Symbol.toStringTag:null,f1=Object.prototype.propertyIsEnumerable,yv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function bv(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||d1.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-vv(-t):vv(t);if(i!==t){var s=String(i),n=wm.call(e,s.length+1);return ji.call(s,r,"$&_")+"."+ji.call(ji.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ji.call(e,r,"$&_")}var Nf=U3,xv=Nf.custom,_v=m1(xv)?xv:null,q3=function t(e,r,i,s){var n=r||{};if(Ei(n,"quoteStyle")&&n.quoteStyle!=="single"&&n.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ei(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Ei(n,"customInspect")?n.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ei(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ei(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=n.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return v1(e,n);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return o?bv(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return o?bv(e,c):c}var h=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=h&&h>0&&typeof e=="object")return Lf(e)?"[Array]":"[Object]";var f=fD(n,i);if(typeof s>"u")s=[];else if(g1(s,e)>=0)return"[Circular]";function u(P,R,O){if(R&&(s=Y3.call(s),s.push(R)),O){var L={depth:n.depth};return Ei(n,"quoteStyle")&&(L.quoteStyle=n.quoteStyle),t(P,L,i+1,s)}return t(P,n,i+1,s)}if(typeof e=="function"&&!wv(e)){var d=sD(e),p=$l(e,u);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+Or.call(p,", ")+" }":"")}if(m1(e)){var m=la?ji.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Df.call(e);return typeof e=="object"&&!la?Ma(m):m}if(hD(e)){for(var g="<"+mv.call(String(e.nodeName)),y=e.attributes||[],_=0;_<y.length;_++)g+=" "+y[_].name+"="+p1(Z3(y[_].value),"double",n);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+mv.call(String(e.nodeName))+">",g}if(Lf(e)){if(e.length===0)return"[]";var v=$l(e,u);return f&&!dD(v)?"["+Bf(v,f)+"]":"[ "+Or.call(v,", ")+" ]"}if(Q3(e)){var b=$l(e,u);return!("cause"in Error.prototype)&&"cause"in e&&!f1.call(e,"cause")?"{ ["+String(e)+"] "+Or.call(gv.call("[cause]: "+u(e.cause),b),", ")+" }":b.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Or.call(b,", ")+" }"}if(typeof e=="object"&&a){if(_v&&typeof e[_v]=="function"&&Nf)return Nf(e,{depth:h-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(nD(e)){var w=[];return dv&&dv.call(e,function(P,R){w.push(u(R,e,!0)+" => "+u(P,e))}),Ev("Map",ih.call(e),w,f)}if(lD(e)){var A=[];return fv&&fv.call(e,function(P){A.push(u(P,e))}),Ev("Set",sh.call(e),A,f)}if(aD(e))return Zu("WeakMap");if(cD(e))return Zu("WeakSet");if(oD(e))return Zu("WeakRef");if(eD(e))return Ma(u(Number(e)));if(rD(e))return Ma(u(kf.call(e)));if(tD(e))return Ma(z3.call(e));if(J3(e))return Ma(u(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Be)return"{ [object globalThis] }";if(!K3(e)&&!wv(e)){var S=$l(e,u),C=yv?yv(e)===Object.prototype:e instanceof Object||e.constructor===Object,T=e instanceof Object?"":"null prototype",M=!C&&ct&&Object(e)===e&&ct in e?wm.call(ls(e),8,-1):T?"Object":"",I=C||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",k=I+(M||T?"["+Or.call(gv.call([],M||[],T||[]),": ")+"] ":"");return S.length===0?k+"{}":f?k+"{"+Bf(S,f)+"}":k+"{ "+Or.call(S,", ")+" }"}return String(e)};function p1(t,e,r){var i=(r.quoteStyle||e)==="double"?'"':"'";return i+t+i}function Z3(t){return ji.call(String(t),/"/g,"&quot;")}function Lf(t){return ls(t)==="[object Array]"&&(!ct||!(typeof t=="object"&&ct in t))}function K3(t){return ls(t)==="[object Date]"&&(!ct||!(typeof t=="object"&&ct in t))}function wv(t){return ls(t)==="[object RegExp]"&&(!ct||!(typeof t=="object"&&ct in t))}function Q3(t){return ls(t)==="[object Error]"&&(!ct||!(typeof t=="object"&&ct in t))}function J3(t){return ls(t)==="[object String]"&&(!ct||!(typeof t=="object"&&ct in t))}function eD(t){return ls(t)==="[object Number]"&&(!ct||!(typeof t=="object"&&ct in t))}function tD(t){return ls(t)==="[object Boolean]"&&(!ct||!(typeof t=="object"&&ct in t))}function m1(t){if(la)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Df)return!1;try{return Df.call(t),!0}catch{}return!1}function rD(t){if(!t||typeof t!="object"||!kf)return!1;try{return kf.call(t),!0}catch{}return!1}var iD=Object.prototype.hasOwnProperty||function(t){return t in this};function Ei(t,e){return iD.call(t,e)}function ls(t){return H3.call(t)}function sD(t){if(t.name)return t.name;var e=W3.call(V3.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function g1(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function nD(t){if(!ih||!t||typeof t!="object")return!1;try{ih.call(t);try{sh.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function aD(t){if(!lo||!t||typeof t!="object")return!1;try{lo.call(t,lo);try{co.call(t,co)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function oD(t){if(!pv||!t||typeof t!="object")return!1;try{return pv.call(t),!0}catch{}return!1}function lD(t){if(!sh||!t||typeof t!="object")return!1;try{sh.call(t);try{ih.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function cD(t){if(!co||!t||typeof t!="object")return!1;try{co.call(t,co);try{lo.call(t,lo)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function hD(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function v1(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return v1(wm.call(t,0,e.maxStringLength),e)+i}var s=ji.call(ji.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,uD);return p1(s,"single",e)}function uD(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+X3.call(e.toString(16))}function Ma(t){return"Object("+t+")"}function Zu(t){return t+" { ? }"}function Ev(t,e,r,i){var s=i?Bf(r,i):Or.call(r,", ");return t+" ("+e+") {"+s+"}"}function dD(t){for(var e=0;e<t.length;e++)if(g1(t[e],`
188
- `)>=0)return!1;return!0}function fD(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Or.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Or.call(Array(e+1),r)}}function Bf(t,e){if(t.length===0)return"";var r=`
189
- `+e.prev+e.base;return r+Or.call(t,","+r)+`
190
- `+e.prev}function $l(t,e){var r=Lf(t),i=[];if(r){i.length=t.length;for(var s=0;s<t.length;s++)i[s]=Ei(t,s)?e(t[s],t):""}var n=typeof qu=="function"?qu(t):[],a;if(la){a={};for(var o=0;o<n.length;o++)a["$"+n[o]]=n[o]}for(var l in t)Ei(t,l)&&(r&&String(Number(l))===l&&l<t.length||la&&a["$"+l]instanceof Symbol||(d1.call(/[^\w$]/,l)?i.push(e(l,t)+": "+e(t[l],t)):i.push(l+": "+e(t[l],t))));if(typeof qu=="function")for(var c=0;c<n.length;c++)f1.call(t,n[c])&&i.push("["+e(n[c])+"]: "+e(t[n[c]],t));return i}var y1=nn,ba=L3,pD=q3,mD=ml,Gl=y1("%WeakMap%",!0),zl=y1("%Map%",!0),gD=ba("WeakMap.prototype.get",!0),vD=ba("WeakMap.prototype.set",!0),yD=ba("WeakMap.prototype.has",!0),bD=ba("Map.prototype.get",!0),xD=ba("Map.prototype.set",!0),_D=ba("Map.prototype.has",!0),Em=function(t,e){for(var r=t,i;(i=r.next)!==null;r=i)if(i.key===e)return r.next=i.next,i.next=t.next,t.next=i,i},wD=function(t,e){var r=Em(t,e);return r&&r.value},ED=function(t,e,r){var i=Em(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},SD=function(t,e){return!!Em(t,e)},TD=function(){var e,r,i,s={assert:function(n){if(!s.has(n))throw new mD("Side channel does not contain "+pD(n))},get:function(n){if(Gl&&n&&(typeof n=="object"||typeof n=="function")){if(e)return gD(e,n)}else if(zl){if(r)return bD(r,n)}else if(i)return wD(i,n)},has:function(n){if(Gl&&n&&(typeof n=="object"||typeof n=="function")){if(e)return yD(e,n)}else if(zl){if(r)return _D(r,n)}else if(i)return SD(i,n);return!1},set:function(n,a){Gl&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new Gl),vD(e,n,a)):zl?(r||(r=new zl),xD(r,n,a)):(i||(i={key:{},next:null}),ED(i,n,a))}};return s},AD=String.prototype.replace,CD=/%20/g,Ku={RFC1738:"RFC1738",RFC3986:"RFC3986"},Sm={default:Ku.RFC3986,formatters:{RFC1738:function(t){return AD.call(t,CD,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ku.RFC1738,RFC3986:Ku.RFC3986},ID=Sm,Qu=Object.prototype.hasOwnProperty,_s=Array.isArray,_r=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),RD=function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(_s(i)){for(var s=[],n=0;n<i.length;++n)typeof i[n]<"u"&&s.push(i[n]);r.obj[r.prop]=s}}},b1=function(e,r){for(var i=r&&r.plainObjects?Object.create(null):{},s=0;s<e.length;++s)typeof e[s]<"u"&&(i[s]=e[s]);return i},PD=function t(e,r,i){if(!r)return e;if(typeof r!="object"){if(_s(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Qu.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var s=e;return _s(e)&&!_s(r)&&(s=b1(e,i)),_s(e)&&_s(r)?(r.forEach(function(n,a){if(Qu.call(e,a)){var o=e[a];o&&typeof o=="object"&&n&&typeof n=="object"?e[a]=t(o,n,i):e.push(n)}else e[a]=n}),e):Object.keys(r).reduce(function(n,a){var o=r[a];return Qu.call(n,a)?n[a]=t(n[a],o,i):n[a]=o,n},s)},MD=function(e,r){return Object.keys(r).reduce(function(i,s){return i[s]=r[s],i},e)},OD=function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},kD=function(e,r,i,s,n){if(e.length===0)return e;var a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var o="",l=0;l<a.length;++l){var c=a.charCodeAt(l);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||n===ID.RFC1738&&(c===40||c===41)){o+=a.charAt(l);continue}if(c<128){o=o+_r[c];continue}if(c<2048){o=o+(_r[192|c>>6]+_r[128|c&63]);continue}if(c<55296||c>=57344){o=o+(_r[224|c>>12]+_r[128|c>>6&63]+_r[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|a.charCodeAt(l)&1023),o+=_r[240|c>>18]+_r[128|c>>12&63]+_r[128|c>>6&63]+_r[128|c&63]}return o},DD=function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],s=0;s<r.length;++s)for(var n=r[s],a=n.obj[n.prop],o=Object.keys(a),l=0;l<o.length;++l){var c=o[l],h=a[c];typeof h=="object"&&h!==null&&i.indexOf(h)===-1&&(r.push({obj:a,prop:c}),i.push(h))}return RD(r),e},ND=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},LD=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},BD=function(e,r){return[].concat(e,r)},FD=function(e,r){if(_s(e)){for(var i=[],s=0;s<e.length;s+=1)i.push(r(e[s]));return i}return r(e)},x1={arrayToObject:b1,assign:MD,combine:BD,compact:DD,decode:OD,encode:kD,isBuffer:LD,isRegExp:ND,maybeMap:FD,merge:PD},_1=TD,Sc=x1,ho=Sm,UD=Object.prototype.hasOwnProperty,Sv={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},si=Array.isArray,jD=Array.prototype.push,w1=function(t,e){jD.apply(t,si(e)?e:[e])},$D=Date.prototype.toISOString,Tv=ho.default,nt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sc.encode,encodeValuesOnly:!1,format:Tv,formatter:ho.formatters[Tv],indices:!1,serializeDate:function(e){return $D.call(e)},skipNulls:!1,strictNullHandling:!1},GD=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Ju={},zD=function t(e,r,i,s,n,a,o,l,c,h,f,u,d,p,m,g){for(var y=e,_=g,v=0,b=!1;(_=_.get(Ju))!==void 0&&!b;){var w=_.get(e);if(v+=1,typeof w<"u"){if(w===v)throw new RangeError("Cyclic object value");b=!0}typeof _.get(Ju)>"u"&&(v=0)}if(typeof l=="function"?y=l(r,y):y instanceof Date?y=f(y):i==="comma"&&si(y)&&(y=Sc.maybeMap(y,function(L){return L instanceof Date?f(L):L})),y===null){if(n)return o&&!p?o(r,nt.encoder,m,"key",u):r;y=""}if(GD(y)||Sc.isBuffer(y)){if(o){var A=p?r:o(r,nt.encoder,m,"key",u);return[d(A)+"="+d(o(y,nt.encoder,m,"value",u))]}return[d(r)+"="+d(String(y))]}var S=[];if(typeof y>"u")return S;var C;if(i==="comma"&&si(y))p&&o&&(y=Sc.maybeMap(y,o)),C=[{value:y.length>0?y.join(",")||null:void 0}];else if(si(l))C=l;else{var T=Object.keys(y);C=c?T.sort(c):T}for(var M=s&&si(y)&&y.length===1?r+"[]":r,I=0;I<C.length;++I){var k=C[I],P=typeof k=="object"&&typeof k.value<"u"?k.value:y[k];if(!(a&&P===null)){var R=si(y)?typeof i=="function"?i(M,k):M:M+(h?"."+k:"["+k+"]");g.set(e,v);var O=_1();O.set(Ju,g),w1(S,t(P,R,i,s,n,a,i==="comma"&&p&&si(y)?null:o,l,c,h,f,u,d,p,m,O))}}return S},HD=function(e){if(!e)return nt;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||nt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=ho.default;if(typeof e.format<"u"){if(!UD.call(ho.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var s=ho.formatters[i],n=nt.filter;return(typeof e.filter=="function"||si(e.filter))&&(n=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:nt.addQueryPrefix,allowDots:typeof e.allowDots>"u"?nt.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:nt.charsetSentinel,delimiter:typeof e.delimiter>"u"?nt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:nt.encode,encoder:typeof e.encoder=="function"?e.encoder:nt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:nt.encodeValuesOnly,filter:n,format:i,formatter:s,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:nt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:nt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:nt.strictNullHandling}},VD=function(t,e){var r=t,i=HD(e),s,n;typeof i.filter=="function"?(n=i.filter,r=n("",r)):si(i.filter)&&(n=i.filter,s=n);var a=[];if(typeof r!="object"||r===null)return"";var o;e&&e.arrayFormat in Sv?o=e.arrayFormat:e&&"indices"in e?o=e.indices?"indices":"repeat":o="indices";var l=Sv[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;s||(s=Object.keys(r)),i.sort&&s.sort(i.sort);for(var h=_1(),f=0;f<s.length;++f){var u=s[f];i.skipNulls&&r[u]===null||w1(a,zD(r[u],u,l,c,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,h))}var d=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},ca=x1,Ff=Object.prototype.hasOwnProperty,WD=Array.isArray,Ze={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ca.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},XD=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},E1=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},YD="utf8=%26%2310003%3B",qD="utf8=%E2%9C%93",ZD=function(e,r){var i={__proto__:null},s=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,n=r.parameterLimit===1/0?void 0:r.parameterLimit,a=s.split(r.delimiter,n),o=-1,l,c=r.charset;if(r.charsetSentinel)for(l=0;l<a.length;++l)a[l].indexOf("utf8=")===0&&(a[l]===qD?c="utf-8":a[l]===YD&&(c="iso-8859-1"),o=l,l=a.length);for(l=0;l<a.length;++l)if(l!==o){var h=a[l],f=h.indexOf("]="),u=f===-1?h.indexOf("="):f+1,d,p;u===-1?(d=r.decoder(h,Ze.decoder,c,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(h.slice(0,u),Ze.decoder,c,"key"),p=ca.maybeMap(E1(h.slice(u+1),r),function(m){return r.decoder(m,Ze.decoder,c,"value")})),p&&r.interpretNumericEntities&&c==="iso-8859-1"&&(p=XD(p)),h.indexOf("[]=")>-1&&(p=WD(p)?[p]:p),Ff.call(i,d)?i[d]=ca.combine(i[d],p):i[d]=p}return i},KD=function(t,e,r,i){for(var s=i?e:E1(e,r),n=t.length-1;n>=0;--n){var a,o=t[n];if(o==="[]"&&r.parseArrays)a=[].concat(s);else{a=r.plainObjects?Object.create(null):{};var l=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,c=parseInt(l,10);!r.parseArrays&&l===""?a={0:s}:!isNaN(c)&&o!==l&&String(c)===l&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(a=[],a[c]=s):l!=="__proto__"&&(a[l]=s)}s=a}return s},QD=function(e,r,i,s){if(e){var n=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,l=i.depth>0&&a.exec(n),c=l?n.slice(0,l.index):n,h=[];if(c){if(!i.plainObjects&&Ff.call(Object.prototype,c)&&!i.allowPrototypes)return;h.push(c)}for(var f=0;i.depth>0&&(l=o.exec(n))!==null&&f<i.depth;){if(f+=1,!i.plainObjects&&Ff.call(Object.prototype,l[1].slice(1,-1))&&!i.allowPrototypes)return;h.push(l[1])}return l&&h.push("["+n.slice(l.index)+"]"),KD(h,r,i,s)}},JD=function(e){if(!e)return Ze;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?Ze.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Ze.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Ze.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Ze.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Ze.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ze.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Ze.comma,decoder:typeof e.decoder=="function"?e.decoder:Ze.decoder,delimiter:typeof e.delimiter=="string"||ca.isRegExp(e.delimiter)?e.delimiter:Ze.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Ze.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Ze.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Ze.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Ze.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ze.strictNullHandling}},eN=function(t,e){var r=JD(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var i=typeof t=="string"?ZD(t,r):t,s=r.plainObjects?Object.create(null):{},n=Object.keys(i),a=0;a<n.length;++a){var o=n[a],l=QD(o,i[o],r,typeof t=="string");s=ca.merge(s,l,r)}return r.allowSparse===!0?s:ca.compact(s)},tN=VD,rN=eN,iN=Sm,sN={formats:iN,parse:rN,stringify:tN},nN=Fk;function hi(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var aN=/^([a-z0-9.+-]+:)/i,oN=/:[0-9]*$/,lN=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,cN=["<",">",'"',"`"," ","\r",`
191
- `," "],hN=["{","}","|","\\","^","`"].concat(cN),Uf=["'"].concat(hN),Av=["%","/","?",";","#"].concat(Uf),Cv=["/","?","#"],uN=255,Iv=/^[+a-z0-9A-Z_-]{0,63}$/,dN=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,fN={javascript:!0,"javascript:":!0},jf={javascript:!0,"javascript:":!0},Mn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},$f=sN;function pN(t,e,r){if(t&&typeof t=="object"&&t instanceof hi)return t;var i=new hi;return i.parse(t,e,r),i}hi.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=i!==-1&&i<t.indexOf("#")?"?":"#",n=t.split(s),a=/\\/g;n[0]=n[0].replace(a,"/"),t=n.join(s);var o=t;if(o=o.trim(),!r&&t.split("#").length===1){var l=lN.exec(o);if(l)return this.path=o,this.href=o,this.pathname=l[1],l[2]?(this.search=l[2],e?this.query=$f.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=aN.exec(o);if(c){c=c[0];var h=c.toLowerCase();this.protocol=h,o=o.substr(c.length)}if(r||c||o.match(/^\/\/[^@/]+@[^@/]+/)){var f=o.substr(0,2)==="//";f&&!(c&&jf[c])&&(o=o.substr(2),this.slashes=!0)}if(!jf[c]&&(f||c&&!Mn[c])){for(var u=-1,d=0;d<Cv.length;d++){var p=o.indexOf(Cv[d]);p!==-1&&(u===-1||p<u)&&(u=p)}var m,g;u===-1?g=o.lastIndexOf("@"):g=o.lastIndexOf("@",u),g!==-1&&(m=o.slice(0,g),o=o.slice(g+1),this.auth=decodeURIComponent(m)),u=-1;for(var d=0;d<Av.length;d++){var p=o.indexOf(Av[d]);p!==-1&&(u===-1||p<u)&&(u=p)}u===-1&&(u=o.length),this.host=o.slice(0,u),o=o.slice(u),this.parseHost(),this.hostname=this.hostname||"";var y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y)for(var _=this.hostname.split(/\./),d=0,v=_.length;d<v;d++){var b=_[d];if(b&&!b.match(Iv)){for(var w="",A=0,S=b.length;A<S;A++)b.charCodeAt(A)>127?w+="x":w+=b[A];if(!w.match(Iv)){var C=_.slice(0,d),T=_.slice(d+1),M=b.match(dN);M&&(C.push(M[1]),T.unshift(M[2])),T.length&&(o="/"+T.join(".")+o),this.hostname=C.join(".");break}}}this.hostname.length>uN?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=nN.toASCII(this.hostname));var I=this.port?":"+this.port:"",k=this.hostname||"";this.host=k+I,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!fN[h])for(var d=0,v=Uf.length;d<v;d++){var P=Uf[d];if(o.indexOf(P)!==-1){var R=encodeURIComponent(P);R===P&&(R=escape(P)),o=o.split(P).join(R)}}var O=o.indexOf("#");O!==-1&&(this.hash=o.substr(O),o=o.slice(0,O));var L=o.indexOf("?");if(L!==-1?(this.search=o.substr(L),this.query=o.substr(L+1),e&&(this.query=$f.parse(this.query)),o=o.slice(0,L)):e&&(this.search="",this.query={}),o&&(this.pathname=o),Mn[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var I=this.pathname||"",N=this.search||"";this.path=I+N}return this.href=this.format(),this};hi.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",s=!1,n="";this.host?s=t+this.host:this.hostname&&(s=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(n=$f.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||n&&"?"+n||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Mn[e])&&s!==!1?(s="//"+(s||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):s||(s=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),e+s+r+a+i};hi.prototype.resolve=function(t){return this.resolveObject(pN(t,!1,!0)).format()};hi.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new hi;e.parse(t,!1,!0),t=e}for(var r=new hi,i=Object.keys(this),s=0;s<i.length;s++){var n=i[s];r[n]=this[n]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),o=0;o<a.length;o++){var l=a[o];l!=="protocol"&&(r[l]=t[l])}return Mn[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!Mn[t.protocol]){for(var c=Object.keys(t),h=0;h<c.length;h++){var f=c[h];r[f]=t[f]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!jf[t.protocol]){for(var v=(t.pathname||"").split("/");v.length&&!(t.host=v.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),v[0]!==""&&v.unshift(""),v.length<2&&v.unshift(""),r.pathname=v.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var u=r.pathname||"",d=r.search||"";r.path=u+d}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var p=r.pathname&&r.pathname.charAt(0)==="/",m=t.host||t.pathname&&t.pathname.charAt(0)==="/",g=m||p||r.host&&t.pathname,y=g,_=r.pathname&&r.pathname.split("/")||[],v=t.pathname&&t.pathname.split("/")||[],b=r.protocol&&!Mn[r.protocol];if(b&&(r.hostname="",r.port=null,r.host&&(_[0]===""?_[0]=r.host:_.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(v[0]===""?v[0]=t.host:v.unshift(t.host)),t.host=null),g=g&&(v[0]===""||_[0]==="")),m)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,_=v;else if(v.length)_||(_=[]),_.pop(),_=_.concat(v),r.search=t.search,r.query=t.query;else if(t.search!=null){if(b){r.host=_.shift(),r.hostname=r.host;var w=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=_.slice(-1)[0],S=(r.host||t.host||_.length>1)&&(A==="."||A==="..")||A==="",C=0,T=_.length;T>=0;T--)A=_[T],A==="."?_.splice(T,1):A===".."?(_.splice(T,1),C++):C&&(_.splice(T,1),C--);if(!g&&!y)for(;C--;C)_.unshift("..");g&&_[0]!==""&&(!_[0]||_[0].charAt(0)!=="/")&&_.unshift(""),S&&_.join("/").substr(-1)!=="/"&&_.push("");var M=_[0]===""||_[0]&&_[0].charAt(0)==="/";if(b){r.hostname=M?"":_.length?_.shift():"",r.host=r.hostname;var w=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return g=g||r.host&&_.length,g&&!M&&_.unshift(""),_.length>0?r.pathname=_.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r};hi.prototype.parseHost=function(){var t=this.host,e=oN.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const Rv={};function xe(t,e,r=3){if(Rv[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
192
- Deprecated since v${t}`):(i=i.split(`
193
- `).splice(r).join(`
194
- `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
195
- Deprecated since v${t}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
196
- Deprecated since v${t}`),console.warn(i))),Rv[e]=!0}function tr(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function Oa(t){return t.split("?")[0].split("#")[0]}function mN(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gN(t,e,r){return t.replace(new RegExp(mN(e),"g"),r)}function vN(t,e){let r="",i=0,s=-1,n=0,a=-1;for(let o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||n===1))if(s!==o-1&&n===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){const l=r.lastIndexOf("/");if(l!==r.length-1){l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),s=o,n=0;continue}}else if(r.length===2||r.length===1){r="",i=0,s=o,n=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+=`/${t.slice(s+1,o)}`:r=t.slice(s+1,o),i=o-s-1;s=o,n=0}else a===46&&n!==-1?++n:n=-1}return r}const Ye={toPosix(t){return gN(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl(t){return t.startsWith("blob:")},hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){tr(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(tr(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=Oa(this.toPosix(e??X.ADAPTER.getBaseUrl())),s=Oa(this.toPosix(r??this.rootname(i)));return t=this.toPosix(t),t.startsWith("/")?Ye.join(s,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(tr(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const r=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=vN(t,!1),t.length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return tr(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){const i=t[r];if(tr(i),i.length>0)if(e===void 0)e=i;else{const s=t[r-1]??"";this.extname(s)?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(tr(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const r=e===47;let i=-1,s=!0;const n=this.getProtocol(t),a=t;t=t.slice(n.length);for(let o=t.length-1;o>=1;--o)if(e=t.charCodeAt(o),e===47){if(!s){i=o;break}}else s=!1;return i===-1?r?"/":this.isUrl(a)?n+t:n:r&&i===1?"//":n+t.slice(0,i)},rootname(t){tr(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);r!==-1?e=t.slice(0,r):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){tr(t),e&&tr(e),t=Oa(this.toPosix(t));let r=0,i=-1,s=!0,n;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let a=e.length-1,o=-1;for(n=t.length-1;n>=0;--n){const l=t.charCodeAt(n);if(l===47){if(!s){r=n+1;break}}else o===-1&&(s=!1,o=n+1),a>=0&&(l===e.charCodeAt(a)?--a===-1&&(i=n):(a=-1,i=o))}return r===i?i=o:i===-1&&(i=t.length),t.slice(r,i)}for(n=t.length-1;n>=0;--n)if(t.charCodeAt(n)===47){if(!s){r=n+1;break}}else i===-1&&(s=!1,i=n+1);return i===-1?"":t.slice(r,i)},extname(t){tr(t),t=Oa(this.toPosix(t));let e=-1,r=0,i=-1,s=!0,n=0;for(let a=t.length-1;a>=0;--a){const o=t.charCodeAt(a);if(o===47){if(!s){r=a+1;break}continue}i===-1&&(s=!1,i=a+1),o===46?e===-1?e=a:n!==1&&(n=1):e!==-1&&(n=-1)}return e===-1||i===-1||n===0||n===1&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){tr(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=Oa(this.toPosix(t));let r=t.charCodeAt(0);const i=this.isAbsolute(t);let s;e.root=this.rootname(t),i||this.hasProtocol(t)?s=1:s=0;let n=-1,a=0,o=-1,l=!0,c=t.length-1,h=0;for(;c>=s;--c){if(r=t.charCodeAt(c),r===47){if(!l){a=c+1;break}continue}o===-1&&(l=!1,o=c+1),r===46?n===-1?n=c:h!==1&&(h=1):n!==-1&&(h=-1)}return n===-1||o===-1||h===0||h===1&&n===o-1&&n===a+1?o!==-1&&(a===0&&i?e.base=e.name=t.slice(1,o):e.base=e.name=t.slice(a,o)):(a===0&&i?(e.name=t.slice(1,n),e.base=t.slice(1,o)):(e.name=t.slice(a,n),e.base=t.slice(a,o)),e.ext=t.slice(n,o)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"};let ed;async function yN(){return ed??(ed=(async()=>{var n;const t=document.createElement("canvas").getContext("webgl");if(!t)return _t.UNPACK;const e=await new Promise(a=>{const o=document.createElement("video");o.onloadeddata=()=>a(o),o.onerror=()=>a(null),o.autoplay=!1,o.crossOrigin="anonymous",o.preload="auto",o.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",o.load()});if(!e)return _t.UNPACK;const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,s),t.deleteFramebuffer(i),t.deleteTexture(r),(n=t.getExtension("WEBGL_lose_context"))==null||n.loseContext(),s[0]<=s[3]?_t.PMA:_t.UNPACK})()),ed}let td;function bN(){return typeof td>"u"&&(td=function(){var e;const t={stencil:!0,failIfMajorPerformanceCaveat:X.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!X.ADAPTER.getWebGLRenderingContext())return!1;const r=X.ADAPTER.createCanvas();let i=r.getContext("webgl",t)||r.getContext("experimental-webgl",t);const s=!!((e=i==null?void 0:i.getContextAttributes())!=null&&e.stencil);if(i){const n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,s}catch{return!1}}()),td}var xN={grad:.9,turn:360,rad:360/(2*Math.PI)},Kr=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},et=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},Yt=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},S1=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},Pv=function(t){return{r:Yt(t.r,0,255),g:Yt(t.g,0,255),b:Yt(t.b,0,255),a:Yt(t.a)}},rd=function(t){return{r:et(t.r),g:et(t.g),b:et(t.b),a:et(t.a,3)}},_N=/^#([0-9a-f]{3,8})$/i,Hl=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},T1=function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=Math.max(e,r,i),a=n-Math.min(e,r,i),o=a?n===e?(r-i)/a:n===r?2+(i-e)/a:4+(e-r)/a:0;return{h:60*(o<0?o+6:o),s:n?a/n*100:0,v:n/255*100,a:s}},A1=function(t){var e=t.h,r=t.s,i=t.v,s=t.a;e=e/360*6,r/=100,i/=100;var n=Math.floor(e),a=i*(1-r),o=i*(1-(e-n)*r),l=i*(1-(1-e+n)*r),c=n%6;return{r:255*[i,o,a,a,l,i][c],g:255*[l,i,i,o,a,a][c],b:255*[a,a,l,i,i,o][c],a:s}},Mv=function(t){return{h:S1(t.h),s:Yt(t.s,0,100),l:Yt(t.l,0,100),a:Yt(t.a)}},Ov=function(t){return{h:et(t.h),s:et(t.s),l:et(t.l),a:et(t.a,3)}},kv=function(t){return A1((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},uo=function(t){return{h:(e=T1(t)).h,s:(s=(200-(r=e.s))*(i=e.v)/100)>0&&s<200?r*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,r,i,s},wN=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,EN=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,SN=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,TN=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gf={string:[[function(t){var e=_N.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?et(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?et(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=SN.exec(t)||TN.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:Pv({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=wN.exec(t)||EN.exec(t);if(!e)return null;var r,i,s=Mv({h:(r=e[1],i=e[2],i===void 0&&(i="deg"),Number(r)*(xN[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return kv(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=s===void 0?1:s;return Kr(e)&&Kr(r)&&Kr(i)?Pv({r:Number(e),g:Number(r),b:Number(i),a:Number(n)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,s=t.a,n=s===void 0?1:s;if(!Kr(e)||!Kr(r)||!Kr(i))return null;var a=Mv({h:Number(e),s:Number(r),l:Number(i),a:Number(n)});return kv(a)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,s=t.a,n=s===void 0?1:s;if(!Kr(e)||!Kr(r)||!Kr(i))return null;var a=function(o){return{h:S1(o.h),s:Yt(o.s,0,100),v:Yt(o.v,0,100),a:Yt(o.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(n)});return A1(a)},"hsv"]]},Dv=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},AN=function(t){return typeof t=="string"?Dv(t.trim(),Gf.string):typeof t=="object"&&t!==null?Dv(t,Gf.object):[null,void 0]},id=function(t,e){var r=uo(t);return{h:r.h,s:Yt(r.s+100*e,0,100),l:r.l,a:r.a}},sd=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},Nv=function(t,e){var r=uo(t);return{h:r.h,s:r.s,l:Yt(r.l+100*e,0,100),a:r.a}},zf=function(){function t(e){this.parsed=AN(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return et(sd(this.rgba),2)},t.prototype.isDark=function(){return sd(this.rgba)<.5},t.prototype.isLight=function(){return sd(this.rgba)>=.5},t.prototype.toHex=function(){return e=rd(this.rgba),r=e.r,i=e.g,s=e.b,a=(n=e.a)<1?Hl(et(255*n)):"","#"+Hl(r)+Hl(i)+Hl(s)+a;var e,r,i,s,n,a},t.prototype.toRgb=function(){return rd(this.rgba)},t.prototype.toRgbString=function(){return e=rd(this.rgba),r=e.r,i=e.g,s=e.b,(n=e.a)<1?"rgba("+r+", "+i+", "+s+", "+n+")":"rgb("+r+", "+i+", "+s+")";var e,r,i,s,n},t.prototype.toHsl=function(){return Ov(uo(this.rgba))},t.prototype.toHslString=function(){return e=Ov(uo(this.rgba)),r=e.h,i=e.s,s=e.l,(n=e.a)<1?"hsla("+r+", "+i+"%, "+s+"%, "+n+")":"hsl("+r+", "+i+"%, "+s+"%)";var e,r,i,s,n},t.prototype.toHsv=function(){return e=T1(this.rgba),{h:et(e.h),s:et(e.s),v:et(e.v),a:et(e.a,3)};var e},t.prototype.invert=function(){return wr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),wr(id(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),wr(id(this.rgba,-e))},t.prototype.grayscale=function(){return wr(id(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),wr(Nv(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),wr(Nv(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?wr({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):et(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=uo(this.rgba);return typeof e=="number"?wr({h:e,s:r.s,l:r.l,a:r.a}):et(r.h)},t.prototype.isEqual=function(e){return this.toHex()===wr(e).toHex()},t}(),wr=function(t){return t instanceof zf?t:new zf(t)},Lv=[],CN=function(t){t.forEach(function(e){Lv.indexOf(e)<0&&(e(zf,Gf),Lv.push(e))})};function IN(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in r)i[r[s]]=s;var n={};t.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,l,c=i[this.toHex()];if(c)return c;if(a!=null&&a.closest){var h=this.toRgb(),f=1/0,u="black";if(!n.length)for(var d in r)n[d]=new t(r[d]).toRgb();for(var p in r){var m=(o=h,l=n[p],Math.pow(o.r-l.r,2)+Math.pow(o.g-l.g,2)+Math.pow(o.b-l.b,2));m<f&&(f=m,u=p)}return u}},e.string.push([function(a){var o=a.toLowerCase(),l=o==="transparent"?"#0000":r[o];return l?new t(l).toRgb():null},"name"])}CN([IN]);const gn=class Tc{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof Tc)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}isSourceEqual(e,r){const i=typeof e;if(i!==typeof r)return!1;if(i==="number"||i==="string"||e instanceof Number)return e===r;if(Array.isArray(e)&&Array.isArray(r)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(r))return e.length!==r.length?!1:e.every((s,n)=>s===r[n]);if(e!==null&&r!==null){const s=Object.keys(e),n=Object.keys(r);return s.length!==n.length?!1:s.every(a=>e[a]===r[a])}return e===r}toRgba(){const[e,r,i,s]=this._components;return{r:e,g:r,b:i,a:s}}toRgb(){const[e,r,i]=this._components;return{r:e,g:r,b:i}}toRgbaString(){const[e,r,i]=this.toUint8RgbArray();return`rgba(${e},${r},${i},${this.alpha})`}toUint8RgbArray(e){const[r,i,s]=this._components;return e=e??[],e[0]=Math.round(r*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toRgbArray(e){e=e??[];const[r,i,s]=this._components;return e[0]=r,e[1]=i,e[2]=s,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[r,i,s,n]=Tc.temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(e,r=!0){return r&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,r=!0){if(e===1)return(255<<24)+this._int;if(e===0)return r?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,n=this._int&255;return r&&(i=i*e+.5|0,s=s*e+.5|0,n=n*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+n}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[r,i,s]=this._components;return this._components[0]=Math.round(r*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(s*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[r,i,s,n]=this._components;return e[0]=r,e[1]=i,e[2]=s,e[3]=n,e}normalize(e){let r,i,s,n;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const a=e;r=(a>>16&255)/255,i=(a>>8&255)/255,s=(a&255)/255,n=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,i,s,n=255]=e,r/=255,i/=255,s/=255,n/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const o=Tc.HEX_PATTERN.exec(e);o&&(e=`#${o[2]}`)}const a=wr(e);a.isValid()&&({r,g:i,b:s,a:n}=a.rgba,r/=255,i/=255,s/=255)}if(r!==void 0)this._components[0]=r,this._components[1]=i,this._components[2]=s,this._components[3]=n,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,r,i]=this._components;this._int=(e*255<<16)+(r*255<<8)+(i*255|0)}_clamp(e,r=0,i=1){return typeof e=="number"?Math.min(Math.max(e,r),i):(e.forEach((s,n)=>{e[n]=Math.min(Math.max(s,r),i)}),e)}};gn.shared=new gn,gn.temp=new gn,gn.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Oe=gn;function RN(t){return xe("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Oe.shared.setValue(t).toHex()}function PN(t){return xe("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Oe.shared.setValue(t).toNumber()}function MN(){const t=[],e=[];for(let i=0;i<32;i++)t[i]=i,e[i]=i;t[ie.NORMAL_NPM]=ie.NORMAL,t[ie.ADD_NPM]=ie.ADD,t[ie.SCREEN_NPM]=ie.SCREEN,e[ie.NORMAL]=ie.NORMAL_NPM,e[ie.ADD]=ie.ADD_NPM,e[ie.SCREEN]=ie.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}const C1=MN();function I1(t,e){return C1[e?1:0][t]}function ON(t,e=null){const r=t*6;if(e=e||new Uint16Array(r),e.length!==r)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${r}`);for(let i=0,s=0;i<r;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}function R1(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function nh(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function Bv(t){return!(t&t-1)&&!!t}function Fv(t){let e=(t>65535?1:0)<<4;t>>>=e;let r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function On(t,e,r){const i=t.length;let s;if(e>=i||r===0)return;r=e+r>i?i-e:r;const n=i-r;for(s=e;s<n;++s)t[s]=t[s+r];t.length=n}function $i(t){return t===0?0:t<0?-1:1}let kN=0;function Zs(){return++kN}const Hf=class{constructor(t,e,r,i){this.left=t,this.top=e,this.right=r,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};Hf.EMPTY=new Hf(0,0,0,0);let Uv=Hf;const jv={},Er=Object.create(null),bi=Object.create(null);class DN{constructor(e,r,i){this._canvas=X.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=i||X.RESOLUTION,this.resize(e,r)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(e,r){this._checkDestroyed(),this._canvas.width=Math.round(e*this.resolution),this._canvas.height=Math.round(r*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(e){this._checkDestroyed(),this._canvas.width=Math.round(e)}get height(){return this._checkDestroyed(),this._canvas.height}set height(e){this._checkDestroyed(),this._canvas.height=Math.round(e)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(this._canvas===null)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function $v(t,e,r){for(let i=0,s=4*r*e;i<e;++i,s+=4)if(t[s+3]!==0)return!1;return!0}function Gv(t,e,r,i,s){const n=4*e;for(let a=i,o=i*n+4*r;a<=s;++a,o+=n)if(t[o+3]!==0)return!1;return!0}function NN(t){const{width:e,height:r}=t,i=t.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const s=i.getImageData(0,0,e,r).data;let n=0,a=0,o=e-1,l=r-1;for(;a<r&&$v(s,e,a);)++a;if(a===r)return Uv.EMPTY;for(;$v(s,e,l);)--l;for(;Gv(s,e,n,a,l);)++n;for(;Gv(s,e,o,a,l);)--o;return++o,++l,new Uv(n,a,o,l)}function LN(t){const e=NN(t),{width:r,height:i}=e;let s=null;if(!e.isEmpty()){const n=t.getContext("2d");if(n===null)throw new TypeError("Failed to get canvas 2D context");s=n.getImageData(e.left,e.top,r,i)}return{width:r,height:i,data:s}}function BN(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location;const r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}function pi(t,e=1){var i;const r=(i=X.RETINA_PREFIX)==null?void 0:i.exec(t);return r?parseFloat(r[1]):e}var V=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(V||{});const Vf=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},zv=(t,e)=>Vf(t).priority??e,Z={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Vf).forEach(e=>{e.type.forEach(r=>{var i,s;return(s=(i=this._removeHandlers)[r])==null?void 0:s.call(i,e)})}),this},add(...t){return t.map(Vf).forEach(e=>{e.type.forEach(r=>{const i=this._addHandlers,s=this._queue;i[r]?i[r](e):(s[r]=s[r]||[],s[r].push(e))})}),this},handle(t,e,r){const i=this._addHandlers,s=this._removeHandlers;if(i[t]||s[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,s[t]=r;const n=this._queue;return n[t]&&(n[t].forEach(a=>e(a)),delete n[t]),this},handleByMap(t,e){return this.handle(t,r=>{e[r.name]=r.ref},r=>{delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((s,n)=>zv(n,r)-zv(s,r)))},i=>{const s=e.indexOf(i.ref);s!==-1&&e.splice(s,1)})}};class Wf{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const FN=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
197
- `);function UN(t){let e="";for(let r=0;r<t;++r)r>0&&(e+=`
198
- else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function jN(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=FN.replace(/%forloop%/gi,UN(t));if(e.shaderSource(r,i),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))t=t/2|0;else break}return t}const nd=0,ad=1,od=2,ld=3,cd=4,hd=5;class Wr{constructor(){this.data=0,this.blendMode=ie.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<nd)}set blend(e){!!(this.data&1<<nd)!==e&&(this.data^=1<<nd)}get offsets(){return!!(this.data&1<<ad)}set offsets(e){!!(this.data&1<<ad)!==e&&(this.data^=1<<ad)}get culling(){return!!(this.data&1<<od)}set culling(e){!!(this.data&1<<od)!==e&&(this.data^=1<<od)}get depthTest(){return!!(this.data&1<<ld)}set depthTest(e){!!(this.data&1<<ld)!==e&&(this.data^=1<<ld)}get depthMask(){return!!(this.data&1<<hd)}set depthMask(e){!!(this.data&1<<hd)!==e&&(this.data^=1<<hd)}get clockwiseFrontFace(){return!!(this.data&1<<cd)}set clockwiseFrontFace(e){!!(this.data&1<<cd)!==e&&(this.data^=1<<cd)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==ie.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}static for2d(){const e=new Wr;return e.depthTest=!1,e.blend=!0,e}}Wr.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const Xf=[];function P1(t,e){if(!t)return null;let r="";if(typeof t=="string"){const i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(let i=Xf.length-1;i>=0;--i){const s=Xf[i];if(s.test&&s.test(t,r))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class cr{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,i,s,n,a,o,l){if(arguments.length>8)throw new Error("max arguments reached");const{name:c,items:h}=this;this._aliasCount++;for(let f=0,u=h.length;f<u;f++)h[f][c](e,r,i,s,n,a,o,l);return h===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(cr.prototype,{dispatch:{value:cr.prototype.emit},run:{value:cr.prototype.emit}});class zo{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new cr("setRealSize"),this.onUpdate=new cr("update"),this.onError=new cr("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){(e!==this._width||r!==this._height)&&(this._width=e,this._height=r,this.onResize.emit(e,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,r,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,r){return!1}}class Kh extends zo{constructor(e,r){const{width:i,height:s}=r||{};if(!i||!s)throw new Error("BufferResource width or height invalid");super(i,s),this.data=e,this.unpackAlignment=r.unpackAlignment??4}upload(e,r,i){const s=e.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,this.unpackAlignment),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===_t.UNPACK);const n=r.realWidth,a=r.realHeight;return i.width===n&&i.height===a?s.texSubImage2D(r.target,0,0,0,n,a,r.format,i.type,this.data):(i.width=n,i.height=a,s.texImage2D(r.target,0,i.internalFormat,n,a,0,r.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const $N={scaleMode:ai.NEAREST,alphaMode:_t.NPM},Yf=class vn extends pl{constructor(e=null,r=null){super(),r=Object.assign({},vn.defaultOptions,r);const{alphaMode:i,mipmap:s,anisotropicLevel:n,scaleMode:a,width:o,height:l,wrapMode:c,format:h,type:f,target:u,resolution:d,resourceOptions:p}=r;e&&!(e instanceof zo)&&(e=P1(e,p),e.internal=!0),this.resolution=d||X.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((l||0)*this.resolution)/this.resolution,this._mipmap=s,this.anisotropicLevel=n,this._wrapMode=c,this._scaleMode=a,this.format=h,this.type=f,this.target=u,this.alphaMode=i,this.uid=Zs(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&l>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,r){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),r!==void 0&&r!==this.mipmap&&(this.mipmap=r,i=!0),i&&this.dirtyStyleId++,this}setSize(e,r,i){return i=i||this.resolution,this.setRealSize(e*i,r*i,i)}setRealSize(e,r,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(r)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Bv(this.realWidth)&&Bv(this.realHeight)}setResolution(e){const r=this.resolution;return r===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*r)/e,this.height=Math.round(this.height*r)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete bi[this.cacheId],delete Er[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),vn.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,r,i=X.STRICT_TEXTURE_CACHE){const s=typeof e=="string";let n=null;if(s)n=e;else{if(!e._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${Zs()}`}n=e._pixiId}let a=bi[n];if(s&&i&&!a)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return a||(a=new vn(e,r),a.cacheId=n,vn.addToCache(a,n)),a}static fromBuffer(e,r,i,s){e=e||new Float32Array(r*i*4);const n=new Kh(e,{width:r,height:i,...s==null?void 0:s.resourceOptions});let a,o;return e instanceof Float32Array?(a=G.RGBA,o=te.FLOAT):e instanceof Int32Array?(a=G.RGBA_INTEGER,o=te.INT):e instanceof Uint32Array?(a=G.RGBA_INTEGER,o=te.UNSIGNED_INT):e instanceof Int16Array?(a=G.RGBA_INTEGER,o=te.SHORT):e instanceof Uint16Array?(a=G.RGBA_INTEGER,o=te.UNSIGNED_SHORT):e instanceof Int8Array?(a=G.RGBA,o=te.BYTE):(a=G.RGBA,o=te.UNSIGNED_BYTE),n.internal=!0,new vn(n,Object.assign({},$N,{type:o,format:a},s))}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),bi[r]&&bi[r]!==e&&console.warn(`BaseTexture added to the cache with an id [${r}] that already had an entry`),bi[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=bi[e];if(r){const i=r.textureCacheIds.indexOf(e);return i>-1&&r.textureCacheIds.splice(i,1),delete bi[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)delete bi[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}};Yf.defaultOptions={mipmap:Vr.POW2,anisotropicLevel:0,scaleMode:ai.LINEAR,wrapMode:qi.CLAMP,alphaMode:_t.UNPACK,target:Rn.TEXTURE_2D,format:G.RGBA,type:te.UNSIGNED_BYTE},Yf._globalBatch=0;let de=Yf;class qf{constructor(){this.texArray=null,this.blend=0,this.type=Nr.TRIANGLES,this.start=0,this.size=0,this.data=null}}let GN=0,We=class M1{constructor(e,r=!0,i=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=r,this.id=GN++,this.disposeRunner=new cr("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?Ur.ELEMENT_ARRAY_BUFFER:Ur.ARRAY_BUFFER}get index(){return this.type===Ur.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new M1(e)}};class ah{constructor(e,r=0,i=!1,s=te.FLOAT,n,a,o,l=1){this.buffer=e,this.size=r,this.normalized=i,this.type=s,this.stride=n,this.start=a,this.instance=o,this.divisor=l}destroy(){this.buffer=null}static from(e,r,i,s,n){return new ah(e,r,i,s,n)}}const zN={Float32Array,Uint32Array,Int32Array,Uint8Array};function HN(t,e){let r=0,i=0;const s={};for(let l=0;l<t.length;l++)i+=e[l],r+=t[l].length;const n=new ArrayBuffer(r*4);let a=null,o=0;for(let l=0;l<t.length;l++){const c=e[l],h=t[l],f=R1(h);s[f]||(s[f]=new zN[f](n)),a=s[f];for(let u=0;u<h.length;u++){const d=(u/c|0)*i+o,p=u%c;a[d+p]=h[u]}o+=c}return new Float32Array(n)}const Hv={5126:4,5123:2,5121:1};let VN=0;const WN={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Ji{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=VN++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new cr("disposeGeometry"),this.refCount=0}addAttribute(e,r,i=0,s=!1,n,a,o,l=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof We||(r instanceof Array&&(r=new Float32Array(r)),r=new We(r));const c=e.split("|");if(c.length>1){for(let f=0;f<c.length;f++)this.addAttribute(c[f],r,i,s,n);return this}let h=this.buffers.indexOf(r);return h===-1&&(this.buffers.push(r),h=this.buffers.length-1),this.attributes[e]=new ah(h,i,s,n,a,o,l),this.instanced=this.instanced||l,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof We||(e instanceof Array&&(e=new Uint16Array(e)),e=new We(e)),e.type=Ur.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],i=new We;let s;for(s in this.attributes){const n=this.attributes[s],a=this.buffers[n.buffer];e.push(a.data),r.push(n.size*Hv[n.type]/4),n.buffer=0}for(i.data=HN(e,r),s=0;s<this.buffers.length;s++)this.buffers[s]!==this.indexBuffer&&this.buffers[s].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new Ji;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new We(this.buffers[r].data.slice(0));for(const r in this.attributes){const i=this.attributes[r];e.attributes[r]=new ah(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Ur.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new Ji,i=[],s=[],n=[];let a;for(let o=0;o<e.length;o++){a=e[o];for(let l=0;l<a.buffers.length;l++)s[l]=s[l]||0,s[l]+=a.buffers[l].data.length,n[l]=0}for(let o=0;o<a.buffers.length;o++)i[o]=new WN[R1(a.buffers[o].data)](s[o]),r.buffers[o]=new We(i[o]);for(let o=0;o<e.length;o++){a=e[o];for(let l=0;l<a.buffers.length;l++)i[l].set(a.buffers[l].data,n[l]),n[l]+=a.buffers[l].data.length}if(r.attributes=a.attributes,a.indexBuffer){r.indexBuffer=r.buffers[a.buffers.indexOf(a.indexBuffer)],r.indexBuffer.type=Ur.ELEMENT_ARRAY_BUFFER;let o=0,l=0,c=0,h=0;for(let f=0;f<a.buffers.length;f++)if(a.buffers[f]!==a.indexBuffer){h=f;break}for(const f in a.attributes){const u=a.attributes[f];(u.buffer|0)===h&&(l+=u.size*Hv[u.type]/4)}for(let f=0;f<e.length;f++){const u=e[f].indexBuffer.data;for(let d=0;d<u.length;d++)r.indexBuffer.data[d+c]+=o;o+=e[f].buffers[h].data.length/l,c+=u.length}}return r}}class O1 extends Ji{constructor(e=!1){super(),this._buffer=new We(null,e,!1),this._indexBuffer=new We(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,te.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,te.FLOAT).addAttribute("aColor",this._buffer,4,!0,te.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,te.FLOAT).addIndex(this._indexBuffer)}}const oh=Math.PI*2,XN=180/Math.PI,YN=Math.PI/180;var it=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(it||{});class Se{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new Se(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,r=e){return this.x=e,this.y=r,this}}Se.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Vl=[new Se,new Se,new Se,new Se];class me{constructor(e=0,r=0,i=0,s=0){this.x=Number(e),this.y=Number(r),this.width=Number(i),this.height=Number(s),this.type=it.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new me(0,0,0,0)}clone(){return new me(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const C=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=C)return!1;const T=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>T}const i=this.left,s=this.right,n=this.top,a=this.bottom;if(s<=i||a<=n)return!1;const o=Vl[0].set(e.left,e.top),l=Vl[1].set(e.left,e.bottom),c=Vl[2].set(e.right,e.top),h=Vl[3].set(e.right,e.bottom);if(c.x<=o.x||l.y<=o.y)return!1;const f=Math.sign(r.a*r.d-r.b*r.c);if(f===0||(r.apply(o,o),r.apply(l,l),r.apply(c,c),r.apply(h,h),Math.max(o.x,l.x,c.x,h.x)<=i||Math.min(o.x,l.x,c.x,h.x)>=s||Math.max(o.y,l.y,c.y,h.y)<=n||Math.min(o.y,l.y,c.y,h.y)>=a))return!1;const u=f*(l.y-o.y),d=f*(o.x-l.x),p=u*i+d*n,m=u*s+d*n,g=u*i+d*a,y=u*s+d*a;if(Math.max(p,m,g,y)<=u*o.x+d*o.y||Math.min(p,m,g,y)>=u*h.x+d*h.y)return!1;const _=f*(o.y-c.y),v=f*(c.x-o.x),b=_*i+v*n,w=_*s+v*n,A=_*i+v*a,S=_*s+v*a;return!(Math.max(b,w,A,S)<=_*o.x+v*o.y||Math.min(b,w,A,S)>=_*h.x+v*h.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2,this}fit(e){const r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(i-r,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,r=.001){const i=Math.ceil((this.x+this.width-r)*e)/e,s=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=i-this.x,this.height=s-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=i-r,this.y=s,this.height=n-s,this}}me.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Qh{constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.radius=i,this.type=it.CIRC}clone(){return new Qh(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const i=this.radius*this.radius;let s=this.x-e,n=this.y-r;return s*=s,n*=n,s+n<=i}getBounds(){return new me(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}Qh.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Jh{constructor(e=0,r=0,i=0,s=0){this.x=e,this.y=r,this.width=i,this.height=s,this.type=it.ELIP}clone(){return new Jh(this.x,this.y,this.width,this.height)}contains(e,r){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,s=(r-this.y)/this.height;return i*=i,s*=s,i+s<=1}getBounds(){return new me(this.x-this.width,this.y-this.height,this.width,this.height)}}Jh.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class js{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const i=[];for(let s=0,n=r.length;s<n;s++)i.push(r[s].x,r[s].y);r=i}this.points=r,this.type=it.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new js(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let i=!1;const s=this.points.length/2;for(let n=0,a=s-1;n<s;a=n++){const o=this.points[n*2],l=this.points[n*2+1],c=this.points[a*2],h=this.points[a*2+1];l>r!=h>r&&e<(c-o)*((r-l)/(h-l))+o&&(i=!i)}return i}}js.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`};class eu{constructor(e=0,r=0,i=0,s=0,n=20){this.x=e,this.y=r,this.width=i,this.height=s,this.radius=n,this.type=it.RREC}clone(){return new eu(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+i&&r<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let s=e-(this.x+i),n=r-(this.y+i);const a=i*i;if(s*s+n*n<=a||(s=e-(this.x+this.width-i),s*s+n*n<=a)||(n=r-(this.y+this.height-i),s*s+n*n<=a)||(s=e-(this.x+i),s*s+n*n<=a))return!0}return!1}}eu.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class ke{constructor(e=1,r=0,i=0,s=1,n=0,a=0){this.array=null,this.a=e,this.b=r,this.c=i,this.d=s,this.tx=n,this.ty=a}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,r,i,s,n,a){return this.a=e,this.b=r,this.c=i,this.d=s,this.tx=n,this.ty=a,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const i=r||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,r){r=r||new Se;const i=e.x,s=e.y;return r.x=this.a*i+this.c*s+this.tx,r.y=this.b*i+this.d*s+this.ty,r}applyInverse(e,r){r=r||new Se;const i=1/(this.a*this.d+this.c*-this.b),s=e.x,n=e.y;return r.x=this.d*i*s+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,r.y=this.a*i*n+-this.b*i*s+(-this.ty*this.a+this.tx*this.b)*i,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),i=Math.sin(e),s=this.a,n=this.c,a=this.tx;return this.a=s*r-this.b*i,this.b=s*i+this.b*r,this.c=n*r-this.d*i,this.d=n*i+this.d*r,this.tx=a*r-this.ty*i,this.ty=a*i+this.ty*r,this}append(e){const r=this.a,i=this.b,s=this.c,n=this.d;return this.a=e.a*r+e.b*s,this.b=e.a*i+e.b*n,this.c=e.c*r+e.d*s,this.d=e.c*i+e.d*n,this.tx=e.tx*r+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*n+this.ty,this}setTransform(e,r,i,s,n,a,o,l,c){return this.a=Math.cos(o+c)*n,this.b=Math.sin(o+c)*n,this.c=-Math.sin(o-l)*a,this.d=Math.cos(o-l)*a,this.tx=e-(i*this.a+s*this.c),this.ty=r-(i*this.b+s*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,s=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,i=this.b,s=this.c,n=this.d,a=e.pivot,o=-Math.atan2(-s,n),l=Math.atan2(i,r),c=Math.abs(o+l);return c<1e-5||Math.abs(oh-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=l),e.scale.x=Math.sqrt(r*r+i*i),e.scale.y=Math.sqrt(s*s+n*n),e.position.x=this.tx+(a.x*r+a.y*s),e.position.y=this.ty+(a.x*i+a.y*n),e}invert(){const e=this.a,r=this.b,i=this.c,s=this.d,n=this.tx,a=e*s-r*i;return this.a=s/a,this.b=-r/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-s*n)/a,this.ty=-(e*this.ty-r*n)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new ke;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new ke}static get TEMP_MATRIX(){return new ke}}ke.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const ps=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ms=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],gs=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vs=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Zf=[],k1=[],Wl=Math.sign;function qN(){for(let t=0;t<16;t++){const e=[];Zf.push(e);for(let r=0;r<16;r++){const i=Wl(ps[t]*ps[r]+gs[t]*ms[r]),s=Wl(ms[t]*ps[r]+vs[t]*ms[r]),n=Wl(ps[t]*gs[r]+gs[t]*vs[r]),a=Wl(ms[t]*gs[r]+vs[t]*vs[r]);for(let o=0;o<16;o++)if(ps[o]===i&&ms[o]===s&&gs[o]===n&&vs[o]===a){e.push(o);break}}}for(let t=0;t<16;t++){const e=new ke;e.set(ps[t],ms[t],gs[t],vs[t],0,0),k1.push(e)}}qN();const Ne={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>ps[t],uY:t=>ms[t],vX:t=>gs[t],vY:t=>vs[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Zf[t][e],sub:(t,e)=>Zf[t][Ne.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?Ne.S:Ne.N:Math.abs(e)*2<=Math.abs(t)?t>0?Ne.E:Ne.W:e>0?t>0?Ne.SE:Ne.SW:t>0?Ne.NE:Ne.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const s=k1[Ne.inv(e)];s.tx=r,s.ty=i,t.append(s)}};class li{constructor(e,r,i=0,s=0){this._x=i,this._y=s,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new li(e,r,this._x,this._y)}set(e=0,r=e){return(this._x!==e||this._y!==r)&&(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}li.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Kf=class{constructor(){this.worldTransform=new ke,this.localTransform=new ke,this.position=new li(this.onChange,this,0,0),this.scale=new li(this.onChange,this,1,1),this.pivot=new li(this.onChange,this,0,0),this.skew=new li(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};Kf.IDENTITY=new Kf;let Tm=Kf;Tm.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var ZN=`varying vec2 vTextureCoord;
199
-
200
- uniform sampler2D uSampler;
201
-
202
- void main(void){
203
- gl_FragColor *= texture2D(uSampler, vTextureCoord);
204
- }`,KN=`attribute vec2 aVertexPosition;
205
- attribute vec2 aTextureCoord;
206
-
207
- uniform mat3 projectionMatrix;
208
-
209
- varying vec2 vTextureCoord;
210
-
211
- void main(void){
212
- gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
213
- vTextureCoord = aTextureCoord;
214
- }
215
- `;function Vv(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function ud(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function D1(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return ud(2*e);case"bvec3":return ud(3*e);case"bvec4":return ud(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const kn=[{test:t=>t.type==="float"&&t.size===1&&!t.isArray,code:t=>`
216
- if(uv["${t}"] !== ud["${t}"].value)
217
- {
218
- ud["${t}"].value = uv["${t}"]
219
- gl.uniform1f(ud["${t}"].location, uv["${t}"])
220
- }
221
- `},{test:(t,e)=>(t.type==="sampler2D"||t.type==="samplerCube"||t.type==="sampler2DArray")&&t.size===1&&!t.isArray&&(e==null||e.castToBaseTexture!==void 0),code:t=>`t = syncData.textureCount++;
222
-
223
- renderer.texture.bind(uv["${t}"], t);
224
-
225
- if(ud["${t}"].value !== t)
226
- {
227
- ud["${t}"].value = t;
228
- gl.uniform1i(ud["${t}"].location, t);
229
- ; // eslint-disable-line max-len
230
- }`},{test:(t,e)=>t.type==="mat3"&&t.size===1&&!t.isArray&&e.a!==void 0,code:t=>`
231
- gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));
232
- `,codeUbo:t=>`
233
- var ${t}_matrix = uv.${t}.toArray(true);
234
-
235
- data[offset] = ${t}_matrix[0];
236
- data[offset+1] = ${t}_matrix[1];
237
- data[offset+2] = ${t}_matrix[2];
238
-
239
- data[offset + 4] = ${t}_matrix[3];
240
- data[offset + 5] = ${t}_matrix[4];
241
- data[offset + 6] = ${t}_matrix[5];
242
-
243
- data[offset + 8] = ${t}_matrix[6];
244
- data[offset + 9] = ${t}_matrix[7];
245
- data[offset + 10] = ${t}_matrix[8];
246
- `},{test:(t,e)=>t.type==="vec2"&&t.size===1&&!t.isArray&&e.x!==void 0,code:t=>`
247
- cv = ud["${t}"].value;
248
- v = uv["${t}"];
249
-
250
- if(cv[0] !== v.x || cv[1] !== v.y)
251
- {
252
- cv[0] = v.x;
253
- cv[1] = v.y;
254
- gl.uniform2f(ud["${t}"].location, v.x, v.y);
255
- }`,codeUbo:t=>`
256
- v = uv.${t};
257
-
258
- data[offset] = v.x;
259
- data[offset+1] = v.y;
260
- `},{test:t=>t.type==="vec2"&&t.size===1&&!t.isArray,code:t=>`
261
- cv = ud["${t}"].value;
262
- v = uv["${t}"];
263
-
264
- if(cv[0] !== v[0] || cv[1] !== v[1])
265
- {
266
- cv[0] = v[0];
267
- cv[1] = v[1];
268
- gl.uniform2f(ud["${t}"].location, v[0], v[1]);
269
- }
270
- `},{test:(t,e)=>t.type==="vec4"&&t.size===1&&!t.isArray&&e.width!==void 0,code:t=>`
271
- cv = ud["${t}"].value;
272
- v = uv["${t}"];
273
-
274
- if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
275
- {
276
- cv[0] = v.x;
277
- cv[1] = v.y;
278
- cv[2] = v.width;
279
- cv[3] = v.height;
280
- gl.uniform4f(ud["${t}"].location, v.x, v.y, v.width, v.height)
281
- }`,codeUbo:t=>`
282
- v = uv.${t};
283
-
284
- data[offset] = v.x;
285
- data[offset+1] = v.y;
286
- data[offset+2] = v.width;
287
- data[offset+3] = v.height;
288
- `},{test:(t,e)=>t.type==="vec4"&&t.size===1&&!t.isArray&&e.red!==void 0,code:t=>`
289
- cv = ud["${t}"].value;
290
- v = uv["${t}"];
291
-
292
- if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)
293
- {
294
- cv[0] = v.red;
295
- cv[1] = v.green;
296
- cv[2] = v.blue;
297
- cv[3] = v.alpha;
298
- gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)
299
- }`,codeUbo:t=>`
300
- v = uv.${t};
301
-
302
- data[offset] = v.red;
303
- data[offset+1] = v.green;
304
- data[offset+2] = v.blue;
305
- data[offset+3] = v.alpha;
306
- `},{test:(t,e)=>t.type==="vec3"&&t.size===1&&!t.isArray&&e.red!==void 0,code:t=>`
307
- cv = ud["${t}"].value;
308
- v = uv["${t}"];
309
-
310
- if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)
311
- {
312
- cv[0] = v.red;
313
- cv[1] = v.green;
314
- cv[2] = v.blue;
315
-
316
- gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)
317
- }`,codeUbo:t=>`
318
- v = uv.${t};
319
-
320
- data[offset] = v.red;
321
- data[offset+1] = v.green;
322
- data[offset+2] = v.blue;
323
- `},{test:t=>t.type==="vec4"&&t.size===1&&!t.isArray,code:t=>`
324
- cv = ud["${t}"].value;
325
- v = uv["${t}"];
326
-
327
- if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
328
- {
329
- cv[0] = v[0];
330
- cv[1] = v[1];
331
- cv[2] = v[2];
332
- cv[3] = v[3];
333
-
334
- gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])
335
- }`}],QN={float:`
336
- if (cv !== v)
337
- {
338
- cu.value = v;
339
- gl.uniform1f(location, v);
340
- }`,vec2:`
341
- if (cv[0] !== v[0] || cv[1] !== v[1])
342
- {
343
- cv[0] = v[0];
344
- cv[1] = v[1];
345
-
346
- gl.uniform2f(location, v[0], v[1])
347
- }`,vec3:`
348
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
349
- {
350
- cv[0] = v[0];
351
- cv[1] = v[1];
352
- cv[2] = v[2];
353
-
354
- gl.uniform3f(location, v[0], v[1], v[2])
355
- }`,vec4:`
356
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
357
- {
358
- cv[0] = v[0];
359
- cv[1] = v[1];
360
- cv[2] = v[2];
361
- cv[3] = v[3];
362
-
363
- gl.uniform4f(location, v[0], v[1], v[2], v[3]);
364
- }`,int:`
365
- if (cv !== v)
366
- {
367
- cu.value = v;
368
-
369
- gl.uniform1i(location, v);
370
- }`,ivec2:`
371
- if (cv[0] !== v[0] || cv[1] !== v[1])
372
- {
373
- cv[0] = v[0];
374
- cv[1] = v[1];
375
-
376
- gl.uniform2i(location, v[0], v[1]);
377
- }`,ivec3:`
378
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
379
- {
380
- cv[0] = v[0];
381
- cv[1] = v[1];
382
- cv[2] = v[2];
383
-
384
- gl.uniform3i(location, v[0], v[1], v[2]);
385
- }`,ivec4:`
386
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
387
- {
388
- cv[0] = v[0];
389
- cv[1] = v[1];
390
- cv[2] = v[2];
391
- cv[3] = v[3];
392
-
393
- gl.uniform4i(location, v[0], v[1], v[2], v[3]);
394
- }`,uint:`
395
- if (cv !== v)
396
- {
397
- cu.value = v;
398
-
399
- gl.uniform1ui(location, v);
400
- }`,uvec2:`
401
- if (cv[0] !== v[0] || cv[1] !== v[1])
402
- {
403
- cv[0] = v[0];
404
- cv[1] = v[1];
405
-
406
- gl.uniform2ui(location, v[0], v[1]);
407
- }`,uvec3:`
408
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
409
- {
410
- cv[0] = v[0];
411
- cv[1] = v[1];
412
- cv[2] = v[2];
413
-
414
- gl.uniform3ui(location, v[0], v[1], v[2]);
415
- }`,uvec4:`
416
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
417
- {
418
- cv[0] = v[0];
419
- cv[1] = v[1];
420
- cv[2] = v[2];
421
- cv[3] = v[3];
422
-
423
- gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
424
- }`,bool:`
425
- if (cv !== v)
426
- {
427
- cu.value = v;
428
- gl.uniform1i(location, v);
429
- }`,bvec2:`
430
- if (cv[0] != v[0] || cv[1] != v[1])
431
- {
432
- cv[0] = v[0];
433
- cv[1] = v[1];
434
-
435
- gl.uniform2i(location, v[0], v[1]);
436
- }`,bvec3:`
437
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
438
- {
439
- cv[0] = v[0];
440
- cv[1] = v[1];
441
- cv[2] = v[2];
442
-
443
- gl.uniform3i(location, v[0], v[1], v[2]);
444
- }`,bvec4:`
445
- if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
446
- {
447
- cv[0] = v[0];
448
- cv[1] = v[1];
449
- cv[2] = v[2];
450
- cv[3] = v[3];
451
-
452
- gl.uniform4i(location, v[0], v[1], v[2], v[3]);
453
- }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`
454
- if (cv !== v)
455
- {
456
- cu.value = v;
457
-
458
- gl.uniform1i(location, v);
459
- }`,samplerCube:`
460
- if (cv !== v)
461
- {
462
- cu.value = v;
463
-
464
- gl.uniform1i(location, v);
465
- }`,sampler2DArray:`
466
- if (cv !== v)
467
- {
468
- cu.value = v;
469
-
470
- gl.uniform1i(location, v);
471
- }`},JN={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function eL(t,e){var i;const r=[`
472
- var v = null;
473
- var cv = null;
474
- var cu = null;
475
- var t = 0;
476
- var gl = renderer.gl;
477
- `];for(const s in t.uniforms){const n=e[s];if(!n){((i=t.uniforms[s])==null?void 0:i.group)===!0&&(t.uniforms[s].ubo?r.push(`
478
- renderer.shader.syncUniformBufferGroup(uv.${s}, '${s}');
479
- `):r.push(`
480
- renderer.shader.syncUniformGroup(uv.${s}, syncData);
481
- `));continue}const a=t.uniforms[s];let o=!1;for(let l=0;l<kn.length;l++)if(kn[l].test(n,a)){r.push(kn[l].code(s,a)),o=!0;break}if(!o){const l=(n.size===1&&!n.isArray?QN:JN)[n.type].replace("location",`ud["${s}"].location`);r.push(`
482
- cu = ud["${s}"];
483
- cv = cu.value;
484
- v = uv["${s}"];
485
- ${l};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
486
- `))}const N1={};let fn=N1;function tL(){if(fn===N1||fn!=null&&fn.isContextLost()){const t=X.ADAPTER.createCanvas();let e;X.PREFER_ENV>=sn.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),fn=e}return fn}let Xl;function rL(){if(!Xl){Xl=Xt.MEDIUM;const t=tL();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e&&(Xl=e.precision?Xt.HIGH:Xt.MEDIUM)}}return Xl}function Wv(t,e){const r=t.getShaderSource(e).split(`
487
- `).map((c,h)=>`${h}: ${c}`),i=t.getShaderInfoLog(e),s=i.split(`
488
- `),n={},a=s.map(c=>parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(c=>c&&!n[c]?(n[c]=!0,!0):!1),o=[""];a.forEach(c=>{r[c-1]=`%c${r[c-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=r.join(`
489
- `);o[0]=l,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function iL(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Wv(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Wv(t,i),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}const sL={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function L1(t){return sL[t]}let Yl=null;const Xv={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function B1(t,e){if(!Yl){const r=Object.keys(Xv);Yl={};for(let i=0;i<r.length;++i){const s=r[i];Yl[t[s]]=Xv[s]}}return Yl[e]}function Yv(t,e,r){if(t.substring(0,9)!=="precision"){let i=e;return e===Xt.HIGH&&r!==Xt.HIGH&&(i=Xt.MEDIUM),`precision ${i} float;
490
- ${t}`}else if(r!==Xt.HIGH&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}let ka;function nL(){if(typeof ka=="boolean")return ka;try{ka=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{ka=!1}return ka}let aL=0;const ql={},Qf=class yn{constructor(e,r,i="pixi-shader",s={}){this.extra={},this.id=aL++,this.vertexSrc=e||yn.defaultVertexSrc,this.fragmentSrc=r||yn.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=s,this.vertexSrc.substring(0,8)!=="#version"&&(i=i.replace(/\s+/g,"-"),ql[i]?(ql[i]++,i+=`-${ql[i]}`):ql[i]=1,this.vertexSrc=`#define SHADER_NAME ${i}
491
- ${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${i}
492
- ${this.fragmentSrc}`,this.vertexSrc=Yv(this.vertexSrc,yn.defaultVertexPrecision,Xt.HIGH),this.fragmentSrc=Yv(this.fragmentSrc,yn.defaultFragmentPrecision,rL())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return KN}static get defaultFragmentSrc(){return ZN}static from(e,r,i){const s=e+r;let n=jv[s];return n||(jv[s]=n=new yn(e,r,i)),n}};Qf.defaultVertexPrecision=Xt.HIGH,Qf.defaultFragmentPrecision=oi.apple.device?Xt.HIGH:Xt.MEDIUM;let ci=Qf,oL=0;class hr{constructor(e,r,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=oL++,this.static=!!r,this.ubo=!!i,e instanceof We?(this.buffer=e,this.buffer.type=Ur.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new We(new Float32Array(1)),this.buffer.type=Ur.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(e,r,i){if(!this.ubo)this.uniforms[e]=new hr(r,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(e,r,i){return new hr(e,r,i)}static uboFrom(e,r){return new hr(e,r??!0,!0)}}class jr{constructor(e,r){this.uniformBindCount=0,this.program=e,r?r instanceof hr?this.uniformGroup=r:this.uniformGroup=new hr(r):this.uniformGroup=new hr({}),this.disposeRunner=new cr("disposeShader")}checkUniformExists(e,r){if(r.uniforms[e])return!0;for(const i in r.uniforms){const s=r.uniforms[i];if(s.group===!0&&this.checkUniformExists(e,s))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(e,r,i){const s=ci.from(e,r);return new jr(s,i)}}class lL{constructor(e,r){if(this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(e){if(!this.programCache[e]){const i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=n;this.defaultGroupCache[e]=hr.from({uSamplers:i},!0);let s=this.fragTemplate;s=s.replace(/%count%/gi,`${e}`),s=s.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new ci(this.vertexSrc,s)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new ke,default:this.defaultGroupCache[e]};return new jr(this.programCache[e],r)}generateSampleSrc(e){let r="";r+=`
493
- `,r+=`
494
- `;for(let i=0;i<e;i++)i>0&&(r+=`
495
- else `),i<e-1&&(r+=`if(vTextureId < ${i}.5)`),r+=`
496
- {`,r+=`
497
- color = texture2D(uSamplers[${i}], vTextureCoord);`,r+=`
498
- }`;return r+=`
499
- `,r+=`
500
- `,r}}class Jf{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}}function cL(){return!oi.apple.device}function hL(t){let e=!0;const r=X.ADAPTER.getNavigator();if(oi.tablet||oi.phone){if(oi.apple.device){const i=r.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)<11&&(e=!1)}if(oi.android.device){const i=r.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)<7&&(e=!1)}}return e?t:4}class tu{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}}var uL=`varying vec2 vTextureCoord;
501
- varying vec4 vColor;
502
- varying float vTextureId;
503
- uniform sampler2D uSamplers[%count%];
504
-
505
- void main(void){
506
- vec4 color;
507
- %forloop%
508
- gl_FragColor = color * vColor;
509
- }
510
- `,dL=`precision highp float;
511
- attribute vec2 aVertexPosition;
512
- attribute vec2 aTextureCoord;
513
- attribute vec4 aColor;
514
- attribute float aTextureId;
515
-
516
- uniform mat3 projectionMatrix;
517
- uniform mat3 translationMatrix;
518
- uniform vec4 tint;
519
-
520
- varying vec2 vTextureCoord;
521
- varying vec4 vColor;
522
- varying float vTextureId;
523
-
524
- void main(void){
525
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
526
-
527
- vTextureCoord = aTextureCoord;
528
- vTextureId = aTextureId;
529
- vColor = aColor * tint;
530
- }
531
- `;const Ga=class ir extends tu{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=O1,this.vertexSize=6,this.state=Wr.for2d(),this.size=ir.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??hL(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??cL(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return xe("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return dL}static get defaultFragmentTemplate(){return uL}setShaderGenerator({vertex:e=ir.defaultVertexSrc,fragment:r=ir.defaultFragmentTemplate}={}){this.shaderGenerator=new lL(e,r)}contextChange(){const e=this.renderer.gl;X.PREFER_ENV===sn.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),ir.defaultMaxTextures),this.maxTextures=jN(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let r=0;r<this._packedGeometryPoolSize;r++)this._packedGeometries[r]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:r}=ir,i=this.size/4,s=Math.floor(i/this.maxTextures)+1;for(;e.length<i;)e.push(new qf);for(;r.length<s;)r.push(new Jf);for(let n=0;n<this.maxTextures;n++)this._tempBoundTextures[n]=null}onPrerender(){this._flushId=0}render(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:r}=this,i=ir._textureArrayPool,s=this.renderer.batch,n=this._tempBoundTextures,a=this.renderer.textureGC.count;let o=++de._globalBatch,l=0,c=i[0],h=0;s.copyBoundTextures(n,r);for(let f=0;f<this._bufferSize;++f){const u=e[f];e[f]=null,u._batchEnabled!==o&&(c.count>=r&&(s.boundArray(c,n,o,r),this.buildDrawCalls(c,h,f),h=f,c=i[++l],++o),u._batchEnabled=o,u.touched=a,c.elements[c.count++]=u)}c.count>0&&(s.boundArray(c,n,o,r),this.buildDrawCalls(c,h,this._bufferSize),++l,++o);for(let f=0;f<n.length;f++)n[f]=null;de._globalBatch=o}buildDrawCalls(e,r,i){const{_bufferedElements:s,_attributeBuffer:n,_indexBuffer:a,vertexSize:o}=this,l=ir._drawCallPool;let c=this._dcIndex,h=this._aIndex,f=this._iIndex,u=l[c];u.start=this._iIndex,u.texArray=e;for(let d=r;d<i;++d){const p=s[d],m=p._texture.baseTexture,g=C1[m.alphaMode?1:0][p.blendMode];s[d]=null,r<d&&u.blend!==g&&(u.size=f-u.start,r=d,u=l[++c],u.texArray=e,u.start=f),this.packInterleavedGeometry(p,n,a,h,f),h+=p.vertexData.length/2*o,f+=p.indices.length,u.blend=g}r<i&&(u.size=f-u.start,++c),this._dcIndex=c,this._aIndex=h,this._iIndex=f}bindAndClearTexArray(e){const r=this.renderer.texture;for(let i=0;i<e.count;i++)r.bind(e.elements[i],e.ids[i]),e.elements[i]=null;e.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:r,_indexBuffer:i}=this;ir.canUploadSameBuffer?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:r,state:i}=this.renderer,s=ir._drawCallPool;let n=null;for(let a=0;a<e;a++){const{texArray:o,type:l,size:c,start:h,blend:f}=s[a];n!==o&&(n=o,this.bindAndClearTexArray(o)),this.state.blendMode=f,i.set(this.state),r.drawElements(l,c,r.UNSIGNED_SHORT,h*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),ir.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(e){const r=nh(Math.ceil(e/8)),i=Fv(r),s=r*8;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);let n=this._aBuffers[s];return n||(this._aBuffers[s]=n=new Wf(s*this.vertexSize*4)),n}getIndexBuffer(e){const r=nh(Math.ceil(e/12)),i=Fv(r),s=r*12;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);let n=this._iBuffers[i];return n||(this._iBuffers[i]=n=new Uint16Array(s)),n}packInterleavedGeometry(e,r,i,s,n){const{uint32View:a,float32View:o}=r,l=s/this.vertexSize,c=e.uvs,h=e.indices,f=e.vertexData,u=e._texture.baseTexture._batchLocation,d=Math.min(e.worldAlpha,1),p=Oe.shared.setValue(e._tintRGB).toPremultiplied(d,e._texture.baseTexture.alphaMode>0);for(let m=0;m<f.length;m+=2)o[s++]=f[m],o[s++]=f[m+1],o[s++]=c[m],o[s++]=c[m+1],a[s++]=p,o[s++]=u;for(let m=0;m<h.length;m++)i[n++]=l+h[m]}};Ga.defaultBatchSize=4096,Ga.extension={name:"batch",type:V.RendererPlugin},Ga._drawCallPool=[],Ga._textureArrayPool=[];let ys=Ga;Z.add(ys);var fL=`varying vec2 vTextureCoord;
532
-
533
- uniform sampler2D uSampler;
534
-
535
- void main(void){
536
- gl_FragColor = texture2D(uSampler, vTextureCoord);
537
- }
538
- `,pL=`attribute vec2 aVertexPosition;
539
-
540
- uniform mat3 projectionMatrix;
541
-
542
- varying vec2 vTextureCoord;
543
-
544
- uniform vec4 inputSize;
545
- uniform vec4 outputFrame;
546
-
547
- vec4 filterVertexPosition( void )
548
- {
549
- vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
550
-
551
- return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
552
- }
553
-
554
- vec2 filterTextureCoord( void )
555
- {
556
- return aVertexPosition * (outputFrame.zw * inputSize.zw);
557
- }
558
-
559
- void main(void)
560
- {
561
- gl_Position = filterVertexPosition();
562
- vTextureCoord = filterTextureCoord();
563
- }
564
- `;const ep=class za extends jr{constructor(e,r,i){const s=ci.from(e||za.defaultVertexSrc,r||za.defaultFragmentSrc);super(s,i),this.padding=0,this.resolution=za.defaultResolution,this.multisample=za.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Wr}apply(e,r,i,s,n){e.applyFilter(this,r,i,s)}get blendMode(){return this.state.blendMode}set blendMode(e){this.state.blendMode=e}get resolution(){return this._resolution}set resolution(e){this._resolution=e}static get defaultVertexSrc(){return pL}static get defaultFragmentSrc(){return fL}};ep.defaultResolution=1,ep.defaultMultisample=$e.NONE;let ft=ep;class lh{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Oe(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:i,backgroundAlpha:s}=e,n=i??r;n!==void 0&&(this.color=n),this.alpha=s}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}lh.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},lh.extension={type:[V.RendererSystem,V.CanvasRendererSystem],name:"background"};Z.add(lh);class F1{constructor(e){this.renderer=e,this.emptyRenderer=new tu(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:i}=this.renderer.texture;for(let s=r-1;s>=0;--s)e[s]=i[s]||null,e[s]&&(e[s]._batchLocation=s)}boundArray(e,r,i,s){const{elements:n,ids:a,count:o}=e;let l=0;for(let c=0;c<o;c++){const h=n[c],f=h._batchLocation;if(f>=0&&f<s&&r[f]===h){a[c]=f;continue}for(;l<s;){const u=r[l];if(u&&u._batchEnabled===i&&u._batchLocation===l){l++;continue}a[c]=l,h._batchLocation=l,r[l]=h;break}}}destroy(){this.renderer=null}}F1.extension={type:V.RendererSystem,name:"batch"};Z.add(F1);let qv=0;class ch{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=qv++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,i=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:i,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=qv++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let i;if(X.PREFER_ENV>=sn.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,r,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=s,s||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}ch.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},ch.extension={type:V.RendererSystem,name:"context"};Z.add(ch);class tp{constructor(e,r){if(this.width=Math.round(e),this.height=Math.round(r),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new cr("disposeFramebuffer"),this.multisample=$e.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new de(null,{scaleMode:ai.NEAREST,resolution:1,mipmap:Vr.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new de(null,{scaleMode:ai.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Vr.OFF,format:G.DEPTH_COMPONENT,type:te.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,r){if(e=Math.round(e),r=Math.round(r),!e||!r)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&r===this.height)){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let i=0;i<this.colorTextures.length;i++){const s=this.colorTextures[i],n=s.resolution;s.setSize(e/n,r/n)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(e/i,r/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class U1 extends de{constructor(e={}){if(typeof e=="number"){const r=arguments[0],i=arguments[1],s=arguments[2],n=arguments[3];e={width:r,height:i,scaleMode:s,resolution:n}}e.width=e.width??100,e.height=e.height??100,e.multisample??(e.multisample=$e.NONE),super(null,e),this.mipmap=Vr.OFF,this.valid=!0,this._clear=new Oe([0,0,0,0]),this.framebuffer=new tp(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class es extends zo{constructor(e){const r=e,i=r.naturalWidth||r.videoWidth||r.width,s=r.naturalHeight||r.videoHeight||r.height;super(i,s),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,i){i===void 0&&!r.startsWith("data:")?e.crossOrigin=BN(r):i!==!1&&(e.crossOrigin=typeof i=="string"?i:"anonymous")}upload(e,r,i,s){const n=e.gl,a=r.realWidth,o=r.realHeight;if(s=s||this.source,typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement){if(!s.complete||s.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement&&s.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===_t.UNPACK),!this.noSubImage&&r.target===n.TEXTURE_2D&&i.width===a&&i.height===o?n.texSubImage2D(n.TEXTURE_2D,0,0,0,r.format,i.type,s):(i.width=a,i.height=o,n.texImage2D(r.target,0,i.internalFormat,r.format,i.type,s)),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),super.update()}dispose(){this.source=null}}class j1 extends es{constructor(e,r){if(r=r||{},typeof e=="string"){const i=new Image;es.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??X.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,i)=>{const s=this.source;this.url=s.src;const n=()=>{this.destroyed||(s.onload=null,s.onerror=null,this.update(),this._load=null,this.createBitmap?r(this.process()):r(this))};s.complete&&s.src?n():(s.onload=n,s.onerror=a=>{i(a),this.onError.emit(a)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(s=>s.blob()).then(s=>r(s,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===_t.UNPACK?"premultiply":"none"})).then(s=>this.destroyed?Promise.reject():(this.bitmap=s,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,i){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,i,this.bitmap),!this.preserveBitmap){let s=!0;const n=r._glTextures;for(const a in n){const o=n[a];if(o!==i&&o.dirtyId!==r.dirtyId){s=!1;break}}s&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class Am{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,r,i){const s=r.width,n=r.height;if(i){const a=e.width/2/s,o=e.height/2/n,l=e.x/s+a,c=e.y/n+o;i=Ne.add(i,Ne.NW),this.x0=l+a*Ne.uX(i),this.y0=c+o*Ne.uY(i),i=Ne.add(i,2),this.x1=l+a*Ne.uX(i),this.y1=c+o*Ne.uY(i),i=Ne.add(i,2),this.x2=l+a*Ne.uX(i),this.y2=c+o*Ne.uY(i),i=Ne.add(i,2),this.x3=l+a*Ne.uX(i),this.y3=c+o*Ne.uY(i)}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Am.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const Zv=new Am;function Zl(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class Q extends pl{constructor(e,r,i,s,n,a,o){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new me(0,0,1,1)),e instanceof Q&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=s,this.valid=!1,this.destroyed=!1,this._uvs=Zv,this.uvMatrix=null,this.orig=i||r,this._rotate=Number(n||0),n===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new Se(a.x,a.y):new Se(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&Er[r.url]&&Q.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Q.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var s;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),i=new Q(this.baseTexture,!this.noFrame&&e,r,(s=this.trim)==null?void 0:s.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===Zv&&(this._uvs=new Am),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},i=X.STRICT_TEXTURE_CACHE){const s=typeof e=="string";let n=null;if(s)n=e;else if(e instanceof de){if(!e.cacheId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${o}-${Zs()}`,de.addToCache(e,e.cacheId)}n=e.cacheId}else{if(!e._pixiId){const o=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${o}_${Zs()}`}n=e._pixiId}let a=Er[n];if(s&&i&&!a)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!a&&!(e instanceof de)?(r.resolution||(r.resolution=pi(e)),a=new Q(new de(e,r)),a.baseTexture.cacheId=n,de.addToCache(a.baseTexture,n),Q.addToCache(a,n)):!a&&e instanceof de&&(a=new Q(e),Q.addToCache(a,n)),a}static fromURL(e,r){const i=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),s=Q.from(e,Object.assign({resourceOptions:i},r),!1),n=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):n.load().then(()=>Promise.resolve(s))}static fromBuffer(e,r,i,s){return new Q(de.fromBuffer(e,r,i,s))}static fromLoader(e,r,i,s){const n=new de(e,Object.assign({scaleMode:de.defaultOptions.scaleMode,resolution:pi(r)},s)),{resource:a}=n;a instanceof j1&&(a.url=r);const o=new Q(n);return i||(i=r),de.addToCache(o.baseTexture,i),Q.addToCache(o,i),i!==r&&(de.addToCache(o.baseTexture,r),Q.addToCache(o,r)),o.baseTexture.valid?Promise.resolve(o):new Promise(l=>{o.baseTexture.once("loaded",()=>l(o))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),Er[r]&&Er[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),Er[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=Er[e];if(r){const i=r.textureCacheIds.indexOf(e);return i>-1&&r.textureCacheIds.splice(i,1),delete Er[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)Er[e.textureCacheIds[r]]===e&&delete Er[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:i,width:s,height:n}=e,a=r+s>this.baseTexture.width,o=i+n>this.baseTexture.height;if(a||o){const l=a&&o?"and":"or",c=`X: ${r} + ${s} = ${r+s} > ${this.baseTexture.width}`,h=`Y: ${i} + ${n} = ${i+n} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${c} ${l} ${h}`)}this.valid=s&&n&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Q._EMPTY||(Q._EMPTY=new Q(new de),Zl(Q._EMPTY),Zl(Q._EMPTY.baseTexture)),Q._EMPTY}static get WHITE(){if(!Q._WHITE){const e=X.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),Q._WHITE=new Q(de.from(e)),Zl(Q._WHITE),Zl(Q._WHITE.baseTexture)}return Q._WHITE}}class an extends Q{constructor(e,r){super(e,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r,i=!0){const s=this.baseTexture.resolution,n=Math.round(e*s)/s,a=Math.round(r*s)/s;this.valid=n>0&&a>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=a,i&&this.baseTexture.resize(n,a),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new an(new U1(e))}}class $1{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,i=$e.NONE){const s=new U1(Object.assign({width:e,height:r,resolution:1,multisample:i},this.textureOptions));return new an(s)}getOptimalTexture(e,r,i=1,s=$e.NONE){let n;e=Math.max(Math.ceil(e*i-1e-6),1),r=Math.max(Math.ceil(r*i-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||r!==this._pixelsHeight?(e=nh(e),r=nh(r),n=((e&65535)<<16|r&65535)>>>0,s>1&&(n+=s*4294967296)):n=s>1?-s:-1,this.texturePool[n]||(this.texturePool[n]=[]);let a=this.texturePool[n].pop();return a||(a=this.createTexture(e,r,s)),a.filterPoolKey=n,a.setResolution(i),a}getFilterTexture(e,r,i){const s=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||$e.NONE);return s.filterFrame=e.filterFrame,s}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const r in this.texturePool){const i=this.texturePool[r];if(i)for(let s=0;s<i.length;s++)i[s].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const i=this.texturePool[r];if(i)for(let s=0;s<i.length;s++)i[s].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}$1.SCREEN_KEY=-1;class mL extends Ji{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class G1 extends Ji{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new We(this.vertices),this.uvBuffer=new We(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let i=0,s=0;return this.uvs[0]=i,this.uvs[1]=s,this.uvs[2]=i+r.width/e.width,this.uvs[3]=s,this.uvs[4]=i+r.width/e.width,this.uvs[5]=s+r.height/e.height,this.uvs[6]=i,this.uvs[7]=s+r.height/e.height,i=r.x,s=r.y,this.vertices[0]=i,this.vertices[1]=s,this.vertices[2]=i+r.width,this.vertices[3]=s,this.vertices[4]=i+r.width,this.vertices[5]=s+r.height,this.vertices[6]=i,this.vertices[7]=s+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class gL{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=$e.NONE,this.sourceFrame=new me,this.destinationFrame=new me,this.bindingSourceFrame=new me,this.bindingDestinationFrame=new me,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Kl=[new Se,new Se,new Se,new Se],dd=new ke;class z1{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new $1,this.statePool=[],this.quad=new mL,this.quadUv=new G1,this.tempRect=new me,this.activeState={},this.globalUniforms=new hr({outputFrame:new me,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const i=this.renderer,s=this.defaultFilterStack,n=this.statePool.pop()||new gL,a=i.renderTexture;let o,l;if(a.current){const g=a.current;o=g.resolution,l=g.multisample}else o=i.resolution,l=i.multisample;let c=r[0].resolution||o,h=r[0].multisample??l,f=r[0].padding,u=r[0].autoFit,d=r[0].legacy??!0;for(let g=1;g<r.length;g++){const y=r[g];c=Math.min(c,y.resolution||o),h=Math.min(h,y.multisample??l),f=this.useMaxPadding?Math.max(f,y.padding):f+y.padding,u=u&&y.autoFit,d=d||(y.legacy??!0)}s.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),s.push(n),n.resolution=c,n.multisample=h,n.legacy=d,n.target=e,n.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),n.sourceFrame.pad(f);const p=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(dd.copyFrom(i.projection.transform).invert(),p),u?(n.sourceFrame.fit(p),(n.sourceFrame.width<=0||n.sourceFrame.height<=0)&&(n.sourceFrame.width=0,n.sourceFrame.height=0)):n.sourceFrame.intersects(p)||(n.sourceFrame.width=0,n.sourceFrame.height=0),this.roundFrame(n.sourceFrame,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,c,h),n.filters=r,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height;const m=this.tempRect;m.x=0,m.y=0,m.width=n.sourceFrame.width,m.height=n.sourceFrame.height,n.renderTexture.filterFrame=n.sourceFrame,n.bindingSourceFrame.copyFrom(a.sourceFrame),n.bindingDestinationFrame.copyFrom(a.destinationFrame),n.transform=i.projection.transform,i.projection.transform=null,a.bind(n.renderTexture,n.sourceFrame,m),i.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),i=r.filters;this.activeState=r;const s=this.globalUniforms.uniforms;s.outputFrame=r.sourceFrame,s.resolution=r.resolution;const n=s.inputSize,a=s.inputPixel,o=s.inputClamp;if(n[0]=r.destinationFrame.width,n[1]=r.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],a[0]=Math.round(n[0]*r.resolution),a[1]=Math.round(n[1]*r.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=r.sourceFrame.width*n[2]-.5*a[2],o[3]=r.sourceFrame.height*n[3]-.5*a[3],r.legacy){const c=s.filterArea;c[0]=r.destinationFrame.width,c[1]=r.destinationFrame.height,c[2]=r.sourceFrame.x,c[3]=r.sourceFrame.y,s.filterClamp=s.inputClamp}this.globalUniforms.update();const l=e[e.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,r.renderTexture,l.renderTexture,Mr.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let c=r.renderTexture,h=this.getOptimalFilterTexture(c.width,c.height,r.resolution);h.filterFrame=c.filterFrame;let f=0;for(f=0;f<i.length-1;++f){f===1&&r.multisample>1&&(h=this.getOptimalFilterTexture(c.width,c.height,r.resolution),h.filterFrame=c.filterFrame),i[f].apply(this,c,h,Mr.CLEAR,r);const u=c;c=h,h=u}i[f].apply(this,c,l.renderTexture,Mr.BLEND,r),f>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=Mr.CLEAR){const{renderTexture:i,state:s}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,i.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=s.stateId&1||this.forceClear;(r===Mr.CLEAR||r===Mr.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,i,s){const n=this.renderer;n.state.set(e.state),this.bindAndClear(i,s),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(Nr.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(Nr.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:i,destinationFrame:s}=this.activeState,{orig:n}=r._texture,a=e.set(s.width,0,0,s.height,i.x,i.y),o=r.worldTransform.copyTo(ke.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/n.width,1/n.height),a.translate(r.anchor.x,r.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,i=1,s=$e.NONE){return this.texturePool.getOptimalTexture(e,r,i,s)}getFilterTexture(e,r,i){if(typeof e=="number"){const n=e;e=r,r=n}e=e||this.activeState.renderTexture;const s=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||$e.NONE);return s.filterFrame=e.filterFrame,s}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const i=Kl[0],s=Kl[1],n=Kl[2],a=Kl[3];i.set(r.left,r.top),s.set(r.left,r.bottom),n.set(r.right,r.top),a.set(r.right,r.bottom),e.apply(i,i),e.apply(s,s),e.apply(n,n),e.apply(a,a);const o=Math.min(i.x,s.x,n.x,a.x),l=Math.min(i.y,s.y,n.y,a.y),c=Math.max(i.x,s.x,n.x,a.x),h=Math.max(i.y,s.y,n.y,a.y);r.x=o,r.y=l,r.width=c-o,r.height=h-l}roundFrame(e,r,i,s,n){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(n){const{a,b:o,c:l,d:c}=n;if((Math.abs(o)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(c)>1e-4))return}n=n?dd.copyFrom(n):dd.identity(),n.translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.transformAABB(n,e),e.ceil(r),this.transformAABB(n.invert(),e)}}}z1.extension={type:V.RendererSystem,name:"filter"};Z.add(z1);class vL{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=$e.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const yL=new me;class H1{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new tp(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new me,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;X.PREFER_ENV===sn.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=s=>r.drawBuffersWEBGL(s):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,i=0){const{gl:s}=this;if(e){const n=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,s.bindFramebuffer(s.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,n.mipLevel=i),n.dirtyId!==e.dirtyId&&(n.dirtyId=e.dirtyId,n.dirtyFormat!==e.dirtyFormat?(n.dirtyFormat=e.dirtyFormat,n.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):n.dirtySize!==e.dirtySize&&(n.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let a=0;a<e.colorTextures.length;a++){const o=e.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const a=r.width>>i,o=r.height>>i,l=a/r.width;this.setViewport(r.x*l,r.y*l,a,o)}else{const a=e.width>>i,o=e.height>>i;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,s.bindFramebuffer(s.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,i,s){const n=this.viewport;e=Math.round(e),r=Math.round(r),i=Math.round(i),s=Math.round(s),(n.width!==i||n.height!==s||n.x!==e||n.y!==r)&&(n.x=e,n.y=r,n.width=i,n.height=s,this.gl.viewport(e,r,i,s))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,r,i,s,n=Cf.COLOR|Cf.DEPTH){const{gl:a}=this;a.clearColor(e,r,i,s),a.clear(n)}initFramebuffer(e){const{gl:r}=this,i=new vL(r.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:r}=this,i=e.glFramebuffers[this.CONTEXT_UID];if(i.stencil){r.bindRenderbuffer(r.RENDERBUFFER,i.stencil);let a;this.renderer.context.webGLVersion===1?a=r.DEPTH_STENCIL:e.depth&&e.stencil?a=r.DEPTH24_STENCIL8:e.depth?a=r.DEPTH_COMPONENT24:a=r.STENCIL_INDEX8,i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,a,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,a,e.width,e.height)}const s=e.colorTextures;let n=s.length;r.drawBuffers||(n=Math.min(n,1));for(let a=0;a<n;a++){const o=s[a],l=o.parentTextureArray||o;this.renderer.texture.bind(l,0),a===0&&i.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,l._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:i}=this,s=e.glFramebuffers[this.CONTEXT_UID],n=e.colorTextures;let a=n.length;i.drawBuffers||(a=Math.min(a,1)),s.multisample>1&&this.canMultisampleFramebuffer(e)?s.msaaBuffer=s.msaaBuffer||i.createRenderbuffer():s.msaaBuffer&&(i.deleteRenderbuffer(s.msaaBuffer),s.msaaBuffer=null,s.blitFramebuffer&&(s.blitFramebuffer.dispose(),s.blitFramebuffer=null));const o=[];for(let l=0;l<a;l++){const c=n[l],h=c.parentTextureArray||c;this.renderer.texture.bind(h,0),l===0&&s.msaaBuffer?(i.bindRenderbuffer(i.RENDERBUFFER,s.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,s.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+l,c.target,h._glTextures[this.CONTEXT_UID].texture,r),o.push(i.COLOR_ATTACHMENT0+l))}if(o.length>1&&i.drawBuffers(o),e.depthTexture&&this.writeDepthTexture){const l=e.depthTexture;this.renderer.texture.bind(l,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,r)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){s.stencil=s.stencil||i.createRenderbuffer();let l,c;this.renderer.context.webGLVersion===1?(l=i.DEPTH_STENCIL_ATTACHMENT,c=i.DEPTH_STENCIL):e.depth&&e.stencil?(l=i.DEPTH_STENCIL_ATTACHMENT,c=i.DEPTH24_STENCIL8):e.depth?(l=i.DEPTH_ATTACHMENT,c=i.DEPTH_COMPONENT24):(l=i.STENCIL_ATTACHMENT,c=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,s.stencil),s.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,c,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,c,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,l,i.RENDERBUFFER,s.stencil)}else s.stencil&&(i.deleteRenderbuffer(s.stencil),s.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let i=$e.NONE;if(e<=1||r===null)return i;for(let s=0;s<r.length;s++)if(r[s]<=e){i=r[s];break}return i===1&&(i=$e.NONE),i}blit(e,r,i){const{current:s,renderer:n,gl:a,CONTEXT_UID:o}=this;if(n.context.webGLVersion!==2||!s)return;const l=s.glFramebuffers[o];if(!l)return;if(!e){if(!l.msaaBuffer)return;const h=s.colorTextures[0];if(!h)return;l.blitFramebuffer||(l.blitFramebuffer=new tp(s.width,s.height),l.blitFramebuffer.addColorTexture(0,h)),e=l.blitFramebuffer,e.colorTextures[0]!==h&&(e.colorTextures[0]=h,e.dirtyId++,e.dirtyFormat++),(e.width!==s.width||e.height!==s.height)&&(e.width=s.width,e.height=s.height,e.dirtyId++,e.dirtySize++)}r||(r=yL,r.width=s.width,r.height=s.height),i||(i=r);const c=r.width===i.width&&r.height===i.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,l.framebuffer),a.blitFramebuffer(r.left,r.top,r.right,r.bottom,i.left,i.top,i.right,i.bottom,a.COLOR_BUFFER_BIT,c?a.NEAREST:a.LINEAR),a.bindFramebuffer(a.READ_FRAMEBUFFER,e.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(e,r){const i=e.glFramebuffers[this.CONTEXT_UID],s=this.gl;if(!i)return;delete e.glFramebuffers[this.CONTEXT_UID];const n=this.managedFramebuffers.indexOf(e);n>=0&&this.managedFramebuffers.splice(n,1),e.disposeRunner.remove(this),r||(s.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&s.deleteRenderbuffer(i.msaaBuffer),i.stencil&&s.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<r.length;i++)this.disposeFramebuffer(r[i],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil&&e.stencil)return;e.stencil=!0;const i=e.width,s=e.height,n=this.gl,a=r.stencil=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,a);let o,l;this.renderer.context.webGLVersion===1?(o=n.DEPTH_STENCIL_ATTACHMENT,l=n.DEPTH_STENCIL):e.depth?(o=n.DEPTH_STENCIL_ATTACHMENT,l=n.DEPTH24_STENCIL8):(o=n.STENCIL_ATTACHMENT,l=n.STENCIL_INDEX8),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,l,i,s):n.renderbufferStorage(n.RENDERBUFFER,l,i,s),n.framebufferRenderbuffer(n.FRAMEBUFFER,o,n.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new me}destroy(){this.renderer=null}}H1.extension={type:V.RendererSystem,name:"framebuffer"};Z.add(H1);const fd={5126:4,5123:2,5121:1};class V1{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let i=this.renderer.context.extensions.vertexArrayObject;X.PREFER_ENV===sn.WEBGL_LEGACY&&(i=null),i?(e.createVertexArray=()=>i.createVertexArrayOES(),e.bindVertexArray=s=>i.bindVertexArrayOES(s),e.deleteVertexArray=s=>i.deleteVertexArrayOES(s)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(s,n)=>i.vertexAttribDivisorANGLE(s,n),e.drawElementsInstanced=(s,n,a,o,l)=>i.drawElementsInstancedANGLE(s,n,a,o,l),e.drawArraysInstanced=(s,n,a,o)=>i.drawArraysInstancedANGLE(s,n,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:i}=this;let s=e.glVertexArrayObjects[this.CONTEXT_UID],n=!1;s||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=s={},n=!0);const a=s[r.program.id]||this.initGeometryVao(e,r,n);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let i=0;i<e.buffers.length;i++){const s=e.buffers[i];r.update(s)}}checkCompatibility(e,r){const i=e.attributes,s=r.attributeData;for(const n in s)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(e,r){const i=e.attributes,s=r.attributeData,n=["g",e.id];for(const a in i)s[a]&&n.push(a,s[a].location);return n.join("-")}initGeometryVao(e,r,i=!0){const s=this.gl,n=this.CONTEXT_UID,a=this.renderer.buffer,o=r.program;o.glPrograms[n]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,o);const l=this.getSignature(e,o),c=e.glVertexArrayObjects[this.CONTEXT_UID];let h=c[l];if(h)return c[o.id]=h,h;const f=e.buffers,u=e.attributes,d={},p={};for(const m in f)d[m]=0,p[m]=0;for(const m in u)!u[m].size&&o.attributeData[m]?u[m].size=o.attributeData[m].size:u[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),d[u[m].buffer]+=u[m].size*fd[u[m].type];for(const m in u){const g=u[m],y=g.size;g.stride===void 0&&(d[g.buffer]===y*fd[g.type]?g.stride=0:g.stride=d[g.buffer]),g.start===void 0&&(g.start=p[g.buffer],p[g.buffer]+=y*fd[g.type])}h=s.createVertexArray(),s.bindVertexArray(h);for(let m=0;m<f.length;m++){const g=f[m];a.bind(g),i&&g._glBuffers[n].refCount++}return this.activateVao(e,o),c[o.id]=h,c[l]=h,s.bindVertexArray(null),a.unbind(Ur.ARRAY_BUFFER),h}disposeGeometry(e,r){var o;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const i=e.glVertexArrayObjects[this.CONTEXT_UID],s=this.gl,n=e.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(e.disposeRunner.remove(this),!!i){if(a)for(let l=0;l<n.length;l++){const c=n[l]._glBuffers[this.CONTEXT_UID];c&&(c.refCount--,c.refCount===0&&!r&&a.dispose(n[l],r))}if(!r){for(const l in i)if(l[0]==="g"){const c=i[l];this._activeVao===c&&this.unbind(),s.deleteVertexArray(c)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let i=0;i<r.length;i++)this.disposeGeometry(this.managedGeometries[r[i]],e)}activateVao(e,r){const i=this.gl,s=this.CONTEXT_UID,n=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&n.bind(e.indexBuffer);let l=null;for(const c in o){const h=o[c],f=a[h.buffer],u=f._glBuffers[s];if(r.attributeData[c]){l!==u&&(n.bind(f),l=u);const d=r.attributeData[c].location;if(i.enableVertexAttribArray(d),i.vertexAttribPointer(d,h.size,h.type||i.FLOAT,h.normalized,h.stride,h.start),h.instance)if(this.hasInstance)i.vertexAttribDivisor(d,h.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,i,s){const{gl:n}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,l=o===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?n.drawElementsInstanced(e,r||a.indexBuffer.data.length,l,(i||0)*o,s||1):n.drawElements(e,r||a.indexBuffer.data.length,l,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?n.drawArraysInstanced(e,i,r||a.getSize(),s||1):n.drawArrays(e,i,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}V1.extension={type:V.RendererSystem,name:"geometry"};Z.add(V1);const Kv=new ke;class W1{constructor(e,r){this._texture=e,this.mapCoord=new ke,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const i=this.mapCoord;for(let s=0;s<e.length;s+=2){const n=e[s],a=e[s+1];r[s]=n*i.a+a*i.c+i.tx,r[s+1]=n*i.b+a*i.d+i.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const i=r._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const s=r.orig,n=r.trim;n&&(Kv.set(s.width/n.width,0,0,s.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(Kv));const a=r.baseTexture,o=this.uClampFrame,l=this.clampMargin/a.resolution,c=this.clampOffset;return o[0]=(r._frame.x+l+c)/a.width,o[1]=(r._frame.y+l+c)/a.height,o[2]=(r._frame.x+r._frame.width-l+c)/a.width,o[3]=(r._frame.y+r._frame.height-l+c)/a.height,this.uClampOffset[0]=c/a.realWidth,this.uClampOffset[1]=c/a.realHeight,this.isSimple=r._frame.width===a.width&&r._frame.height===a.height&&r.rotate===0,!0}}var bL=`varying vec2 vMaskCoord;
565
- varying vec2 vTextureCoord;
566
-
567
- uniform sampler2D uSampler;
568
- uniform sampler2D mask;
569
- uniform float alpha;
570
- uniform float npmAlpha;
571
- uniform vec4 maskClamp;
572
-
573
- void main(void)
574
- {
575
- float clip = step(3.5,
576
- step(maskClamp.x, vMaskCoord.x) +
577
- step(maskClamp.y, vMaskCoord.y) +
578
- step(vMaskCoord.x, maskClamp.z) +
579
- step(vMaskCoord.y, maskClamp.w));
580
-
581
- vec4 original = texture2D(uSampler, vTextureCoord);
582
- vec4 masky = texture2D(mask, vMaskCoord);
583
- float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
584
-
585
- original *= (alphaMul * masky.r * alpha * clip);
586
-
587
- gl_FragColor = original;
588
- }
589
- `,xL=`attribute vec2 aVertexPosition;
590
- attribute vec2 aTextureCoord;
591
-
592
- uniform mat3 projectionMatrix;
593
- uniform mat3 otherMatrix;
594
-
595
- varying vec2 vMaskCoord;
596
- varying vec2 vTextureCoord;
597
-
598
- void main(void)
599
- {
600
- gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
601
-
602
- vTextureCoord = aTextureCoord;
603
- vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
604
- }
605
- `;class _L extends ft{constructor(e,r,i){let s=null;typeof e!="string"&&r===void 0&&i===void 0&&(s=e,e=void 0,r=void 0,i=void 0),super(e||xL,r||bL,i),this.maskSprite=s,this.maskMatrix=new ke}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,i,s){const n=this._maskSprite,a=n._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new W1(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,n).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,e.applyFilter(this,r,i,s))}}class wL{constructor(e=null){this.type=He.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=ft.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=He.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class X1{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let i=r;if(!i.isMaskData){const n=this.maskDataPool.pop()||new wL;n.pooled=!0,n.maskObject=r,i=n}const s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(s),i._colorMask=s?s._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==He.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case He.SCISSOR:this.renderer.scissor.push(i);break;case He.STENCIL:this.renderer.stencil.push(i);break;case He.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case He.COLOR:this.pushColorMask(i);break}i.type===He.SPRITE&&this.maskStack.push(i)}pop(e){const r=this.maskStack.pop();if(!(!r||r._target!==e)){if(r.enabled)switch(r.type){case He.SCISSOR:this.renderer.scissor.pop(r);break;case He.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case He.SPRITE:this.popSpriteMask(r);break;case He.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===He.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=He.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=He.SCISSOR:e.type=He.STENCIL:e.type=He.COLOR}pushSpriteMask(e){const{maskObject:r}=e,i=e._target;let s=e._filters;s||(s=this.alphaMaskPool[this.alphaMaskIndex],s||(s=this.alphaMaskPool[this.alphaMaskIndex]=[new _L])),s[0].resolution=e.resolution,s[0].multisample=e.multisample,s[0].maskSprite=r;const n=i.filterArea;i.filterArea=r.getBounds(!0),this.renderer.filter.push(i,s),i.filterArea=n,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,i=e._colorMask=r&e.colorMask;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(e){const r=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==r&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}X1.extension={type:V.RendererSystem,name:"mask"};Z.add(X1);class Y1{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,i=this.getStackLength();this.maskStack=e;const s=this.getStackLength();s!==i&&(s===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Qv=new ke,Jv=[],q1=class Ac extends Y1{constructor(e){super(e),this.glConst=X.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const r=e._scissorRect,{maskObject:i}=e,{renderer:s}=this,n=s.renderTexture,a=i.getBounds(!0,Jv.pop()??new me);this.roundFrameToPixels(a,n.current?n.current.resolution:s.resolution,n.sourceFrame,n.destinationFrame,s.projection.transform),r&&a.fit(r),e._scissorRectLocal=a}static isMatrixRotated(e){if(!e)return!1;const{a:r,b:i,c:s,d:n}=e;return(Math.abs(i)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(r)>1e-4||Math.abs(n)>1e-4)}testScissor(e){const{maskObject:r}=e;if(!r.isFastRect||!r.isFastRect()||Ac.isMatrixRotated(r.worldTransform)||Ac.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,r,i,s,n){Ac.isMatrixRotated(n)||(n=n?Qv.copyFrom(n):Qv.identity(),n.translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(n,e),e.fit(s),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:r}=this.renderer;e._scissorRect||r.enable(r.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:r}=this.renderer;e&&Jv.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():r.disable(r.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let r;this.renderer.renderTexture.current?r=e.y:r=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,r,e.width,e.height)}};q1.extension={type:V.RendererSystem,name:"scissor"};let EL=q1;Z.add(EL);class Z1 extends Y1{constructor(e){super(e),this.glConst=X.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:i}=this.renderer,s=e._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const n=e._colorMask;n!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,s,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,n!==0&&(e._colorMask=n,i.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=i?i._colorMask:15;s!==0&&(i._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(i._colorMask=s,r.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}Z1.extension={type:V.RendererSystem,name:"stencil"};Z.add(Z1);class K1{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return xe("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return xe("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return xe("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}K1.extension={type:[V.RendererSystem,V.CanvasRendererSystem],name:"_plugin"};Z.add(K1);class Q1{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ke,this.transform=null}update(e,r,i,s){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,s),this.transform&&this.projectionMatrix.append(this.transform);const n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)}calculateProjection(e,r,i,s){const n=this.projectionMatrix,a=s?-1:1;n.identity(),n.a=1/r.width*2,n.d=a*(1/r.height*2),n.tx=-1-r.x*n.a,n.ty=-a-r.y*n.d}setTransform(e){}destroy(){this.renderer=null}}Q1.extension={type:V.RendererSystem,name:"projection"};Z.add(Q1);const SL=new Tm,ey=new me;class J1{constructor(e){this.renderer=e,this._tempMatrix=new ke}generateTexture(e,r){const{region:i,...s}=r||{},n=(i==null?void 0:i.copyTo(ey))||e.getLocalBounds(ey,!0),a=s.resolution||this.renderer.resolution;n.width=Math.max(n.width,1/a),n.height=Math.max(n.height,1/a),s.width=n.width,s.height=n.height,s.resolution=a,s.multisample??(s.multisample=this.renderer.multisample);const o=an.create(s);this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const l=e.transform;return e.transform=SL,this.renderer.render(e,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=l,o}destroy(){}}J1.extension={type:[V.RendererSystem,V.CanvasRendererSystem],name:"textureGenerator"};Z.add(J1);const us=new me,Da=new me;class ew{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new me,this.destinationFrame=new me,this.viewportFrame=new me}contextChange(){var r;const e=(r=this.renderer)==null?void 0:r.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,r,i){const s=this.renderer;this.current=e;let n,a,o;e?(n=e.baseTexture,o=n.resolution,r||(us.width=e.frame.width,us.height=e.frame.height,r=us),i||(Da.x=e.frame.x,Da.y=e.frame.y,Da.width=r.width,Da.height=r.height,i=Da),a=n.framebuffer):(o=s.resolution,r||(us.width=s._view.screen.width,us.height=s._view.screen.height,r=us),i||(i=us,i.width=r.width,i.height=r.height));const l=this.viewportFrame;l.x=i.x*o,l.y=i.y*o,l.width=i.width*o,l.height=i.height*o,e||(l.y=s.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(a,l),this.renderer.projection.update(i,r,o,!a),e?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(i)}clear(e,r){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,s=Oe.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&s.premultiply(s.alpha);const n=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=n.width!==a.width||n.height!==a.height;if(o){let{x:l,y:c,width:h,height:f}=this.viewportFrame;l=Math.round(l),c=Math.round(c),h=Math.round(h),f=Math.round(f),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(l,c,h,f)}this.renderer.framebuffer.clear(s.red,s.green,s.blue,s.alpha,r),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}ew.extension={type:V.RendererSystem,name:"renderTexture"};Z.add(ew);class TL{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function AL(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s<i;s++){const n=e.getActiveAttrib(t,s);if(n.name.startsWith("gl_"))continue;const a=B1(e,n.type),o={type:a,name:n.name,size:L1(a),location:e.getAttribLocation(t,n.name)};r[n.name]=o}return r}function CL(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<i;s++){const n=e.getActiveUniform(t,s),a=n.name.replace(/\[.*?\]$/,""),o=!!n.name.match(/\[.*?\]$/),l=B1(e,n.type);r[a]={name:a,index:s,type:l,size:n.size,isArray:o,value:D1(l,n.size)}}return r}function IL(t,e){var o;const r=Vv(t,t.VERTEX_SHADER,e.vertexSrc),i=Vv(t,t.FRAGMENT_SHADER,e.fragmentSrc),s=t.createProgram();t.attachShader(s,r),t.attachShader(s,i);const n=(o=e.extra)==null?void 0:o.transformFeedbackVaryings;if(n&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(s,n.names,n.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||iL(t,s,r,i),e.attributeData=AL(s,t),e.uniformData=CL(s,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const l=Object.keys(e.attributeData);l.sort((c,h)=>c>h?1:-1);for(let c=0;c<l.length;c++)e.attributeData[l[c]].location=c,t.bindAttribLocation(s,c,l[c]);t.linkProgram(s)}t.deleteShader(r),t.deleteShader(i);const a={};for(const l in e.uniformData){const c=e.uniformData[l];a[l]={location:t.getUniformLocation(s,l),value:D1(c.type,c.size)}}return new TL(s,a)}function RL(t,e,r,i,s){r.buffer.update(s)}const PL={float:`
606
- data[offset] = v;
607
- `,vec2:`
608
- data[offset] = v[0];
609
- data[offset+1] = v[1];
610
- `,vec3:`
611
- data[offset] = v[0];
612
- data[offset+1] = v[1];
613
- data[offset+2] = v[2];
614
-
615
- `,vec4:`
616
- data[offset] = v[0];
617
- data[offset+1] = v[1];
618
- data[offset+2] = v[2];
619
- data[offset+3] = v[3];
620
- `,mat2:`
621
- data[offset] = v[0];
622
- data[offset+1] = v[1];
623
-
624
- data[offset+4] = v[2];
625
- data[offset+5] = v[3];
626
- `,mat3:`
627
- data[offset] = v[0];
628
- data[offset+1] = v[1];
629
- data[offset+2] = v[2];
630
-
631
- data[offset + 4] = v[3];
632
- data[offset + 5] = v[4];
633
- data[offset + 6] = v[5];
634
-
635
- data[offset + 8] = v[6];
636
- data[offset + 9] = v[7];
637
- data[offset + 10] = v[8];
638
- `,mat4:`
639
- for(var i = 0; i < 16; i++)
640
- {
641
- data[offset + i] = v[i];
642
- }
643
- `},tw={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function ML(t){const e=t.map(n=>({data:n,offset:0,dataLen:0,dirty:0}));let r=0,i=0,s=0;for(let n=0;n<e.length;n++){const a=e[n];if(r=tw[a.data.type],a.data.size>1&&(r=Math.max(r,16)*a.data.size),a.dataLen=r,i%r!==0&&i<16){const o=i%r%16;i+=o,s+=o}i+r>16?(s=Math.ceil(s/16)*16,a.offset=s,s+=r,i=r):(a.offset=s,i+=r,s+=r)}return s=Math.ceil(s/16)*16,{uboElements:e,size:s}}function OL(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort((i,s)=>i.index-s.index),r}function kL(t,e){if(!t.autoManage)return{size:0,syncFunc:RL};const r=OL(t.uniforms,e),{uboElements:i,size:s}=ML(r),n=[`
644
- var v = null;
645
- var v2 = null;
646
- var cv = null;
647
- var t = 0;
648
- var gl = renderer.gl
649
- var index = 0;
650
- var data = buffer.data;
651
- `];for(let a=0;a<i.length;a++){const o=i[a],l=t.uniforms[o.data.name],c=o.data.name;let h=!1;for(let f=0;f<kn.length;f++){const u=kn[f];if(u.codeUbo&&u.test(o.data,l)){n.push(`offset = ${o.offset/4};`,kn[f].codeUbo(o.data.name,l)),h=!0;break}}if(!h)if(o.data.size>1){const f=L1(o.data.type),u=Math.max(tw[o.data.type]/16,1),d=f/u,p=(4-d%4)%4;n.push(`
652
- cv = ud.${c}.value;
653
- v = uv.${c};
654
- offset = ${o.offset/4};
655
-
656
- t = 0;
657
-
658
- for(var i=0; i < ${o.data.size*u}; i++)
659
- {
660
- for(var j = 0; j < ${d}; j++)
661
- {
662
- data[offset++] = v[t++];
663
- }
664
- offset += ${p};
665
- }
666
-
667
- `)}else{const f=PL[o.data.type];n.push(`
668
- cv = ud.${c}.value;
669
- v = uv.${c};
670
- offset = ${o.offset/4};
671
- ${f};
672
- `)}}return n.push(`
673
- renderer.buffer.update(buffer);
674
- `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join(`
675
- `))}}let DL=0;const Ql={textureCount:0,uboCount:0};class rw{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=DL++}systemCheck(){if(!nL())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,s=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(s.program)),r||(Ql.textureCount=0,Ql.uboCount=0,this.syncUniformGroup(e.uniformGroup,Ql)),s}setUniforms(e){const r=this.shader.program,i=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,r){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,r))}syncUniforms(e,r,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=eL(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const s=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,r);e.buffer.update(),s(i.uniformData,e.uniforms,this.renderer,Ql,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[r])}createSyncBufferGroup(e,r,i){const{gl:s}=this.renderer;this.renderer.buffer.bind(e.buffer);const n=this.gl.getUniformBlockIndex(r.program,i);r.uniformBufferBindings[i]=this.shader.uniformBindCount,s.uniformBlockBinding(r.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(e,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=kL(e,this.shader.program.uniformData)),e.autoManage){const l=new Float32Array(o.size/4);e.buffer.update(l)}return r.uniformGroups[e.id]=o.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,i){const s=e.uniforms,n=[`${i}-`];for(const a in s)n.push(a),r[a]&&n.push(r[a].type);return n.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,i=e.program,s=IL(r,i);return i.glPrograms[this.renderer.CONTEXT_UID]=s,s}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}rw.extension={type:V.RendererSystem,name:"shader"};Z.add(rw);class hh{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.3.2 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}hh.defaultOptions={hello:!1},hh.extension={type:[V.RendererSystem,V.CanvasRendererSystem],name:"startup"};Z.add(hh);function NL(t,e=[]){return e[ie.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.ADD]=[t.ONE,t.ONE],e[ie.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.NONE]=[0,0],e[ie.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[ie.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[ie.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[ie.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[ie.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[ie.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[ie.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[ie.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[ie.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[ie.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[ie.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}const LL=0,BL=1,FL=2,UL=3,jL=4,$L=5,iw=class rp{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ie.NONE,this._blendEq=!1,this.map=[],this.map[LL]=this.setBlend,this.map[BL]=this.setOffset,this.map[FL]=this.setCullFace,this.map[UL]=this.setDepthTest,this.map[jL]=this.setFrontFace,this.map[$L]=this.setDepthMask,this.checks=[],this.defaultState=new Wr,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=NL(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let r=this.stateId^e.data,i=0;for(;r;)r&1&&this.map[i].call(this,!!(e.data&1<<i)),r=r>>1,i++;this.stateId=e.data}for(let r=0;r<this.checks.length;r++)this.checks[r](this,e)}forceState(e){e=e||this.defaultState;for(let r=0;r<this.map.length;r++)this.map[r].call(this,!!(e.data&1<<r));for(let r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data}setBlend(e){this.updateCheck(rp.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(rp.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(e===this.blendMode)return;this.blendMode=e;const r=this.blendModes[e],i=this.gl;r.length===2?i.blendFunc(r[0],r[1]):i.blendFuncSeparate(r[0],r[1],r[2],r[3]),r.length===6?(this._blendEq=!0,i.blendEquationSeparate(r[4],r[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(e,r){this.gl.polygonOffset(e,r)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(e,r){const i=this.checks.indexOf(e);r&&i===-1?this.checks.push(e):!r&&i!==-1&&this.checks.splice(i,1)}static checkBlendMode(e,r){e.setBlendMode(r.blendMode)}static checkPolygonOffset(e,r){e.setPolygonOffset(1,r.polygonOffset)}destroy(){this.gl=null}};iw.extension={type:V.RendererSystem,name:"state"};let GL=iw;Z.add(GL);class zL extends pl{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(s=>e.systems[s]),i=[...r,...Object.keys(e.systems).filter(s=>!r.includes(s))];for(const s of i)this.addSystem(e.systems[s],s)}addRunners(...e){e.forEach(r=>{this.runners[r]=new cr(r)})}addSystem(e,r){const i=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=i,this._systemsHash[r]=i;for(const s in this.runners)this.runners[s].add(i);return this}emitWithCustomOptions(e,r){const i=Object.keys(this._systemsHash);e.items.forEach(s=>{const n=i.find(a=>this._systemsHash[a]===s);s[e.name](r[n])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Ha=class Cc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Cc.defaultMaxIdle,this.checkCountMax=Cc.defaultCheckCountMax,this.mode=Cc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==vm.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,r=e.managedTextures;let i=!1;for(let s=0;s<r.length;s++){const n=r[s];n.resource&&this.count-n.touched>this.maxIdle&&(e.destroyTexture(n,!0),r[s]=null,i=!0)}if(i){let s=0;for(let n=0;n<r.length;n++)r[n]!==null&&(r[s++]=r[n]);r.length=s}}unload(e){const r=this.renderer.texture,i=e._texture;i&&!i.framebuffer&&r.destroyTexture(i);for(let s=e.children.length-1;s>=0;s--)this.unload(e.children[s])}destroy(){this.renderer=null}};Ha.defaultMode=vm.AUTO,Ha.defaultMaxIdle=60*60,Ha.defaultCheckCountMax=60*10,Ha.extension={type:V.RendererSystem,name:"textureGC"};let bs=Ha;Z.add(bs);class pd{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=te.UNSIGNED_BYTE,this.internalFormat=G.RGBA,this.samplerType=0}}function HL(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[t.RGB]:W.FLOAT,[t.RGBA]:W.FLOAT,[t.ALPHA]:W.FLOAT,[t.LUMINANCE]:W.FLOAT,[t.LUMINANCE_ALPHA]:W.FLOAT,[t.R8]:W.FLOAT,[t.R8_SNORM]:W.FLOAT,[t.RG8]:W.FLOAT,[t.RG8_SNORM]:W.FLOAT,[t.RGB8]:W.FLOAT,[t.RGB8_SNORM]:W.FLOAT,[t.RGB565]:W.FLOAT,[t.RGBA4]:W.FLOAT,[t.RGB5_A1]:W.FLOAT,[t.RGBA8]:W.FLOAT,[t.RGBA8_SNORM]:W.FLOAT,[t.RGB10_A2]:W.FLOAT,[t.RGB10_A2UI]:W.FLOAT,[t.SRGB8]:W.FLOAT,[t.SRGB8_ALPHA8]:W.FLOAT,[t.R16F]:W.FLOAT,[t.RG16F]:W.FLOAT,[t.RGB16F]:W.FLOAT,[t.RGBA16F]:W.FLOAT,[t.R32F]:W.FLOAT,[t.RG32F]:W.FLOAT,[t.RGB32F]:W.FLOAT,[t.RGBA32F]:W.FLOAT,[t.R11F_G11F_B10F]:W.FLOAT,[t.RGB9_E5]:W.FLOAT,[t.R8I]:W.INT,[t.R8UI]:W.UINT,[t.R16I]:W.INT,[t.R16UI]:W.UINT,[t.R32I]:W.INT,[t.R32UI]:W.UINT,[t.RG8I]:W.INT,[t.RG8UI]:W.UINT,[t.RG16I]:W.INT,[t.RG16UI]:W.UINT,[t.RG32I]:W.INT,[t.RG32UI]:W.UINT,[t.RGB8I]:W.INT,[t.RGB8UI]:W.UINT,[t.RGB16I]:W.INT,[t.RGB16UI]:W.UINT,[t.RGB32I]:W.INT,[t.RGB32UI]:W.UINT,[t.RGBA8I]:W.INT,[t.RGBA8UI]:W.UINT,[t.RGBA16I]:W.INT,[t.RGBA16UI]:W.UINT,[t.RGBA32I]:W.INT,[t.RGBA32UI]:W.UINT,[t.DEPTH_COMPONENT16]:W.FLOAT,[t.DEPTH_COMPONENT24]:W.FLOAT,[t.DEPTH_COMPONENT32F]:W.FLOAT,[t.DEPTH_STENCIL]:W.FLOAT,[t.DEPTH24_STENCIL8]:W.FLOAT,[t.DEPTH32F_STENCIL8]:W.FLOAT}:e={[t.RGB]:W.FLOAT,[t.RGBA]:W.FLOAT,[t.ALPHA]:W.FLOAT,[t.LUMINANCE]:W.FLOAT,[t.LUMINANCE_ALPHA]:W.FLOAT,[t.DEPTH_STENCIL]:W.FLOAT},e}function VL(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[te.UNSIGNED_BYTE]:{[G.RGBA]:t.RGBA8,[G.RGB]:t.RGB8,[G.RG]:t.RG8,[G.RED]:t.R8,[G.RGBA_INTEGER]:t.RGBA8UI,[G.RGB_INTEGER]:t.RGB8UI,[G.RG_INTEGER]:t.RG8UI,[G.RED_INTEGER]:t.R8UI,[G.ALPHA]:t.ALPHA,[G.LUMINANCE]:t.LUMINANCE,[G.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[te.BYTE]:{[G.RGBA]:t.RGBA8_SNORM,[G.RGB]:t.RGB8_SNORM,[G.RG]:t.RG8_SNORM,[G.RED]:t.R8_SNORM,[G.RGBA_INTEGER]:t.RGBA8I,[G.RGB_INTEGER]:t.RGB8I,[G.RG_INTEGER]:t.RG8I,[G.RED_INTEGER]:t.R8I},[te.UNSIGNED_SHORT]:{[G.RGBA_INTEGER]:t.RGBA16UI,[G.RGB_INTEGER]:t.RGB16UI,[G.RG_INTEGER]:t.RG16UI,[G.RED_INTEGER]:t.R16UI,[G.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[te.SHORT]:{[G.RGBA_INTEGER]:t.RGBA16I,[G.RGB_INTEGER]:t.RGB16I,[G.RG_INTEGER]:t.RG16I,[G.RED_INTEGER]:t.R16I},[te.UNSIGNED_INT]:{[G.RGBA_INTEGER]:t.RGBA32UI,[G.RGB_INTEGER]:t.RGB32UI,[G.RG_INTEGER]:t.RG32UI,[G.RED_INTEGER]:t.R32UI,[G.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[te.INT]:{[G.RGBA_INTEGER]:t.RGBA32I,[G.RGB_INTEGER]:t.RGB32I,[G.RG_INTEGER]:t.RG32I,[G.RED_INTEGER]:t.R32I},[te.FLOAT]:{[G.RGBA]:t.RGBA32F,[G.RGB]:t.RGB32F,[G.RG]:t.RG32F,[G.RED]:t.R32F,[G.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[te.HALF_FLOAT]:{[G.RGBA]:t.RGBA16F,[G.RGB]:t.RGB16F,[G.RG]:t.RG16F,[G.RED]:t.R16F},[te.UNSIGNED_SHORT_5_6_5]:{[G.RGB]:t.RGB565},[te.UNSIGNED_SHORT_4_4_4_4]:{[G.RGBA]:t.RGBA4},[te.UNSIGNED_SHORT_5_5_5_1]:{[G.RGBA]:t.RGB5_A1},[te.UNSIGNED_INT_2_10_10_10_REV]:{[G.RGBA]:t.RGB10_A2,[G.RGBA_INTEGER]:t.RGB10_A2UI},[te.UNSIGNED_INT_10F_11F_11F_REV]:{[G.RGB]:t.R11F_G11F_B10F},[te.UNSIGNED_INT_5_9_9_9_REV]:{[G.RGB]:t.RGB9_E5},[te.UNSIGNED_INT_24_8]:{[G.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[te.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[G.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:e={[te.UNSIGNED_BYTE]:{[G.RGBA]:t.RGBA,[G.RGB]:t.RGB,[G.ALPHA]:t.ALPHA,[G.LUMINANCE]:t.LUMINANCE,[G.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[te.UNSIGNED_SHORT_5_6_5]:{[G.RGB]:t.RGB},[te.UNSIGNED_SHORT_4_4_4_4]:{[G.RGBA]:t.RGBA},[te.UNSIGNED_SHORT_5_5_5_1]:{[G.RGBA]:t.RGBA}},e}class sw{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new de,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=VL(e),this.samplerTypes=HL(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let s=0;s<r;s++)this.boundTextures[s]=null;this.emptyTextures={};const i=new pd(e.createTexture());e.bindTexture(e.TEXTURE_2D,i.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=i,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new pd(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let s=0;s<6;s++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let s=0;s<this.boundTextures.length;s++)this.bind(null,s)}bind(e,r=0){const{gl:i}=this;if(e=e==null?void 0:e.castToBaseTexture(),(e==null?void 0:e.valid)&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const s=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(e.target,s.texture)),s.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),this.updateTexture(e)):s.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,i.activeTexture(i.TEXTURE0+r)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let s=0;s<i.length;s++)i[s]===this.unknownTexture&&this.bind(null,s)}for(let s=0;s<i.length;s++)i[s]===e&&(this.currentLocation!==s&&(r.activeTexture(r.TEXTURE0+s),this.currentLocation=s),r.bindTexture(e.target,this.emptyTextures[e.target].texture),i[s]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:i,CONTEXT_UID:s}=this;if(i)for(let n=e-1;n>=0;--n){const a=r[n];a&&a._glTextures[s].samplerType!==W.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(e){const r=new pd(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var i;r.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,r.samplerType=this.samplerTypes[r.internalFormat]??W.FLOAT,this.webGLVersion===2&&e.type===te.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var s;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const i=this.renderer;if(this.initTextureType(e,r),(s=e.resource)==null?void 0:s.upload(i,e,r))r.samplerType!==W.FLOAT&&(this.hasIntegerTextures=!0);else{const n=e.realWidth,a=e.realHeight,o=i.gl;(r.width!==n||r.height!==a||r.dirtyId<0)&&(r.width=n,r.height=a,o.texImage2D(e.target,0,r.internalFormat,n,a,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const s=this.managedTextures.indexOf(e);s!==-1&&On(this.managedTextures,s,1)}}updateTextureStyle(e){var i;const r=e._glTextures[this.CONTEXT_UID];r&&((e.mipmap===Vr.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?r.mipmap=!1:r.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?r.wrapMode=qi.CLAMP:r.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const i=this.gl;if(r.mipmap&&e.mipmap!==Vr.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===ai.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const s=this.renderer.context.extensions.anisotropicFiltering;if(s&&e.anisotropicLevel>0&&e.scaleMode===ai.LINEAR){const n=Math.min(e.anisotropicLevel,i.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,s.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===ai.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===ai.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}sw.extension={type:V.RendererSystem,name:"texture"};Z.add(sw);class nw{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:i}=this,s=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:i,renderer:s}=this;r&&s.shader.bind(r),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:i,CONTEXT_UID:s}=this,n=r.createTransformFeedback();e._glTransformFeedbacks[s]=n,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n);for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];o&&(i.buffer.update(o),o._glBuffers[s].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[s].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),n}disposeTransformFeedback(e,r){const i=e._glTransformFeedbacks[this.CONTEXT_UID],s=this.gl;e.disposeRunner.remove(this);const n=this.renderer.buffer;if(n)for(let a=0;a<e.buffers.length;a++){const o=e.buffers[a];if(!o)continue;const l=o._glBuffers[this.CONTEXT_UID];l&&(l.refCount--,l.refCount===0&&!r&&n.dispose(o,r))}i&&(r||s.deleteTransformFeedback(i),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}nw.extension={type:V.RendererSystem,name:"transformFeedback"};Z.add(nw);class uh{constructor(e){this.renderer=e}init(e){this.screen=new me(0,0,e.width,e.height),this.element=e.view||X.ADAPTER.createCanvas(),this.resolution=e.resolution||X.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const i=this.element.width/this.resolution,s=this.element.height/this.resolution;this.screen.width=i,this.screen.height=s,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${s}px`),this.renderer.emit("resize",i,s),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}uh.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},uh.extension={type:[V.RendererSystem,V.CanvasRendererSystem],name:"_view"};Z.add(uh);X.PREFER_ENV=sn.WEBGL2;X.STRICT_TEXTURE_CACHE=!1;X.RENDER_OPTIONS={...ch.defaultOptions,...lh.defaultOptions,...uh.defaultOptions,...hh.defaultOptions};Object.defineProperties(X,{WRAP_MODE:{get(){return de.defaultOptions.wrapMode},set(t){xe("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),de.defaultOptions.wrapMode=t}},SCALE_MODE:{get(){return de.defaultOptions.scaleMode},set(t){xe("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),de.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get(){return de.defaultOptions.mipmap},set(t){xe("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),de.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get(){return de.defaultOptions.anisotropicLevel},set(t){xe("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),de.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get(){return xe("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),ft.defaultResolution},set(t){ft.defaultResolution=t}},FILTER_MULTISAMPLE:{get(){return xe("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),ft.defaultMultisample},set(t){ft.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get(){return ys.defaultMaxTextures},set(t){xe("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),ys.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get(){return ys.defaultBatchSize},set(t){xe("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),ys.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get(){return ys.canUploadSameBuffer},set(t){xe("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),ys.canUploadSameBuffer=t}},GC_MODE:{get(){return bs.defaultMode},set(t){xe("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),bs.defaultMode=t}},GC_MAX_IDLE:{get(){return bs.defaultMaxIdle},set(t){xe("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),bs.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get(){return bs.defaultCheckCountMax},set(t){xe("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),bs.defaultCheckCountMax=t}},PRECISION_VERTEX:{get(){return ci.defaultVertexPrecision},set(t){xe("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),ci.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get(){return ci.defaultFragmentPrecision},set(t){xe("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),ci.defaultFragmentPrecision=t}}});var Ks=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(Ks||{});class md{constructor(e,r=null,i=0,s=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=i,this.once=s}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const r=this.next;return this.next=e?null:r,this.previous=null,r}}const aw=class At{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new md(null,null,1/0),this.deltaMS=1/At.targetFPMS,this.elapsedMS=1/At.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,r,i=Ks.NORMAL){return this._addListener(new md(e,r,i))}addOnce(e,r,i=Ks.NORMAL){return this._addListener(new md(e,r,i,!0))}_addListener(e){let r=this._head.next,i=this._head;if(!r)e.connect(i);else{for(;r;){if(e.priority>r.priority){e.connect(i);break}i=r,r=r.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,r){let i=this._head.next;for(;i;)i.match(e,r)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,r=this._head;for(;r=r.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*At.targetFPMS;const i=this._head;let s=i.next;for(;s;)s=s.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const r=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,r)/1e3,At.targetFPMS);this._maxElapsedMS=1/i}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const r=Math.max(this.minFPS,e);this._minElapsedMS=1/(r/1e3)}}static get shared(){if(!At._shared){const e=At._shared=new At;e.autoStart=!0,e._protected=!0}return At._shared}static get system(){if(!At._system){const e=At._system=new At;e.autoStart=!0,e._protected=!0}return At._system}};aw.targetFPMS=.06;let kt=aw;Object.defineProperties(X,{TARGET_FPMS:{get(){return kt.targetFPMS},set(t){xe("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),kt.targetFPMS=t}}});class ow{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,Ks.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?kt.shared:new kt,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}ow.extension=V.Application;Z.add(ow);const lw=[];Z.handleByList(V.Renderer,lw);function WL(t){for(const e of lw)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}var XL=`attribute vec2 aVertexPosition;
676
- attribute vec2 aTextureCoord;
677
-
678
- uniform mat3 projectionMatrix;
679
-
680
- varying vec2 vTextureCoord;
681
-
682
- void main(void)
683
- {
684
- gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
685
- vTextureCoord = aTextureCoord;
686
- }`,YL=`attribute vec2 aVertexPosition;
687
-
688
- uniform mat3 projectionMatrix;
689
-
690
- varying vec2 vTextureCoord;
691
-
692
- uniform vec4 inputSize;
693
- uniform vec4 outputFrame;
694
-
695
- vec4 filterVertexPosition( void )
696
- {
697
- vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
698
-
699
- return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
700
- }
701
-
702
- vec2 filterTextureCoord( void )
703
- {
704
- return aVertexPosition * (outputFrame.zw * inputSize.zw);
705
- }
706
-
707
- void main(void)
708
- {
709
- gl_Position = filterVertexPosition();
710
- vTextureCoord = filterTextureCoord();
711
- }
712
- `;const qL=XL,cw=YL;class hw{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}r>=$e.HIGH?this.multisample=$e.HIGH:r>=$e.MEDIUM?this.multisample=$e.MEDIUM:r>=$e.LOW?this.multisample=$e.LOW:this.multisample=$e.NONE}destroy(){}}hw.extension={type:V.RendererSystem,name:"_multisample"};Z.add(hw);class ZL{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class uw{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:i}=this,s=e._glBuffers[i]||this.createGLBuffer(e);r.bindBuffer(e.type,s.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:i,CONTEXT_UID:s}=this;if(this.boundBufferBases[r]!==e){const n=e._glBuffers[s]||this.createGLBuffer(e);this.boundBufferBases[r]=e,i.bindBufferBase(i.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,i){const{gl:s,CONTEXT_UID:n}=this;i=i||0;const a=e._glBuffers[n]||this.createGLBuffer(e);s.bindBufferRange(s.UNIFORM_BUFFER,r||0,a.buffer,i*256,256)}update(e){const{gl:r,CONTEXT_UID:i}=this,s=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==s.updateID)if(s.updateID=e._updateID,r.bindBuffer(e.type,s.buffer),s.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const n=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,n)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],s=this.gl;e.disposeRunner.remove(this),i&&(r||s.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let i=0;i<r.length;i++)this.dispose(this.managedBuffers[r[i]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:i}=this;return e._glBuffers[r]=new ZL(i.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}uw.extension={type:V.RendererSystem,name:"buffer"};Z.add(uw);class dw{constructor(e){this.renderer=e}render(e,r){const i=this.renderer;let s,n,a,o;if(r&&(s=r.renderTexture,n=r.clear,a=r.transform,o=r.skipUpdateTransform),this.renderingToScreen=!s,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=a,!i.context.isLost){if(s||(this.lastObjectRendered=e),!o){const l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}i.renderTexture.bind(s),i.batch.currentRenderer.start(),(n??i.background.clearBeforeRender)&&i.renderTexture.clear(),e.render(i),i.batch.currentRenderer.flush(),s&&(r.blit&&i.framebuffer.blit(),s.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}dw.extension={type:V.RendererSystem,name:"objectRenderer"};Z.add(dw);const Ic=class ip extends zL{constructor(e){super(),this.type=e1.WEBGL,e=Object.assign({},X.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new hr({projectionMatrix:new ke},!0);const r={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:ip.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(r),"useContextAlpha"in e&&(xe("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=ip.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:bN()}render(e,r){this.objectRenderer.render(e,r)}resize(e,r){this._view.resizeView(e,r)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return xe("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return xe("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return xe("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return xe("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){xe("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return xe("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){xe("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return xe("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,r){return this.textureGenerator.generateTexture(e,r)}};Ic.extension={type:V.Renderer,priority:1},Ic.__plugins={},Ic.__systems={};let Cm=Ic;Z.handleByMap(V.RendererPlugin,Cm.__plugins);Z.handleByMap(V.RendererSystem,Cm.__systems);Z.add(Cm);class fw extends zo{constructor(e,r){const{width:i,height:s}=r||{};super(i,s),this.items=[],this.itemDirtyIds=[];for(let n=0;n<e;n++){const a=new de;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let i=0;i<this.length;i++)e[i]&&(e[i].castToBaseTexture?this.addBaseTextureAt(e[i].castToBaseTexture(),i):e[i]instanceof zo?this.addResourceAt(e[i],i):this.addResourceAt(P1(e[i],r),i))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const e=this.items.map(r=>r.resource).filter(r=>r).map(r=>r.load());return this._load=Promise.all(e).then(()=>{const{realWidth:r,realHeight:i}=this.items[0];return this.resize(r,i),this.update(),Promise.resolve(this)}),this._load}}class KL extends fw{constructor(e,r){const{width:i,height:s}=r||{};let n,a;Array.isArray(e)?(n=e,a=e.length):a=e,super(a,{width:i,height:s}),n&&this.initFromArray(n,r)}addBaseTextureAt(e,r){if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=Rn.TEXTURE_2D_ARRAY}upload(e,r,i){const{length:s,itemDirtyIds:n,items:a}=this,{gl:o}=e;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,s,0,r.format,i.type,null);for(let l=0;l<s;l++){const c=a[l];n[l]<c.dirtyId&&(n[l]=c.dirtyId,c.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,l,c.resource.width,c.resource.height,1,r.format,i.type,c.resource.source))}return!0}}class QL extends es{constructor(e){super(e)}static test(e){const{OffscreenCanvas:r}=globalThis;return r&&e instanceof r?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}}const pw=class Va extends fw{constructor(e,r){const{width:i,height:s,autoLoad:n,linkBaseTexture:a}=r||{};if(e&&e.length!==Va.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:i,height:s});for(let o=0;o<Va.SIDES;o++)this.items[o].target=Rn.TEXTURE_CUBE_MAP_POSITIVE_X+o;this.linkBaseTexture=a!==!1,e&&this.initFromArray(e,r),n!==!1&&this.load()}bind(e){super.bind(e),e.target=Rn.TEXTURE_CUBE_MAP}addBaseTextureAt(e,r,i){if(i===void 0&&(i=this.linkBaseTexture),!this.items[r])throw new Error(`Index ${r} is out of bounds`);if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Rn.TEXTURE_CUBE_MAP_POSITIVE_X+r,e.parentTextureArray=this.baseTexture,this.items[r]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[r]=e,this}upload(e,r,i){const s=this.itemDirtyIds;for(let n=0;n<Va.SIDES;n++){const a=this.items[n];(s[n]<a.dirtyId||i.dirtyId<r.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(e,a,i),s[n]=a.dirtyId):s[n]<-1&&(e.gl.texImage2D(a.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),s[n]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===Va.SIDES}};pw.SIDES=6;let JL=pw;class Sn extends es{constructor(e,r){r=r||{};let i,s,n;typeof e=="string"?(i=Sn.EMPTY,s=e,n=!0):(i=e,s=null,n=!1),super(i),this.url=s,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.ownsImageBitmap=r.ownsImageBitmap??n,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(e,r)=>{if(this.url===null){e(this);return}try{const i=await X.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const s=await i.blob();if(this.destroyed)return;const n=await createImageBitmap(s,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===_t.UNPACK?"premultiply":"none"});if(this.destroyed){n.close();return}this.source=n,this.update(),e(this)}catch(i){if(this.destroyed)return;r(i),this.onError.emit(i)}}),this._load)}upload(e,r,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Sn._EMPTY=Sn._EMPTY??X.ADAPTER.createCanvas(0,0),Sn._EMPTY}}const sp=class Rc extends es{constructor(e,r){r=r||{},super(X.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=r.scale||1,this._overrideWidth=r.width,this._overrideHeight=r.height,this._resolve=null,this._crossorigin=r.crossorigin,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Rc.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;es.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=r=>{this._resolve&&(e.onerror=null,this.onError.emit(r))},e.onload=()=>{if(!this._resolve)return;const r=e.width,i=e.height;if(!r||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let s=r*this.scale,n=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(s=this._overrideWidth||this._overrideHeight/i*r,n=this._overrideHeight||this._overrideWidth/r*i),s=Math.round(s),n=Math.round(n);const a=this.source;a.width=s,a.height=n,a._pixiId=`canvas_${Zs()}`,a.getContext("2d").drawImage(e,0,0,r,i,0,0,s,n),this._resolve(),this._resolve=null}}static getSize(e){const r=Rc.SVG_SIZE.exec(e),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,r){return r==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Rc.SVG_XML.test(e)}};sp.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,sp.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let np=sp;const ap=class op extends es{constructor(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");r.autoLoad!==!1&&i.setAttribute("preload","auto"),r.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),r.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),r.loop===!0&&i.setAttribute("loop",""),r.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const s=e[0].src||e[0];es.crossOrigin(i,s,r.crossorigin);for(let n=0;n<e.length;++n){const a=document.createElement("source");let{src:o,mime:l}=e[n];if(o=o||e[n],o.startsWith("data:"))l=o.slice(5,o.indexOf(";"));else if(!o.startsWith("blob:")){const c=o.split("?").shift().toLowerCase(),h=c.slice(c.lastIndexOf(".")+1);l=l||op.MIME_TYPES[h]||`video/${h}`}a.src=o,l&&(a.type=l),i.appendChild(a)}e=i}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=r.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=r.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),r.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){const r=kt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((r,i)=>{this.valid?r(this):(this._resolve=r,this._reject=i,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const r=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!r&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(kt.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(kt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||op.TYPES.includes(r)}};ap.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],ap.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let mw=ap;Xf.push(Sn,j1,QL,mw,np,Kh,JL,KL);class dh{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?me.EMPTY:(e=e||new me(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:i,b:s,c:n,d:a,tx:o,ty:l}=e,c=i*r.x+n*r.y+o,h=s*r.x+a*r.y+l;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let r=this.minX,i=this.minY,s=this.maxX,n=this.maxY,a=e[0],o=e[1];r=a<r?a:r,i=o<i?o:i,s=a>s?a:s,n=o>n?o:n,a=e[2],o=e[3],r=a<r?a:r,i=o<i?o:i,s=a>s?a:s,n=o>n?o:n,a=e[4],o=e[5],r=a<r?a:r,i=o<i?o:i,s=a>s?a:s,n=o>n?o:n,a=e[6],o=e[7],r=a<r?a:r,i=o<i?o:i,s=a>s?a:s,n=o>n?o:n,this.minX=r,this.minY=i,this.maxX=s,this.maxY=n}addFrame(e,r,i,s,n){this.addFrameMatrix(e.worldTransform,r,i,s,n)}addFrameMatrix(e,r,i,s,n){const a=e.a,o=e.b,l=e.c,c=e.d,h=e.tx,f=e.ty;let u=this.minX,d=this.minY,p=this.maxX,m=this.maxY,g=a*r+l*i+h,y=o*r+c*i+f;u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,m=y>m?y:m,g=a*s+l*i+h,y=o*s+c*i+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,m=y>m?y:m,g=a*r+l*n+h,y=o*r+c*n+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,m=y>m?y:m,g=a*s+l*n+h,y=o*s+c*n+f,u=g<u?g:u,d=y<d?y:d,p=g>p?g:p,m=y>m?y:m,this.minX=u,this.minY=d,this.maxX=p,this.maxY=m}addVertexData(e,r,i){let s=this.minX,n=this.minY,a=this.maxX,o=this.maxY;for(let l=r;l<i;l+=2){const c=e[l],h=e[l+1];s=c<s?c:s,n=h<n?h:n,a=c>a?c:a,o=h>o?h:o}this.minX=s,this.minY=n,this.maxX=a,this.maxY=o}addVertices(e,r,i,s){this.addVerticesMatrix(e.worldTransform,r,i,s)}addVerticesMatrix(e,r,i,s,n=0,a=n){const o=e.a,l=e.b,c=e.c,h=e.d,f=e.tx,u=e.ty;let d=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let y=i;y<s;y+=2){const _=r[y],v=r[y+1],b=o*_+c*v+f,w=h*v+l*_+u;d=Math.min(d,b-n),m=Math.max(m,b+n),p=Math.min(p,w-a),g=Math.max(g,w+a)}this.minX=d,this.minY=p,this.maxX=m,this.maxY=g}addBounds(e){const r=this.minX,i=this.minY,s=this.maxX,n=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<i?e.minY:i,this.maxX=e.maxX>s?e.maxX:s,this.maxY=e.maxY>n?e.maxY:n}addBoundsMask(e,r){const i=e.minX>r.minX?e.minX:r.minX,s=e.minY>r.minY?e.minY:r.minY,n=e.maxX<r.maxX?e.maxX:r.maxX,a=e.maxY<r.maxY?e.maxY:r.maxY;if(i<=n&&s<=a){const o=this.minX,l=this.minY,c=this.maxX,h=this.maxY;this.minX=i<o?i:o,this.minY=s<l?s:l,this.maxX=n>c?n:c,this.maxY=a>h?a:h}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const i=e.minX>r.x?e.minX:r.x,s=e.minY>r.y?e.minY:r.y,n=e.maxX<r.x+r.width?e.maxX:r.x+r.width,a=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(i<=n&&s<=a){const o=this.minX,l=this.minY,c=this.maxX,h=this.maxY;this.minX=i<o?i:o,this.minY=s<l?s:l,this.maxX=n>c?n:c,this.maxY=a>h?a:h}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,i,s,n,a){e-=n,r-=a,i+=n,s+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>s?this.maxY:s}}class Fe extends pl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Tm,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new dh,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const r=Object.keys(e);for(let i=0;i<r.length;++i){const s=r[i];Object.defineProperty(Fe.prototype,s,Object.getOwnPropertyDescriptor(e,s))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new me),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new me),e=this._localBoundsRect),this._localBounds||(this._localBounds=new dh);const r=this.transform,i=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(i==null?void 0:i.worldAlpha)??1,this.transform=this._tempDisplayObjectParent.transform;const s=this._bounds,n=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,e);return this.parent=i,this.transform=r,this._bounds=s,this._bounds.updateID+=this._boundsID-n,a}toGlobal(e,r,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,i,s){return r&&(e=r.toGlobal(e,i,s)),s||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,i)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,i=1,s=1,n=0,a=0,o=0,l=0,c=0){return this.position.x=e,this.position.y=r,this.scale.x=i||1,this.scale.y=s||1,this.rotation=n,this.skew.x=a,this.skew.y=o,this.pivot.x=l,this.pivot.y=c,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new eB),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*XN}set angle(e){this.transform.rotation=e*YN}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class eB extends Fe{constructor(){super(...arguments),this.sortDirty=null}}Fe.prototype.displayObjectUpdateTransform=Fe.prototype.updateTransform;const tB=new ke;function rB(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const gw=class lp extends Fe{constructor(){super(),this.children=[],this.sortableChildren=lp.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(e){}addChild(...e){if(e.length>1)for(let r=0;r<e.length;r++)this.addChild(e[r]);else{const r=e[0];r.parent&&r.parent.removeChild(r),r.parent=this,this.sortDirty=!0,r.transform._parentID=-1,this.children.push(r),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",r,this,this.children.length-1),r.emit("added",this)}return e[0]}addChildAt(e,r){if(r<0||r>this.children.length)throw new Error(`${e}addChildAt: The index ${r} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(r,0,e),this._boundsID++,this.onChildrenChange(r),e.emit("added",this),this.emit("childAdded",e,this,r),e}swapChildren(e,r){if(e===r)return;const i=this.getChildIndex(e),s=this.getChildIndex(r);this.children[i]=r,this.children[s]=e,this.onChildrenChange(i<s?i:s)}getChildIndex(e){const r=this.children.indexOf(e);if(r===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return r}setChildIndex(e,r){if(r<0||r>=this.children.length)throw new Error(`The index ${r} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);On(this.children,i,1),this.children.splice(r,0,e),this.onChildrenChange(r)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let r=0;r<e.length;r++)this.removeChild(e[r]);else{const r=e[0],i=this.children.indexOf(r);if(i===-1)return null;r.parent=null,r.transform._parentID=-1,On(this.children,i,1),this._boundsID++,this.onChildrenChange(i),r.emit("removed",this),this.emit("childRemoved",r,this,i)}return e[0]}removeChildAt(e){const r=this.getChildAt(e);return r.parent=null,r.transform._parentID=-1,On(this.children,e,1),this._boundsID++,this.onChildrenChange(e),r.emit("removed",this),this.emit("childRemoved",r,this,e),r}removeChildren(e=0,r=this.children.length){const i=e,s=r,n=s-i;let a;if(n>0&&n<=s){a=this.children.splice(i,n);for(let o=0;o<a.length;++o)a[o].parent=null,a[o].transform&&(a[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let o=0;o<a.length;++o)a[o].emit("removed",this),this.emit("childRemoved",a[o],this,o);return a}else if(n===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let e=!1;for(let r=0,i=this.children.length;r<i;++r){const s=this.children[r];s._lastSortedIndex=r,!e&&s.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(rB),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,r=this.children.length;e<r;++e){const i=this.children[e];i.visible&&i.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let e=0;e<this.children.length;e++){const r=this.children[e];if(!(!r.visible||!r.renderable))if(r.calculateBounds(),r._mask){const i=r._mask.isMaskData?r._mask.maskObject:r._mask;i?(i.calculateBounds(),this._bounds.addBoundsMask(r._bounds,i._bounds)):this._bounds.addBounds(r._bounds)}else r.filterArea?this._bounds.addBoundsArea(r._bounds,r.filterArea):this._bounds.addBounds(r._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(e,r=!1){const i=super.getLocalBounds(e);if(!r)for(let s=0,n=this.children.length;s<n;++s){const a=this.children[s];a.visible&&a.updateTransform()}return i}_calculateBounds(){}_renderWithCulling(e){const r=e.renderTexture.sourceFrame;if(!(r.width>0&&r.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==lp.prototype._render&&(i=this.getBounds(!0));const n=e.projection.transform;if(n&&(s?(s=tB.copyFrom(s),s.prepend(n)):s=n),i&&r.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let a=0,o=this.children.length;a<o;++a){const l=this.children[a],c=l.cullable;l.cullable=c||!this.cullArea,l.render(e),l.cullable=c}}render(e){var r;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(r=this.filters)!=null&&r.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(let i=0,s=this.children.length;i<s;++i)this.children[i].render(e)}}renderAdvanced(e){var n,a,o;const r=this.filters,i=this._mask;if(r){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let l=0;l<r.length;l++)r[l].enabled&&this._enabledFilters.push(r[l])}const s=r&&((n=this._enabledFilters)==null?void 0:n.length)||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==He.NONE));if(s&&e.batch.flush(),r&&((a=this._enabledFilters)!=null&&a.length)&&e.filter.push(this,this._enabledFilters),i&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(let l=0,c=this.children.length;l<c;++l)this.children[l].render(e)}s&&e.batch.flush(),i&&e.mask.pop(this),r&&((o=this._enabledFilters)!=null&&o.length)&&e.filter.pop()}_render(e){}destroy(e){super.destroy(),this.sortDirty=!1;const r=typeof e=="boolean"?e:e==null?void 0:e.children,i=this.removeChildren(0,this.children.length);if(r)for(let s=0;s<i.length;++s)i[s].destroy(e)}get width(){return this.scale.x*this.getLocalBounds().width}set width(e){const r=this.getLocalBounds().width;r!==0?this.scale.x=e/r:this.scale.x=1,this._width=e}get height(){return this.scale.y*this.getLocalBounds().height}set height(e){const r=this.getLocalBounds().height;r!==0?this.scale.y=e/r:this.scale.y=1,this._height=e}};gw.defaultSortableChildren=!1;let fr=gw;fr.prototype.containerUpdateTransform=fr.prototype.updateTransform;Object.defineProperties(X,{SORTABLE_CHILDREN:{get(){return fr.defaultSortableChildren},set(t){xe("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),fr.defaultSortableChildren=t}}});var ru=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(ru||{});const Na=new Se,iB=new Uint16Array([0,1,2,0,2,3]);class xa extends fr{constructor(e){super(),this._anchor=new li(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Oe(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=ie.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=e||Q.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=iB,this.pluginName="batch",this.isSprite=!0,this._roundPixels=X.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=$i(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=$i(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const e=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===e._updateID)return;this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;const r=this.transform.worldTransform,i=r.a,s=r.b,n=r.c,a=r.d,o=r.tx,l=r.ty,c=this.vertexData,h=e.trim,f=e.orig,u=this._anchor;let d=0,p=0,m=0,g=0;if(h?(p=h.x-u._x*f.width,d=p+h.width,g=h.y-u._y*f.height,m=g+h.height):(p=-u._x*f.width,d=p+f.width,g=-u._y*f.height,m=g+f.height),c[0]=i*p+n*g+o,c[1]=a*g+s*p+l,c[2]=i*d+n*g+o,c[3]=a*g+s*d+l,c[4]=i*d+n*m+o,c[5]=a*m+s*d+l,c[6]=i*p+n*m+o,c[7]=a*m+s*p+l,this._roundPixels){const y=X.RESOLUTION;for(let _=0;_<c.length;++_)c[_]=Math.round(c[_]*y)/y}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const e=this._texture,r=this.vertexTrimmedData,i=e.orig,s=this._anchor,n=this.transform.worldTransform,a=n.a,o=n.b,l=n.c,c=n.d,h=n.tx,f=n.ty,u=-s._x*i.width,d=u+i.width,p=-s._y*i.height,m=p+i.height;if(r[0]=a*u+l*p+h,r[1]=c*p+o*u+f,r[2]=a*d+l*p+h,r[3]=c*p+o*d+f,r[4]=a*d+l*m+h,r[5]=c*m+o*d+f,r[6]=a*u+l*m+h,r[7]=c*m+o*u+f,this._roundPixels){const g=X.RESOLUTION;for(let y=0;y<r.length;++y)r[y]=Math.round(r[y]*g)/g}}_render(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)}_calculateBounds(){const e=this._texture.trim,r=this._texture.orig;!e||e.width===r.width&&e.height===r.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(e){return this.children.length===0?(this._localBounds||(this._localBounds=new dh),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new me),e=this._localBoundsRect),this._localBounds.getRectangle(e)):super.getLocalBounds.call(this,e)}containsPoint(e){this.worldTransform.applyInverse(e,Na);const r=this._texture.orig.width,i=this._texture.orig.height,s=-r*this.anchor.x;let n=0;return Na.x>=s&&Na.x<s+r&&(n=-i*this.anchor.y,Na.y>=n&&Na.y<n+i)}destroy(e){if(super.destroy(e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof e=="boolean"?e:e==null?void 0:e.texture){const r=typeof e=="boolean"?e:e==null?void 0:e.baseTexture;this._texture.destroy(!!r)}this._texture=null}static from(e,r){const i=e instanceof Q?e:Q.from(e,r);return new xa(i)}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){const r=$i(this.scale.x)||1;this.scale.x=r*e/this._texture.orig.width,this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){const r=$i(this.scale.y)||1;this.scale.y=r*e/this._texture.orig.height,this._height=e}get anchor(){return this._anchor}set anchor(e){this._anchor.copyFrom(e)}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||Q.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}const Jl={willReadFrequently:!0},Sr=class K{static get experimentalLetterSpacingSupported(){let e=K._experimentalLetterSpacingSupported;if(e!==void 0){const r=X.ADAPTER.getCanvasRenderingContext2D().prototype;e=K._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(e,r,i,s,n,a,o,l,c){this.text=e,this.style=r,this.width=i,this.height=s,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=c}static measureText(e,r,i,s=K._canvas){i=i??r.wordWrap;const n=r.toFontString(),a=K.measureFont(n);a.fontSize===0&&(a.fontSize=r.fontSize,a.ascent=r.fontSize);const o=s.getContext("2d",Jl);o.font=n;const l=(i?K.wordWrap(e,r,s):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length);let h=0;for(let p=0;p<l.length;p++){const m=K._measureText(l[p],r.letterSpacing,o);c[p]=m,h=Math.max(h,m)}let f=h+r.strokeThickness;r.dropShadow&&(f+=r.dropShadowDistance);const u=r.lineHeight||a.fontSize+r.strokeThickness;let d=Math.max(u,a.fontSize+r.strokeThickness*2)+r.leading+(l.length-1)*(u+r.leading);return r.dropShadow&&(d+=r.dropShadowDistance),new K(e,r,f,d,l,c,u+r.leading,h,a)}static _measureText(e,r,i){let s=!1;K.experimentalLetterSpacingSupported&&(K.experimentalLetterSpacing?(i.letterSpacing=`${r}px`,i.textLetterSpacing=`${r}px`,s=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e).width;return n>0&&(s?n-=r:n+=(K.graphemeSegmenter(e).length-1)*r),n}static wordWrap(e,r,i=K._canvas){const s=i.getContext("2d",Jl);let n=0,a="",o="";const l=Object.create(null),{letterSpacing:c,whiteSpace:h}=r,f=K.collapseSpaces(h),u=K.collapseNewlines(h);let d=!f;const p=r.wordWrapWidth+c,m=K.tokenize(e);for(let g=0;g<m.length;g++){let y=m[g];if(K.isNewline(y)){if(!u){o+=K.addLine(a),d=!f,a="",n=0;continue}y=" "}if(f){const v=K.isBreakingSpace(y),b=K.isBreakingSpace(a[a.length-1]);if(v&&b)continue}const _=K.getFromCache(y,c,l,s);if(_>p)if(a!==""&&(o+=K.addLine(a),a="",n=0),K.canBreakWords(y,r.breakWords)){const v=K.wordWrapSplit(y);for(let b=0;b<v.length;b++){let w=v[b],A=w,S=1;for(;v[b+S];){const T=v[b+S];if(!K.canBreakChars(A,T,y,b,r.breakWords))w+=T;else break;A=T,S++}b+=S-1;const C=K.getFromCache(w,c,l,s);C+n>p&&(o+=K.addLine(a),d=!1,a="",n=0),a+=w,n+=C}}else{a.length>0&&(o+=K.addLine(a),a="",n=0);const v=g===m.length-1;o+=K.addLine(y,!v),d=!1,a="",n=0}else _+n>p&&(d=!1,o+=K.addLine(a),a="",n=0),(a.length>0||!K.isBreakingSpace(y)||d)&&(a+=y,n+=_)}return o+=K.addLine(a,!1),o}static addLine(e,r=!0){return e=K.trimRight(e),e=r?`${e}
713
- `:e,e}static getFromCache(e,r,i,s){let n=i[e];return typeof n!="number"&&(n=K._measureText(e,r,s)+r,i[e]=n),n}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!K.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:K._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,r){return typeof e!="string"?!1:K._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const r=[];let i="";if(typeof e!="string")return r;for(let s=0;s<e.length;s++){const n=e[s],a=e[s+1];if(K.isBreakingSpace(n,a)||K.isNewline(n)){i!==""&&(r.push(i),i=""),r.push(n);continue}i+=n}return i!==""&&r.push(i),r}static canBreakWords(e,r){return r}static canBreakChars(e,r,i,s,n){return!0}static wordWrapSplit(e){return K.graphemeSegmenter(e)}static measureFont(e){if(K._fonts[e])return K._fonts[e];const r={ascent:0,descent:0,fontSize:0},i=K._canvas,s=K._context;s.font=e;const n=K.METRICS_STRING+K.BASELINE_SYMBOL,a=Math.ceil(s.measureText(n).width);let o=Math.ceil(s.measureText(K.BASELINE_SYMBOL).width);const l=Math.ceil(K.HEIGHT_MULTIPLIER*o);if(o=o*K.BASELINE_MULTIPLIER|0,a===0||l===0)return K._fonts[e]=r,r;i.width=a,i.height=l,s.fillStyle="#f00",s.fillRect(0,0,a,l),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(n,0,o);const c=s.getImageData(0,0,a,l).data,h=c.length,f=a*4;let u=0,d=0,p=!1;for(u=0;u<o;++u){for(let m=0;m<f;m+=4)if(c[d+m]!==255){p=!0;break}if(!p)d+=f;else break}for(r.ascent=o-u,d=h-f,p=!1,u=l;u>o;--u){for(let m=0;m<f;m+=4)if(c[d+m]!==255){p=!0;break}if(!p)d-=f;else break}return r.descent=u-o,r.fontSize=r.ascent+r.descent,K._fonts[e]=r,r}static clearMetrics(e=""){e?delete K._fonts[e]:K._fonts={}}static get _canvas(){var e;if(!K.__canvas){let r;try{const i=new OffscreenCanvas(0,0);if((e=i.getContext("2d",Jl))!=null&&e.measureText)return K.__canvas=i,i;r=X.ADAPTER.createCanvas()}catch{r=X.ADAPTER.createCanvas()}r.width=r.height=10,K.__canvas=r}return K.__canvas}static get _context(){return K.__context||(K.__context=K._canvas.getContext("2d",Jl)),K.__context}};Sr.METRICS_STRING="|ÉqÅ",Sr.BASELINE_SYMBOL="M",Sr.BASELINE_MULTIPLIER=1.4,Sr.HEIGHT_MULTIPLIER=2,Sr.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map(r=>r.segment)}return t=>[...t]})(),Sr.experimentalLetterSpacing=!1,Sr._fonts={},Sr._newlines=[10,13],Sr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Si=Sr;const sB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],vw=class Wa{constructor(e){this.styleID=0,this.reset(),vd(this,e,e)}clone(){const e={};return vd(e,this,Wa.defaultStyle),new Wa(e)}reset(){vd(this,Wa.defaultStyle,Wa.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const r=gd(e);this._dropShadowColor!==r&&(this._dropShadowColor=r,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const r=gd(e);this._fill!==r&&(this._fill=r,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){nB(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const r=gd(e);this._stroke!==r&&(this._stroke=r,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let r=this.fontFamily;Array.isArray(this.fontFamily)||(r=this.fontFamily.split(","));for(let i=r.length-1;i>=0;i--){let s=r[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!sB.includes(s)&&(s=`"${s}"`),r[i]=s}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${r.join(",")}`}};vw.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:ru.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let ts=vw;function gd(t){const e=Oe.shared,r=i=>{const s=e.setValue(i);return s.alpha===1?s.toHex():s.toRgbaString()};return Array.isArray(t)?t.map(r):r(t)}function nB(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}function vd(t,e,r){for(const i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}const aB={texture:!0,children:!1,baseTexture:!0},yw=class cp extends xa{constructor(e,r,i){let s=!1;i||(i=X.ADAPTER.createCanvas(),s=!0),i.width=3,i.height=3;const n=Q.from(i);n.orig=new me,n.trim=new me,super(n),this._ownCanvas=s,this.canvas=i,this.context=i.getContext("2d",{willReadFrequently:!0}),this._resolution=cp.defaultResolution??X.RESOLUTION,this._autoResolution=cp.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=r,this.localStyleID=-1}static get experimentalLetterSpacing(){return Si.experimentalLetterSpacing}static set experimentalLetterSpacing(e){xe("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),Si.experimentalLetterSpacing=e}updateText(e){const r=this._style;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;this._font=this._style.toFontString();const i=this.context,s=Si.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),n=s.width,a=s.height,o=s.lines,l=s.lineHeight,c=s.lineWidths,h=s.maxLineWidth,f=s.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,n)+r.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+r.padding*2)*this._resolution),i.scale(this._resolution,this._resolution),i.clearRect(0,0,this.canvas.width,this.canvas.height),i.font=this._font,i.lineWidth=r.strokeThickness,i.textBaseline=r.textBaseline,i.lineJoin=r.lineJoin,i.miterLimit=r.miterLimit;let u,d;const p=r.dropShadow?2:1;for(let m=0;m<p;++m){const g=r.dropShadow&&m===0,y=g?Math.ceil(Math.max(1,a)+r.padding*2):0,_=y*this._resolution;if(g){i.fillStyle="black",i.strokeStyle="black";const b=r.dropShadowColor,w=r.dropShadowBlur*this._resolution,A=r.dropShadowDistance*this._resolution;i.shadowColor=Oe.shared.setValue(b).setAlpha(r.dropShadowAlpha).toRgbaString(),i.shadowBlur=w,i.shadowOffsetX=Math.cos(r.dropShadowAngle)*A,i.shadowOffsetY=Math.sin(r.dropShadowAngle)*A+_}else i.fillStyle=this._generateFillStyle(r,o,s),i.strokeStyle=r.stroke,i.shadowColor="black",i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0;let v=(l-f.fontSize)/2;l-f.fontSize<0&&(v=0);for(let b=0;b<o.length;b++)u=r.strokeThickness/2,d=r.strokeThickness/2+b*l+f.ascent+v,r.align==="right"?u+=h-c[b]:r.align==="center"&&(u+=(h-c[b])/2),r.stroke&&r.strokeThickness&&this.drawLetterSpacing(o[b],u+r.padding,d+r.padding-y,!0),r.fill&&this.drawLetterSpacing(o[b],u+r.padding,d+r.padding-y)}this.updateTexture()}drawLetterSpacing(e,r,i,s=!1){const n=this._style.letterSpacing;let a=!1;if(Si.experimentalLetterSpacingSupported&&(Si.experimentalLetterSpacing?(this.context.letterSpacing=`${n}px`,this.context.textLetterSpacing=`${n}px`,a=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),n===0||a){s?this.context.strokeText(e,r,i):this.context.fillText(e,r,i);return}let o=r;const l=Si.graphemeSegmenter(e);let c=this.context.measureText(e).width,h=0;for(let f=0;f<l.length;++f){const u=l[f];s?this.context.strokeText(u,o,i):this.context.fillText(u,o,i);let d="";for(let p=f+1;p<l.length;++p)d+=l[p];h=this.context.measureText(d).width,o+=c-h+n,c=h}}updateTexture(){const e=this.canvas;if(this._style.trim){const a=LN(e);a.data&&(e.width=a.width,e.height=a.height,this.context.putImageData(a.data,0,0))}const r=this._texture,i=this._style,s=i.trim?0:i.padding,n=r.baseTexture;r.trim.width=r._frame.width=e.width/this._resolution,r.trim.height=r._frame.height=e.height/this._resolution,r.trim.x=-s,r.trim.y=-s,r.orig.width=r._frame.width-s*2,r.orig.height=r._frame.height-s*2,this._onTextureUpdate(),n.setRealSize(e.width,e.height,this._resolution),r.updateUvs(),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(e,r){return this.updateText(!0),this._textureID===-1&&(e=!1),super.getBounds(e,r)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds.call(this,e)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(e,r,i){const s=e.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;let n;const a=e.dropShadow?e.dropShadowDistance:0,o=e.padding||0,l=this.canvas.width/this._resolution-a-o*2,c=this.canvas.height/this._resolution-a-o*2,h=s.slice(),f=e.fillGradientStops.slice();if(!f.length){const u=h.length+1;for(let d=1;d<u;++d)f.push(d/u)}if(h.unshift(s[0]),f.unshift(0),h.push(s[s.length-1]),f.push(1),e.fillGradientType===ru.LINEAR_VERTICAL){n=this.context.createLinearGradient(l/2,o,l/2,c+o);const u=i.fontProperties.fontSize+e.strokeThickness;for(let d=0;d<r.length;d++){const p=i.lineHeight*(d-1)+u,m=i.lineHeight*d;let g=m;d>0&&p>m&&(g=(m+p)/2);const y=m+u,_=i.lineHeight*(d+1);let v=y;d+1<r.length&&_<y&&(v=(y+_)/2);const b=(v-g)/c;for(let w=0;w<h.length;w++){let A=0;typeof f[w]=="number"?A=f[w]:A=w/h.length;let S=Math.min(1,Math.max(0,g/c+A*b));S=Number(S.toFixed(5)),n.addColorStop(S,h[w])}}}else{n=this.context.createLinearGradient(o,c/2,l+o,c/2);const u=h.length+1;let d=1;for(let p=0;p<h.length;p++){let m;typeof f[p]=="number"?m=f[p]:m=d/u,n.addColorStop(m,h[p]),d++}}return n}destroy(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},aB,e),super.destroy(e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this.updateText(!0);const r=$i(this.scale.x)||1;this.scale.x=r*e/this._texture.orig.width,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this.updateText(!0);const r=$i(this.scale.y)||1;this.scale.y=r*e/this._texture.orig.height,this._height=e}get style(){return this._style}set style(e){e=e||{},e instanceof ts?this._style=e:this._style=new ts(e),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}};yw.defaultAutoResolution=!0;let bw=yw;class fh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Pc{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const r=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const n in r){const a=r[n].match(/^[a-z]+/gm)[0],o=r[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),l={};for(const c in o){const h=o[c].split("="),f=h[0],u=h[1].replace(/"/gm,""),d=parseFloat(u),p=isNaN(d)?u:d;l[f]=p}i[a].push(l)}const s=new fh;return i.info.forEach(n=>s.info.push({face:n.face,size:parseInt(n.size,10)})),i.common.forEach(n=>s.common.push({lineHeight:parseInt(n.lineHeight,10)})),i.page.forEach(n=>s.page.push({id:parseInt(n.id,10),file:n.file})),i.char.forEach(n=>s.char.push({id:parseInt(n.id,10),page:parseInt(n.page,10),x:parseInt(n.x,10),y:parseInt(n.y,10),width:parseInt(n.width,10),height:parseInt(n.height,10),xoffset:parseInt(n.xoffset,10),yoffset:parseInt(n.yoffset,10),xadvance:parseInt(n.xadvance,10)})),i.kerning.forEach(n=>s.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),i.distanceField.forEach(n=>s.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),s}}class hp{static test(e){const r=e;return typeof e!="string"&&"getElementsByTagName"in e&&r.getElementsByTagName("page").length&&r.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const r=new fh,i=e.getElementsByTagName("info"),s=e.getElementsByTagName("common"),n=e.getElementsByTagName("page"),a=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField");for(let c=0;c<i.length;c++)r.info.push({face:i[c].getAttribute("face"),size:parseInt(i[c].getAttribute("size"),10)});for(let c=0;c<s.length;c++)r.common.push({lineHeight:parseInt(s[c].getAttribute("lineHeight"),10)});for(let c=0;c<n.length;c++)r.page.push({id:parseInt(n[c].getAttribute("id"),10)||0,file:n[c].getAttribute("file")});for(let c=0;c<a.length;c++){const h=a[c];r.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(let c=0;c<o.length;c++)r.kerning.push({first:parseInt(o[c].getAttribute("first"),10),second:parseInt(o[c].getAttribute("second"),10),amount:parseInt(o[c].getAttribute("amount"),10)});for(let c=0;c<l.length;c++)r.distanceField.push({fieldType:l[c].getAttribute("fieldType"),distanceRange:parseInt(l[c].getAttribute("distanceRange"),10)});return r}}class up{static test(e){return typeof e=="string"&&e.includes("<font>")?hp.test(X.ADAPTER.parseXML(e)):!1}static parse(e){return hp.parse(X.ADAPTER.parseXML(e))}}const yd=[Pc,hp,up];function oB(t){for(let e=0;e<yd.length;e++)if(yd[e].test(t))return yd[e];return null}function lB(t,e,r,i,s,n){const a=r.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;let o;const l=r.dropShadow?r.dropShadowDistance:0,c=r.padding||0,h=t.width/i-l-c*2,f=t.height/i-l-c*2,u=a.slice(),d=r.fillGradientStops.slice();if(!d.length){const p=u.length+1;for(let m=1;m<p;++m)d.push(m/p)}if(u.unshift(a[0]),d.unshift(0),u.push(a[a.length-1]),d.push(1),r.fillGradientType===ru.LINEAR_VERTICAL){o=e.createLinearGradient(h/2,c,h/2,f+c);let p=0;const m=(n.fontProperties.fontSize+r.strokeThickness)/f;for(let g=0;g<s.length;g++){const y=n.lineHeight*g;for(let _=0;_<u.length;_++){let v=0;typeof d[_]=="number"?v=d[_]:v=_/u.length;const b=y/f+v*m;let w=Math.max(p,b);w=Math.min(w,1),o.addColorStop(w,u[_]),p=w}}}else{o=e.createLinearGradient(c,f/2,h+c,f/2);const p=u.length+1;let m=1;for(let g=0;g<u.length;g++){let y;typeof d[g]=="number"?y=d[g]:y=m/p,o.addColorStop(y,u[g]),m++}}return o}function cB(t,e,r,i,s,n,a){const o=r.text,l=r.fontProperties;e.translate(i,s),e.scale(n,n);const c=a.strokeThickness/2,h=-(a.strokeThickness/2);if(e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=lB(t,e,a,n,[o],r),e.strokeStyle=a.stroke,a.dropShadow){const f=a.dropShadowColor,u=a.dropShadowBlur*n,d=a.dropShadowDistance*n;e.shadowColor=Oe.shared.setValue(f).setAlpha(a.dropShadowAlpha).toRgbaString(),e.shadowBlur=u,e.shadowOffsetX=Math.cos(a.dropShadowAngle)*d,e.shadowOffsetY=Math.sin(a.dropShadowAngle)*d}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;a.stroke&&a.strokeThickness&&e.strokeText(o,c,h+r.lineHeight-l.descent),a.fill&&e.fillText(o,c,h+r.lineHeight-l.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Mc(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}function xw(t){return Array.from?Array.from(t):t.split("")}function hB(t){typeof t=="string"&&(t=[t]);const e=[];for(let r=0,i=t.length;r<i;r++){const s=t[r];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);const n=s[0].charCodeAt(0),a=s[1].charCodeAt(0);if(a<n)throw new Error("[BitmapFont]: Invalid character range.");for(let o=n,l=a;o<=l;o++)e.push(String.fromCharCode(o))}else e.push(...xw(s))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}const _i=class Tr{constructor(e,r,i){var h;const[s]=e.info,[n]=e.common,[a]=e.page,[o]=e.distanceField,l=pi(a.file),c={};this._ownsTextures=i,this.font=s.face,this.size=s.size,this.lineHeight=n.lineHeight/l,this.chars={},this.pageTextures=c;for(let f=0;f<e.page.length;f++){const{id:u,file:d}=e.page[f];c[u]=r instanceof Array?r[f]:r[d],o!=null&&o.fieldType&&o.fieldType!=="none"&&(c[u].baseTexture.alphaMode=_t.NO_PREMULTIPLIED_ALPHA,c[u].baseTexture.mipmap=Vr.OFF)}for(let f=0;f<e.char.length;f++){const{id:u,page:d}=e.char[f];let{x:p,y:m,width:g,height:y,xoffset:_,yoffset:v,xadvance:b}=e.char[f];p/=l,m/=l,g/=l,y/=l,_/=l,v/=l,b/=l;const w=new me(p+c[d].frame.x/l,m+c[d].frame.y/l,g,y);this.chars[u]={xOffset:_,yOffset:v,xAdvance:b,kerning:{},texture:new Q(c[d].baseTexture,w),page:d}}for(let f=0;f<e.kerning.length;f++){let{first:u,second:d,amount:p}=e.kerning[f];u/=l,d/=l,p/=l,this.chars[d]&&(this.chars[d].kerning[u]=p)}this.distanceFieldRange=o==null?void 0:o.distanceRange,this.distanceFieldType=((h=o==null?void 0:o.fieldType)==null?void 0:h.toLowerCase())??"none"}destroy(){for(const e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(const e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null}static install(e,r,i){let s;if(e instanceof fh)s=e;else{const a=oB(e);if(!a)throw new Error("Unrecognized data format for font.");s=a.parse(e)}r instanceof Q&&(r=[r]);const n=new Tr(s,r,i);return Tr.available[n.font]=n,n}static uninstall(e){const r=Tr.available[e];if(!r)throw new Error(`No font found named '${e}'`);r.destroy(),delete Tr.available[e]}static from(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:s,padding:n,resolution:a,textureWidth:o,textureHeight:l,...c}=Object.assign({},Tr.defaultOptions,i),h=hB(s),f=r instanceof ts?r:new ts(r),u=o,d=new fh;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};let p=0,m=0,g,y,_,v=0;const b=[];for(let A=0;A<h.length;A++){g||(g=X.ADAPTER.createCanvas(),g.width=o,g.height=l,y=g.getContext("2d"),_=new de(g,{resolution:a,...c}),b.push(new Q(_)),d.page.push({id:b.length-1,file:""}));const S=h[A],C=Si.measureText(S,f,!1,g),T=C.width,M=Math.ceil(C.height),I=Math.ceil((f.fontStyle==="italic"?2:1)*T);if(m>=l-M*a){if(m===0)throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${f.fontFamily}', fontSize: ${f.fontSize}px, char: '${S}')`);--A,g=null,y=null,_=null,m=0,p=0,v=0;continue}if(v=Math.max(M+C.fontProperties.descent,v),I*a+p>=u){if(p===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${f.fontFamily}', fontSize: ${f.fontSize}px, char: '${S}')`);--A,m+=v*a,m=Math.ceil(m),p=0,v=0;continue}cB(g,y,C,p,m,a,f);const k=Mc(C.text);d.char.push({id:k,page:b.length-1,x:p/a,y:m/a,width:I,height:M,xoffset:0,yoffset:0,xadvance:T-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0)}),p+=(I+2*n)*a,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let A=0,S=h.length;A<S;A++){const C=h[A];for(let T=0;T<S;T++){const M=h[T],I=y.measureText(C).width,k=y.measureText(M).width,P=y.measureText(C+M).width-(I+k);P&&d.kerning.push({first:Mc(C),second:Mc(M),amount:P})}}const w=new Tr(d,b,!0);return Tr.available[e]!==void 0&&Tr.uninstall(e),Tr.available[e]=w,w}};_i.ALPHA=[["a","z"],["A","Z"]," "],_i.NUMERIC=[["0","9"]],_i.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],_i.ASCII=[[" ","~"]],_i.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:_i.ALPHANUMERIC},_i.available={};let wi=_i;class uB{constructor(e,r){this.uvBuffer=e,this.uvMatrix=r,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(e){if(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const r=this.uvBuffer.data;(!this.data||this.data.length!==r.length)&&(this.data=new Float32Array(r.length)),this.uvMatrix.multiplyUvs(r,this.data),this._updateID++}}const bd=new Se,ty=new js,_w=class ww extends fr{constructor(e,r,i,s=Nr.TRIANGLES){super(),this.geometry=e,this.shader=r,this.state=i||Wr.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=X.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(e){this.shader=e}get material(){return this.shader}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(e){this.shader.tint=e}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(e){this.shader.texture=e}_render(e){const r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===Nr.TRIANGLES&&r.length<ww.BATCHABLE_SIZE*2?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(e){const r=this.shader;r.alpha=this.worldAlpha,r.update&&r.update(),e.batch.flush(),r.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(r),e.state.set(this.state),e.geometry.bind(this.geometry,r),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(e){const r=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=r.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;const s=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[s]),e.plugins[s].render(this)}calculateVertices(){const e=this.geometry.buffers[0],r=e.data,i=e._updateID;if(i===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==r.length&&(this.vertexData=new Float32Array(r.length));const s=this.transform.worldTransform,n=s.a,a=s.b,o=s.c,l=s.d,c=s.tx,h=s.ty,f=this.vertexData;for(let u=0;u<f.length/2;u++){const d=r[u*2],p=r[u*2+1];f[u*2]=n*d+o*p+c,f[u*2+1]=a*d+l*p+h}if(this._roundPixels){const u=X.RESOLUTION;for(let d=0;d<f.length;++d)f[d]=Math.round(f[d]*u)/u}this.vertexDirty=i}calculateUvs(){const e=this.geometry.buffers[1],r=this.shader;r.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new uB(e,r.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,bd);const r=this.geometry.getBuffer("aVertexPosition").data,i=ty.points,s=this.geometry.getIndex().data,n=s.length,a=this.drawMode===4?3:1;for(let o=0;o+2<n;o+=a){const l=s[o]*2,c=s[o+1]*2,h=s[o+2]*2;if(i[0]=r[l],i[1]=r[l+1],i[2]=r[c],i[3]=r[c+1],i[4]=r[h],i[5]=r[h+1],ty.contains(bd.x,bd.y))return!0}return!1}destroy(e){super.destroy(e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};_w.BATCHABLE_SIZE=100;let ry=_w;class dB extends Ji{constructor(e,r,i){super();const s=new We(e),n=new We(r,!0),a=new We(i,!0,!0);this.addAttribute("aVertexPosition",s,2,!1,te.FLOAT).addAttribute("aTextureCoord",n,2,!1,te.FLOAT).addIndex(a),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var fB=`varying vec2 vTextureCoord;
714
- uniform vec4 uColor;
715
-
716
- uniform sampler2D uSampler;
717
-
718
- void main(void)
719
- {
720
- gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
721
- }
722
- `,pB=`attribute vec2 aVertexPosition;
723
- attribute vec2 aTextureCoord;
724
-
725
- uniform mat3 projectionMatrix;
726
- uniform mat3 translationMatrix;
727
- uniform mat3 uTextureMatrix;
728
-
729
- varying vec2 vTextureCoord;
730
-
731
- void main(void)
732
- {
733
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
734
-
735
- vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
736
- }
737
- `;class iy extends jr{constructor(e,r){const i={uSampler:e,alpha:1,uTextureMatrix:ke.IDENTITY,uColor:new Float32Array([1,1,1,1])};r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r),r.uniforms&&Object.assign(i,r.uniforms),super(r.program||ci.from(pB,fB),i),this._colorDirty=!1,this.uvMatrix=new W1(e),this.batchable=r.program===void 0,this.pluginName=r.pluginName,this._tintColor=new Oe(r.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=r.alpha}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const e=this.texture.baseTexture.alphaMode;Oe.shared.setValue(this._tintColor).premultiply(this._alpha,e).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}var mB=`// Pixi texture info\r
738
- varying vec2 vTextureCoord;\r
739
- uniform sampler2D uSampler;\r
740
- \r
741
- // Tint\r
742
- uniform vec4 uColor;\r
743
- \r
744
- // on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
745
- uniform float uFWidth;\r
746
- \r
747
- void main(void) {\r
748
- \r
749
- // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
750
- vec4 texColor = texture2D(uSampler, vTextureCoord);\r
751
- \r
752
- // MSDF\r
753
- float median = texColor.r + texColor.g + texColor.b -\r
754
- min(texColor.r, min(texColor.g, texColor.b)) -\r
755
- max(texColor.r, max(texColor.g, texColor.b));\r
756
- // SDF\r
757
- median = min(median, texColor.a);\r
758
- \r
759
- float screenPxDistance = uFWidth * (median - 0.5);\r
760
- float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
761
- if (median < 0.01) {\r
762
- alpha = 0.0;\r
763
- } else if (median > 0.99) {\r
764
- alpha = 1.0;\r
765
- }\r
766
- \r
767
- // Gamma correction for coverage-like alpha\r
768
- float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r
769
- float gamma = mix(1.0, 1.0 / 2.2, luma);\r
770
- float coverage = pow(uColor.a * alpha, gamma); \r
771
- \r
772
- // NPM Textures, NPM outputs\r
773
- gl_FragColor = vec4(uColor.rgb, coverage);\r
774
- }\r
775
- `,gB=`// Mesh material default fragment\r
776
- attribute vec2 aVertexPosition;\r
777
- attribute vec2 aTextureCoord;\r
778
- \r
779
- uniform mat3 projectionMatrix;\r
780
- uniform mat3 translationMatrix;\r
781
- uniform mat3 uTextureMatrix;\r
782
- \r
783
- varying vec2 vTextureCoord;\r
784
- \r
785
- void main(void)\r
786
- {\r
787
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
788
- \r
789
- vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
790
- }\r
791
- `;const sy=[],ny=[],ay=[],vB=class Ew extends fr{constructor(e,r={}){super();const{align:i,tint:s,maxWidth:n,letterSpacing:a,fontName:o,fontSize:l}=Object.assign({},Ew.styleDefaults,r);if(!wi.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new Oe(s),this._font=void 0,this._fontName=o,this._fontSize=l,this.text=e,this._maxWidth=n,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new li(()=>{this.dirty=!0},this,0,0),this._roundPixels=X.ROUND_PIXELS,this.dirty=!0,this._resolution=X.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const e=wi.available[this._fontName],r=this.fontSize,i=r/e.size,s=new Se,n=[],a=[],o=[],l=this._text.replace(/(?:\r\n|\r)/g,`
792
- `)||" ",c=xw(l),h=this._maxWidth*e.size/r,f=e.distanceFieldType==="none"?sy:ny;let u=null,d=0,p=0,m=0,g=-1,y=0,_=0,v=0,b=0;for(let k=0;k<c.length;k++){const P=c[k],R=Mc(P);if(/(?:\s)/.test(P)&&(g=k,y=d,b++),P==="\r"||P===`
793
- `){a.push(d),o.push(-1),p=Math.max(p,d),++m,++_,s.x=0,s.y+=e.lineHeight,u=null,b=0;continue}const O=e.chars[R];if(!O)continue;u&&O.kerning[u]&&(s.x+=O.kerning[u]);const L=ay.pop()||{texture:Q.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Se};L.texture=O.texture,L.line=m,L.charCode=R,L.position.x=Math.round(s.x+O.xOffset+this._letterSpacing/2),L.position.y=Math.round(s.y+O.yOffset),L.prevSpaces=b,n.push(L),d=L.position.x+Math.max(O.xAdvance-O.xOffset,O.texture.orig.width),s.x+=O.xAdvance+this._letterSpacing,v=Math.max(v,O.yOffset+O.texture.height),u=R,g!==-1&&h>0&&s.x>h&&(++_,On(n,1+g-_,1+k-g),k=g,g=-1,a.push(y),o.push(n.length>0?n[n.length-1].prevSpaces:0),p=Math.max(p,y),m++,s.x=0,s.y+=e.lineHeight,u=null,b=0)}const w=c[c.length-1];w!=="\r"&&w!==`
794
- `&&(/(?:\s)/.test(w)&&(d=y),a.push(d),p=Math.max(p,d),o.push(-1));const A=[];for(let k=0;k<=m;k++){let P=0;this._align==="right"?P=p-a[k]:this._align==="center"?P=(p-a[k])/2:this._align==="justify"&&(P=o[k]<0?0:(p-a[k])/o[k]),A.push(P)}const S=n.length,C={},T=[],M=this._activePagesMeshData;f.push(...M);for(let k=0;k<S;k++){const P=n[k].texture,R=P.baseTexture.uid;if(!C[R]){let O=f.pop();if(!O){const N=new dB;let B,U;e.distanceFieldType==="none"?(B=new iy(Q.EMPTY),U=ie.NORMAL):(B=new iy(Q.EMPTY,{program:ci.from(gB,mB),uniforms:{uFWidth:0}}),U=ie.NORMAL_NPM);const F=new ry(N,B);F.blendMode=U,O={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:F,vertices:null,uvs:null,indices:null}}O.index=0,O.indexCount=0,O.vertexCount=0,O.uvsCount=0,O.total=0;const{_textureCache:L}=this;L[R]=L[R]||new Q(P.baseTexture),O.mesh.texture=L[R],O.mesh.tint=this._tintColor.value,T.push(O),C[R]=O}C[R].total++}for(let k=0;k<M.length;k++)T.includes(M[k])||this.removeChild(M[k].mesh);for(let k=0;k<T.length;k++)T[k].mesh.parent!==this&&this.addChild(T[k].mesh);this._activePagesMeshData=T;for(const k in C){const P=C[k],R=P.total;if(!(((I=P.indices)==null?void 0:I.length)>6*R)||P.vertices.length<ry.BATCHABLE_SIZE*2)P.vertices=new Float32Array(4*2*R),P.uvs=new Float32Array(4*2*R),P.indices=new Uint16Array(6*R);else{const O=P.total,L=P.vertices;for(let N=O*4*2;N<L.length;N++)L[N]=0}P.mesh.size=6*R}for(let k=0;k<S;k++){const P=n[k];let R=P.position.x+A[P.line]*(this._align==="justify"?P.prevSpaces:1);this._roundPixels&&(R=Math.round(R));const O=R*i,L=P.position.y*i,N=P.texture,B=C[N.baseTexture.uid],U=N.frame,F=N._uvs,j=B.index++;B.indices[j*6+0]=0+j*4,B.indices[j*6+1]=1+j*4,B.indices[j*6+2]=2+j*4,B.indices[j*6+3]=0+j*4,B.indices[j*6+4]=2+j*4,B.indices[j*6+5]=3+j*4,B.vertices[j*8+0]=O,B.vertices[j*8+1]=L,B.vertices[j*8+2]=O+U.width*i,B.vertices[j*8+3]=L,B.vertices[j*8+4]=O+U.width*i,B.vertices[j*8+5]=L+U.height*i,B.vertices[j*8+6]=O,B.vertices[j*8+7]=L+U.height*i,B.uvs[j*8+0]=F.x0,B.uvs[j*8+1]=F.y0,B.uvs[j*8+2]=F.x1,B.uvs[j*8+3]=F.y1,B.uvs[j*8+4]=F.x2,B.uvs[j*8+5]=F.y2,B.uvs[j*8+6]=F.x3,B.uvs[j*8+7]=F.y3}this._textWidth=p*i,this._textHeight=(s.y+e.lineHeight)*i;for(const k in C){const P=C[k];if(this.anchor.x!==0||this.anchor.y!==0){let N=0;const B=this._textWidth*this.anchor.x,U=this._textHeight*this.anchor.y;for(let F=0;F<P.total;F++)P.vertices[N++]-=B,P.vertices[N++]-=U,P.vertices[N++]-=B,P.vertices[N++]-=U,P.vertices[N++]-=B,P.vertices[N++]-=U,P.vertices[N++]-=B,P.vertices[N++]-=U}this._maxLineHeight=v*i;const R=P.mesh.geometry.getBuffer("aVertexPosition"),O=P.mesh.geometry.getBuffer("aTextureCoord"),L=P.mesh.geometry.getIndex();R.data=P.vertices,O.data=P.uvs,L.data=P.indices,R.update(),O.update(),L.update()}for(let k=0;k<n.length;k++)ay.push(n[k]);this._font=e,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);const{distanceFieldRange:r,distanceFieldType:i,size:s}=wi.available[this._fontName];if(i!=="none"){const{a:n,b:a,c:o,d:l}=this.worldTransform,c=Math.sqrt(n*n+a*a),h=Math.sqrt(o*o+l*l),f=(Math.abs(c)+Math.abs(h))/2,u=this.fontSize/s,d=e._view.resolution;for(const p of this._activePagesMeshData)p.mesh.shader.uniforms.uFWidth=f*r*u*d}super._render(e)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const e=wi.available[this._fontName];if(!e)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==e&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(e){if(this.tint!==e){this._tintColor.setValue(e);for(let r=0;r<this._activePagesMeshData.length;r++)this._activePagesMeshData[r].mesh.tint=e}}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.dirty=!0)}get fontName(){return this._fontName}set fontName(e){if(!wi.available[e])throw new Error(`Missing BitmapFont "${e}"`);this._fontName!==e&&(this._fontName=e,this.dirty=!0)}get fontSize(){return this._fontSize??wi.available[this._fontName].size}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get text(){return this._text}set text(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}destroy(e){const{_textureCache:r}=this,i=wi.available[this._fontName].distanceFieldType==="none"?sy:ny;i.push(...this._activePagesMeshData);for(const s of this._activePagesMeshData)this.removeChild(s.mesh);this._activePagesMeshData=[],i.filter(s=>r[s.mesh.texture.baseTexture.uid]).forEach(s=>{s.mesh.texture=Q.EMPTY});for(const s in r)r[s].destroy(),delete r[s];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};vB.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const oy={loader:V.LoadParser,resolver:V.ResolveParser,cache:V.CacheParser,detection:V.DetectionParser};Z.handle(V.Asset,t=>{const e=t.ref;Object.entries(oy).filter(([r])=>!!e[r]).forEach(([r,i])=>Z.add(Object.assign(e[r],{extension:e[r].extension??i})))},t=>{const e=t.ref;Object.keys(oy).filter(r=>!!e[r]).forEach(r=>Z.remove(e[r]))});class yB{constructor(e,r=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=r}add(e){e.forEach(r=>{this._assetList.push(r)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],r=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<r;i++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())}}function _a(t,e){if(Array.isArray(e)){for(const r of e)if(t.startsWith(`data:${r}`))return!0;return!1}return t.startsWith(`data:${e}`)}function cs(t,e){const r=t.split("?")[0],i=Ye.extname(r).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}const or=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(i=>typeof i=="string"||r?e(i):i):t),dp=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};function Sw(t,e,r,i,s){const n=e[r];for(let a=0;a<n.length;a++){const o=n[a];r<e.length-1?Sw(t.replace(i[r],o),e,r+1,i,s):s.push(t.replace(i[r],o))}}function bB(t){const e=/\{(.*?)\}/g,r=t.match(e),i=[];if(r){const s=[];r.forEach(n=>{const a=n.substring(1,n.length-1).split(",");s.push(a)}),Sw(t,s,0,r,i)}else i.push(t);return i}const ph=t=>!Array.isArray(t);class xB{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const r=this._cache.get(e);return r||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),r}set(e,r){const i=or(e);let s;for(let o=0;o<this.parsers.length;o++){const l=this.parsers[o];if(l.test(r)){s=l.getCacheableAssets(i,r);break}}s||(s={},i.forEach(o=>{s[o]=r}));const n=Object.keys(s),a={cacheKeys:n,keys:i};if(i.forEach(o=>{this._cacheMap.set(o,a)}),n.forEach(o=>{this._cache.has(o)&&this._cache.get(o)!==r&&console.warn("[Cache] already has key:",o),this._cache.set(o,s[o])}),r instanceof Q){const o=r;i.forEach(l=>{o.baseTexture!==Q.EMPTY.baseTexture&&de.addToCache(o.baseTexture,l),Q.addToCache(o,l)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const r=this._cacheMap.get(e);r.cacheKeys.forEach(i=>{this._cache.delete(i)}),r.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const ws=new xB;class _B{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,r,i)=>(this._parsersValidated=!1,e[r]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,r){const i={promise:null,parser:null};return i.promise=(async()=>{var a,o;let s=null,n=null;if(r.loadParser&&(n=this._parserHash[r.loadParser],n||console.warn(`[Assets] specified load parser "${r.loadParser}" not found while loading ${e}`)),!n){for(let l=0;l<this.parsers.length;l++){const c=this.parsers[l];if(c.load&&((a=c.test)!=null&&a.call(c,e,r,this))){n=c;break}}if(!n)return console.warn(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}s=await n.load(e,r,this),i.parser=n;for(let l=0;l<this.parsers.length;l++){const c=this.parsers[l];c.parse&&c.parse&&await((o=c.testParse)==null?void 0:o.call(c,s,r,this))&&(s=await c.parse(s,r,this)||s,i.parser=c)}return s})(),i}async load(e,r){this._parsersValidated||this._validateParsers();let i=0;const s={},n=ph(e),a=or(e,c=>({alias:[c],src:c})),o=a.length,l=a.map(async c=>{const h=Ye.toAbsolute(c.src);if(!s[c.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,c)),s[c.src]=await this.promiseCache[h].promise,r&&r(++i/o)}catch(f){throw delete this.promiseCache[h],delete s[c.src],new Error(`[Loader.load] Failed to load ${h}.
795
- ${f}`)}});return await Promise.all(l),n?s[a[0].src]:s}async unload(e){const r=or(e,i=>({alias:[i],src:i})).map(async i=>{var a,o;const s=Ye.toAbsolute(i.src),n=this.promiseCache[s];if(n){const l=await n.promise;delete this.promiseCache[s],(o=(a=n.parser)==null?void 0:a.unload)==null||o.call(a,l,i,this)}});await Promise.all(r)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,r)=>(e[r.name]&&console.warn(`[Assets] loadParser name conflict "${r.name}"`),{...e,[r.name]:r}),{})}}var pr=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(pr||{});const wB=".json",EB="application/json",SB={extension:{type:V.LoadParser,priority:pr.Low},name:"loadJson",test(t){return _a(t,EB)||cs(t,wB)},async load(t){return await(await X.ADAPTER.fetch(t)).json()}};Z.add(SB);const TB=".txt",AB="text/plain",CB={name:"loadTxt",extension:{type:V.LoadParser,priority:pr.Low},test(t){return _a(t,AB)||cs(t,TB)},async load(t){return await(await X.ADAPTER.fetch(t)).text()}};Z.add(CB);const IB=["normal","bold","100","200","300","400","500","600","700","800","900"],RB=[".ttf",".otf",".woff",".woff2"],PB=["font/ttf","font/otf","font/woff","font/woff2"],MB=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function OB(t){const e=Ye.extname(t),r=Ye.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1));let i=r.length>0;for(const n of r)if(!n.match(MB)){i=!1;break}let s=r.join(" ");return i||(s=`"${s.replace(/[\\"]/g,"\\$&")}"`),s}const kB=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function DB(t){return kB.test(t)?t:encodeURI(t)}const NB={extension:{type:V.LoadParser,priority:pr.Low},name:"loadWebFont",test(t){return _a(t,PB)||cs(t,RB)},async load(t,e){var i,s,n;const r=X.ADAPTER.getFontFaceSet();if(r){const a=[],o=((i=e.data)==null?void 0:i.family)??OB(t),l=((n=(s=e.data)==null?void 0:s.weights)==null?void 0:n.filter(h=>IB.includes(h)))??["normal"],c=e.data??{};for(let h=0;h<l.length;h++){const f=l[h],u=new FontFace(o,`url(${DB(t)})`,{...c,weight:f});await u.load(),r.add(u),a.push(u)}return a.length===1?a[0]:a}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){(Array.isArray(t)?t:[t]).forEach(e=>X.ADAPTER.getFontFaceSet().delete(e))}};Z.add(NB);let ly=0,xd;const LB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=",BB={id:"checkImageBitmap",code:`
796
- async function checkImageBitmap()
797
- {
798
- try
799
- {
800
- if (typeof createImageBitmap !== 'function') return false;
801
-
802
- const response = await fetch('${LB}');
803
- const imageBlob = await response.blob();
804
- const imageBitmap = await createImageBitmap(imageBlob);
805
-
806
- return imageBitmap.width === 1 && imageBitmap.height === 1;
807
- }
808
- catch (e)
809
- {
810
- return false;
811
- }
812
- }
813
- checkImageBitmap().then((result) => { self.postMessage(result); });
814
- `},FB={id:"loadImageBitmap",code:`
815
- async function loadImageBitmap(url)
816
- {
817
- const response = await fetch(url);
818
-
819
- if (!response.ok)
820
- {
821
- throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \`
822
- + \`\${response.status} \${response.statusText}\`);
823
- }
824
-
825
- const imageBlob = await response.blob();
826
- const imageBitmap = await createImageBitmap(imageBlob);
827
-
828
- return imageBitmap;
829
- }
830
- self.onmessage = async (event) =>
831
- {
832
- try
833
- {
834
- const imageBitmap = await loadImageBitmap(event.data.data[0]);
835
-
836
- self.postMessage({
837
- data: imageBitmap,
838
- uuid: event.data.uuid,
839
- id: event.data.id,
840
- }, [imageBitmap]);
841
- }
842
- catch(e)
843
- {
844
- self.postMessage({
845
- error: e,
846
- uuid: event.data.uuid,
847
- id: event.data.id,
848
- });
849
- }
850
- };`};let _d;class UB{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const r=URL.createObjectURL(new Blob([BB.code],{type:"application/javascript"})),i=new Worker(r);i.addEventListener("message",s=>{i.terminate(),URL.revokeObjectURL(r),e(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){xd===void 0&&(xd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers<xd&&(_d||(_d=URL.createObjectURL(new Blob([FB.code],{type:"application/javascript"}))),this._createdWorkers++,e=new Worker(_d),e.addEventListener("message",r=>{this.complete(r.data),this.returnWorker(r.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,r){await this._initWorkers();const i=new Promise((s,n)=>{this.queue.push({id:e,arguments:r,resolve:s,reject:n})});return this.next(),i}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const r=this.queue.pop(),i=r.id;this.resolveHash[ly]={resolve:r.resolve,reject:r.reject},e.postMessage({data:r.arguments,uuid:ly++,id:i})}}const cy=new UB;function vl(t,e,r){t.resource.internal=!0;const i=new Q(t),s=()=>{delete e.promiseCache[r],ws.has(r)&&ws.remove(r)};return i.baseTexture.once("destroyed",()=>{r in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),s())}),i.once("destroyed",()=>{t.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s())}),i}const jB=[".jpeg",".jpg",".png",".webp",".avif"],$B=["image/jpeg","image/png","image/webp","image/avif"];async function GB(t){const e=await X.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const r=await e.blob();return await createImageBitmap(r)}const iu={name:"loadTextures",extension:{type:V.LoadParser,priority:pr.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(t){return _a(t,$B)||cs(t,jB)},async load(t,e,r){var o;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let s;i?this.config.preferWorkers&&await cy.isImageBitmapSupported()?s=await cy.loadImageBitmap(t):s=await GB(t):s=await new Promise((l,c)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=t,h.complete?l(h):(h.onload=()=>l(h),h.onerror=f=>c(f))});const n={...e.data};n.resolution??(n.resolution=pi(t)),i&&((o=n.resourceOptions)==null?void 0:o.ownsImageBitmap)===void 0&&(n.resourceOptions={...n.resourceOptions},n.resourceOptions.ownsImageBitmap=!0);const a=new de(s,n);return a.resource.src=t,vl(a,r,t)},unload(t){t.destroy(!0)}};Z.add(iu);const zB=".svg",HB="image/svg+xml",VB={extension:{type:V.LoadParser,priority:pr.High},name:"loadSVG",test(t){return _a(t,HB)||cs(t,zB)},async testParse(t){return np.test(t)},async parse(t,e,r){var n;const i=new np(t,(n=e==null?void 0:e.data)==null?void 0:n.resourceOptions);await i.load();const s=new de(i,{resolution:pi(t),...e==null?void 0:e.data});return s.resource.src=e.src,vl(s,r,e.src)},async load(t,e){return(await X.ADAPTER.fetch(t)).text()},unload:iu.unload};Z.add(VB);const WB=[".mp4",".m4v",".webm",".ogv"],XB=["video/mp4","video/webm","video/ogg"],YB={name:"loadVideo",extension:{type:V.LoadParser,priority:pr.High},config:{defaultAutoPlay:!0},test(t){return _a(t,XB)||cs(t,WB)},async load(t,e,r){var a;let i;const s=await(await X.ADAPTER.fetch(t)).blob(),n=URL.createObjectURL(s);try{const o={autoPlay:this.config.defaultAutoPlay,...(a=e==null?void 0:e.data)==null?void 0:a.resourceOptions},l=new mw(n,o);await l.load();const c=new de(l,{alphaMode:await yN(),resolution:pi(t),...e==null?void 0:e.data});c.resource.src=t,i=vl(c,r,t),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(n)})}catch(o){throw URL.revokeObjectURL(n),o}return i},unload(t){t.destroy(!0)}};Z.add(YB);class qB{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,r)=>`${e}${this._bundleIdConnector}${r}`,extractAssetIdFromBundle:(e,r)=>r.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(r=>{this._preferredOrder.push(r),r.priority||(r.priority=Object.keys(r.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const r=e;this._defaultSearchParams=Object.keys(r).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(r[i])}`).join("&")}}getAlias(e){const{alias:r,name:i,src:s,srcs:n}=e;return or(r||i||s||n,a=>typeof a=="string"?a:Array.isArray(a)?a.map(o=>(o==null?void 0:o.src)??(o==null?void 0:o.srcs)??o):a!=null&&a.src||a!=null&&a.srcs?a.src??a.srcs:a,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(r=>{this.addBundle(r.name,r.assets)})}addBundle(e,r){const i=[];Array.isArray(r)?r.forEach(s=>{const n=s.src??s.srcs,a=s.alias??s.name;let o;if(typeof a=="string"){const l=this._createBundleAssetId(e,a);i.push(l),o=[a,l]}else{const l=a.map(c=>this._createBundleAssetId(e,c));i.push(...l),o=[...a,...l]}this.add({...s,alias:o,src:n})}):Object.keys(r).forEach(s=>{const n=[s,this._createBundleAssetId(e,s)];if(typeof r[s]=="string")this.add({alias:n,src:r[s]});else if(Array.isArray(r[s]))this.add({alias:n,src:r[s]});else{const a=r[s],o=a.src??a.srcs;this.add({...a,alias:n,src:Array.isArray(o)?o:[o]})}i.push(...n)}),this._bundles[e]=i}add(e,r,i,s,n){const a=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(xe("7.2.0",`Assets.add now uses an object instead of individual parameters.
851
- Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:e,src:r,data:i,format:s,loadParser:n})):Array.isArray(e)?a.push(...e):a.push(e);let o;o=l=>{this.hasKey(l)&&console.warn(`[Resolver] already has key: ${l} overwriting`)},or(a).forEach(l=>{const{src:c,srcs:h}=l;let{data:f,format:u,loadParser:d}=l;const p=or(c||h).map(y=>typeof y=="string"?bB(y):Array.isArray(y)?y:[y]),m=this.getAlias(l);Array.isArray(m)?m.forEach(o):o(m);const g=[];p.forEach(y=>{y.forEach(_=>{let v={};if(typeof _!="object"){v.src=_;for(let b=0;b<this._parsers.length;b++){const w=this._parsers[b];if(w.test(_)){v=w.parse(_);break}}}else f=_.data??f,u=_.format??u,d=_.loadParser??d,v={...v,..._};if(!m)throw new Error(`[Resolver] alias is undefined for this asset: ${v.src}`);v=this.buildResolvedAsset(v,{aliases:m,data:f,format:u,loadParser:d}),g.push(v)})}),m.forEach(y=>{this._assetMap[y]=g})})}resolveBundle(e){const r=ph(e);e=or(e);const i={};return e.forEach(s=>{const n=this._bundles[s];if(n){const a=this.resolve(n),o={};for(const l in a){const c=a[l];o[this._extractAssetIdFromBundle(s,l)]=c}i[s]=o}}),r?i[e[0]]:i}resolveUrl(e){const r=this.resolve(e);if(typeof e!="string"){const i={};for(const s in r)i[s]=r[s].src;return i}return r.src}resolve(e){const r=ph(e);e=or(e);const i={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s];const a=n[0],o=this._getPreferredOrder(n);o==null||o.priority.forEach(l=>{o.params[l].forEach(c=>{const h=n.filter(f=>f[l]?f[l]===c:!1);h.length&&(n=h)})}),this._resolverHash[s]=n[0]??a}else this._resolverHash[s]=this.buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s]}),r?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let r=0;r<e.length;r++){const i=e[0],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const r=/\?/.test(e)?"&":"?";return`${e}${r}${this._defaultSearchParams}`}buildResolvedAsset(e,r){const{aliases:i,data:s,loadParser:n,format:a}=r;return(this._basePath||this._rootPath)&&(e.src=Ye.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=n??e.loadParser,e.format=a??Ye.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class ZB{constructor(){this._detections=[],this._initialized=!1,this.resolver=new qB,this.loader=new _B,this.cache=ws,this._backgroundLoader=new yB(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var n,a;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let o=e.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}const r=((n=e.texturePreference)==null?void 0:n.resolution)??1,i=typeof r=="number"?[r]:r,s=await this._detectFormats({preferredFormats:(a=e.texturePreference)==null?void 0:a.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),e.preferences&&this.setPreferences(e.preferences)}add(e,r,i,s,n){this.resolver.add(e,r,i,s,n)}async load(e,r){this._initialized||await this.init();const i=ph(e),s=or(e).map(o=>{if(typeof o!="string"){const l=this.resolver.getAlias(o);return l.some(c=>!this.resolver.hasKey(c))&&this.add(o),Array.isArray(l)?l[0]:l}return this.resolver.hasKey(o)||this.add({alias:o,src:o}),o}),n=this.resolver.resolve(s),a=await this._mapLoadToResolve(n,r);return i?a[s[0]]:a}addBundle(e,r){this.resolver.addBundle(e,r)}async loadBundle(e,r){this._initialized||await this.init();let i=!1;typeof e=="string"&&(i=!0,e=[e]);const s=this.resolver.resolveBundle(e),n={},a=Object.keys(s);let o=0,l=0;const c=()=>{r==null||r(++o/l)},h=a.map(f=>{const u=s[f];return l+=Object.keys(u).length,this._mapLoadToResolve(u,c).then(d=>{n[f]=d})});return await Promise.all(h),i?n[e[0]]:n}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const r=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(r))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const r=this.resolver.resolveBundle(e);Object.values(r).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return ws.get(e);const r={};for(let i=0;i<e.length;i++)r[i]=ws.get(e[i]);return r}async _mapLoadToResolve(e,r){const i=Object.values(e),s=Object.keys(e);this._backgroundLoader.active=!1;const n=await this.loader.load(i,r);this._backgroundLoader.active=!0;const a={};return i.forEach((o,l)=>{const c=n[o.src],h=[o.src];o.alias&&h.push(...o.alias),a[s[l]]=c,ws.set(h,c)}),a}async unload(e){this._initialized||await this.init();const r=or(e).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(r);await this._unloadFromResolved(i)}async unloadBundle(e){this._initialized||await this.init(),e=or(e);const r=this.resolver.resolveBundle(e),i=Object.keys(r).map(s=>this._unloadFromResolved(r[s]));await Promise.all(i)}async _unloadFromResolved(e){const r=Object.values(e);r.forEach(i=>{ws.remove(i.src)}),await this.loader.unload(r)}async _detectFormats(e){let r=[];e.preferredFormats&&(r=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const i of e.detections)e.skipDetections||await i.test()?r=await i.add(r):e.skipDetections||(r=await i.remove(r));return r=r.filter((i,s)=>r.indexOf(i)===s),r}get detections(){return this._detections}get preferWorkers(){return iu.config.preferWorkers}set preferWorkers(e){xe("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(r=>{r.config&&Object.keys(r.config).filter(i=>i in e).forEach(i=>{r.config[i]=e[i]})})}}const ec=new ZB;Z.handleByList(V.LoadParser,ec.loader.parsers).handleByList(V.ResolveParser,ec.resolver.parsers).handleByList(V.CacheParser,ec.cache.parsers).handleByList(V.DetectionParser,ec.detections);const KB={extension:V.CacheParser,test:t=>Array.isArray(t)&&t.every(e=>e instanceof Q),getCacheableAssets:(t,e)=>{const r={};return t.forEach(i=>{e.forEach((s,n)=>{r[i+(n===0?"":n+1)]=s})}),r}};Z.add(KB);async function Tw(t){if("Image"in globalThis)return new Promise(e=>{const r=new Image;r.onload=()=>{e(!0)},r.onerror=()=>{e(!1)},r.src=t});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const QB={extension:{type:V.DetectionParser,priority:1},test:async()=>Tw("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter(e=>e!=="avif")};Z.add(QB);const JB={extension:{type:V.DetectionParser,priority:0},test:async()=>Tw("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter(e=>e!=="webp")};Z.add(JB);const hy=["png","jpg","jpeg"],eF={extension:{type:V.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...hy],remove:async t=>t.filter(e=>!hy.includes(e))};Z.add(eF);const tF="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Im(t){return tF?!1:document.createElement("video").canPlayType(t)!==""}const rF={extension:{type:V.DetectionParser,priority:0},test:async()=>Im("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter(e=>e!=="webm")};Z.add(rF);const iF={extension:{type:V.DetectionParser,priority:0},test:async()=>Im("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter(e=>e!=="mp4"&&e!=="m4v")};Z.add(iF);const sF={extension:{type:V.DetectionParser,priority:0},test:async()=>Im("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter(e=>e!=="ogv")};Z.add(sF);const nF={extension:V.ResolveParser,test:iu.test,parse:t=>{var e;return{resolution:parseFloat(((e=X.RETINA_PREFIX.exec(t))==null?void 0:e[1])??"1"),format:Ye.extname(t).slice(1),src:t}}};Z.add(nF);const aF=[".xml",".fnt"],oF={extension:{type:V.LoadParser,priority:pr.Normal},name:"loadBitmapFont",test(t){return aF.includes(Ye.extname(t).toLowerCase())},async testParse(t){return Pc.test(t)||up.test(t)},async parse(t,e,r){const i=Pc.test(t)?Pc.parse(t):up.parse(t),{src:s}=e,{page:n}=i,a=[];for(let c=0;c<n.length;++c){const h=n[c].file;let f=Ye.join(Ye.dirname(s),h);f=dp(f,s),a.push(f)}const o=await r.load(a),l=a.map(c=>o[c]);return wi.install(i,l,!0)},async load(t,e){return(await X.ADAPTER.fetch(t)).text()},unload(t){t.destroy()}};Z.add(oF);const mh={build(t){const e=t.points;let r,i,s,n,a,o;if(t.type===it.CIRC){const p=t.shape;r=p.x,i=p.y,a=o=p.radius,s=n=0}else if(t.type===it.ELIP){const p=t.shape;r=p.x,i=p.y,a=p.width,o=p.height,s=n=0}else{const p=t.shape,m=p.width/2,g=p.height/2;r=p.x+m,i=p.y+g,a=o=Math.max(0,Math.min(p.radius,Math.min(m,g))),s=m-a,n=g-o}if(!(a>=0&&o>=0&&s>=0&&n>=0)){e.length=0;return}const l=Math.ceil(2.3*Math.sqrt(a+o)),c=l*8+(s?4:0)+(n?4:0);if(e.length=c,c===0)return;if(l===0){e.length=8,e[0]=e[6]=r+s,e[1]=e[3]=i+n,e[2]=e[4]=r-s,e[5]=e[7]=i-n;return}let h=0,f=l*4+(s?2:0)+2,u=f,d=c;{const p=s+a,m=n,g=r+p,y=r-p,_=i+m;if(e[h++]=g,e[h++]=_,e[--f]=_,e[--f]=y,n){const v=i-m;e[u++]=y,e[u++]=v,e[--d]=v,e[--d]=g}}for(let p=1;p<l;p++){const m=Math.PI/2*(p/l),g=s+Math.cos(m)*a,y=n+Math.sin(m)*o,_=r+g,v=r-g,b=i+y,w=i-y;e[h++]=_,e[h++]=b,e[--f]=b,e[--f]=v,e[u++]=v,e[u++]=w,e[--d]=w,e[--d]=_}{const p=s,m=n+o,g=r+p,y=r-p,_=i+m,v=i-m;e[h++]=g,e[h++]=_,e[--d]=v,e[--d]=g,s&&(e[h++]=y,e[h++]=_,e[--d]=v,e[--d]=y)}},triangulate(t,e){const r=t.points,i=e.points,s=e.indices;if(r.length===0)return;let n=i.length/2;const a=n;let o,l;if(t.type!==it.RREC){const h=t.shape;o=h.x,l=h.y}else{const h=t.shape;o=h.x+h.width/2,l=h.y+h.height/2}const c=t.matrix;i.push(t.matrix?c.a*o+c.c*l+c.tx:o,t.matrix?c.b*o+c.d*l+c.ty:l),n++,i.push(r[0],r[1]);for(let h=2;h<r.length;h+=2)i.push(r[h],r[h+1]),s.push(n++,a,n);s.push(a+1,a,n)}};function uy(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let s=0,n=t[r-2],a=t[r-1];s<r;s+=2){const o=t[s],l=t[s+1];i+=(o-n)*(l+a),n=o,a=l}if(!e&&i>0||e&&i<=0){const s=r/2;for(let n=s+s%2;n<r;n+=2){const a=r-n-2,o=r-n-1,l=n,c=n+1;[t[a],t[l]]=[t[l],t[a]],[t[o],t[c]]=[t[c],t[o]]}}}const Aw={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const i=t.holes,s=e.points,n=e.indices;if(r.length>=6){uy(r,!1);const a=[];for(let c=0;c<i.length;c++){const h=i[c];uy(h.points,!0),a.push(r.length/2),r=r.concat(h.points)}const o=Bk(r,a,2);if(!o)return;const l=s.length/2;for(let c=0;c<o.length;c+=3)n.push(o[c]+l),n.push(o[c+1]+l),n.push(o[c+2]+l);for(let c=0;c<r.length;c++)s.push(r[c])}}},lF={build(t){const e=t.shape,r=e.x,i=e.y,s=e.width,n=e.height,a=t.points;a.length=0,s>=0&&n>=0&&a.push(r,i,r+s,i,r+s,i+n,r,i+n)},triangulate(t,e){const r=t.points,i=e.points;if(r.length===0)return;const s=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},cF={build(t){mh.build(t)},triangulate(t,e){mh.triangulate(t,e)}};var Gt=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(Gt||{}),Gi=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(Gi||{});const ha={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class dy{static curveTo(e,r,i,s,n,a){const o=a[a.length-2],l=a[a.length-1]-r,c=o-e,h=s-r,f=i-e,u=Math.abs(l*f-c*h);if(u<1e-8||n===0)return(a[a.length-2]!==e||a[a.length-1]!==r)&&a.push(e,r),null;const d=l*l+c*c,p=h*h+f*f,m=l*h+c*f,g=n*Math.sqrt(d)/u,y=n*Math.sqrt(p)/u,_=g*m/d,v=y*m/p,b=g*f+y*c,w=g*h+y*l,A=c*(y+_),S=l*(y+_),C=f*(g+v),T=h*(g+v),M=Math.atan2(S-w,A-b),I=Math.atan2(T-w,C-b);return{cx:b+e,cy:w+r,radius:n,startAngle:M,endAngle:I,anticlockwise:c*h>f*l}}static arc(e,r,i,s,n,a,o,l,c){const h=o-a,f=ha._segmentsCount(Math.abs(h)*n,Math.ceil(Math.abs(h)/oh)*40),u=h/(f*2),d=u*2,p=Math.cos(u),m=Math.sin(u),g=f-1,y=g%1/g;for(let _=0;_<=g;++_){const v=_+y*_,b=u+a+d*v,w=Math.cos(b),A=-Math.sin(b);c.push((p*w+m*A)*n+i,(p*-A+m*w)*n+s)}}}class hF{constructor(){this.reset()}begin(e,r,i){this.reset(),this.style=e,this.start=r,this.attribStart=i}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Rm{static curveLength(e,r,i,s,n,a,o,l){let c=0,h=0,f=0,u=0,d=0,p=0,m=0,g=0,y=0,_=0,v=0,b=e,w=r;for(let A=1;A<=10;++A)h=A/10,f=h*h,u=f*h,d=1-h,p=d*d,m=p*d,g=m*e+3*p*h*i+3*d*f*n+u*o,y=m*r+3*p*h*s+3*d*f*a+u*l,_=b-g,v=w-y,b=g,w=y,c+=Math.sqrt(_*_+v*v);return c}static curveTo(e,r,i,s,n,a,o){const l=o[o.length-2],c=o[o.length-1];o.length-=2;const h=ha._segmentsCount(Rm.curveLength(l,c,e,r,i,s,n,a));let f=0,u=0,d=0,p=0,m=0;o.push(l,c);for(let g=1,y=0;g<=h;++g)y=g/h,f=1-y,u=f*f,d=u*f,p=y*y,m=p*y,o.push(d*l+3*u*y*e+3*f*p*i+m*n,d*c+3*u*y*r+3*f*p*s+m*a)}}function fy(t,e,r,i,s,n,a,o){const l=t-r*s,c=e-i*s,h=t+r*n,f=e+i*n;let u,d;a?(u=i,d=-r):(u=-i,d=r);const p=l+u,m=c+d,g=h+u,y=f+d;return o.push(p,m,g,y),2}function ds(t,e,r,i,s,n,a,o){const l=r-t,c=i-e;let h=Math.atan2(l,c),f=Math.atan2(s-t,n-e);o&&h<f?h+=Math.PI*2:!o&&h>f&&(f+=Math.PI*2);let u=h;const d=f-h,p=Math.abs(d),m=Math.sqrt(l*l+c*c),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,y=d/g;if(u+=y,o){a.push(t,e,r,i);for(let _=1,v=u;_<g;_++,v+=y)a.push(t,e,t+Math.sin(v)*m,e+Math.cos(v)*m);a.push(t,e,s,n)}else{a.push(r,i,t,e);for(let _=1,v=u;_<g;_++,v+=y)a.push(t+Math.sin(v)*m,e+Math.cos(v)*m,t,e);a.push(s,n,t,e)}return g*2}function uF(t,e){const r=t.shape;let i=t.points||r.points.slice();const s=e.closePointEps;if(i.length===0)return;const n=t.lineStyle,a=new Se(i[0],i[1]),o=new Se(i[i.length-2],i[i.length-1]),l=r.type!==it.POLY||r.closeStroke,c=Math.abs(a.x-o.x)<s&&Math.abs(a.y-o.y)<s;if(l){i=i.slice(),c&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const N=(a.x+o.x)*.5,B=(o.y+a.y)*.5;i.unshift(N,B),i.push(N,B)}const h=e.points,f=i.length/2;let u=i.length;const d=h.length/2,p=n.width/2,m=p*p,g=n.miterLimit*n.miterLimit;let y=i[0],_=i[1],v=i[2],b=i[3],w=0,A=0,S=-(_-b),C=y-v,T=0,M=0,I=Math.sqrt(S*S+C*C);S/=I,C/=I,S*=p,C*=p;const k=n.alignment,P=(1-k)*2,R=k*2;l||(n.cap===Gi.ROUND?u+=ds(y-S*(P-R)*.5,_-C*(P-R)*.5,y-S*P,_-C*P,y+S*R,_+C*R,h,!0)+2:n.cap===Gi.SQUARE&&(u+=fy(y,_,S,C,P,R,!0,h))),h.push(y-S*P,_-C*P,y+S*R,_+C*R);for(let N=1;N<f-1;++N){y=i[(N-1)*2],_=i[(N-1)*2+1],v=i[N*2],b=i[N*2+1],w=i[(N+1)*2],A=i[(N+1)*2+1],S=-(_-b),C=y-v,I=Math.sqrt(S*S+C*C),S/=I,C/=I,S*=p,C*=p,T=-(b-A),M=v-w,I=Math.sqrt(T*T+M*M),T/=I,M/=I,T*=p,M*=p;const B=v-y,U=_-b,F=v-w,j=A-b,z=B*F+U*j,q=U*F-j*B,J=q<0;if(Math.abs(q)<.001*Math.abs(z)){h.push(v-S*P,b-C*P,v+S*R,b+C*R),z>=0&&(n.join===Gt.ROUND?u+=ds(v,b,v-S*P,b-C*P,v-T*P,b-M*P,h,!1)+4:u+=2,h.push(v-T*R,b-M*R,v+T*P,b+M*P));continue}const ee=(-S+y)*(-C+b)-(-S+v)*(-C+_),ne=(-T+w)*(-M+b)-(-T+v)*(-M+A),se=(B*ne-F*ee)/q,pe=(j*ee-U*ne)/q,ge=(se-v)*(se-v)+(pe-b)*(pe-b),ae=v+(se-v)*P,he=b+(pe-b)*P,ye=v-(se-v)*R,Ee=b-(pe-b)*R,Ue=Math.min(B*B+U*U,F*F+j*j),qe=J?P:R,Tt=Ue+qe*qe*m,mr=ge<=Tt;let gr=n.join;if(gr===Gt.MITER&&ge/m>g&&(gr=Gt.BEVEL),mr)switch(gr){case Gt.MITER:{h.push(ae,he,ye,Ee);break}case Gt.BEVEL:{J?h.push(ae,he,v+S*R,b+C*R,ae,he,v+T*R,b+M*R):h.push(v-S*P,b-C*P,ye,Ee,v-T*P,b-M*P,ye,Ee),u+=2;break}case Gt.ROUND:{J?(h.push(ae,he,v+S*R,b+C*R),u+=ds(v,b,v+S*R,b+C*R,v+T*R,b+M*R,h,!0)+4,h.push(ae,he,v+T*R,b+M*R)):(h.push(v-S*P,b-C*P,ye,Ee),u+=ds(v,b,v-S*P,b-C*P,v-T*P,b-M*P,h,!1)+4,h.push(v-T*P,b-M*P,ye,Ee));break}}else{switch(h.push(v-S*P,b-C*P,v+S*R,b+C*R),gr){case Gt.MITER:{J?h.push(ye,Ee,ye,Ee):h.push(ae,he,ae,he),u+=2;break}case Gt.ROUND:{J?u+=ds(v,b,v+S*R,b+C*R,v+T*R,b+M*R,h,!0)+2:u+=ds(v,b,v-S*P,b-C*P,v-T*P,b-M*P,h,!1)+2;break}}h.push(v-T*P,b-M*P,v+T*R,b+M*R),u+=2}}y=i[(f-2)*2],_=i[(f-2)*2+1],v=i[(f-1)*2],b=i[(f-1)*2+1],S=-(_-b),C=y-v,I=Math.sqrt(S*S+C*C),S/=I,C/=I,S*=p,C*=p,h.push(v-S*P,b-C*P,v+S*R,b+C*R),l||(n.cap===Gi.ROUND?u+=ds(v-S*(P-R)*.5,b-C*(P-R)*.5,v-S*P,b-C*P,v+S*R,b+C*R,h,!1)+2:n.cap===Gi.SQUARE&&(u+=fy(v,b,S,C,P,R,!1,h)));const O=e.indices,L=ha.epsilon*ha.epsilon;for(let N=d;N<u+d-2;++N)y=h[N*2],_=h[N*2+1],v=h[(N+1)*2],b=h[(N+1)*2+1],w=h[(N+2)*2],A=h[(N+2)*2+1],!(Math.abs(y*(b-A)+v*(A-_)+w*(_-b))<L)&&O.push(N,N+1,N+2)}function dF(t,e){let r=0;const i=t.shape,s=t.points||i.points,n=i.type!==it.POLY||i.closeStroke;if(s.length===0)return;const a=e.points,o=e.indices,l=s.length/2,c=a.length/2;let h=c;for(a.push(s[0],s[1]),r=1;r<l;r++)a.push(s[r*2],s[r*2+1]),o.push(h,h+1),h++;n&&o.push(h,c)}function py(t,e){t.lineStyle.native?dF(t,e):uF(t,e)}class Pm{static curveLength(e,r,i,s,n,a){const o=e-2*i+n,l=r-2*s+a,c=2*i-2*e,h=2*s-2*r,f=4*(o*o+l*l),u=4*(o*c+l*h),d=c*c+h*h,p=2*Math.sqrt(f+u+d),m=Math.sqrt(f),g=2*f*m,y=2*Math.sqrt(d),_=u/m;return(g*p+m*u*(p-y)+(4*d*f-u*u)*Math.log((2*m+_+p)/(_+y)))/(4*g)}static curveTo(e,r,i,s,n){const a=n[n.length-2],o=n[n.length-1],l=ha._segmentsCount(Pm.curveLength(a,o,e,r,i,s));let c=0,h=0;for(let f=1;f<=l;++f){const u=f/l;c=a+(e-a)*u,h=o+(r-o)*u,n.push(c+(e+(i-e)*u-c)*u,h+(r+(s-r)*u-h)*u)}}}const wd={[it.POLY]:Aw,[it.CIRC]:mh,[it.ELIP]:mh,[it.RECT]:lF,[it.RREC]:cF},my=[],tc=[];class gh{constructor(e,r=null,i=null,s=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=r,this.matrix=s,this.type=e.type}clone(){return new gh(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const pn=new Se,Cw=class Iw extends O1{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new dh,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),tc.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const r=this.batches[e];r.reset(),my.push(r)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,r=null,i=null,s=null){const n=new gh(e,r,i,s);return this.graphicsData.push(n),this.dirty++,this}drawHole(e,r=null){if(!this.graphicsData.length)return null;const i=new gh(e,null,null,r),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(e){const r=this.graphicsData;for(let i=0;i<r.length;++i){const s=r[i];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(e,pn):pn.copyFrom(e),s.shape.contains(pn.x,pn.y))){let n=!1;if(s.holes){for(let a=0;a<s.holes.length;a++)if(s.holes[a].shape.contains(pn.x,pn.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const e=this.uvs,r=this.graphicsData;let i=null,s=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],s=i.style);for(let l=this.shapeIndex;l<r.length;l++){this.shapeIndex++;const c=r[l],h=c.fillStyle,f=c.lineStyle;wd[c.type].build(c),c.matrix&&this.transformPoints(c.points,c.matrix),(h.visible||f.visible)&&this.processHoles(c.holes);for(let u=0;u<2;u++){const d=u===0?h:f;if(!d.visible)continue;const p=d.texture.baseTexture,m=this.indices.length,g=this.points.length/2;p.wrapMode=qi.REPEAT,u===0?this.processFill(c):this.processLine(c);const y=this.points.length/2-g;y!==0&&(i&&!this._compareStyles(s,d)&&(i.end(m,g),i=null),i||(i=my.pop()||new hF,i.begin(d,m,g),this.batches.push(i),s=d),this.addUvs(this.points,e,d.texture,g,y,d.matrix))}}const n=this.indices.length,a=this.points.length/2;if(i&&i.end(n,a),this.batches.length===0){this.batchable=!0;return}const o=a>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,r){return!(!e||!r||e.texture.baseTexture!==r.texture.baseTexture||e.color+e.alpha!==r.color+r.alpha||!!e.native!=!!r.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,r=this.graphicsData.length;e<r;e++){const i=this.graphicsData[e],s=i.fillStyle,n=i.lineStyle;if(s&&!s.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const e=this.batches;for(let r=0,i=e.length;r<i;r++){const s=e[r];for(let n=0;n<s.size;n++){const a=s.start+n;this.indicesUint16[a]=this.indicesUint16[a]-s.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const e=this.batches;for(let r=0;r<e.length;r++)if(e[r].style.native)return!1;return this.points.length<Iw.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++de._globalBatch;for(let f=0;f<this.drawCalls.length;f++)this.drawCalls[f].texArray.clear(),tc.push(this.drawCalls[f]);this.drawCalls.length=0;const r=this.colors,i=this.textureIds;let s=tc.pop();s||(s=new qf,s.texArray=new Jf),s.texArray.count=0,s.start=0,s.size=0,s.type=Nr.TRIANGLES;let n=0,a=null,o=0,l=!1,c=Nr.TRIANGLES,h=0;this.drawCalls.push(s);for(let f=0;f<this.batches.length;f++){const u=this.batches[f],d=8,p=u.style,m=p.texture.baseTexture;l!==!!p.native&&(l=!!p.native,c=l?Nr.LINES:Nr.TRIANGLES,a=null,n=d,e++),a!==m&&(a=m,m._batchEnabled!==e&&(n===d&&(e++,n=0,s.size>0&&(s=tc.pop(),s||(s=new qf,s.texArray=new Jf),this.drawCalls.push(s)),s.start=h,s.size=0,s.texArray.count=0,s.type=c),m.touched=1,m._batchEnabled=e,m._batchLocation=n,m.wrapMode=qi.REPEAT,s.texArray.elements[s.texArray.count++]=m,n++)),s.size+=u.size,h+=u.size,o=m._batchLocation,this.addColors(r,p.color,p.alpha,u.attribSize,u.attribStart),this.addTextureIds(i,o,u.attribSize,u.attribStart)}de._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,r=this.uvs,i=this.colors,s=this.textureIds,n=new ArrayBuffer(e.length*3*4),a=new Float32Array(n),o=new Uint32Array(n);let l=0;for(let c=0;c<e.length/2;c++)a[l++]=e[c*2],a[l++]=e[c*2+1],a[l++]=r[c*2],a[l++]=r[c*2+1],o[l++]=i[c],a[l++]=s[c];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?Aw.triangulate(e,this):wd[e.type].triangulate(e,this)}processLine(e){py(e,this);for(let r=0;r<e.holes.length;r++)py(e.holes[r],this)}processHoles(e){for(let r=0;r<e.length;r++){const i=e[r];wd[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}}calculateBounds(){const e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)}transformPoints(e,r){for(let i=0;i<e.length/2;i++){const s=e[i*2],n=e[i*2+1];e[i*2]=r.a*s+r.c*n+r.tx,e[i*2+1]=r.b*s+r.d*n+r.ty}}addColors(e,r,i,s,n=0){const a=Oe.shared.setValue(r).toLittleEndianNumber(),o=Oe.shared.setValue(a).toPremultiplied(i);e.length=Math.max(e.length,n+s);for(let l=0;l<s;l++)e[n+l]=o}addTextureIds(e,r,i,s=0){e.length=Math.max(e.length,s+i);for(let n=0;n<i;n++)e[s+n]=r}addUvs(e,r,i,s,n,a=null){let o=0;const l=r.length,c=i.frame;for(;o<n;){let f=e[(s+o)*2],u=e[(s+o)*2+1];if(a){const d=a.a*f+a.c*u+a.tx;u=a.b*f+a.d*u+a.ty,f=d}o++,r.push(f/c.width,u/c.height)}const h=i.baseTexture;(c.width<h.width||c.height<h.height)&&this.adjustUvs(r,i,l,n)}adjustUvs(e,r,i,s){const n=r.baseTexture,a=1e-6,o=i+s*2,l=r.frame,c=l.width/n.width,h=l.height/n.height;let f=l.x/l.width,u=l.y/l.height,d=Math.floor(e[i]+a),p=Math.floor(e[i+1]+a);for(let m=i+2;m<o;m+=2)d=Math.min(d,Math.floor(e[m]+a)),p=Math.min(p,Math.floor(e[m+1]+a));f-=d,u-=p;for(let m=i;m<o;m+=2)e[m]=(e[m]+f)*c,e[m+1]=(e[m+1]+u)*h}};Cw.BATCHABLE_SIZE=100;let fF=Cw;class su{constructor(){this.color=16777215,this.alpha=1,this.texture=Q.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new su;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=Q.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class Mm extends su{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Gi.BUTT,this.join=Gt.MITER,this.miterLimit=10}clone(){const e=new Mm;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=Gi.BUTT,this.join=Gt.MITER,this.miterLimit=10}}const Ed={},fp=class Oc extends fr{constructor(e=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new su,this._lineStyle=new Mm,this._matrix=null,this._holeMode=!1,this.state=Wr.for2d(),this._geometry=e||new fF,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Oe(16777215),this.blendMode=ie.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new Oc(this._geometry)}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(e=null,r=0,i,s=.5,n=!1){return typeof e=="number"&&(e={width:e,color:r,alpha:i,alignment:s,native:n}),this.lineTextureStyle(e)}lineTextureStyle(e){const r={width:0,texture:Q.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Gi.BUTT,join:Gt.MITER,miterLimit:10};e=Object.assign(r,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const i=e.width>0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,r=this.currentPath.points.length;r>2&&(this.drawShape(this.currentPath),this.currentPath=new js,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[r-2],e[r-1]))}else this.currentPath=new js,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,r){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=r,this}lineTo(e,r){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],n=i[i.length-1];return(s!==e||n!==r)&&i.push(e,r),this}_initCurve(e=0,r=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,r]):this.moveTo(e,r)}quadraticCurveTo(e,r,i,s){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),Pm.curveTo(e,r,i,s,n),this}bezierCurveTo(e,r,i,s,n,a){return this._initCurve(),Rm.curveTo(e,r,i,s,n,a,this.currentPath.points),this}arcTo(e,r,i,s,n){this._initCurve(e,r);const a=this.currentPath.points,o=dy.curveTo(e,r,i,s,n,a);if(o){const{cx:l,cy:c,radius:h,startAngle:f,endAngle:u,anticlockwise:d}=o;this.arc(l,c,h,f,u,d)}return this}arc(e,r,i,s,n,a=!1){if(s===n)return this;if(!a&&n<=s?n+=oh:a&&s<=n&&(s+=oh),n-s===0)return this;const o=e+Math.cos(s)*i,l=r+Math.sin(s)*i,c=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const f=Math.abs(h[h.length-2]-o),u=Math.abs(h[h.length-1]-l);f<c&&u<c||h.push(o,l)}else this.moveTo(o,l),h=this.currentPath.points;return dy.arc(o,l,e,r,i,s,n,a,h),this}beginFill(e=0,r){return this.beginTextureFill({texture:Q.WHITE,color:e,alpha:r})}normalizeColor(e){const r=Oe.shared.setValue(e.color??0);e.color=r.toNumber(),e.alpha??(e.alpha=r.alpha)}beginTextureFill(e){const r={texture:Q.WHITE,color:16777215,matrix:null};e=Object.assign(r,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const i=e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,r,i,s){return this.drawShape(new me(e,r,i,s))}drawRoundedRect(e,r,i,s,n){return this.drawShape(new eu(e,r,i,s,n))}drawCircle(e,r,i){return this.drawShape(new Qh(e,r,i))}drawEllipse(e,r,i,s){return this.drawShape(new Jh(e,r,i,s))}drawPolygon(...e){let r,i=!0;const s=e[0];s.points?(i=s.closeStroke,r=s.points):Array.isArray(e[0])?r=e[0]:r=e;const n=new js(r);return n.closeStroke=i,this.drawShape(n),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===it.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const r=this._geometry;r.updateBatches(),r.batchable?(this.batchDirty!==r.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,r=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let s=0;s<i;s++){const n=e.batches[s],a=n.style.color,o=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),l=new Float32Array(e.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),c=new Uint16Array(e.indicesUint16.buffer,n.start*2,n.size),h={vertexData:o,blendMode:r,indices:c,uvs:l,_batchRGB:Oe.shared.setValue(a).toRgbArray(),_tintRGB:a,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[s]=h}}_renderBatched(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let r=0,i=this.batches.length;r<i;r++){const s=this.batches[r];s.worldAlpha=this.worldAlpha*s.alpha,e.plugins[this.pluginName].render(s)}}}_renderDirect(e){const r=this._resolveDirectShader(e),i=this._geometry,s=this.worldAlpha,n=r.uniforms,a=i.drawCalls;n.translationMatrix=this.transform.worldTransform,Oe.shared.setValue(this._tintColor).premultiply(s).toArray(n.tint),e.shader.bind(r),e.geometry.bind(i,r),e.state.set(this.state);for(let o=0,l=a.length;o<l;o++)this._renderDrawCallDirect(e,i.drawCalls[o])}_renderDrawCallDirect(e,r){const{texArray:i,type:s,size:n,start:a}=r,o=i.count;for(let l=0;l<o;l++)e.texture.bind(i.elements[l],l);e.geometry.draw(s,n,a)}_resolveDirectShader(e){let r=this.shader;const i=this.pluginName;if(!r){if(!Ed[i]){const{maxTextures:s}=e.plugins[i],n=new Int32Array(s);for(let l=0;l<s;l++)n[l]=l;const a={tint:new Float32Array([1,1,1,1]),translationMatrix:new ke,default:hr.from({uSamplers:n},!0)},o=e.plugins[i]._shader.program;Ed[i]=new jr(o,a)}r=Ed[i]}return r}_calculateBounds(){this.finishPoly();const e=this._geometry;if(!e.graphicsData.length)return;const{minX:r,minY:i,maxX:s,maxY:n}=e.bounds;this._bounds.addFrame(this.transform,r,i,s,n)}containsPoint(e){return this.worldTransform.applyInverse(e,Oc._TEMP_POINT),this._geometry.containsPoint(Oc._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let e=0;e<this.batches.length;e++){const r=this.batches[e];r._tintRGB=Oe.shared.setValue(this._tintColor).multiply(r._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const e=this.transform._worldID;if(this._transformID===e)return;this._transformID=e;const r=this.transform.worldTransform,i=r.a,s=r.b,n=r.c,a=r.d,o=r.tx,l=r.ty,c=this._geometry.points,h=this.vertexData;let f=0;for(let u=0;u<c.length;u+=2){const d=c[u],p=c[u+1];h[f++]=i*d+n*p+o,h[f++]=a*p+s*d+l}}closePath(){const e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this}setMatrix(e){return this._matrix=e,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(e)}};fp.curves=ha,fp._TEMP_POINT=new Se;let Rw=fp;class gy{constructor(e,r,i){this.geometry=new Ji,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(let s=0;s<e.length;++s){let n=e[s];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||te.FLOAT,offset:n.offset},r[s]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const e=this.geometry;let r=0;this.indexBuffer=new We(ON(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(let a=0;a<this.dynamicProperties.length;++a){const o=this.dynamicProperties[a];o.offset=r,r+=o.size,this.dynamicStride+=o.size}const i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new We(this.dynamicData,!1,!1);let s=0;this.staticStride=0;for(let a=0;a<this.staticProperties.length;++a){const o=this.staticProperties[a];o.offset=s,s+=o.size,this.staticStride+=o.size}const n=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(n),this.staticDataUint32=new Uint32Array(n),this.staticBuffer=new We(this.staticData,!0,!1);for(let a=0;a<this.dynamicProperties.length;++a){const o=this.dynamicProperties[a];e.addAttribute(o.attributeName,this.dynamicBuffer,0,o.type===te.UNSIGNED_BYTE,o.type,this.dynamicStride*4,o.offset*4)}for(let a=0;a<this.staticProperties.length;++a){const o=this.staticProperties[a];e.addAttribute(o.attributeName,this.staticBuffer,0,o.type===te.UNSIGNED_BYTE,o.type,this.staticStride*4,o.offset*4)}}uploadDynamic(e,r,i){for(let s=0;s<this.dynamicProperties.length;s++){const n=this.dynamicProperties[s];n.uploadFunction(e,r,i,n.type===te.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++}uploadStatic(e,r,i){for(let s=0;s<this.staticProperties.length;s++){const n=this.staticProperties[s];n.uploadFunction(e,r,i,n.type===te.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}var pF=`varying vec2 vTextureCoord;
852
- varying vec4 vColor;
853
-
854
- uniform sampler2D uSampler;
855
-
856
- void main(void){
857
- vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
858
- gl_FragColor = color;
859
- }`,mF=`attribute vec2 aVertexPosition;
860
- attribute vec2 aTextureCoord;
861
- attribute vec4 aColor;
862
-
863
- attribute vec2 aPositionCoord;
864
- attribute float aRotation;
865
-
866
- uniform mat3 translationMatrix;
867
- uniform vec4 uColor;
868
-
869
- varying vec2 vTextureCoord;
870
- varying vec4 vColor;
871
-
872
- void main(void){
873
- float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
874
- float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
875
-
876
- vec2 v = vec2(x, y);
877
- v = v + aPositionCoord;
878
-
879
- gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
880
-
881
- vTextureCoord = aTextureCoord;
882
- vColor = aColor * uColor;
883
- }
884
- `;class Pw extends tu{constructor(e){super(e),this.shader=null,this.properties=null,this.tempMatrix=new ke,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:te.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=jr.from(mF,pF,{}),this.state=Wr.for2d()}render(e){const r=e.children,i=e._maxSize,s=e._batchSize,n=this.renderer;let a=r.length;if(a===0)return;a>i&&!e.autoResize&&(a=i);let o=e._buffers;o||(o=e._buffers=this.generateBuffers(e));const l=r[0]._texture.baseTexture,c=l.alphaMode>0;this.state.blendMode=I1(e.blendMode,c),n.state.set(this.state);const h=n.gl,f=e.worldTransform.copyTo(this.tempMatrix);f.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=f.toArray(!0),this.shader.uniforms.uColor=Oe.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,c).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=l,this.renderer.shader.bind(this.shader);let u=!1;for(let d=0,p=0;d<a;d+=s,p+=1){let m=a-d;m>s&&(m=s),p>=o.length&&o.push(this._generateOneMoreBuffer(e));const g=o[p];g.uploadDynamic(r,d,m);const y=e._bufferUpdateIDs[p]||0;u=u||g._updateID<y,u&&(g._updateID=e._updateID,g.uploadStatic(r,d,m)),n.geometry.bind(g.geometry),h.drawElements(h.TRIANGLES,m*6,h.UNSIGNED_SHORT,0)}}generateBuffers(e){const r=[],i=e._maxSize,s=e._batchSize,n=e._properties;for(let a=0;a<i;a+=s)r.push(new gy(this.properties,n,s));return r}_generateOneMoreBuffer(e){const r=e._batchSize,i=e._properties;return new gy(this.properties,i,r)}uploadVertices(e,r,i,s,n,a){let o=0,l=0,c=0,h=0;for(let f=0;f<i;++f){const u=e[r+f],d=u._texture,p=u.scale.x,m=u.scale.y,g=d.trim,y=d.orig;g?(l=g.x-u.anchor.x*y.width,o=l+g.width,h=g.y-u.anchor.y*y.height,c=h+g.height):(o=y.width*(1-u.anchor.x),l=y.width*-u.anchor.x,c=y.height*(1-u.anchor.y),h=y.height*-u.anchor.y),s[a]=l*p,s[a+1]=h*m,s[a+n]=o*p,s[a+n+1]=h*m,s[a+n*2]=o*p,s[a+n*2+1]=c*m,s[a+n*3]=l*p,s[a+n*3+1]=c*m,a+=n*4}}uploadPosition(e,r,i,s,n,a){for(let o=0;o<i;o++){const l=e[r+o].position;s[a]=l.x,s[a+1]=l.y,s[a+n]=l.x,s[a+n+1]=l.y,s[a+n*2]=l.x,s[a+n*2+1]=l.y,s[a+n*3]=l.x,s[a+n*3+1]=l.y,a+=n*4}}uploadRotation(e,r,i,s,n,a){for(let o=0;o<i;o++){const l=e[r+o].rotation;s[a]=l,s[a+n]=l,s[a+n*2]=l,s[a+n*3]=l,a+=n*4}}uploadUvs(e,r,i,s,n,a){for(let o=0;o<i;++o){const l=e[r+o]._texture._uvs;l?(s[a]=l.x0,s[a+1]=l.y0,s[a+n]=l.x1,s[a+n+1]=l.y1,s[a+n*2]=l.x2,s[a+n*2+1]=l.y2,s[a+n*3]=l.x3,s[a+n*3+1]=l.y3,a+=n*4):(s[a]=0,s[a+1]=0,s[a+n]=0,s[a+n+1]=0,s[a+n*2]=0,s[a+n*2+1]=0,s[a+n*3]=0,s[a+n*3+1]=0,a+=n*4)}}uploadTint(e,r,i,s,n,a){for(let o=0;o<i;++o){const l=e[r+o],c=Oe.shared.setValue(l._tintRGB).toPremultiplied(l.alpha,l.texture.baseTexture.alphaMode>0);s[a]=c,s[a+n]=c,s[a+n*2]=c,s[a+n*3]=c,a+=n*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Pw.extension={name:"particle",type:V.RendererPlugin};Z.add(Pw);var gF=`#version 300 es
885
- #define SHADER_NAME Tiling-Sprite-100
886
-
887
- precision lowp float;
888
-
889
- in vec2 vTextureCoord;
890
-
891
- out vec4 fragmentColor;
892
-
893
- uniform sampler2D uSampler;
894
- uniform vec4 uColor;
895
- uniform mat3 uMapCoord;
896
- uniform vec4 uClampFrame;
897
- uniform vec2 uClampOffset;
898
-
899
- void main(void)
900
- {
901
- vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
902
- coord = (uMapCoord * vec3(coord, 1.0)).xy;
903
- vec2 unclamped = coord;
904
- coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
905
-
906
- vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
907
-
908
- fragmentColor = texSample * uColor;
909
- }
910
- `,vF=`#version 300 es
911
- #define SHADER_NAME Tiling-Sprite-300
912
-
913
- precision lowp float;
914
-
915
- in vec2 aVertexPosition;
916
- in vec2 aTextureCoord;
917
-
918
- uniform mat3 projectionMatrix;
919
- uniform mat3 translationMatrix;
920
- uniform mat3 uTransform;
921
-
922
- out vec2 vTextureCoord;
923
-
924
- void main(void)
925
- {
926
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
927
-
928
- vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
929
- }
930
- `,yF=`#version 100
931
- #ifdef GL_EXT_shader_texture_lod
932
- #extension GL_EXT_shader_texture_lod : enable
933
- #endif
934
- #define SHADER_NAME Tiling-Sprite-100
935
-
936
- precision lowp float;
937
-
938
- varying vec2 vTextureCoord;
939
-
940
- uniform sampler2D uSampler;
941
- uniform vec4 uColor;
942
- uniform mat3 uMapCoord;
943
- uniform vec4 uClampFrame;
944
- uniform vec2 uClampOffset;
945
-
946
- void main(void)
947
- {
948
- vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
949
- coord = (uMapCoord * vec3(coord, 1.0)).xy;
950
- vec2 unclamped = coord;
951
- coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
952
-
953
- #ifdef GL_EXT_shader_texture_lod
954
- vec4 texSample = unclamped == coord
955
- ? texture2D(uSampler, coord)
956
- : texture2DLodEXT(uSampler, coord, 0);
957
- #else
958
- vec4 texSample = texture2D(uSampler, coord);
959
- #endif
960
-
961
- gl_FragColor = texSample * uColor;
962
- }
963
- `,vy=`#version 100
964
- #define SHADER_NAME Tiling-Sprite-100
965
-
966
- precision lowp float;
967
-
968
- attribute vec2 aVertexPosition;
969
- attribute vec2 aTextureCoord;
970
-
971
- uniform mat3 projectionMatrix;
972
- uniform mat3 translationMatrix;
973
- uniform mat3 uTransform;
974
-
975
- varying vec2 vTextureCoord;
976
-
977
- void main(void)
978
- {
979
- gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
980
-
981
- vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
982
- }
983
- `,bF=`#version 100
984
- #define SHADER_NAME Tiling-Sprite-Simple-100
985
-
986
- precision lowp float;
987
-
988
- varying vec2 vTextureCoord;
989
-
990
- uniform sampler2D uSampler;
991
- uniform vec4 uColor;
992
-
993
- void main(void)
994
- {
995
- vec4 texSample = texture2D(uSampler, vTextureCoord);
996
- gl_FragColor = texSample * uColor;
997
- }
998
- `;const rc=new ke;class Mw extends tu{constructor(e){super(e),e.runners.contextChange.add(this),this.quad=new G1,this.state=Wr.for2d()}contextChange(){const e=this.renderer,r={globals:e.globalUniforms};this.simpleShader=jr.from(vy,bF,r),this.shader=e.context.webGLVersion>1?jr.from(vF,gF,r):jr.from(vy,yF,r)}render(e){const r=this.renderer,i=this.quad;let s=i.vertices;s[0]=s[6]=e._width*-e.anchor.x,s[1]=s[3]=e._height*-e.anchor.y,s[2]=s[4]=e._width*(1-e.anchor.x),s[5]=s[7]=e._height*(1-e.anchor.y);const n=e.uvRespectAnchor?e.anchor.x:0,a=e.uvRespectAnchor?e.anchor.y:0;s=i.uvs,s[0]=s[6]=-n,s[1]=s[3]=-a,s[2]=s[4]=1-n,s[5]=s[7]=1-a,i.invalidate();const o=e._texture,l=o.baseTexture,c=l.alphaMode>0,h=e.tileTransform.localTransform,f=e.uvMatrix;let u=l.isPowerOfTwo&&o.frame.width===l.width&&o.frame.height===l.height;u&&(l._glTextures[r.CONTEXT_UID]?u=l.wrapMode!==qi.CLAMP:l.wrapMode===qi.CLAMP&&(l.wrapMode=qi.REPEAT));const d=u?this.simpleShader:this.shader,p=o.width,m=o.height,g=e._width,y=e._height;rc.set(h.a*p/g,h.b*p/y,h.c*m/g,h.d*m/y,h.tx/g,h.ty/y),rc.invert(),u?rc.prepend(f.mapCoord):(d.uniforms.uMapCoord=f.mapCoord.toArray(!0),d.uniforms.uClampFrame=f.uClampFrame,d.uniforms.uClampOffset=f.uClampOffset),d.uniforms.uTransform=rc.toArray(!0),d.uniforms.uColor=Oe.shared.setValue(e.tint).premultiply(e.worldAlpha,c).toArray(d.uniforms.uColor),d.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),d.uniforms.uSampler=o,r.shader.bind(d),r.geometry.bind(i),this.state.blendMode=I1(e.blendMode,c),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Mw.extension={name:"tilingSprite",type:V.RendererPlugin};Z.add(Mw);const Ow=class pp{constructor(e){this.stage=new fr,e=Object.assign({forceCanvas:!1},e),this.renderer=WL(e),pp._plugins.forEach(r=>{r.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,r){const i=pp._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this)}),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};Ow._plugins=[];let xF=Ow;Z.handleByList(V.Application,xF._plugins);class kw{static init(e){Object.defineProperty(this,"resizeTo",{set(r){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=r,r&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let r,i;if(this._resizeTo===globalThis.window)r=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:s,clientHeight:n}=this._resizeTo;r=s,i=n}this.renderer.resize(r,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}kw.extension=V.Application;Z.add(kw);const Dw=new ke;Fe.prototype._cacheAsBitmap=!1;Fe.prototype._cacheData=null;Fe.prototype._cacheAsBitmapResolution=null;Fe.prototype._cacheAsBitmapMultisample=null;class _F{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(Fe.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;this._cacheAsBitmap=t;let e;t?(this._cacheData||(this._cacheData=new _F),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}});Fe.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))};Fe.prototype._initCachedDisplayObject=function(t){var u,d;if((u=this._cacheData)!=null&&u.sprite)return;const e=this.alpha;this.alpha=1,t.batch.flush();const r=this.getLocalBounds(new me,!0);if((d=this.filters)!=null&&d.length){const p=this.filters[0].padding;r.pad(p)}const i=this.cacheAsBitmapResolution||t.resolution;r.ceil(i),r.width=Math.max(r.width,1/i),r.height=Math.max(r.height,1/i);const s=t.renderTexture.current,n=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),o=t.projection.transform,l=an.create({width:r.width,height:r.height,resolution:i,multisample:this.cacheAsBitmapMultisample??t.multisample}),c=`cacheAsBitmap_${Zs()}`;this._cacheData.textureCacheId=c,de.addToCache(l.baseTexture,c),Q.addToCache(l,c);const h=this.transform.localTransform.copyTo(Dw).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:l,clear:!0,transform:h,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=o,t.renderTexture.bind(s,n,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const f=new xa(l);f.transform.worldTransform=this.transform.worldTransform,f.anchor.x=-(r.x/r.width),f.anchor.y=-(r.y/r.height),f.alpha=e,f._bounds=this._bounds,this._cacheData.sprite=f,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=f.containsPoint.bind(f)};Fe.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))};Fe.prototype._initCachedDisplayObjectCanvas=function(t){var h;if((h=this._cacheData)!=null&&h.sprite)return;const e=this.getLocalBounds(new me,!0),r=this.alpha;this.alpha=1;const i=t.canvasContext.activeContext,s=t._projTransform,n=this.cacheAsBitmapResolution||t.resolution;e.ceil(n),e.width=Math.max(e.width,1/n),e.height=Math.max(e.height,1/n);const a=an.create({width:e.width,height:e.height,resolution:n}),o=`cacheAsBitmap_${Zs()}`;this._cacheData.textureCacheId=o,de.addToCache(a.baseTexture,o),Q.addToCache(a,o);const l=Dw;this.transform.localTransform.copyTo(l),l.invert(),l.tx-=e.x,l.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:a,clear:!0,transform:l,skipUpdateTransform:!1}),t.canvasContext.activeContext=i,t._projTransform=s,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;const c=new xa(a);c.transform.worldTransform=this.transform.worldTransform,c.anchor.x=-(e.x/e.width),c.anchor.y=-(e.y/e.height),c.alpha=r,c._bounds=this._bounds,this._cacheData.sprite=c,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=c.containsPoint.bind(c)};Fe.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID};Fe.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)};Fe.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,de.removeFromCache(this._cacheData.textureCacheId),Q.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null};Fe.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)};Fe.prototype.name=null;fr.prototype.getChildByName=function(t,e){for(let r=0,i=this.children.length;r<i;r++)if(this.children[r].name===t)return this.children[r];if(e)for(let r=0,i=this.children.length;r<i;r++){const s=this.children[r];if(!s.getChildByName)continue;const n=s.getChildByName(t,!0);if(n)return n}return null};Fe.prototype.getGlobalPosition=function(t=new Se,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var wF=`varying vec2 vTextureCoord;
999
-
1000
- uniform sampler2D uSampler;
1001
- uniform float uAlpha;
1002
-
1003
- void main(void)
1004
- {
1005
- gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
1006
- }
1007
- `;class EF extends ft{constructor(e=1){super(qL,wF,{uAlpha:1}),this.alpha=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}const SF={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},TF=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
1008
- `);function AF(t){const e=SF[t],r=e.length;let i=TF,s="";const n="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;";let a;for(let o=0;o<t;o++){let l=n.replace("%index%",o.toString());a=o,o>=r&&(a=t-o-1),l=l.replace("%value%",e[a].toString()),s+=l,s+=`
1009
- `}return i=i.replace("%blur%",s),i=i.replace("%size%",t.toString()),i}const CF=`
1010
- attribute vec2 aVertexPosition;
1011
-
1012
- uniform mat3 projectionMatrix;
1013
-
1014
- uniform float strength;
1015
-
1016
- varying vec2 vBlurTexCoords[%size%];
1017
-
1018
- uniform vec4 inputSize;
1019
- uniform vec4 outputFrame;
1020
-
1021
- vec4 filterVertexPosition( void )
1022
- {
1023
- vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1024
-
1025
- return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1026
- }
1027
-
1028
- vec2 filterTextureCoord( void )
1029
- {
1030
- return aVertexPosition * (outputFrame.zw * inputSize.zw);
1031
- }
1032
-
1033
- void main(void)
1034
- {
1035
- gl_Position = filterVertexPosition();
1036
-
1037
- vec2 textureCoord = filterTextureCoord();
1038
- %blur%
1039
- }`;function IF(t,e){const r=Math.ceil(t/2);let i=CF,s="",n;e?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let a=0;a<t;a++){let o=n.replace("%index%",a.toString());o=o.replace("%sampleIndex%",`${a-(r-1)}.0`),s+=o,s+=`
1040
- `}return i=i.replace("%blur%",s),i=i.replace("%size%",t.toString()),i}class mp extends ft{constructor(e,r=8,i=4,s=ft.defaultResolution,n=5){const a=IF(n,e),o=AF(n);super(a,o),this.horizontal=e,this.resolution=s,this._quality=0,this.quality=i,this.blur=r}apply(e,r,i,s){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/r.width):this.uniforms.strength=1/i.height*(i.height/r.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/r.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/r.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,r,i,s);else{const n=e.getFilterTexture(),a=e.renderer;let o=r,l=n;this.state.blend=!1,e.applyFilter(this,o,l,Mr.CLEAR);for(let c=1;c<this.passes-1;c++){e.bindAndClear(o,Mr.BLIT),this.uniforms.uSampler=l;const h=l;l=o,o=h,a.shader.bind(this),a.geometry.draw(5)}this.state.blend=!0,e.applyFilter(this,l,i,s),e.returnFilterTexture(n)}}get blur(){return this.strength}set blur(e){this.padding=1+Math.abs(e)*2,this.strength=e}get quality(){return this._quality}set quality(e){this._quality=e,this.passes=e}}class RF extends ft{constructor(e=8,r=4,i=ft.defaultResolution,s=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new mp(!0,e,r,i,s),this.blurYFilter=new mp(!1,e,r,i,s),this.resolution=i,this.quality=r,this.blur=e,this.repeatEdgePixels=!1}apply(e,r,i,s){const n=Math.abs(this.blurXFilter.strength),a=Math.abs(this.blurYFilter.strength);if(n&&a){const o=e.getFilterTexture();this.blurXFilter.apply(e,r,o,Mr.CLEAR),this.blurYFilter.apply(e,o,i,s),e.returnFilterTexture(o)}else a?this.blurYFilter.apply(e,r,i,s):this.blurXFilter.apply(e,r,i,s)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2}get blur(){return this.blurXFilter.blur}set blur(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(e){this.blurXFilter.quality=this.blurYFilter.quality=e}get blurX(){return this.blurXFilter.blur}set blurX(e){this.blurXFilter.blur=e,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(e){this.blurYFilter.blur=e,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(e){this.blurYFilter.blendMode=e}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(e){this._repeatEdgePixels=e,this.updatePadding()}}var PF=`varying vec2 vTextureCoord;
1041
- uniform sampler2D uSampler;
1042
- uniform float m[20];
1043
- uniform float uAlpha;
1044
-
1045
- void main(void)
1046
- {
1047
- vec4 c = texture2D(uSampler, vTextureCoord);
1048
-
1049
- if (uAlpha == 0.0) {
1050
- gl_FragColor = c;
1051
- return;
1052
- }
1053
-
1054
- // Un-premultiply alpha before applying the color matrix. See issue #3539.
1055
- if (c.a > 0.0) {
1056
- c.rgb /= c.a;
1057
- }
1058
-
1059
- vec4 result;
1060
-
1061
- result.r = (m[0] * c.r);
1062
- result.r += (m[1] * c.g);
1063
- result.r += (m[2] * c.b);
1064
- result.r += (m[3] * c.a);
1065
- result.r += m[4];
1066
-
1067
- result.g = (m[5] * c.r);
1068
- result.g += (m[6] * c.g);
1069
- result.g += (m[7] * c.b);
1070
- result.g += (m[8] * c.a);
1071
- result.g += m[9];
1072
-
1073
- result.b = (m[10] * c.r);
1074
- result.b += (m[11] * c.g);
1075
- result.b += (m[12] * c.b);
1076
- result.b += (m[13] * c.a);
1077
- result.b += m[14];
1078
-
1079
- result.a = (m[15] * c.r);
1080
- result.a += (m[16] * c.g);
1081
- result.a += (m[17] * c.b);
1082
- result.a += (m[18] * c.a);
1083
- result.a += m[19];
1084
-
1085
- vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
1086
-
1087
- // Premultiply alpha again.
1088
- rgb *= result.a;
1089
-
1090
- gl_FragColor = vec4(rgb, result.a);
1091
- }
1092
- `;class gp extends ft{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(cw,PF,e),this.alpha=1}_loadMatrix(e,r=!1){let i=e;r&&(this._multiply(i,this.uniforms.m,e),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(e,r,i){return e[0]=r[0]*i[0]+r[1]*i[5]+r[2]*i[10]+r[3]*i[15],e[1]=r[0]*i[1]+r[1]*i[6]+r[2]*i[11]+r[3]*i[16],e[2]=r[0]*i[2]+r[1]*i[7]+r[2]*i[12]+r[3]*i[17],e[3]=r[0]*i[3]+r[1]*i[8]+r[2]*i[13]+r[3]*i[18],e[4]=r[0]*i[4]+r[1]*i[9]+r[2]*i[14]+r[3]*i[19]+r[4],e[5]=r[5]*i[0]+r[6]*i[5]+r[7]*i[10]+r[8]*i[15],e[6]=r[5]*i[1]+r[6]*i[6]+r[7]*i[11]+r[8]*i[16],e[7]=r[5]*i[2]+r[6]*i[7]+r[7]*i[12]+r[8]*i[17],e[8]=r[5]*i[3]+r[6]*i[8]+r[7]*i[13]+r[8]*i[18],e[9]=r[5]*i[4]+r[6]*i[9]+r[7]*i[14]+r[8]*i[19]+r[9],e[10]=r[10]*i[0]+r[11]*i[5]+r[12]*i[10]+r[13]*i[15],e[11]=r[10]*i[1]+r[11]*i[6]+r[12]*i[11]+r[13]*i[16],e[12]=r[10]*i[2]+r[11]*i[7]+r[12]*i[12]+r[13]*i[17],e[13]=r[10]*i[3]+r[11]*i[8]+r[12]*i[13]+r[13]*i[18],e[14]=r[10]*i[4]+r[11]*i[9]+r[12]*i[14]+r[13]*i[19]+r[14],e[15]=r[15]*i[0]+r[16]*i[5]+r[17]*i[10]+r[18]*i[15],e[16]=r[15]*i[1]+r[16]*i[6]+r[17]*i[11]+r[18]*i[16],e[17]=r[15]*i[2]+r[16]*i[7]+r[17]*i[12]+r[18]*i[17],e[18]=r[15]*i[3]+r[16]*i[8]+r[17]*i[13]+r[18]*i[18],e[19]=r[15]*i[4]+r[16]*i[9]+r[17]*i[14]+r[18]*i[19]+r[19],e}_colorMatrix(e){const r=new Float32Array(e);return r[4]/=255,r[9]/=255,r[14]/=255,r[19]/=255,r}brightness(e,r){const i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,r)}tint(e,r){const[i,s,n]=Oe.shared.setValue(e).toArray(),a=[i,0,0,0,0,0,s,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(a,r)}greyscale(e,r){const i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,r)}blackAndWhite(e){const r=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(r,e)}hue(e,r){e=(e||0)/180*Math.PI;const i=Math.cos(e),s=Math.sin(e),n=Math.sqrt,a=1/3,o=n(a),l=i+(1-i)*a,c=a*(1-i)-o*s,h=a*(1-i)+o*s,f=a*(1-i)+o*s,u=i+a*(1-i),d=a*(1-i)-o*s,p=a*(1-i)-o*s,m=a*(1-i)+o*s,g=i+a*(1-i),y=[l,c,h,0,0,f,u,d,0,0,p,m,g,0,0,0,0,0,1,0];this._loadMatrix(y,r)}contrast(e,r){const i=(e||0)+1,s=-.5*(i-1),n=[i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0];this._loadMatrix(n,r)}saturate(e=0,r){const i=e*2/3+1,s=(i-1)*-.5,n=[i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0];this._loadMatrix(n,r)}desaturate(){this.saturate(-1)}negative(e){const r=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(r,e)}sepia(e){const r=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(r,e)}technicolor(e){const r=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(r,e)}polaroid(e){const r=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(r,e)}toBGR(e){const r=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(r,e)}kodachrome(e){const r=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(r,e)}browni(e){const r=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(r,e)}vintage(e){const r=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(r,e)}colorTone(e,r,i,s,n){e=e||.2,r=r||.15,i=i||16770432,s=s||3375104;const a=Oe.shared,[o,l,c]=a.setValue(i).toArray(),[h,f,u]=a.setValue(s).toArray(),d=[.3,.59,.11,0,0,o,l,c,e,0,h,f,u,r,0,o-h,l-f,c-u,0,0];this._loadMatrix(d,n)}night(e,r){e=e||.1;const i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,r)}predator(e,r){const i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,r)}lsd(e){const r=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(r,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}gp.prototype.grayscale=gp.prototype.greyscale;var MF=`varying vec2 vFilterCoord;
1093
- varying vec2 vTextureCoord;
1094
-
1095
- uniform vec2 scale;
1096
- uniform mat2 rotation;
1097
- uniform sampler2D uSampler;
1098
- uniform sampler2D mapSampler;
1099
-
1100
- uniform highp vec4 inputSize;
1101
- uniform vec4 inputClamp;
1102
-
1103
- void main(void)
1104
- {
1105
- vec4 map = texture2D(mapSampler, vFilterCoord);
1106
-
1107
- map -= 0.5;
1108
- map.xy = scale * inputSize.zw * (rotation * map.xy);
1109
-
1110
- gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
1111
- }
1112
- `,OF=`attribute vec2 aVertexPosition;
1113
-
1114
- uniform mat3 projectionMatrix;
1115
- uniform mat3 filterMatrix;
1116
-
1117
- varying vec2 vTextureCoord;
1118
- varying vec2 vFilterCoord;
1119
-
1120
- uniform vec4 inputSize;
1121
- uniform vec4 outputFrame;
1122
-
1123
- vec4 filterVertexPosition( void )
1124
- {
1125
- vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1126
-
1127
- return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1128
- }
1129
-
1130
- vec2 filterTextureCoord( void )
1131
- {
1132
- return aVertexPosition * (outputFrame.zw * inputSize.zw);
1133
- }
1134
-
1135
- void main(void)
1136
- {
1137
- gl_Position = filterVertexPosition();
1138
- vTextureCoord = filterTextureCoord();
1139
- vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
1140
- }
1141
- `;class kF extends ft{constructor(e,r){const i=new ke;e.renderable=!1,super(OF,MF,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,r==null&&(r=20),this.scale=new Se(r,r)}apply(e,r,i,s){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const n=this.maskSprite.worldTransform,a=Math.sqrt(n.a*n.a+n.b*n.b),o=Math.sqrt(n.c*n.c+n.d*n.d);a!==0&&o!==0&&(this.uniforms.rotation[0]=n.a/a,this.uniforms.rotation[1]=n.b/a,this.uniforms.rotation[2]=n.c/o,this.uniforms.rotation[3]=n.d/o),e.applyFilter(this,r,i,s)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var DF=`varying vec2 v_rgbNW;
1142
- varying vec2 v_rgbNE;
1143
- varying vec2 v_rgbSW;
1144
- varying vec2 v_rgbSE;
1145
- varying vec2 v_rgbM;
1146
-
1147
- varying vec2 vFragCoord;
1148
- uniform sampler2D uSampler;
1149
- uniform highp vec4 inputSize;
1150
-
1151
-
1152
- /**
1153
- Basic FXAA implementation based on the code on geeks3d.com with the
1154
- modification that the texture2DLod stuff was removed since it's
1155
- unsupported by WebGL.
1156
-
1157
- --
1158
-
1159
- From:
1160
- https://github.com/mitsuhiko/webgl-meincraft
1161
-
1162
- Copyright (c) 2011 by Armin Ronacher.
1163
-
1164
- Some rights reserved.
1165
-
1166
- Redistribution and use in source and binary forms, with or without
1167
- modification, are permitted provided that the following conditions are
1168
- met:
1169
-
1170
- * Redistributions of source code must retain the above copyright
1171
- notice, this list of conditions and the following disclaimer.
1172
-
1173
- * Redistributions in binary form must reproduce the above
1174
- copyright notice, this list of conditions and the following
1175
- disclaimer in the documentation and/or other materials provided
1176
- with the distribution.
1177
-
1178
- * The names of the contributors may not be used to endorse or
1179
- promote products derived from this software without specific
1180
- prior written permission.
1181
-
1182
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1183
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1184
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1185
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1186
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1187
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1188
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1189
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1190
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1191
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1192
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1193
- */
1194
-
1195
- #ifndef FXAA_REDUCE_MIN
1196
- #define FXAA_REDUCE_MIN (1.0/ 128.0)
1197
- #endif
1198
- #ifndef FXAA_REDUCE_MUL
1199
- #define FXAA_REDUCE_MUL (1.0 / 8.0)
1200
- #endif
1201
- #ifndef FXAA_SPAN_MAX
1202
- #define FXAA_SPAN_MAX 8.0
1203
- #endif
1204
-
1205
- //optimized version for mobile, where dependent
1206
- //texture reads can be a bottleneck
1207
- vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
1208
- vec2 v_rgbNW, vec2 v_rgbNE,
1209
- vec2 v_rgbSW, vec2 v_rgbSE,
1210
- vec2 v_rgbM) {
1211
- vec4 color;
1212
- vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
1213
- vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
1214
- vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
1215
- vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
1216
- vec4 texColor = texture2D(tex, v_rgbM);
1217
- vec3 rgbM = texColor.xyz;
1218
- vec3 luma = vec3(0.299, 0.587, 0.114);
1219
- float lumaNW = dot(rgbNW, luma);
1220
- float lumaNE = dot(rgbNE, luma);
1221
- float lumaSW = dot(rgbSW, luma);
1222
- float lumaSE = dot(rgbSE, luma);
1223
- float lumaM = dot(rgbM, luma);
1224
- float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
1225
- float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
1226
-
1227
- mediump vec2 dir;
1228
- dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
1229
- dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
1230
-
1231
- float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
1232
- (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
1233
-
1234
- float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
1235
- dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
1236
- max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
1237
- dir * rcpDirMin)) * inverseVP;
1238
-
1239
- vec3 rgbA = 0.5 * (
1240
- texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
1241
- texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
1242
- vec3 rgbB = rgbA * 0.5 + 0.25 * (
1243
- texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
1244
- texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
1245
-
1246
- float lumaB = dot(rgbB, luma);
1247
- if ((lumaB < lumaMin) || (lumaB > lumaMax))
1248
- color = vec4(rgbA, texColor.a);
1249
- else
1250
- color = vec4(rgbB, texColor.a);
1251
- return color;
1252
- }
1253
-
1254
- void main() {
1255
-
1256
- vec4 color;
1257
-
1258
- color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
1259
-
1260
- gl_FragColor = color;
1261
- }
1262
- `,NF=`
1263
- attribute vec2 aVertexPosition;
1264
-
1265
- uniform mat3 projectionMatrix;
1266
-
1267
- varying vec2 v_rgbNW;
1268
- varying vec2 v_rgbNE;
1269
- varying vec2 v_rgbSW;
1270
- varying vec2 v_rgbSE;
1271
- varying vec2 v_rgbM;
1272
-
1273
- varying vec2 vFragCoord;
1274
-
1275
- uniform vec4 inputSize;
1276
- uniform vec4 outputFrame;
1277
-
1278
- vec4 filterVertexPosition( void )
1279
- {
1280
- vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1281
-
1282
- return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1283
- }
1284
-
1285
- void texcoords(vec2 fragCoord, vec2 inverseVP,
1286
- out vec2 v_rgbNW, out vec2 v_rgbNE,
1287
- out vec2 v_rgbSW, out vec2 v_rgbSE,
1288
- out vec2 v_rgbM) {
1289
- v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
1290
- v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
1291
- v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
1292
- v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
1293
- v_rgbM = vec2(fragCoord * inverseVP);
1294
- }
1295
-
1296
- void main(void) {
1297
-
1298
- gl_Position = filterVertexPosition();
1299
-
1300
- vFragCoord = aVertexPosition * outputFrame.zw;
1301
-
1302
- texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
1303
- }
1304
- `;class LF extends ft{constructor(){super(NF,DF)}}var BF=`precision highp float;
1305
-
1306
- varying vec2 vTextureCoord;
1307
- varying vec4 vColor;
1308
-
1309
- uniform float uNoise;
1310
- uniform float uSeed;
1311
- uniform sampler2D uSampler;
1312
-
1313
- float rand(vec2 co)
1314
- {
1315
- return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
1316
- }
1317
-
1318
- void main()
1319
- {
1320
- vec4 color = texture2D(uSampler, vTextureCoord);
1321
- float randomValue = rand(gl_FragCoord.xy * uSeed);
1322
- float diff = (randomValue - 0.5) * uNoise;
1323
-
1324
- // Un-premultiply alpha before applying the color matrix. See issue #3539.
1325
- if (color.a > 0.0) {
1326
- color.rgb /= color.a;
1327
- }
1328
-
1329
- color.r += diff;
1330
- color.g += diff;
1331
- color.b += diff;
1332
-
1333
- // Premultiply alpha again.
1334
- color.rgb *= color.a;
1335
-
1336
- gl_FragColor = color;
1337
- }
1338
- `;class FF extends ft{constructor(e=.5,r=Math.random()){super(cw,BF,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const yy={AlphaFilter:EF,BlurFilter:RF,BlurFilterPass:mp,ColorMatrixFilter:gp,DisplacementFilter:kF,FXAAFilter:LF,NoiseFilter:FF};Object.entries(yy).forEach(([t,e])=>{Object.defineProperty(yy,t,{get(){return xe("7.1.0",`filters.${t} has moved to ${t}`),e}})});class UF{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||(kt.system.add(this.tickerUpdate,this,Ks.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(kt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}}const Ci=new UF;class yl{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=yl.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Se,this.page=new Se,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,r,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,r,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class vh extends yl{constructor(){super(...arguments),this.client=new Se,this.movement=new Se,this.offset=new Se,this.global=new Se,this.screen=new Se}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,r,i){return e.worldTransform.applyInverse(i||this.global,r)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,r,i,s,n,a,o,l,c,h,f,u,d,p,m){throw new Error("Method not implemented.")}}class sr extends vh{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Dn extends vh{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}Dn.DOM_DELTA_PIXEL=0,Dn.DOM_DELTA_LINE=1,Dn.DOM_DELTA_PAGE=2;const jF=2048,$F=new Se,Sd=new Se;class GF{constructor(e){this.dispatch=new pl,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,r){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:r,priority:0}),this.mappingTable[e].sort((i,s)=>i.priority-s.priority)}dispatchEvent(e,r){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,r),this.dispatch.emit(r||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const r=this.mappingTable[e.type];if(r)for(let i=0,s=r.length;i<s;i++)r[i].fn(e);else console.warn(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,r){Ci.pauseUpdate=!0;const i=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",s=this[i](this.rootTarget,this.rootTarget.eventMode,$F.set(e,r),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(e,r){if(!e.target)return;const i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let s=0,n=i.length-1;s<n;s++)if(e.currentTarget=i[s],this.notifyTarget(e,r),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,r),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let s=i.length-2;s>=0;s--)if(e.currentTarget=i[s],this.notifyTarget(e,r),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,r,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const s=Array.isArray(r)?r:[r];for(let n=i.length-1;n>=0;n--)s.forEach(a=>{e.currentTarget=i[n],this.notifyTarget(e,a)})}propagationPath(e){const r=[e];for(let i=0;i<jF&&e!==this.rootTarget;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");r.push(e.parent),e=e.parent}return r.reverse(),r}hitTestMoveRecursive(e,r,i,s,n,a=!1){let o=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||r==="dynamic")&&(Ci.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let f=h.length-1;f>=0;f--){const u=h[f],d=this.hitTestMoveRecursive(u,this._isInteractive(r)?r:u.eventMode,i,s,n,a||n(e,i));if(d){if(d.length>0&&!d[d.length-1].parent)continue;const p=e.isInteractive();(d.length>0||p)&&(p&&this._allInteractiveElements.push(e),d.push(e)),this._hitElements.length===0&&(this._hitElements=d),o=!0}}}const l=this._isInteractive(r),c=e.isInteractive();return l&&c&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:l&&!n(e,i)&&s(e,i)?c?[e]:[]:null}hitTestRecursive(e,r,i,s,n){if(this._interactivePrune(e)||n(e,i))return null;if((e.eventMode==="dynamic"||r==="dynamic")&&(Ci.pauseUpdate=!1),e.interactiveChildren&&e.children){const l=e.children;for(let c=l.length-1;c>=0;c--){const h=l[c],f=this.hitTestRecursive(h,this._isInteractive(r)?r:h.eventMode,i,s,n);if(f){if(f.length>0&&!f[f.length-1].parent)continue;const u=e.isInteractive();return(f.length>0||u)&&f.push(e),f}}}const a=this._isInteractive(r),o=e.isInteractive();return a&&s(e,i)?o?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,r){var i;if(e.hitArea&&(e.worldTransform.applyInverse(r,Sd),!e.hitArea.contains(Sd.x,Sd.y)))return!0;if(e._mask){const s=e._mask.isMaskData?e._mask.maskObject:e._mask;if(s&&!((i=s.containsPoint)!=null&&i.call(s,r)))return!0}return!1}hitTestFn(e,r){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(r):!1}notifyTarget(e,r){var n,a;r=r??e.type;const i=`on${r}`;(a=(n=e.currentTarget)[i])==null||a.call(n,e);const s=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${r}capture`:r;this.notifyListeners(e,s),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,r)}mapPointerDown(e){if(!(e instanceof sr)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.createPointerEvent(e);if(this.dispatchEvent(r,"pointerdown"),r.pointerType==="touch")this.dispatchEvent(r,"touchstart");else if(r.pointerType==="mouse"||r.pointerType==="pen"){const s=r.button===2;this.dispatchEvent(r,s?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=r.composedPath(),this.freeEvent(r)}mapPointerMove(e){var l,c;if(!(e instanceof sr)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=r.pointerType==="mouse"||r.pointerType==="pen",s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.overTargets);if(((l=s.overTargets)==null?void 0:l.length)>0&&n!==r.target){const h=e.type==="mousemove"?"mouseout":"pointerout",f=this.createPointerEvent(e,h,n);if(this.dispatchEvent(f,"pointerout"),i&&this.dispatchEvent(f,"mouseout"),!r.composedPath().includes(n)){const u=this.createPointerEvent(e,"pointerleave",n);for(u.eventPhase=u.AT_TARGET;u.target&&!r.composedPath().includes(u.target);)u.currentTarget=u.target,this.notifyTarget(u),i&&this.notifyTarget(u,"mouseleave"),u.target=u.target.parent;this.freeEvent(u)}this.freeEvent(f)}if(n!==r.target){const h=e.type==="mousemove"?"mouseover":"pointerover",f=this.clonePointerEvent(r,h);this.dispatchEvent(f,"pointerover"),i&&this.dispatchEvent(f,"mouseover");let u=n==null?void 0:n.parent;for(;u&&u!==this.rootTarget.parent&&u!==r.target;)u=u.parent;if(!u||u===this.rootTarget.parent){const d=this.clonePointerEvent(r,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(f)}const a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push("pointermove"):this.dispatchEvent(r,"pointermove"),o&&a.push("globalpointermove"),r.pointerType==="touch"&&(this.moveOnAll?a.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),o&&a.push("globaltouchmove")),i&&(this.moveOnAll?a.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),o&&a.push("globalmousemove"),this.cursor=(c=r.target)==null?void 0:c.cursor),a.length>0&&this.all(r,a),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(e){var a;if(!(e instanceof sr)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(e.pointerId),i=this.createPointerEvent(e),s=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(a=i.target)==null?void 0:a.cursor);const n=this.clonePointerEvent(i,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;r.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(n)}mapPointerOut(e){if(!(e instanceof sr)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(e.pointerId);if(r.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",s=this.findMountedTarget(r.overTargets),n=this.createPointerEvent(e,"pointerout",s);this.dispatchEvent(n),i&&this.dispatchEvent(n,"mouseout");const a=this.createPointerEvent(e,"pointerleave",s);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),i&&this.notifyTarget(a,"mouseleave"),a.target=a.target.parent;r.overTargets=null,this.freeEvent(n),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof sr)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const o=i.button===2;this.dispatchEvent(i,o?"rightup":"mouseup")}const s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.pressTargetsByButton[e.button]);let a=n;if(n&&!i.composedPath().includes(n)){let o=n;for(;o&&!i.composedPath().includes(o);){if(i.currentTarget=o,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const l=i.button===2;this.notifyTarget(i,l?"rightupoutside":"mouseupoutside")}o=o.parent}delete s.pressTargetsByButton[e.button],a=o}if(a){const o=this.clonePointerEvent(i,"click");o.target=a,o.path=null,s.clicksByButton[e.button]||(s.clicksByButton[e.button]={clickCount:0,target:o.target,timeStamp:r});const l=s.clicksByButton[e.button];if(l.target===o.target&&r-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=o.target,l.timeStamp=r,o.detail=l.clickCount,o.pointerType==="mouse"){const c=o.button===2;this.dispatchEvent(o,c?"rightclick":"click")}else o.pointerType==="touch"&&this.dispatchEvent(o,"tap");this.dispatchEvent(o,"pointertap"),this.freeEvent(o)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof sr)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[e.button]),s=this.createPointerEvent(e);if(i){let n=i;for(;n;)s.currentTarget=n,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"?this.notifyTarget(s,"touchendoutside"):(s.pointerType==="mouse"||s.pointerType==="pen")&&this.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete r.pressTargetsByButton[e.button]}this.freeEvent(s)}mapWheel(e){if(!(e instanceof Dn)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const r=this.createWheelEvent(e);this.dispatchEvent(r),this.freeEvent(r)}findMountedTarget(e){if(!e)return null;let r=e[0];for(let i=1;i<e.length&&e[i].parent===r;i++)r=e[i];return r}createPointerEvent(e,r,i){const s=this.allocateEvent(sr);return this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e,s.target=i??this.hitTest(s.global.x,s.global.y)??this._hitElements[0],typeof r=="string"&&(s.type=r),s}createWheelEvent(e){const r=this.allocateEvent(Dn);return this.copyWheelData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=this.hitTest(r.global.x,r.global.y),r}clonePointerEvent(e,r){const i=this.allocateEvent(sr);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=r??i.type,i}copyWheelData(e,r){r.deltaMode=e.deltaMode,r.deltaX=e.deltaX,r.deltaY=e.deltaY,r.deltaZ=e.deltaZ}copyPointerData(e,r){e instanceof sr&&r instanceof sr&&(r.pointerId=e.pointerId,r.width=e.width,r.height=e.height,r.isPrimary=e.isPrimary,r.pointerType=e.pointerType,r.pressure=e.pressure,r.tangentialPressure=e.tangentialPressure,r.tiltX=e.tiltX,r.tiltY=e.tiltY,r.twist=e.twist)}copyMouseData(e,r){e instanceof vh&&r instanceof vh&&(r.altKey=e.altKey,r.button=e.button,r.buttons=e.buttons,r.client.copyFrom(e.client),r.ctrlKey=e.ctrlKey,r.metaKey=e.metaKey,r.movement.copyFrom(e.movement),r.screen.copyFrom(e.screen),r.shiftKey=e.shiftKey,r.global.copyFrom(e.global))}copyData(e,r){r.isTrusted=e.isTrusted,r.srcElement=e.srcElement,r.timeStamp=performance.now(),r.type=e.type,r.detail=e.detail,r.view=e.view,r.which=e.which,r.layer.copyFrom(e.layer),r.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const r=this.eventPool.get(e).pop()||new e(this);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=null,r.target=null,r}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const r=e.constructor;this.eventPool.has(r)||this.eventPool.set(r,[]),this.eventPool.get(r).push(e)}notifyListeners(e,r){const i=e.currentTarget._events[r];if(i&&e.currentTarget.isInteractive())if("fn"in i)i.once&&e.currentTarget.removeListener(r,i.fn,void 0,!0),i.fn.call(i.context,e);else for(let s=0,n=i.length;s<n&&!e.propagationImmediatelyStopped;s++)i[s].once&&e.currentTarget.removeListener(r,i[s].fn,void 0,!0),i[s].fn.call(i[s].context,e)}}const zF=1,HF={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},vp=class yp{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new GF(null),Ci.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new sr(null),this.rootWheelEvent=new Dn(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...yp.defaultEventFeatures},{set:(r,i,s)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),r[i]=s,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:r,resolution:i}=this.renderer;this.setTargetElement(r),this.resolution=i,yp._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let r=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(r=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":r&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":r&&Object.assign(this.domElement.style,i);break}else r&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const r=this.normalizeToPointerData(e);this.autoPreventDefault&&r[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=r.length;i<s;i++){const n=r[i],a=this.bootstrapEvent(this.rootPointerEvent,n);this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Ci.pointerMoved();const r=this.normalizeToPointerData(e);for(let i=0,s=r.length;i<s;i++){const n=this.bootstrapEvent(this.rootPointerEvent,r[i]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let r=e.target;e.composedPath&&e.composedPath().length>0&&(r=e.composedPath()[0]);const i=r!==this.domElement?"outside":"",s=this.normalizeToPointerData(e);for(let n=0,a=s.length;n<a;n++){const o=this.bootstrapEvent(this.rootPointerEvent,s[n]);o.type+=i,this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const r=this.normalizeToPointerData(e);for(let i=0,s=r.length;i<s;i++){const n=this.bootstrapEvent(this.rootPointerEvent,r[i]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const r=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(r)}setTargetElement(e){this.removeEvents(),this.domElement=e,Ci.domElement=e,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;Ci.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;Ci.removeTickerListener();const e=this.domElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(e,r,i){const s=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;e.x=(r-s.left)*(this.domElement.width/s.width)*n,e.y=(i-s.top)*(this.domElement.height/s.height)*n}normalizeToPointerData(e){const r=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){const n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=e.type,r.push(n)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=zF),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,r.push(i)}else r.push(e);return r}normalizeWheelEvent(e){const r=this.rootWheelEvent;return this.transferMouseData(r,e),r.deltaX=e.deltaX,r.deltaY=e.deltaY,r.deltaZ=e.deltaZ,r.deltaMode=e.deltaMode,this.mapPositionToPoint(r.screen,e.clientX,e.clientY),r.global.copyFrom(r.screen),r.offset.copyFrom(r.screen),r.nativeEvent=e,r.type=e.type,r}bootstrapEvent(e,r){return e.originalEvent=null,e.nativeEvent=r,e.pointerId=r.pointerId,e.width=r.width,e.height=r.height,e.isPrimary=r.isPrimary,e.pointerType=r.pointerType,e.pressure=r.pressure,e.tangentialPressure=r.tangentialPressure,e.tiltX=r.tiltX,e.tiltY=r.tiltY,e.twist=r.twist,this.transferMouseData(e,r),this.mapPositionToPoint(e.screen,r.clientX,r.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=r.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=HF[e.type]||e.type),e}transferMouseData(e,r){e.isTrusted=r.isTrusted,e.srcElement=r.srcElement,e.timeStamp=performance.now(),e.type=r.type,e.altKey=r.altKey,e.button=r.button,e.buttons=r.buttons,e.client.x=r.clientX,e.client.y=r.clientY,e.ctrlKey=r.ctrlKey,e.metaKey=r.metaKey,e.movement.x=r.movementX,e.movement.y=r.movementY,e.page.x=r.pageX,e.page.y=r.pageY,e.relatedTarget=null,e.shiftKey=r.shiftKey}};vp.extension={name:"events",type:[V.RendererSystem,V.CanvasRendererSystem]},vp.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let bp=vp;Z.add(bp);function by(t){return t==="dynamic"||t==="static"}const VF={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??by(bp.defaultEventMode)},set interactive(t){xe("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??bp.defaultEventMode},set eventMode(t){this._internalInteractive=by(t),this._internalEventMode=t},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(t,e,r){const i=typeof r=="boolean"&&r||typeof r=="object"&&r.capture,s=typeof e=="function"?void 0:e;t=i?`${t}capture`:t,e=typeof e=="function"?e:e.handleEvent,this.on(t,e,s)},removeEventListener(t,e,r){const i=typeof r=="boolean"&&r||typeof r=="object"&&r.capture,s=typeof e=="function"?void 0:e;t=i?`${t}capture`:t,e=typeof e=="function"?e:e.handleEvent,this.off(t,e,s)},dispatchEvent(t){if(!(t instanceof yl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};Fe.mixin(VF);const WF={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Fe.mixin(WF);const XF=9,ic=100,YF=0,qF=0,xy=2,_y=1,ZF=-1e3,KF=-1e3,QF=2;class Nw{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(oi.tablet||oi.phone)&&this.createTouchHook();const r=document.createElement("div");r.style.width=`${ic}px`,r.style.height=`${ic}px`,r.style.position="absolute",r.style.top=`${YF}px`,r.style.left=`${qF}px`,r.style.zIndex=xy.toString(),this.div=r,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${_y}px`,e.style.height=`${_y}px`,e.style.position="absolute",e.style.top=`${ZF}px`,e.style.left=`${KF}px`,e.style.zIndex=QF.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const r=e.children;if(r)for(let i=0;i<r.length;i++)this.updateAccessibleObjects(r[i])}update(){const e=performance.now();if(oi.android.device&&e<this.androidUpdateCount||(this.androidUpdateCount=e+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:r,y:i,width:s,height:n}=this.renderer.view.getBoundingClientRect(),{width:a,height:o,resolution:l}=this.renderer,c=s/a*l,h=n/o*l;let f=this.div;f.style.left=`${r}px`,f.style.top=`${i}px`,f.style.width=`${a}px`,f.style.height=`${o}px`;for(let u=0;u<this.children.length;u++){const d=this.children[u];if(d.renderId!==this.renderId)d._accessibleActive=!1,On(this.children,u,1),this.div.removeChild(d._accessibleDiv),this.pool.push(d._accessibleDiv),d._accessibleDiv=null,u--;else{f=d._accessibleDiv;let p=d.hitArea;const m=d.worldTransform;d.hitArea?(f.style.left=`${(m.tx+p.x*m.a)*c}px`,f.style.top=`${(m.ty+p.y*m.d)*h}px`,f.style.width=`${p.width*m.a*c}px`,f.style.height=`${p.height*m.d*h}px`):(p=d.getBounds(),this.capHitArea(p),f.style.left=`${p.x*c}px`,f.style.top=`${p.y*h}px`,f.style.width=`${p.width*c}px`,f.style.height=`${p.height*h}px`,f.title!==d.accessibleTitle&&d.accessibleTitle!==null&&(f.title=d.accessibleTitle),f.getAttribute("aria-label")!==d.accessibleHint&&d.accessibleHint!==null&&f.setAttribute("aria-label",d.accessibleHint)),(d.accessibleTitle!==f.title||d.tabIndex!==f.tabIndex)&&(f.title=d.accessibleTitle,f.tabIndex=d.tabIndex,this.debug&&this.updateDebugHTML(f))}}this.renderId++}updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:r,height:i}=this.renderer;e.x+e.width>r&&(e.width=r-e.x),e.y+e.height>i&&(e.height=i-e.y)}addChild(e){let r=this.pool.pop();r||(r=document.createElement("button"),r.style.width=`${ic}px`,r.style.height=`${ic}px`,r.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",r.style.position="absolute",r.style.zIndex=xy.toString(),r.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?r.setAttribute("aria-live","off"):r.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?r.setAttribute("aria-relevant","additions"):r.setAttribute("aria-relevant","text"),r.addEventListener("click",this._onClick.bind(this)),r.addEventListener("focus",this._onFocus.bind(this)),r.addEventListener("focusout",this._onFocusOut.bind(this))),r.style.pointerEvents=e.accessiblePointerEvents,r.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?r.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(r.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&r.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(r),e._accessibleActive=!0,e._accessibleDiv=r,r.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,r){const{displayObject:i}=e.target,s=this.renderer.events.rootBoundary,n=Object.assign(new yl(s),{target:i});s.rootTarget=this.renderer.lastObjectRendered,r.forEach(a=>s.dispatchEvent(n,a))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===XF&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}Nw.extension={name:"accessibility",type:[V.RendererPlugin,V.CanvasRendererPlugin]};Z.add(Nw);var Rt=(t=>(t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t))(Rt||{});const yh={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35986:1,34798:1,37808:1};let ei,bn;function wy(){bn={s3tc:ei.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:ei.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:ei.getExtension("WEBGL_compressed_texture_etc"),etc1:ei.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:ei.getExtension("WEBGL_compressed_texture_pvrtc")||ei.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:ei.getExtension("WEBGL_compressed_texture_atc"),astc:ei.getExtension("WEBGL_compressed_texture_astc")}}const JF={extension:{type:V.DetectionParser,priority:2},test:async()=>{const t=X.ADAPTER.createCanvas().getContext("webgl");return t?(ei=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{bn||wy();const e=[];for(const r in bn)bn[r]&&e.push(r);return[...e,...t]},remove:async t=>(bn||wy(),t.filter(e=>!(e in bn)))};Z.add(JF);class e4 extends Kh{constructor(e,r={width:1,height:1,autoLoad:!0}){let i,s;typeof e=="string"?(i=e,s=new Uint8Array):(i=null,s=e),super(s,r),this.origin=i,this.buffer=s?new Wf(s):null,this._load=null,this.loaded=!1,this.origin!==null&&r.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Wf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class $s extends e4{constructor(e,r){super(e,r),this.format=r.format,this.levels=r.levels||1,this._width=r.width,this._height=r.height,this._extension=$s._formatToExtension(this.format),(r.levelBuffers||this.buffer)&&(this._levelBuffers=r.levelBuffers||$s._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,r,i){const s=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;s.pixelStorei(s.UNPACK_ALIGNMENT,4);for(let n=0,a=this.levels;n<a;n++){const{levelID:o,levelWidth:l,levelHeight:c,levelBuffer:h}=this._levelBuffers[n];s.compressedTexImage2D(s.TEXTURE_2D,o,this.format,l,c,0,h)}return!0}onBlobLoaded(){this._levelBuffers=$s._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(e){if(e>=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(e,r,i,s,n,a,o){const l=new Array(i);let c=e.byteOffset,h=a,f=o,u=h+s-1&~(s-1),d=f+n-1&~(n-1),p=u*d*yh[r];for(let m=0;m<i;m++)l[m]={levelID:m,levelWidth:i>1?h:u,levelHeight:i>1?f:d,levelBuffer:new Uint8Array(e.buffer,c,p)},c+=p,h=h>>1||1,f=f>>1||1,u=h+s-1&~(s-1),d=f+n-1&~(n-1),p=u*d*yh[r];return l}}const Td=4,sc=124,t4=32,Ey=20,r4=542327876,nc={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},i4={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},ac={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},s4=1,n4=2,a4=4,o4=64,l4=512,c4=131072,h4=827611204,u4=861165636,d4=894720068,f4=808540228,p4=4,m4={[h4]:Rt.COMPRESSED_RGBA_S3TC_DXT1_EXT,[u4]:Rt.COMPRESSED_RGBA_S3TC_DXT3_EXT,[d4]:Rt.COMPRESSED_RGBA_S3TC_DXT5_EXT},g4={70:Rt.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Rt.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Rt.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Rt.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Rt.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Rt.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Rt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Rt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Rt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function v4(t){const e=new Uint32Array(t);if(e[0]!==r4)throw new Error("Invalid DDS file magic word");const r=new Uint32Array(t,0,sc/Uint32Array.BYTES_PER_ELEMENT),i=r[nc.HEIGHT],s=r[nc.WIDTH],n=r[nc.MIPMAP_COUNT],a=new Uint32Array(t,nc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,t4/Uint32Array.BYTES_PER_ELEMENT),o=a[s4];if(o&a4){const l=a[i4.FOURCC];if(l!==f4){const _=m4[l],v=Td+sc,b=new Uint8Array(t,v);return[new $s(b,{format:_,width:s,height:i,levels:n})]}const c=Td+sc,h=new Uint32Array(e.buffer,c,Ey/Uint32Array.BYTES_PER_ELEMENT),f=h[ac.DXGI_FORMAT],u=h[ac.RESOURCE_DIMENSION],d=h[ac.MISC_FLAG],p=h[ac.ARRAY_SIZE],m=g4[f];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${f}`);if(d===p4)throw new Error("DDSParser does not support cubemap textures");if(u===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,y=Td+sc+Ey;if(p===1)g.push(new Uint8Array(t,y));else{const _=yh[m];let v=0,b=s,w=i;for(let S=0;S<n;S++){const C=Math.max(1,b+3&-4),T=Math.max(1,w+3&-4),M=C*T*_;v+=M,b=b>>>1,w=w>>>1}let A=y;for(let S=0;S<p;S++)g.push(new Uint8Array(t,A,v)),A+=v}return g.map(_=>new $s(_,{format:m,width:s,height:i,levels:n}))}throw o&o4?new Error("DDSParser does not support uncompressed texture data."):o&l4?new Error("DDSParser does not supported YUV uncompressed texture data."):o&c4?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&n4?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Sy=[171,75,84,88,32,49,49,187,13,10,26,10],y4=67305985,rr={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},xp=64,Ty={[te.UNSIGNED_BYTE]:1,[te.UNSIGNED_SHORT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4,[te.HALF_FLOAT]:8},b4={[G.RGBA]:4,[G.RGB]:3,[G.RG]:2,[G.RED]:1,[G.LUMINANCE]:1,[G.LUMINANCE_ALPHA]:2,[G.ALPHA]:1},x4={[te.UNSIGNED_SHORT_4_4_4_4]:2,[te.UNSIGNED_SHORT_5_5_5_1]:2,[te.UNSIGNED_SHORT_5_6_5]:2};function _4(t,e,r=!1){const i=new DataView(e);if(!w4(t,i))return null;const s=i.getUint32(rr.ENDIANNESS,!0)===y4,n=i.getUint32(rr.GL_TYPE,s),a=i.getUint32(rr.GL_FORMAT,s),o=i.getUint32(rr.GL_INTERNAL_FORMAT,s),l=i.getUint32(rr.PIXEL_WIDTH,s),c=i.getUint32(rr.PIXEL_HEIGHT,s)||1,h=i.getUint32(rr.PIXEL_DEPTH,s)||1,f=i.getUint32(rr.NUMBER_OF_ARRAY_ELEMENTS,s)||1,u=i.getUint32(rr.NUMBER_OF_FACES,s),d=i.getUint32(rr.NUMBER_OF_MIPMAP_LEVELS,s),p=i.getUint32(rr.BYTES_OF_KEY_VALUE_DATA,s);if(c===0||h!==1)throw new Error("Only 2D textures are supported");if(u!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(f!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,y=l+3&-4,_=c+3&-4,v=new Array(f);let b=l*c;n===0&&(b=y*_);let w;if(n!==0?Ty[n]?w=Ty[n]*b4[a]:w=x4[n]:w=yh[o],w===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const A=r?S4(i,p,s):null;let S=b*w,C=l,T=c,M=y,I=_,k=xp+p;for(let P=0;P<d;P++){const R=i.getUint32(k,s);let O=k+4;for(let L=0;L<f;L++){let N=v[L];N||(N=v[L]=new Array(d)),N[P]={levelID:P,levelWidth:d>1||n!==0?C:M,levelHeight:d>1||n!==0?T:I,levelBuffer:new Uint8Array(e,O,S)},O+=S}k+=R+4,k=k%4!==0?k+4-k%4:k,C=C>>1||1,T=T>>1||1,M=C+m-1&~(m-1),I=T+g-1&~(g-1),S=M*I*w}return n!==0?{uncompressed:v.map(P=>{let R=P[0].levelBuffer,O=!1;return n===te.FLOAT?R=new Float32Array(P[0].levelBuffer.buffer,P[0].levelBuffer.byteOffset,P[0].levelBuffer.byteLength/4):n===te.UNSIGNED_INT?(O=!0,R=new Uint32Array(P[0].levelBuffer.buffer,P[0].levelBuffer.byteOffset,P[0].levelBuffer.byteLength/4)):n===te.INT&&(O=!0,R=new Int32Array(P[0].levelBuffer.buffer,P[0].levelBuffer.byteOffset,P[0].levelBuffer.byteLength/4)),{resource:new Kh(R,{width:P[0].levelWidth,height:P[0].levelHeight}),type:n,format:O?E4(a):a}}),kvData:A}:{compressed:v.map(P=>new $s(null,{format:o,width:l,height:c,levels:d,levelBuffers:P})),kvData:A}}function w4(t,e){for(let r=0;r<Sy.length;r++)if(e.getUint8(r)!==Sy[r])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}function E4(t){switch(t){case G.RGBA:return G.RGBA_INTEGER;case G.RGB:return G.RGB_INTEGER;case G.RG:return G.RG_INTEGER;case G.RED:return G.RED_INTEGER;default:return t}}function S4(t,e,r){const i=new Map;let s=0;for(;s<e;){const n=t.getUint32(xp+s,r),a=xp+s+4,o=3-(n+3)%4;if(n===0||n>e-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let l=0;for(;l<n&&t.getUint8(a+l)!==0;l++);if(l===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const c=new TextDecoder().decode(new Uint8Array(t.buffer,a,l)),h=new DataView(t.buffer,a+l+1,n-l-1);i.set(c,h),s+=4+n+o}return i}const T4={extension:{type:V.LoadParser,priority:pr.High},name:"loadDDS",test(t){return cs(t,".dds")},async load(t,e,r){const i=await(await X.ADAPTER.fetch(t)).arrayBuffer(),s=v4(i).map(n=>{const a=new de(n,{mipmap:Vr.OFF,alphaMode:_t.NO_PREMULTIPLIED_ALPHA,resolution:pi(t),...e.data});return vl(a,r,t)});return s.length===1?s[0]:s},unload(t){Array.isArray(t)?t.forEach(e=>e.destroy(!0)):t.destroy(!0)}};Z.add(T4);const A4={extension:{type:V.LoadParser,priority:pr.High},name:"loadKTX",test(t){return cs(t,".ktx")},async load(t,e,r){const i=await(await X.ADAPTER.fetch(t)).arrayBuffer(),{compressed:s,uncompressed:n,kvData:a}=_4(t,i),o=s??n,l={mipmap:Vr.OFF,alphaMode:_t.NO_PREMULTIPLIED_ALPHA,resolution:pi(t),...e.data},c=o.map(h=>{o===n&&Object.assign(l,{type:h.type,format:h.format});const f=h.resource??h,u=new de(f,l);return u.ktxKeyValueData=a,vl(u,r,t)});return c.length===1?c[0]:c},unload(t){Array.isArray(t)?t.forEach(e=>e.destroy(!0)):t.destroy(!0)}};Z.add(A4);const C4={extension:V.ResolveParser,test:t=>{const e=Ye.extname(t).slice(1);return["basis","ktx","dds"].includes(e)},parse:t=>{var r,i;const e=Ye.extname(t).slice(1);if(e==="ktx"){const s=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(s.some(n=>t.endsWith(n)))return{resolution:parseFloat(((r=X.RETINA_PREFIX.exec(t))==null?void 0:r[1])??"1"),format:s.find(n=>t.endsWith(n)),src:t}}return{resolution:parseFloat(((i=X.RETINA_PREFIX.exec(t))==null?void 0:i[1])??"1"),format:e,src:t}}};Z.add(C4);const oc=new me,I4=4,Lw=class Xa{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var r;const e=(r=this.renderer)==null?void 0:r.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,r,i,s){const n=new Image;return n.src=await this.base64(e,r,i,s),n}async base64(e,r,i,s){const n=this.canvas(e,s);if(n.toBlob!==void 0)return new Promise((a,o)=>{n.toBlob(l=>{if(!l){o(new Error("ICanvas.toBlob failed!"));return}const c=new FileReader;c.onload=()=>a(c.result),c.onerror=o,c.readAsDataURL(l)},r,i)});if(n.toDataURL!==void 0)return n.toDataURL(r,i);if(n.convertToBlob!==void 0){const a=await n.convertToBlob({type:r,quality:i});return new Promise((o,l)=>{const c=new FileReader;c.onload=()=>o(c.result),c.onerror=l,c.readAsDataURL(a)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,r){const{pixels:i,width:s,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(e,r);a&&Xa._flipY(i,s,n),o&&Xa._unpremultiplyAlpha(i);const l=new DN(s,n,1),c=new ImageData(new Uint8ClampedArray(i.buffer),s,n);return l.context.putImageData(c,0,0),l.canvas}pixels(e,r){const{pixels:i,width:s,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(e,r);return a&&Xa._flipY(i,s,n),o&&Xa._unpremultiplyAlpha(i),i}_rawPixels(e,r){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,n=!1,a=!1,o,l=!1;e&&(e instanceof an?o=e:(o=i.generateTexture(e,{region:r,resolution:i.resolution,multisample:i.multisample}),l=!0,r&&(oc.width=r.width,oc.height=r.height,r=oc)));const c=i.gl;if(o){if(s=o.baseTexture.resolution,r=r??o.frame,n=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===G.RGBA,!l){i.renderTexture.bind(o);const d=o.framebuffer.glFramebuffers[i.CONTEXT_UID];d.blitFramebuffer&&i.framebuffer.bind(d.blitFramebuffer)}}else s=i.resolution,r||(r=oc,r.width=i.width/s,r.height=i.height/s),n=!0,a=this._rendererPremultipliedAlpha,i.renderTexture.bind();const h=Math.max(Math.round(r.width*s),1),f=Math.max(Math.round(r.height*s),1),u=new Uint8Array(I4*h*f);return c.readPixels(Math.round(r.x*s),Math.round(r.y*s),h,f,c.RGBA,c.UNSIGNED_BYTE,u),l&&(o==null||o.destroy(!0)),{pixels:u,width:h,height:f,flipY:n,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(e,r,i){const s=r<<2,n=i>>1,a=new Uint8Array(s);for(let o=0;o<n;o++){const l=o*s,c=(i-o-1)*s;a.set(e.subarray(l,l+s)),e.copyWithin(l,c,c+s),e.set(a,c)}}static _unpremultiplyAlpha(e){e instanceof Uint8ClampedArray&&(e=new Uint8Array(e.buffer));const r=e.length;for(let i=0;i<r;i+=4){const s=e[i+3];if(s!==0){const n=255.001/s;e[i]=e[i]*n+.5,e[i+1]=e[i+1]*n+.5,e[i+2]=e[i+2]*n+.5}}}};Lw.extension={name:"extract",type:V.RendererSystem};let R4=Lw;Z.add(R4);class P4{constructor(e){this.maxItemsPerFrame=e,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function M4(t,e){var i;let r=!1;if((i=t==null?void 0:t._textures)!=null&&i.length){for(let s=0;s<t._textures.length;s++)if(t._textures[s]instanceof Q){const n=t._textures[s].baseTexture;e.includes(n)||(e.push(n),r=!0)}}return r}function O4(t,e){if(t.baseTexture instanceof de){const r=t.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function k4(t,e){if(t._texture&&t._texture instanceof Q){const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function D4(t,e){return e instanceof bw?(e.updateText(!0),!0):!1}function N4(t,e){if(e instanceof ts){const r=e.toFontString();return Si.measureFont(r),!0}return!1}function L4(t,e){if(t instanceof bw){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function B4(t,e){return t instanceof ts?(e.includes(t)||e.push(t),!0):!1}const Bw=class Fw{constructor(e){this.limiter=new P4(Fw.uploadsPerFrame),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(L4),this.registerFindHook(B4),this.registerFindHook(M4),this.registerFindHook(O4),this.registerFindHook(k4),this.registerUploadHook(D4),this.registerUploadHook(N4)}upload(e){return new Promise(r=>{e&&this.add(e),this.queue.length?(this.completes.push(r),this.ticking||(this.ticking=!0,kt.system.addOnce(this.tick,this,Ks.UTILITY))):r()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let r=!1;if(e&&!e._destroyed){for(let i=0,s=this.uploadHooks.length;i<s;i++)if(this.uploadHooks[i](this.uploadHookHelper,e)){this.queue.shift(),r=!0;break}}r||this.queue.shift()}if(this.queue.length)kt.system.addOnce(this.tick,this,Ks.UTILITY);else{this.ticking=!1;const e=this.completes.slice(0);this.completes.length=0;for(let r=0,i=e.length;r<i;r++)e[r]()}}registerFindHook(e){return e&&this.addHooks.push(e),this}registerUploadHook(e){return e&&this.uploadHooks.push(e),this}add(e){for(let r=0,i=this.addHooks.length;r<i&&!this.addHooks[r](e,this.queue);r++);if(e instanceof fr)for(let r=e.children.length-1;r>=0;r--)this.add(e.children[r]);return this}destroy(){this.ticking&&kt.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};Bw.uploadsPerFrame=4;let _p=Bw;Object.defineProperties(X,{UPLOADS_PER_FRAME:{get(){return _p.uploadsPerFrame},set(t){xe("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),_p.uploadsPerFrame=t}}});function Uw(t,e){return e instanceof de?(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0):!1}function F4(t,e){if(!(e instanceof Rw))return!1;const{geometry:r}=e;e.finishPoly(),r.updateBatches();const{batches:i}=r;for(let s=0;s<i.length;s++){const{texture:n}=i[s].style;n&&Uw(t,n.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function U4(t,e){return t instanceof Rw?(e.push(t),!0):!1}class jw extends _p{constructor(e){super(e),this.uploadHookHelper=this.renderer,this.registerFindHook(U4),this.registerUploadHook(Uw),this.registerUploadHook(F4)}}jw.extension={name:"prepare",type:V.RendererSystem};Z.add(jw);const $w=class Ya{constructor(e,r,i=null){this.linkedSheets=[],this._texture=e instanceof Q?e:null,this.baseTexture=e instanceof de?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const s=this.baseTexture.resource;this.resolution=this._updateResolution(i||(s?s.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:r}=this.data.meta;let i=pi(e,null);return i===null&&(i=parseFloat(r??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Ya.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let r=e;const i=Ya.BATCH_SIZE;for(;r-e<i&&r<this._frameKeys.length;){const s=this._frameKeys[r],n=this._frames[s],a=n.frame;if(a){let o=null,l=null;const c=n.trimmed!==!1&&n.sourceSize?n.sourceSize:n.frame,h=new me(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);n.rotated?o=new me(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):o=new me(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),n.trimmed!==!1&&n.spriteSourceSize&&(l=new me(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[s]=new Q(this.baseTexture,o,h,l,n.rotated?2:0,n.anchor,n.borders),Q.addToCache(this.textures[s],s.toString())}r++}}_processAnimations(){const e=this.data.animations||{};for(const r in e){this.animations[r]=[];for(let i=0;i<e[r].length;i++){const s=e[r][i];this.animations[r].push(this.textures[s])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Ya.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Ya.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var r;for(const i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((r=this._texture)==null||r.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};$w.BATCH_SIZE=1e3;let Ay=$w;const j4=["jpg","png","jpeg","avif","webp"];function Gw(t,e,r){const i={};if(t.forEach(s=>{i[s]=e}),Object.keys(e.textures).forEach(s=>{i[s]=e.textures[s]}),!r){const s=Ye.dirname(t[0]);e.linkedSheets.forEach((n,a)=>{const o=Gw([`${s}/${e.data.meta.related_multi_packs[a]}`],n,!0);Object.assign(i,o)})}return i}const $4={extension:V.Asset,cache:{test:t=>t instanceof Ay,getCacheableAssets:(t,e)=>Gw(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),i=e.pop();return r==="json"&&j4.includes(i)},parse:t=>{var r;const e=t.split(".");return{resolution:parseFloat(((r=X.RETINA_PREFIX.exec(t))==null?void 0:r[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:V.LoadParser,priority:pr.Normal},async testParse(t,e){return Ye.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,r){var l,c;let i=Ye.dirname(e.src);i&&i.lastIndexOf("/")!==i.length-1&&(i+="/");let s=i+t.meta.image;s=dp(s,e.src);const n=(await r.load([s]))[s],a=new Ay(n.baseTexture,t,e.src);await a.parse();const o=(l=t==null?void 0:t.meta)==null?void 0:l.related_multi_packs;if(Array.isArray(o)){const h=[];for(const u of o){if(typeof u!="string")continue;let d=i+u;(c=e.data)!=null&&c.ignoreMultiPack||(d=dp(d,e.src),h.push(r.load({src:d,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(h);a.linkedSheets=f,f.forEach(u=>{u.linkedSheets=[a].concat(a.linkedSheets.filter(d=>d!==u))})}return a},unload(t){t.destroy(!0)}}};Z.add($4);const wp=class xn extends ts{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new xn(Object.keys(xn.defaultOptions).reduce((r,i)=>({...r,[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete xn.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,r={}){const{availableFonts:i}=xn;if(i[e]){const s=i[e];return this._fonts.push(s),s.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return X.ADAPTER.fetch(e).then(s=>s.blob()).then(async s=>new Promise((n,a)=>{const o=URL.createObjectURL(s),l=new FileReader;l.onload=()=>n([o,l.result]),l.onerror=a,l.readAsDataURL(s)})).then(async([s,n])=>{const a=Object.assign({family:Ye.basename(e,Ye.extname(e)),weight:"normal",style:"normal",display:"auto",src:s,dataSrc:n,refs:1,originalUrl:e,fontFace:null},r);i[e]=a,this._fonts.push(a),this.styleID++;const o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const r=e.filter(i=>!this._overrides.includes(i));r.length>0&&(this._overrides.push(...r),this.styleID++)}removeOverride(...e){const r=e.filter(i=>this._overrides.includes(i));r.length>0&&(this._overrides=this._overrides.filter(i=>!r.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,r)=>`${e}
1339
- @font-face {
1340
- font-family: "${r.family}";
1341
- src: url('${r.dataSrc}');
1342
- font-weight: ${r.weight};
1343
- font-style: ${r.style};
1344
- font-display: ${r.display};
1345
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=PN(e)),typeof e=="number"?RN(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const r=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&r<1&&(e+=(r*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${n} ${e}`}reset(){Object.assign(this,xn.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(r=>setTimeout(r,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=X.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};wp.availableFonts={},wp.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Ad=wp;const lc=class _n extends xa{constructor(e="",r={}){super(Q.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=Q.from(i,{scaleMode:X.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new me,s.trim=new me,this.texture=s;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),l=document.createElementNS(n,"foreignObject"),c=document.createElementNS(a,"div"),h=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",o.appendChild(l),this.maxWidth=_n.defaultMaxWidth,this.maxHeight=_n.defaultMaxHeight,this._domElement=c,this._styleElement=h,this._svgRoot=o,this._foreignObject=l,this._foreignObject.appendChild(h),this._foreignObject.appendChild(c),this._image=i,this._loadImage=new Image,this._autoResolution=_n.defaultAutoResolution,this._resolution=_n.defaultResolution??X.RESOLUTION,this.text=e,this.style=r}measureText(e){var h,f;const{text:r,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:r,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:a,height:o}=n;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const l=Math.min(this.maxWidth,Math.ceil(a)),c=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),r!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(s)}),this._styleElement.textContent=(f=this._style)==null?void 0:f.toGlobalCSS()),{width:l+i.padding*2,height:c+i.padding*2}}async updateText(e=!0){const{style:r,_image:i,_loadImage:s}=this;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;const{width:n,height:a}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(l=>{s.onload=async()=>{if(o<this._updateID){l();return}await r.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),l()};const c=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:r,_image:i,resolution:s}=this,{padding:n}=e,{baseTexture:a}=r;r.trim.width=r._frame.width=i.width/s,r.trim.height=r._frame.height=i.height/s,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-n*2,r.orig.height=r._frame.height-n*2,this._onTextureUpdate(),a.setRealSize(i.width,i.height,s),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var i,s,n,a,o;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},_n.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=r,(s=this._svgRoot)==null||s.remove(),this._svgRoot=r,(n=this._domElement)==null||n.remove(),this._domElement=r,(a=this._foreignObject)==null||a.remove(),this._foreignObject=r,(o=this._styleElement)==null||o.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const r=$i(this.scale.x)||1;this.scale.x=r*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const r=$i(this.scale.y)||1;this.scale.y=r*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof Ad?(this.ownsStyle=!1,this._style=e):e instanceof ts?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Ad.from(e)):(this.ownsStyle=!0,this._style=new Ad(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};lc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},lc.defaultMaxWidth=2024,lc.defaultMaxHeight=2024,lc.defaultAutoResolution=!0;const G4=E.forwardRef(({children:t},e)=>x.jsx("div",{ref:e,className:"actionbar",children:t})),t8=G4,z4=E.forwardRef((t,e)=>{const{isLoading:r,loadingIcon:i,loadingPosition:s="left",children:n,className:a,...o}=t,l=()=>{let h;return i?h=i:h=x.jsx(bE,{...o,"aria-label":"Loading"}),h},c=re("loading",{"is-loading":r},a);return x.jsxs("div",{className:c,role:"status",ref:e,children:[(!s||s==="left")&&l(),n,s==="right"&&l()]})}),zw=z4,H4=E.forwardRef(({color:t="primary",type:e="button",size:r="md",children:i,isLoading:s,loadingIcon:n,loadingPosition:a,leftIcon:o,rightIcon:l,className:c,variant:h="filled",...f},u)=>{const d=re("btn",{[`btn-filled btn-${t}`]:h==="filled",[`btn-${h}-${t}`]:h==="outline"||h==="ghost","btn-icon":!i,"btn-loading":s,"btn-lg":r==="lg","btn-sm":r==="sm"},c);return x.jsx("button",{ref:u,className:d,type:e,...f,children:s?x.jsx(zw,{isLoading:!0,loadingIcon:n,loadingPosition:a,children:i}):x.jsxs("span",{children:[o,i,l]})})}),tt=H4,V4=E.forwardRef(({icon:t,className:e,...r},i)=>{const s={...r,className:re("btn-icon btn-sm",e)};return x.jsx(tt,{ref:i,...s,children:t})}),ua=V4,W4=E.forwardRef(({icon:t=x.jsx(xE,{}),onClick:e,className:r,...i},s)=>{const n=re("btn-search",r);return x.jsx(ua,{ref:s,className:n,icon:t,onClick:e,...i})}),X4=W4,Y4=E.forwardRef(({type:t="success",className:e="",children:r,button:i,isDismissible:s=!1,isToast:n=!1,isConfirm:a=!1,position:o="none",autoClose:l=!1,autoCloseDelay:c=3e3,onClose:h,onVisibilityChange:f},u)=>{const[d,p]=E.useState(!0),m=E.useRef(null),{t:g}=Ce(),y=E.useCallback(()=>{p(!1),h==null||h()},[h]);E.useImperativeHandle(u,()=>({show:_,hide:y,...m.current})),E.useLayoutEffect(()=>{f==null||f(d)},[d,f]),E.useEffect(()=>{l&&d&&setTimeout(()=>{y()},c)},[l,c,y,d]);const _=()=>{p(!0)},v={success:{icon:x.jsx(gE,{}),classModifier:"alert-success"},warning:{icon:x.jsx(vE,{}),classModifier:"alert-warning"},info:{icon:x.jsx(Qy,{}),classModifier:"alert-info"},danger:{icon:x.jsx(yE,{}),classModifier:"alert-danger"}},b={"is-dismissible":s,"is-toast ":n},w={"is-confirm":a},A=re("alert gap-12",v[t].classModifier,b,w,o,e);return x.jsx(x.Fragment,{children:d?x.jsxs("div",{ref:m,className:A,role:"alert",children:[!a&&v[t].icon,x.jsx("div",{className:"alert-content small",children:r}),i&&x.jsxs("div",{className:"ms-12",children:[i," ",a&&x.jsx(tt,{onClick:y,children:g("close")})]}),(s||a)&&x.jsx("div",{className:"btn-close-container",children:x.jsx("button",{type:"button",className:"btn-close","data-bs-dismiss":"alert","aria-label":"Close",onClick:y})}),l&&x.jsx("div",{className:"alert-progress",style:{transform:"scaleX(0)"}})]}):null})}),zi=Y4,q4=E.forwardRef(({children:t,render:e,isFullscreen:r=!1,...i},s)=>{const n=re("d-flex flex-wrap p-16 gap-8 border-bottom bg-white",{"justify-content-between":e,"mx-n16":!r,"z-2000 top-0 start-0 end-0":r});return x.jsxs("div",{ref:s,className:n,...i,children:[t,e?x.jsx("div",{className:"d-flex align-items-center ms-auto gap-8",children:e()}):null]})}),r8=q4;function Hw({appCode:t}){return vb({queryKey:["conf"],queryFn:async()=>await Ae.conf().getConf(t),suspense:!0})}function Z4(t){return{getPreference:async()=>await Ae.conf().getPreference(t),savePreference:async e=>await Ae.conf().savePreference(t,JSON.stringify(e))}}function K4(){const[t,e]=E.useState(!1),{getPreference:r,savePreference:i}=Z4("rgpdCookies");return E.useEffect(()=>{(async()=>{const s=await r();e(s===null?!0:s.showInfoTip)})()},[]),{showCookiesConsent:t,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",i({showInfoTip:!1}),e(!1)},handleCloseCookiesConsent:()=>{i({showInfoTip:!1}),e(!1)}}}function Q4(){return vb({queryKey:["session"],queryFn:async()=>await Ae.session().getSession(),suspense:!0})}const Vw=E.createContext(null);function i8({children:t,params:e}){const r=e.app,{t:i}=Ce(),s=i(r),n=Q4(),a=Hw({appCode:r}),{showCookiesConsent:o,handleConsultCookies:l,handleCloseCookiesConsent:c}=K4(),h=(a==null?void 0:a.isSuccess)&&(n==null?void 0:n.isSuccess);E.useEffect(()=>{var u,d;(d=document.querySelector("html"))==null||d.setAttribute("lang",((u=n==null?void 0:n.data)==null?void 0:u.currentLanguage)||"fr")},[n==null?void 0:n.data]),E.useEffect(()=>{document.title=`${s}`},[r,n.data,s]);const f=E.useMemo(()=>{var u,d,p,m,g,y;return{appCode:r,applications:(u=a==null?void 0:a.data)==null?void 0:u.applications,confQuery:a,currentApp:(d=a==null?void 0:a.data)==null?void 0:d.currentApp,currentLanguage:(p=n==null?void 0:n.data)==null?void 0:p.currentLanguage,init:h,sessionQuery:n,user:(m=n==null?void 0:n.data)==null?void 0:m.user,userDescription:(g=n==null?void 0:n.data)==null?void 0:g.userDescription,userProfile:(y=n==null?void 0:n.data)==null?void 0:y.userProfile}},[r,a,h,n]);return x.jsxs(Vw.Provider,{value:f,children:[t,o&&x.jsx(zi,{type:"info",className:"m-12",isConfirm:!0,position:"bottom-right",button:x.jsx(tt,{color:"tertiary",variant:"ghost",onClick:l,children:i("rgpd.cookies.banner.button.consult")}),onClose:c,children:i("rgpd.cookies.banner.text1")})]})}function mt(){const t=E.useContext(Vw);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}const Ww=E.createContext(null);function s8({children:t}){var e;const{appCode:r}=mt(),i=Hw({appCode:r});E.useEffect(()=>{var n,a,o,l,c,h,f,u,d;const p=document.getElementById("favicon");p.href=`${(a=(n=i==null?void 0:i.data)==null?void 0:n.theme)==null?void 0:a.basePath}/img/illustrations/favicon.ico`;const m=(c=(l=(o=i==null?void 0:i.data)==null?void 0:o.theme)==null?void 0:l.bootstrapVersion)==null?void 0:c.split("-"),g=m?m[m.length-1]:void 0;[{data:"data-skin",value:(f=(h=i==null?void 0:i.data)==null?void 0:h.theme)==null?void 0:f.skinName},{data:"data-theme",value:(d=(u=i==null?void 0:i.data)==null?void 0:u.theme)==null?void 0:d.themeName},{data:"data-product",value:g}].forEach(y=>{var _;return(_=document.querySelector("html"))==null?void 0:_.setAttribute(y.data,y.value)})},[i==null?void 0:i.data]);const s=E.useMemo(()=>{var n;return{theme:(n=i==null?void 0:i.data)==null?void 0:n.theme}},[(e=i==null?void 0:i.data)==null?void 0:e.theme]);return x.jsx(Ww.Provider,{value:s,children:t})}function Om(){const t=E.useContext(Ww);if(!t)throw new Error("Cannot be used outside of OdeClientProvider");return t}function J4(){var t;const{sessionQuery:e}=mt(),r=new Set;return(t=e==null?void 0:e.data)==null?void 0:t.bookmarkedApps.filter(i=>{const s=r.has(i.displayName);return r.add(i.displayName),!s})}const e5=E.createContext(null);function t5(){return E.useContext(e5)}function Cy(...t){return e=>{r5(e,...t)}}function r5(t,...e){e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}const n8=(t,e)=>{const r=e==null?void 0:e.filter(i=>i.id===t&&i.available);return r&&r.length>0},Xw={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};function fo(t){const e=t5(),[r,i]=E.useState();return E.useEffect(()=>{(async()=>{let s;if(e!=null&&e.hasWorkflow)if(typeof t=="string")s=await e.hasWorkflow(t);else throw"not.implemented.yet)";else typeof t=="string"?s=await Ae.rights().sessionHasWorkflowRight(t):s=await Ae.rights().sessionHasWorkflowRights(t);i(s)})()},[t,e]),r}const i5=()=>{const t=fo("fr.openent.zimbra.controllers.ZimbraController|view"),e=fo("fr.openent.zimbra.controllers.ZimbraController|preauth"),[r,i]=E.useState(0),[s,n]=E.useState(""),a=E.useCallback(async()=>{if(t)try{const l=await Ae.http().get("/zimbra/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});l.status!==200&&i(0),i(l.count)}catch{console.error("error"),i(0)}else try{const l=await Ae.http().get("/conversation/count/INBOX",{queryParams:{unread:!0,_:new Date().getTime()}});i(l.count)}catch{console.error("error"),i(0)}},[t]),o=E.useCallback(()=>{let l="";Ae.http().get("/userbook/preference/zimbra").then(c=>{try{c.preference&&JSON.parse(c.preference).modeExpert&&e?l="/zimbra/preauth":l=window.location.origin+"/zimbra/zimbra"}catch{l="/zimbra/zimbra"}}),n(l)},[e]);return E.useEffect(()=>{(async()=>{try{await a()}catch(l){console.error(l)}})(),o()},[o,a]),{messages:r,msgLink:s,zimbraWorkflow:t}},s5=i5,Iy=["mousedown","touchstart"];function Yw(t,e,r){const i=E.useRef();return E.useEffect(()=>{const s=n=>{const{target:a}=n??{};if(Array.isArray(r)){const o=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";r.every(l=>!!l&&!n.composedPath().includes(l))&&!o&&t()}else i.current&&!i.current.contains(a)&&t()};return(e||Iy).forEach(n=>{document.addEventListener(n,s)}),()=>{(e||Iy).forEach(n=>{document.removeEventListener(n,s)})}},[i,t,r,e]),i}function n5(t,e){const[r,i]=E.useState(t);return E.useEffect(()=>{const s=setTimeout(()=>{i(t)},e||500);return()=>{clearTimeout(s)}},[t,e]),r}const a5=(t,e)=>{const r=E.useId(),[i,s]=E.useState(!1),[n,a]=E.useState(-1),[o,l]=E.useState(null),{refs:c,floatingStyles:h}=zT({placement:t,open:i,onOpenChange:s,whileElementsMounted:IT,middleware:[cT(4),PT({apply({rects:T,elements:M}){M.floating.style,`${T.reference.width}`}}),RT({padding:0})]}),f=E.useRef(null),u=E.useRef(null),d=E.useRef({});E.useEffect(()=>{i?f.current&&(f.current.focus(),a(0)):(a(-1),d.current={})},[i]),E.useEffect(()=>{if(n!==-1){const T=Object.values(d.current)[n];if(T){const M=T.getAttribute("id");l(M),T.focus()}}},[n]);const p=()=>{const T=Object.values(d.current).length;a(M=>(M+1)%T)},m=()=>{const T=Object.values(d.current).length;a(M=>(M-1+T)%T)},g=()=>{a(0)},y=()=>{const T=Object.values(d.current).length;a(T-1)},_=E.useCallback(()=>{s(!0)},[]),v=E.useCallback(()=>{u.current&&(u.current.focus({preventScroll:!0}),s(!1))},[]),b=(T,M)=>{T&&(M.stopPropagation(),M.preventDefault())},w=E.useCallback(T=>{let M=!1;switch(T.code){case" ":case"Space":case"Enter":case"ArrowDown":case"Down":_(),M=!0;break;case"Esc":case"Escape":v(),M=!0;break;case"Up":case"ArrowUp":_(),M=!0;break}e==null||e(T),b(M,T)},[v,_]),A=T=>{const M=Object.values(d.current).findIndex(I=>I.id===T.currentTarget.getAttribute("id"));a(M)},S=E.useCallback((T,M)=>{let I=!1;if(T.shiftKey)T.key==="Tab"&&(v(),I=!0);else{switch(T.code){case"Escape":v();break;case" ":case"Enter":n!==-1&&(Object.values(d.current)[n].getAttribute("role")==="menuitem"&&u.current&&(u.current.focus(),s(!1)),M==null||M()),I=!0;break;case"ArrowDown":case"Down":p(),I=!0;break;case"ArrowUp":case"Up":m(),I=!0;break;case"Home":g(),I=!0;break;case"End":y(),I=!0;break}b(I,T)}},[n,v]),C=E.useCallback(T=>{s(i!==!0),T.stopPropagation(),T.preventDefault()},[i]);return{isFocused:o,visible:i,itemRefs:d,triggerRef:u,menuRef:f,triggerProps:{ref:Cy(u,c.setReference),id:`dropdown-toggle-${r}`,"aria-haspopup":"menu","aria-controls":`dropdown-${r}`,"aria-expanded":!!i,className:`${i?"selected":""}`,onClick:C,onKeyDown:w,"aria-activedescendant":o},menuProps:{ref:Cy(f,c.setFloating),className:"dropdown-menu bg-white shadow rounded-4 p-8","aria-labelledby":`dropdown-toggle-${r}`,style:{...h}},itemProps:{onMenuItemMouseEnter:A,onMenuItemClick:v,onMenuItemKeyDown:S},setVisible:s}},o5=a5,l5=()=>{const[t,e]=E.useState(!1),[r,i]=E.useState([]),s=E.useRef(null),n=f=>{i(u=>[...u,f])},a=f=>{i(u=>u.filter(d=>d.name!==f.name))},o=()=>{i([])},l=f=>{const u=f.target.files;u&&[...u].forEach(d=>{n(d)})},c=f=>{f.preventDefault(),f.stopPropagation(),e(!0)},h=f=>{f.preventDefault(),f.stopPropagation(),e(!1)};return{inputRef:s,files:r,dragging:t,handleDragging:c,handleDragLeave:h,handleDrop:f=>{var u;h(f);const d=(u=f.dataTransfer)==null?void 0:u.files;d&&[...d].forEach(p=>{n(p)}),s!=null&&s.current&&d&&(s.current.files=d)},deleteFile:a,addFile:n,cleanFiles:o,handleOnChange:l}},c5=l5,cc="top-right";function bl(){return{success:(t,e)=>Sa.custom(x.jsx(zi,{type:"success",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??cc}),error:(t,e)=>Sa.custom(x.jsx(zi,{type:"danger",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??cc}),info:(t,e)=>Sa.custom(x.jsx(zi,{type:"info",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??cc}),warning:(t,e)=>Sa.custom(x.jsx(zi,{type:"warning",isToast:!0,isDismissible:e==null?void 0:e.isDismissible,className:"mb-12",children:t}),{duration:e==null?void 0:e.duration,position:(e==null?void 0:e.position)??cc}),loading:Sa.loading}}function qw(){const[t,e]=E.useState(!1),r=E.useRef(null),i=()=>{e(!0)},s=()=>{e(!1)};return E.useEffect(()=>{const n=r.current;if(n)return n.addEventListener("mouseover",i),n.addEventListener("mouseout",s),()=>{n.removeEventListener("mouseover",i),n.removeEventListener("mouseout",s)}},[r]),[r,t]}function h5({src:t,placeholder:e}){const[r,i]=E.useState(t||e),s=E.useCallback(()=>{i(e)},[e]);return E.useEffect(()=>{i(t)},[t]),{imgSrc:r,onError:s}}function u5(t,e){const r=E.useCallback(({code:i})=>{e.includes(i)&&t()},[t,e]);E.useEffect(()=>(window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}),[r])}function a8(){const t=document.querySelector("html");return()=>{t&&t.scrollIntoView()}}function d5(t=!1){const[e,r]=E.useState(t),i=E.useCallback(()=>{r(s=>!s)},[]);return[e,i]}function f5(){const t=E.useRef(null),e='button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';return E.useEffect(()=>{const r=t.current,i=r.querySelectorAll(e)[0],s=r.querySelectorAll(e),n=t&&(s==null?void 0:s[s.length-1]),a=o=>{o.key==="Tab"&&(o.shiftKey?document.activeElement===i&&(n.focus(),o.preventDefault()):document.activeElement===n&&(i.focus(),o.preventDefault()))};if(r)return r.addEventListener("keydown",a),()=>{r.removeEventListener("keydown",a)}},[]),t}function p5({user:t,avatar:e}){const{appCode:r}=mt(),{t:i}=Ce(),s=i(r),[n,a]=E.useState(!0),[o,l]=qw(),c=E.useId(),h=E.useId(),f=e,u=t==null?void 0:t.username,d=i("welcome",{username:t==null?void 0:t.firstName}),p=J4(),m=fo("net.atos.entng.community.controllers.CommunityController|view"),g=fo("org.entcore.conversation.controllers.ConversationController|view"),y=fo("fr.openent.searchengine.controllers.SearchEngineController|view"),_=E.useCallback(()=>{a(!n)},[n]),v=async()=>{await Ae.session().logout(),window.location.href="/auth/login"};return E.useMemo(()=>({title:s,bookmarkedApps:p,appsRef:o,isAppsHovered:l,popoverAppsId:c,popoverSearchId:h,userAvatar:f,userName:u,welcomeUser:d,communityWorkflow:m,conversationWorflow:g,searchWorkflow:y,isCollapsed:n,toggleCollapsedNav:_,handleLogout:v}),[o,p,m,g,l,n,c,h,y,s,_,f,u,d])}function m5(){const[t,e]=E.useState(!1);E.useEffect(()=>{r()},[]);const r=E.useCallback(async()=>{const i=await Ae.session().isAdml();e(i)},[]);return{isAdml:t}}const g5=()=>{var t;const{user:e,appCode:r}=mt(),i=Xw[r],s=(t=e.apps.find(l=>l.isExternal&&l.address.includes("library")&&l.name.includes("library")))==null?void 0:t.address.split("?");let n=s==null?void 0:s[0];n!=null&&n.endsWith("/")||(n=`${n}/`);const a=s==null?void 0:s[1],o=`application%5B0%5D=${i}&page=1&sort_field=views&sort_order=desc`;return{libraryUrl:`${n}search/?${a}&${o}`}},o8=g5;function km(){const t={"last-infos-widget":"ic-widget-actualites",birthday:"ic-star","calendar-widget":"ic-widget-calendar","carnet-de-bord":"ic-widget-carnet-de-bord","record-me":"ic-widget-microphone",mood:"ic-star","my-apps":"ic-widget-apps",notes:"ic-widget-notes","rss-widget":"ic-widget-rss","bookmark-widget":"ic-widget-signets",qwant:"ic-widget-qwant","qwant-junior":"ic-widget-qwant","agenda-widget":"ic-widget-agenda","cursus-widget":"ic-widget-aide-devoirs","maxicours-widget":"ic-widget-maxicours","school-widget":"ic-widget-schoolbook","universalis-widget":"ic-widget-universalis","briefme-widget":"ic-widget-briefme"};function e(o){let l="";switch(typeof o=="string"?l=o:l=(o==null?void 0:o.icon)!==void 0?o==null?void 0:o.icon.trim().toLowerCase():"placeholder",l&&l.length>0?l.endsWith("-large")&&(l=l.replace("-large","")):typeof o=="object"&&(l=(o==null?void 0:o.displayName)!==void 0?o==null?void 0:o.displayName.trim().toLowerCase():""),l){case"admin.title":l="admin";break;case"banques des savoirs":l="banquesavoir";break;case"collaborativewall":l="collaborative-wall";break;case"communautés":l="community";break;case"directory.user":l="userbook";break;case"emploi du temps":l="edt";break;case"formulaire":l="forms";break;case"messagerie":l="conversation";break;case"news":l="actualites";break;case"homeworks":case"cahier de texte":l="cahier-de-texte";break;case"diary":case"cahier de texte 2d":l="cahier-textes";break}return l}function r(o){return o&&(o.startsWith("/")||o.startsWith("http://")||o.startsWith("https://"))}function i(o){const l=e(o);return l?`color-app-${l}`:"color-app-placeholder"}function s(o){const l=e(o);return l?`bg-app-${l}`:"bg-app-placeholder"}function n(o){const l=e(o);return l?`bg-light-${l}`:"bg-light-placeholder"}function a(o){return t[o.platformConf.name]}return{getIconClass:i,getBackgroundIconClass:s,getBackgroundLightIconClass:n,getIconCode:e,getWidgetIconClass:a,isIconUrl:r}}function wa(){return["/assets/themes/edifice-bootstrap/images","/assets/themes/edifice-bootstrap/icons","/assets/themes/edifice-bootstrap/fonts"]}function Zw(){const{user:t,userDescription:e,userProfile:r}=mt(),{theme:i}=Om();function s(){let n=e==null?void 0:e.picture;return(!n||n==="no-avatar.jpg"||n==="no-avatar.svg")&&(n=`${i==null?void 0:i.basePath}/img/illustrations/no-avatar.svg`),n}return{user:{...t,type:r},avatar:s(),userDescription:e}}function l8(){const[t,e]=E.useState("pending"),{currentApp:r}=mt();E.useEffect(()=>{i()},[]);const i=async()=>{if(!r){e("[Xiti] Error, currentApp is not defined.");return}try{await Ae.analytics().trackPageLoad(window.location.pathname,r),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),e(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(s){console.error("[Xiti] Error Tracking Page Load",s),e(`[Xiti] Error Tracking Page Load: ${s}`)}};return{xitiStatus:t}}const v5=E.forwardRef(({src:t,alt:e,imgPlaceholder:r,ratio:i,objectFit:s,className:n,...a},o)=>{const[l]=wa(),c=r??`${l}/common/image-placeholder.png`,{imgSrc:h,onError:f}=h5({src:t,placeholder:c}),u={"ratio ratio-1x1":i==="1","ratio ratio-4x3":i==="4","ratio ratio-16x9":i==="16","ratio ratio-21x9":i==="21"},d={"object-fit-contain":s==="contain","object-fit-cover":s==="cover","object-fit-fill":s==="fill","object-fit-scale":s==="scale","object-fit-none":s==="none"},p=re({...u}),m=re({...d},n),g=x.jsx("img",{alt:e,onError:f,ref:o,src:h,className:m,...a});return i?x.jsx("div",{className:p,children:g}):g}),nu=v5,y5=E.forwardRef(({app:t,size:e="24",iconFit:r="contain",variant:i="square"},s)=>{const{isIconUrl:n,getIconCode:a}=km(),[,o]=wa(),l=i==="square",c=i==="rounded",h=i==="circle",f=r==="contain",u=r==="ratio",d={"icon-xs":e==="24","icon-sm":e==="40","icon-md":e==="48","icon-lg":e==="80","icon-xl":e==="160"},p={square:l,rounded:c,"rounded-circle":h},m={"icon-contain":f,"icon-ratio":u},g=typeof t=="string"?t:(t==null?void 0:t.icon)!==void 0?t.icon:"placeholder",y=typeof t!="string"&&(t==null?void 0:t.displayName)!==void 0?t.displayName:"",_=t?a(t):"",v=n(g),b=_||"placeholder",w=re("app-icon",{...d,...p,...m,[`bg-light-${b}`]:b&&!f,[`color-app-${b}`]:b});return v?x.jsx(nu,{src:g,alt:y,objectFit:"contain",width:e,height:e,className:"h-full"}):x.jsx("div",{className:w,style:{width:e+"px",height:e+"px"},children:x.jsx("svg",{ref:s,width:e,height:e,role:"img",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:x.jsx("use",{xlinkHref:`${o}/apps.svg#${b}`})})})}),Ho=y5,b5=E.forwardRef(({variant:t="square",size:e="md",alt:r,src:i,imgPlaceholder:s,className:n,...a},o)=>{const[l]=wa(),c=s||`${l}/avatar/no-avatar.svg`,h=re("avatar",{"avatar-xs":e==="xs","avatar-sm":e==="sm","avatar-md":e==="md","avatar-lg":e==="lg","avatar-xl":e==="xl",square:t==="square",rounded:t==="rounded","rounded-circle":t==="circle"},n);return x.jsx("div",{ref:o,className:h,children:x.jsx(nu,{src:i||c,alt:r,imgPlaceholder:c,...a})})}),da=b5,x5=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("breadcrumb-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})}),hc=x5,_5=E.forwardRef(({children:t,className:e},r)=>{const i=re("breadcrumb d-flex flex-nowrap align-items-center mb-0",e);return x.jsx("ol",{ref:r,className:i,children:t})}),w5=_5,E5=E.forwardRef(({children:t,app:e,className:r},i)=>{const{t:s}=Ce(),{getIconClass:n}=km(),a=re("d-flex align-items-center mb-0",n(e),r),o={"--edifice-breadcrumb-divider":"-"};return x.jsx("nav",{ref:i,className:a,"aria-label":s("breadcrumb"),style:o,children:t})}),S5=E5,T5=E.forwardRef(({level:t="h1",headingStyle:e="h1",children:r,className:i,...s},n)=>{const a=re(e,i);return x.jsx(t,{ref:n,className:a,...s,children:r})}),ur=T5,A5=E.forwardRef(({app:t,name:e},r)=>{const{t:i}=Ce();return x.jsx(S5,{app:t,ref:r,className:"mw-100",children:x.jsx(w5,{className:"gap-12 mw-100",children:e?x.jsxs(x.Fragment,{children:[x.jsx(hc,{children:x.jsx("a",{href:t==null?void 0:t.address,className:"d-flex",children:x.jsx(Ho,{app:t,size:"40"})})}),x.jsx(hc,{children:x.jsx(Pd,{color:"var(--edifice-gray-600)",width:20,height:20})}),x.jsx(hc,{className:"text-truncate",children:x.jsx(ur,{level:"h1",headingStyle:"h3",className:"text-truncate",children:e})})]}):x.jsxs(hc,{className:"gap-12 d-flex align-items-center",children:[x.jsx("a",{href:t==null?void 0:t.address,className:"d-flex",children:x.jsx(Ho,{app:t,size:"40"})}),x.jsx(ur,{level:"h1",headingStyle:"h3",className:"d-none d-md-flex",children:i(t==null?void 0:t.displayName)})]})})})}),c8=A5,C5=({children:t,space:e=null,flexDirection:r="row"})=>{const i=re("card-body",{[`p-${e}`]:e,[`gap-${e}`]:e,"align-items-start":r==="column","flex-column":r==="column"});return x.jsx("div",{className:i,children:t})},I5=C5,Kw=E.createContext(null),Qw=()=>{const t=E.useContext(Kw);if(!t)throw new Error("Cannot be rendered outside the Card component");return t},R5=({children:t})=>x.jsx("div",{className:"card-footer gap-16",children:t}),P5=R5,M5=()=>{const{isSelectable:t,isClickable:e,onClick:r,onSelect:i}=Qw();return t||e?x.jsxs("div",{className:"card-header",children:[t?x.jsx(ua,{"aria-label":"Open Action Bar",className:"z-3 bg-white",color:"secondary",icon:x.jsx(_E,{}),onClick:i,variant:"ghost"}):null,e?x.jsx("button",{onClick:r,className:"position-absolute bottom-0 end-0 top-0 start-0 opacity-0 z-1 w-100","aria-label":"Open resource"}):null]}):null},O5=M5,k5=({imageSrc:t,className:e,variant:r="medium"})=>{const{app:i}=Qw(),s=r==="landscape"?{width:"100%",height:"auto"}:null;return x.jsx("div",{className:re("card-image",r),children:t?x.jsx(nu,{alt:"",src:t,objectFit:"cover",className:re("h-full w-100",e)}):x.jsx(Ho,{app:i,iconFit:"ratio",size:"80",variant:"rounded",...s})})},D5=k5,N5=({children:t,className:e})=>{const r=re("card-text small text-break text-truncate text-truncate-1",e);return x.jsx("p",{className:r,children:t})},L5=N5,B5=({children:t,className:e})=>{const r=re("card-title body text-break text-truncate text-truncate-1",e);return x.jsx("h3",{className:r,children:x.jsx("strong",{children:t})})},F5=B5,U5=({userSrc:t,creatorName:e})=>t?x.jsx(da,{alt:e||"",size:"xs",src:t,variant:"circle",width:"24",height:"24"}):x.jsx(Ax,{}),j5=U5,$5=E.forwardRef(({app:t,isSelectable:e=!0,isClickable:r=!0,isSelected:i=!1,onClick:s,onSelect:n,children:a,className:o},l)=>{const{getIconCode:c}=km(),h=t?c(t):"placeholder",f=E.useMemo(()=>({app:t,appCode:h,isSelectable:e,isClickable:r,onClick:s,onSelect:n}),[t,h,e,r,s,n]);return x.jsx(Kw.Provider,{value:f,children:x.jsxs("div",{ref:l,className:re("card",{"is-selected":i,"c-pointer":r},o),children:[x.jsx(Jw.Header,{}),typeof a=="function"?a(h):a]})})}),Jw=Object.assign($5,{Title:F5,Text:L5,Image:D5,Body:I5,User:j5,Footer:P5,Header:O5}),h8=Jw,G5=E.forwardRef(({label:t,disabled:e=!1,checked:r=!1,indeterminate:i=!1,...s},n)=>{const a=E.useRef(null);E.useImperativeHandle(n,()=>({...a.current})),E.useEffect(()=>{a.current.indeterminate=i},[a,i]);const o=E.useId(),l={type:"checkbox",checked:r,disabled:e,ref:a,className:re(s.className,"form-check-input c-pointer"),id:o},c={...s,...l};return x.jsxs("div",{className:"form-check d-flex align-items-center gap-8",children:[x.jsx("input",{...c}),t&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:t})]})}),Dm=G5,z5=({children:t,message:e,icon:r=null,placement:i="auto"})=>{const[s,n]=E.useState(null),[a,o]=E.useState(null),[l,c]=E.useState(null),{styles:h,attributes:f}=w2(s,a,{placement:i,modifiers:[{name:"arrow",options:{element:l}}]}),[u,d]=E.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"d-inline-block position-relative z-2",ref:n,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},children:t}),u&&e&&x.jsxs("div",{className:re("tooltip d-block show mb-12","bs-tooltip-auto"),ref:o,style:h.popper,...f.popper,children:[x.jsxs("div",{className:"tooltip-inner shadow-hover d-flex gap-8 align-items-center",children:[r&&r,x.jsx("div",{children:e})]}),x.jsx("div",{className:"tooltip-arrow",ref:c,style:h.arrow})]})]})},H5=z5,eE=E.createContext(null),Ea=()=>{const t=E.useContext(eE);if(!t)throw new Error("Cannot be rendered outside the Dropdown Component");return t},tE=E.createContext(null),au=()=>{const t=E.useContext(tE);if(!t)throw new Error("Cannot be rendered outside the FormControl component");return t},V5=({children:t})=>{const{status:e}=au(),r=re("form-text",{"is-invalid":e==="invalid",valid:e==="valid"});return x.jsx("p",{className:r,children:x.jsx("em",{children:t})})},W5=V5,X5=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",type:i="text",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=au(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("input",{ref:a,id:o,className:f,type:i,placeholder:e,required:l,readOnly:c,...n})}),Qs=X5,Y5=E.forwardRef(({leftIcon:t,optionalText:e="Optional",requiredText:r="*",children:i,className:s},n)=>{const{id:a,isOptional:o,isRequired:l}=au(),c=re("form-label",{"has-icon":t},s),h=o&&!l,f=l&&!o;return E.useEffect(()=>{if(o&&l)throw new Error("Cannot be optional and required at the same time")},[o,l]),x.jsxs("label",{ref:n,htmlFor:a,className:c,children:[t,i,h&&x.jsxs("em",{className:"optional",children:["- ",e]}),f&&x.jsx("em",{className:"required",children:r})]})}),Nn=Y5,q5=E.forwardRef(({children:t,className:e,id:r,isOptional:i,isReadOnly:s,isRequired:n,status:a,...o},l)=>{const c=E.useMemo(()=>({id:r,isOptional:i,isRequired:n,isReadOnly:s,status:a}),[r,i,s,n,a]);return x.jsx(tE.Provider,{value:c,children:x.jsx("div",{ref:l,className:e,...o,children:t})})}),Z5=Object.assign(q5,{Label:Nn,Input:Qs,Text:W5}),ot=Z5,K5=({placeholder:t,value:e="",searchMinLength:r=3,handleSearchInputChange:i})=>{const{triggerProps:s,itemProps:n,setVisible:a}=Ea(),o={...s,role:"combobox",onClick:()=>{e.length>=r&&a(!0)},onChange:i};return E.useEffect(()=>{a(e.length>=r)},[a,e,r]),x.jsx(ot,{className:"d-flex align-items-center",id:"search",children:x.jsx(Qs,{...o,className:"max-w-512",noValidationIcon:!0,placeholder:t,size:"md",type:"search",onKeyDown:n.onMenuItemKeyDown})})},Q5=K5,J5=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h=r.includes(e),f={value:e,model:r,checked:h,readOnly:!0},u=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:d=>n.current[c]=d,role:"menuitemcheckbox","aria-checked":h,onMouseUp:()=>i(e),onKeyDown:d=>o(d,()=>i(e)),onMouseEnter:l,tabIndex:h?0:-1,className:u,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(Dm,{...f})]})})},e6=J5,t6=({type:t="action",icon:e,onClick:r,children:i,...s})=>{const{itemProps:n,itemRefs:a,isFocused:o}=Ea(),{onMenuItemKeyDown:l,onMenuItemMouseEnter:c,onMenuItemClick:h}=n,f=()=>{r==null||r(),t==="action"&&h()},u=E.useId(),d=re("dropdown-item",{focus:o===u});return x.jsx("div",{id:u,role:"menuitem",ref:p=>a.current[u]=p,tabIndex:o===u?0:-1,className:d,"aria-current":o===u,onClick:f,onMouseEnter:c,onKeyDown:p=>l(p,r),...s,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center",children:[e,i]})})},r6=t6,i6=E.forwardRef(({children:t,block:e,...r},i)=>{const{menuProps:s,visible:n}=Ea(),{className:a,...o}=s,l={...o,...r},c=re({"w-100":e},a);return n?x.jsx("div",{ref:i,className:c,...l,children:t}):null}),s6=i6,n6=E.forwardRef(({label:t,children:e},r)=>x.jsxs("div",{ref:r,role:"group",children:[x.jsx("span",{className:"small px-4",children:x.jsx("strong",{children:t})}),e]})),a6=n6,o6=E.forwardRef(({model:t,icon:e,label:r=!1,disabled:i=!1,checked:s,...n},a)=>{const o=E.useId(),l={type:"radio",checked:s,disabled:i,ref:a,className:re(n.className,"form-check-input c-pointer",e&&"d-none"),id:o},c={...n,...l};return x.jsxs("div",{className:re("form-check d-flex align-items-center gap-8",e&&"ps-0"),children:[x.jsx("input",{...c}),e&&x.jsx("label",{htmlFor:c.id,className:re("c-pointer",t!==n.value&&"text-muted"),children:e}),!e&&r&&x.jsx("label",{className:"form-check-label",htmlFor:c.id,children:r})]})}),Ep=o6,l6=({children:t,value:e,model:r,onChange:i})=>{const{itemProps:s,itemRefs:n,isFocused:a}=Ea(),{onMenuItemKeyDown:o,onMenuItemMouseEnter:l}=s,c=E.useId(),h={value:e,model:r,checked:e===r,readOnly:!0},f=re("dropdown-item c-pointer",{focus:a===c});return x.jsx("div",{id:c,ref:u=>n.current[c]=u,role:"menuitemradio","aria-checked":e===r,onMouseUp:()=>i(e),onKeyDown:u=>o(u,()=>i(e)),onMouseEnter:l,tabIndex:e===r?0:-1,className:f,children:x.jsxs("div",{className:"d-flex gap-8 align-items-center justify-content-between position-relative",children:[t,x.jsx(Ep,{...h,className:"position-absolute start-0 end-0 top-0 bottom-0 opacity-0"})]})})},c6=l6,h6=()=>x.jsx("div",{role:"separator",className:"px-4",children:x.jsx("hr",{className:"m-0"})}),u6=h6,d6=E.forwardRef(({label:t,icon:e,variant:r,disabled:i=!1,size:s,badgeContent:n,...a},o)=>{const{triggerProps:l,block:c}=Ea(),{className:h,...f}=l,u={...f,...a},d=re("dropdown-toggle ",s,r,{"w-100":c},h);return x.jsxs("button",{ref:o,className:d,disabled:i,...u,children:[e||null,t,n?x.jsx("span",{className:"badge text-bg-secondary rounded-pill",children:n}):x.jsx(wE,{width:16,height:16,className:"dropdown-toggle-caret"})]})}),f6=d6,p6=({children:t,block:e,overflow:r=!0,placement:i="bottom-start",extraTriggerKeyDownHandler:s})=>{const{visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,setVisible:f}=o5(i,s),u=Yw(()=>f(!1)),d=E.useMemo(()=>({visible:n,isFocused:a,triggerProps:o,menuProps:l,itemProps:c,itemRefs:h,block:e,setVisible:f}),[n,a,o,l,c,h,e,f]),p=re("dropdown",{"w-100":e,overflow:r});return x.jsx(eE.Provider,{value:d,children:x.jsx("div",{ref:u,className:p,children:typeof t=="function"?t(o,h):t})})},m6=Object.assign(p6,{Trigger:f6,Menu:s6,Item:r6,Separator:u6,CheckboxItem:e6,RadioItem:c6,MenuGroup:a6}),lt=m6,Nm=({onSearchResultsChange:t,onSearchInputChange:e,options:r,value:i,isLoading:s,noResult:n,searchMinLength:a,placeholder:o})=>{const{t:l}=Ce(),[c,h]=E.useState([]);E.useEffect(()=>{t(c)},[c]);const f=d=>{h([d])},u=()=>s?x.jsxs("div",{className:"d-flex align-items-center p-4",children:[x.jsx(zw,{isLoading:s}),x.jsx("span",{className:"ps-4",children:l("explorer.search.pending")})]}):n?x.jsx("div",{className:"p-4",children:l("portal.no.result")}):r.map((d,p)=>x.jsxs(E.Fragment,{children:[x.jsx(lt.Item,{type:"select",icon:d.icon,onClick:()=>f(d.value),children:d.label}),p<r.length-1&&x.jsx(lt.Separator,{})]},p));return x.jsxs(lt,{block:!0,children:[x.jsx(Nm.Trigger,{placeholder:o,searchMinLength:a,handleSearchInputChange:e,value:i}),x.jsx(lt.Menu,{children:u()})]})};Nm.Trigger=Q5;const g6=Nm,v6=({imageSrc:t,imageAlt:e="",title:r,text:i,className:s})=>{const n=re("text",s);return x.jsxs("div",{className:"emptyscreen",children:[t&&x.jsx("div",{className:"emptyscreen-image mb-12",children:x.jsx("img",{className:"mx-auto",src:t,alt:e,width:"250",height:"250"})}),r&&x.jsx(ur,{level:"h2",headingStyle:"h2",className:"text-secondary mb-8",children:r}),i&&x.jsx("div",{className:n,children:i})]})},u8=v6,y6=({children:t,className:e,...r})=>{const i=re("grid",e);return x.jsx("div",{className:i,...r,children:t})},b6=({sm:t,md:e,lg:r,xl:i,children:s,className:n,as:a,...o})=>{const l=a||"div",c=re({[`g-col-${t}`]:t,[e?`g-col-md-${e}`:""]:e,[r?`g-col-lg-${r}`:""]:r,[i?`g-col-xl-${i}`:""]:i},n);return x.jsx(l,{className:c,...o,children:s})};y6.Col=b6;const x6=E.forwardRef(({label:t,addButtonLabel:e="Add image",deleteButtonLabel:r="Delete image",src:i,className:s,app:n,onUploadImage:a,onDeleteImage:o},l)=>{const[c,h]=E.useState(i||""),{inputRef:f,files:u,deleteFile:d,handleOnChange:p,handleDragging:m,handleDragLeave:g,handleDrop:y}=c5();E.useEffect(()=>{if(u.length>0){d(u[0]),h("");const w=u==null?void 0:u[0];if(!w)return;h(URL.createObjectURL(w)),a(w)}},[u]);const _=()=>{var w;(w=f.current)==null||w.click()},v=()=>{f.current&&(f.current.value=""),d(u[0]),h(""),o()},b=re("image-input",s);return x.jsxs(ot,{id:"image-input",className:b,onDragEnter:m,onDragOver:m,onDragLeave:g,onDrop:y,ref:l,children:[x.jsxs("div",{className:"image-input-actions gap-8",children:[x.jsx(ua,{"aria-label":e,color:"tertiary",icon:x.jsx(pE,{}),onClick:_,type:"button",variant:"ghost"}),x.jsx(ua,{"aria-label":r,color:"danger",disabled:!c,icon:x.jsx(mE,{width:"20",height:"20"}),onClick:v,type:"button",variant:"ghost"})]}),x.jsxs(ot.Label,{children:[x.jsx("span",{className:"visually-hidden",children:t}),x.jsx(Qs,{accept:"image/*",hidden:!0,onChange:p,ref:f,size:"sm",type:"file"}),c?x.jsx(da,{alt:"",src:c,size:"xl"}):x.jsx(Ho,{app:n,iconFit:"ratio",size:"160",variant:"rounded"})]})]})}),rE=x6,_6=E.forwardRef(({position:t=!0,caption:e},r)=>{const[i]=wa(),s=`${i}/loading/screen-loading.gif`,n=re("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000",{"position-fixed":!t,"position-static":t}),a=re("text-center pt-12",{"text-white":!t});return x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:r,className:n,children:[x.jsx("div",{className:"bg-white rounded-circle mx-auto w-25",children:x.jsx("img",{src:s,alt:"loading"})}),e&&x.jsx("div",{className:a,children:e})]}),!t&&x.jsx("div",{className:"modal-backdrop fade show"})]})}),Lm=_6,w6=E.forwardRef(({src:t,is1d:e,translate:r="Retour accueil"},i)=>{const s=re("navbar-brand d-none d-md-block");return x.jsx("a",{ref:i,className:s,href:"/timeline/timeline","aria-label":r,children:x.jsx("img",{className:"logo",src:t,alt:`logo ${e?"ONE":"NEO"}`,width:"300",height:"52"})})}),Ry=w6,iE=E.createContext({ariaLabelId:"",ariaDescriptionId:"",focusId:""}),sE=()=>{const t=E.useContext(iE);if(!t)throw new Error("Cannot be rendered outside the Modal component");return t},E6=t=>{const{ariaDescriptionId:e}=sE(),{children:r,className:i}=t,s=re("modal-body",i);return x.jsx("div",{id:e,className:s,children:r})},S6=E6,T6=t=>x.jsx("div",{className:"modal-footer",children:t.children}),A6=T6,C6=t=>{const{onModalClose:e,children:r}=t,{ariaLabelId:i,focusId:s}=sE(),n=E.useRef(null);return E.useEffect(()=>{var a;s||(a=n.current)==null||a.focus()},[s]),x.jsxs("div",{className:"modal-header",children:[x.jsx("h2",{id:i,className:"modal-title",tabIndex:-1,children:r}),x.jsx(ua,{ref:n,"aria-label":"Close",color:"tertiary",icon:x.jsx(Jy,{}),type:"button",variant:"ghost",title:"Delete",onClick:e,className:"btn-close"})]})},I6=C6,R6=t=>x.jsx("p",{className:"modal-subtitle",children:t.children}),P6=R6,M6=E.forwardRef((t,e)=>{const{id:r,isOpen:i,onModalClose:s,size:n="md",viewport:a=!1,scrollable:o=!1,focusId:l,children:c}=t,h=`aria_label_${r}`,f=`aria_desc_${r}`,u=Yw(s),d=f5();u5(s,["Escape"]),E.useEffect(()=>{if(i&&(document.body.style.overflow="hidden",l)){const _=document.getElementById(l);_==null||_.focus()}return()=>{document.body.style.overflow=""}},[l,i]);const p=re("modal fade",{"show d-block":i,"modal-scrollable":o,viewport:a,[`modal-${n}`]:n}),m=re("modal-dialog"),g={ariaLabelId:h,ariaDescriptionId:f,focusId:l},y=mx(i,{from:{x:-50,opacity:0},enter:{x:0,opacity:1},leave:{x:50,opacity:0}});return x.jsx(iE.Provider,{value:g,children:y((_,v)=>x.jsxs(x.Fragment,{children:[v&&x.jsx(cf.div,{id:r,ref:e,role:"dialog","aria-modal":"true","aria-labelledby":h,"aria-describedby":f,className:p,style:_,tabIndex:-1,children:x.jsx("div",{id:`${r}_ref`,ref:b=>{u.current=b,v&&(d.current=b)},className:m,children:x.jsx("div",{className:"modal-content",children:c})})}),v&&x.jsx(cf.div,{className:"modal-backdrop fade show",style:{opacity:.65}})]}))})}),O6=Object.assign(M6,{Header:I6,Subtitle:P6,Body:S6,Footer:A6}),je=O6,k6=({children:t,className:e})=>{const r=re("popover-body",e);return x.jsx("div",{className:r,children:t})},D6=({children:t,className:e})=>{const r=re("popover-footer p-8",e);return x.jsx("div",{className:r,children:t})},nE=E.forwardRef(({children:t,className:e,id:r,isVisible:i,...s},n)=>{const a=re("popover d-block position-absolute top-100 start-50 translate-middle-x",e);return mx(i,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((o,l)=>l&&x.jsx(cf.div,{ref:n,"aria-labelledby":r,className:a,role:"tooltip",style:o,...s,children:t}))}),N6=t=>x.jsx(lt.Trigger,{...t,"aria-haspopup":"listbox",role:"combobox"}),L6=N6,B6=({icon:t,options:e,overflow:r,block:i,variant:s,size:n,disabled:a,placeholderOption:o,onValueChange:l})=>{const[c,h]=E.useState(),{t:f}=Ce();E.useEffect(()=>{if(c){const d=typeof c=="object"?c.value:c;l==null||l(d)}},[c]);const u=typeof c=="object"?c.label:c;return x.jsxs(lt,{overflow:r,block:i,children:[x.jsx(L6,{icon:t,label:f(u||o),variant:s,size:n,disabled:a}),x.jsx(lt.Menu,{role:"listbox",children:e==null?void 0:e.map(d=>{const p=typeof d=="object"?d.value:d,m=typeof d=="object"?d.label:d;return x.jsx(lt.Item,{type:"action",onClick:()=>h(d),children:m},p)})})]})},aE=B6,F6=E.forwardRef(({noValidationIcon:t,placeholder:e,size:r="md",height:i="md",className:s,...n},a)=>{const{id:o,isRequired:l,isReadOnly:c,status:h}=au(),f=re({"form-control":!c,"form-control-lg":r==="lg","form-control-sm":r==="sm","textarea-height-lg":i==="lg","textarea-height-md":i==="md","textarea-height-sm":i==="sm","is-invalid":h==="invalid","is-valid":h==="valid","form-control-plaintext":c,"no-validation-icon":t},s);return x.jsx("textarea",{ref:a,id:o,className:f,placeholder:e,required:l,readOnly:c,...n})}),oE=F6;function U6(t,e,r,i,s,n,a,o,l){const c=u=>{u.preventDefault(),s==null||s(t),u.stopPropagation()},h=u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),s==null||s(t),u.stopPropagation())},f=()=>{i(!r),r?n==null||n(t):a==null||a(t)};return{handleItemClick:c,handleItemKeyDown:h,handleItemFoldUnfoldClick:u=>{u.preventDefault(),f(),u.stopPropagation()},handleItemFoldUnfoldKeyDown:u=>{(u.code==="Enter"||u.code==="Space")&&(u.preventDefault(),f(),u.stopPropagation())},handleItemFocus:u=>{u.preventDefault(),o==null||o(t)},handleItemBlur:u=>{u.preventDefault(),l==null||l(t)}}}const j6=t=>{const{nodeId:e,label:r,children:i,section:s,selected:n,onItemSelect:a,onItemFold:o,onItemUnfold:l,onItemFocus:c,onItemBlur:h,selectedNodesIds:f}=t,[u,d]=E.useState(!1),{handleItemClick:p,handleItemKeyDown:m,handleItemFoldUnfoldClick:g,handleItemFoldUnfoldKeyDown:y,handleItemFocus:_,handleItemBlur:v}=U6(e,r,u,d,a,o,l,c,h);E.useEffect(()=>{if(f!=null&&f.length&&(f==null?void 0:f.length)>=1){const A=f[f.length-1];f.some(S=>S===e&&e!==A?(d(!0),S===e):(d(!1),!1))}else d(!1)},[e,f]);const b=s?16:12,w=()=>x.jsx("li",{id:`listitem_${e}`,role:"treeitem","aria-selected":n,"aria-expanded":u,children:x.jsxs("div",{children:[x.jsxs("div",{className:"action-container d-flex align-items-center gap-8 px-2",children:[x.jsxs("div",{className:`py-8 ${Array.isArray(i)?null:"invisible"}`,tabIndex:0,role:"button",onClick:g,onKeyDown:y,"aria-label":"fold/unfold button",children:[Array.isArray(i)&&!u&&x.jsx(Pd,{title:"RafterRight",width:b,height:b}),Array.isArray(i)&&u&&x.jsx(po,{title:"RafterDown",width:b,height:b}),!Array.isArray(i)&&x.jsx(Pd,{title:"RafterRight",width:b,height:b,"aria-hidden":"true"})]}),x.jsxs("div",{tabIndex:0,role:"button",className:"flex-fill d-flex align-items-center text-truncate gap-8 py-8",onClick:p,onKeyDown:m,onFocus:_,onBlur:v,children:[s&&x.jsx(EE,{title:"Folder",width:20,height:20}),x.jsx("span",{className:"text-truncate",children:r})]})]}),Array.isArray(i)&&x.jsx("ul",{role:"group",children:i})]})},e);return s?x.jsx("ul",{role:"tree",className:"m-0 p-0",children:w()}):w()},$6=j6,G6=E.forwardRef((t,e)=>{const{data:r,onTreeItemSelect:i,onTreeItemFold:s,onTreeItemUnfold:n,onTreeItemFocus:a,onTreeItemBlur:o,selectedNodesIds:l}=t,[c,h]=E.useState(null);E.useEffect(()=>{l!=null&&l.length&&(l==null?void 0:l.length)>=1?h(l[l.length-1]):h(null)},[l]);const f=E.useMemo(()=>({unselectAll(){h(null)},select(y){h(y),i==null||i(y)}}),[i]);E.useImperativeHandle(e,()=>f,[f]);const u=y=>{s==null||s(y)},d=y=>{n==null||n(y)},p=y=>{a==null||a(y)},m=y=>{o==null||o(y)},g=y=>x.jsx($6,{nodeId:y.id,label:y.name,section:y.section,selectedNodesIds:l,selected:c===y.id,onItemSelect:f.select,onItemFold:u,onItemUnfold:d,onItemFocus:p,onItemBlur:m,children:Array.isArray(y.children)?y.children.map(_=>g(_)):null},y.id);return x.jsx("div",{className:"treeview",children:g(r)})}),d8=G6,z6=E.forwardRef(({children:t},e)=>x.jsx("span",{className:"visually-hidden",ref:e,children:t})),Hi=z6,H6=async t=>await Ae.conf().getPreference(t),V6=async t=>await Ae.conf().savePreference(t,JSON.stringify({showOnboardingTrash:!1})),W6=t=>{const[e,r]=E.useState(!0),[i,s]=E.useState(!1);return E.useEffect(()=>{(async()=>{const n=await H6(t);if(n){const{showOnboardingTrash:a}=n;s(a);return}s(!0)})()},[t]),{isOpen:e,setIsOpen:r,isOnboardingTrash:i,handleSavePreference:async()=>{await V6(t),r(!1)}}},X6=({id:t,items:e,modalOptions:r})=>{const[i]=wa(),[s,n]=E.useState(),[a,o]=E.useState(0),{isOpen:l,isOnboardingTrash:c,setIsOpen:h,handleSavePreference:f}=W6(t);E.useEffect(()=>{const y=document.createElement("link");return y.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",y.rel="stylesheet",y.type="text/css",document.head.appendChild(y),()=>{document.head.removeChild(y)}},[]);const{t:u}=Ce(),{title:d,prevText:p,closeText:m,nextText:g}=r;return c?rs.createPortal(x.jsxs(je,{id:"onboarding-modal",size:"md",isOpen:l,focusId:"nextButtonId",onModalClose:()=>h(!1),children:[x.jsx(je.Header,{onModalClose:()=>h(!1),children:u(d||"explorer.modal.onboarding.trash.title")}),x.jsx(je.Body,{children:x.jsx($x,{modules:[K2],onSwiper:y=>{n(y)},onSlideChange:y=>{o(y.progress)},pagination:{clickable:!0},children:e.map((y,_)=>x.jsxs(Gx,{children:[x.jsx(nu,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:`${i}/${y.src}`,alt:u(y.alt)}),x.jsx("p",{children:u(y.text)})]},_))})}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:()=>h(!1),children:u("explorer.modal.onboarding.trash.later")}),a>0&&x.jsx(tt,{type:"button",color:"primary",variant:"outline",onClick:()=>s.slidePrev(),children:u(p||"explorer.modal.onboarding.trash.prev")}),a<1&&x.jsx(tt,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>s.slideNext(),children:u(g||"explorer.modal.onboarding.trash.next")}),a===1&&x.jsx(tt,{type:"button",color:"primary",variant:"filled",onClick:f,children:u(m||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")):null},f8=X6,Y6=()=>{const{t}=Ce();return[{value:"bpr.activityType.classroomActivity",label:t("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:t("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:t("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:t("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:t("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:t("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:t("bpr.activityType.courseElement")},{value:"bpr.other",label:t("bpr.other")}]},q6=({control:t,selectedActivities:e,selectActivities:r})=>{const i=Y6(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(xh,{name:"activityType",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(lt,{block:!0,overflow:!0,children:[x.jsx(lt.Trigger,{size:"md",label:s("bpr.form.publication.type"),badgeContent:e==null?void 0:e.length}),x.jsx(lt.Menu,{children:i.map((a,o)=>x.jsx(lt.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})},Z6=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],Py=({name:t,control:e,placeholderOption:r,validate:i})=>x.jsx(xh,{name:t,control:e,rules:{required:!0,validate:i},render:({field:{onChange:s}})=>x.jsx(aE,{block:!0,size:"md",onValueChange:s,options:Z6,"aria-required":!0,placeholderOption:r})}),K6=()=>{const{t}=Ce();return[{value:"de_DE",label:t("de_DE")},{value:"en_EN",label:t("en_EN")},{value:"ar_DZ",label:t("ar_DZ")},{value:"es_ES",label:t("es_ES")},{value:"fr_FR",label:t("fr_FR")},{value:"it_IT",label:t("it_IT")},{value:"ja_JP",label:t("ja_JP")},{value:"zh_CN",label:t("zh_CN")},{value:"pt_PT",label:t("pt_PT")},{value:"ru_RU",label:t("ru_RU")},{value:"bpr.other",label:t("bpr.other")}]},Q6="bpr.form.publication.language",J6=({control:t})=>{const e=K6();return x.jsx("div",{className:"col",children:x.jsx(xh,{name:"language",control:t,rules:{required:!0},render:({field:{onChange:r}})=>x.jsx(aE,{block:!0,size:"md",onValueChange:r,options:e,"aria-required":!0,placeholderOption:Q6})})})},eU=()=>{const{t}=Ce(),[e]=wa();return x.jsxs(x.Fragment,{children:[x.jsxs("ul",{className:"mb-12",children:[x.jsxs("li",{children:[t("bpr.form.publication.licence.text.1"),x.jsx("img",{className:"ms-8 d-inline-block",src:`${e}/common/image-creative-commons.png`,alt:"licence creative commons"})]}),x.jsx("li",{children:t("bpr.form.publication.licence.text.2")})]}),x.jsx(zi,{type:"info",className:"mb-12",children:t("bpr.form.publication.licence.text.3")}),x.jsx(zi,{type:"warning",children:t("bpr.form.publication.licence.text.4")})]})},tU=()=>{const{t}=Ce();return[{value:"bpr.subjectArea.artActivity",label:t("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:t("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:t("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:t("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:t("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:t("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:t("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:t("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:t("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:t("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:t("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:t("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:t("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:t("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:t("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:t("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:t("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:t("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:t("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:t("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:t("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:t("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:t("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:t("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:t("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:t("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:t("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:t("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:t("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:t("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:t("bpr.subjectArea.technology")},{value:"bpr.other",label:t("bpr.other")}]},rU=({control:t,selectedSubjectAreas:e,selectSubjects:r})=>{const i=tU(),{t:s}=Ce();return x.jsx("div",{className:"col d-flex",children:x.jsx(xh,{name:"subjectArea",control:t,rules:{required:!0},render:({field:{onChange:n}})=>x.jsxs(lt,{block:!0,overflow:!0,children:[x.jsx(lt.Trigger,{size:"md",label:s("bpr.form.publication.discipline"),badgeContent:e==null?void 0:e.length}),x.jsx(lt.Menu,{children:i.map((a,o)=>x.jsx(lt.CheckboxItem,{value:a.value,model:e,onChange:()=>{r(a.value),n(a.value)},children:a.label},o))})]})})})};function My({formData:t}){const{t:e}=Ce(),r=i=>i.match(/^\s/);return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.error.title")}),x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("strong",{children:e("bpr.form.publication.response.error.content")})}),x.jsxs("ul",{children:[r(t.title)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.title")})}),r(t.description)&&x.jsx("li",{className:"pt-2 pb-2",children:x.jsx("strong",{children:e("bpr.form.publication.response.empty.description")})})]})]})}function iU({result:t}){const{t:e}=Ce();return x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"pt-24",children:e("bpr.form.publication.response.success.title")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.1")}),x.jsx("p",{className:"pt-24",children:e("bpr.form.publication.response.success.content.2")}),t.details.front_url&&x.jsx("p",{className:"pt-24 pb-24",children:x.jsx("a",{className:"button right-magnet",href:t.details.front_url,target:"_blank",rel:"noreferrer",children:e("bpr.form.publication.response.success.button")})})]})}function sU({onSuccess:t,resource:e}){const{user:r,appCode:i}=mt(),s=bl(),[n,a]=E.useState((e==null?void 0:e.thumbnail)||"");E.useEffect(()=>{a(e==null?void 0:e.thumbnail)},[e]);const{control:o,register:l,watch:c,setValue:h,handleSubmit:f,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m}}=Ky({mode:"onChange"}),[g,y]=E.useState([]),[_,v]=E.useState([]),b=(w,A,S)=>{let C=[...A];const T=C.findIndex(M=>M===w);A.includes(w)?C=A.filter((M,I)=>I!==T):C=[...A,w],S(C)};return{control:o,cover:n,formState:{errors:u,isSubmitting:d,isDirty:p,isValid:m},handleDeleteImage:()=>a(""),handlePublish:async w=>{const A=r?r==null?void 0:r.userId:"";try{let S=new Blob;typeof n=="string"?S=await Ae.http().get(n,{responseType:"blob"}):n?S=await Ae.http().get(URL.createObjectURL(n),{responseType:"blob"}):e!=null&&e.thumbnail&&(S=await Ae.http().get(e==null?void 0:e.thumbnail,{responseType:"blob"}));const C=await Ae.http().get(`/userbook/avatar/${A}?thumbnail=48x48`,{responseType:"blob"}),T=await Ae.http().get(`/directory/user/${A}/attachment-school`,{responseType:"json"}),M=Xw[i],I={activityType:g,age:[w.ageMin,w.ageMax],application:M,cover:S,description:w.description,keyWords:w.keyWords,language:w.language,licence:"CC-BY",resourceId:e==null?void 0:e.assetId,resourceEntId:e==null?void 0:e.assetId,subjectArea:_,teacherAvatar:C,title:w.title,userId:A,userStructureName:T.name||(r==null?void 0:r.structureNames[0])},k=await Ae.resource(i).publish(I);k.success?s.success(x.jsx(iU,{result:k}),{duration:1e4}):s.error(x.jsx(My,{formData:w})),t==null||t()}catch(S){console.error(S),s.error(x.jsx(My,{formData:w}))}},handleSubmit:f,handleUploadImage:w=>a(w),register:l,selectActivities:w=>{b(w,g,y)},selectedActivities:g,selectedSubjectAreas:_,selectSubjects:w=>{b(w,_,v)},setValue:h,watch:c}}const nU=(t,e)=>{const[r,i]=E.useState(null);return E.useEffect(()=>{if(e===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{const s=[e],n=await Ae.resource(t).searchContext({application:t,filters:{folder:void 0,owner:void 0,shared:void 0,public:void 0},pagination:{startIdx:0,pageSize:s.length},types:[t],asset_id:s});i(n.resources[0])})()},[]),r},Bm=nU;function p8({isOpen:t,resourceId:e,onSuccess:r,onCancel:i}){const{appCode:s,currentApp:n}=mt(),{t:a}=Ce(),o=Bm(s,e),{control:l,cover:c,formState:{isDirty:h,isValid:f,isSubmitting:u},handleDeleteImage:d,handleSubmit:p,handleUploadImage:m,handlePublish:g,register:y,selectActivities:_,selectedActivities:v,selectedSubjectAreas:b,selectSubjects:w}=sU({resource:o,onSuccess:r});return o?rs.createPortal(x.jsxs(je,{isOpen:t,onModalClose:i,id:"libraryModal",size:"lg",children:[x.jsx(je.Header,{onModalClose:i,children:a("bpr.publish")}),x.jsx(je.Subtitle,{children:a("bpr.form.tip")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.heading.general")}),x.jsxs("form",{id:"libraryModalForm",onSubmit:p(g),children:[x.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[x.jsxs("div",{style:{maxWidth:"160px"},children:[x.jsx("div",{className:"form-label",children:a("bpr.form.publication.cover.title")}),x.jsx(rE,{app:n,src:o==null?void 0:o.thumbnail,label:a("bpr.form.publication.cover.upload.label"),addButtonLabel:a("bpr.form.publication.cover.upload.add"),deleteButtonLabel:a("bpr.form.publication.cover.upload.remove"),onUploadImage:m,onDeleteImage:d,className:"align-self-center"}),!c&&x.jsx("p",{className:"form-text is-invalid",children:x.jsx("em",{children:a("bpr.form.publication.cover.upload.required.image")})})]}),x.jsxs("div",{className:"flex-fill",children:[x.jsxs(ot,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.title")}),x.jsx(Qs,{type:"text",defaultValue:o==null?void 0:o.name,...y("title",{required:!0}),placeholder:a("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ot,{id:"description",isRequired:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.description")}),x.jsx(oE,{...y("description",{required:!0}),placeholder:a("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.heading.infos")}),x.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[x.jsx(q6,{control:l,selectedActivities:v,selectActivities:_}),x.jsx(rU,{control:l,selectedSubjectAreas:b,selectSubjects:w}),x.jsx(J6,{control:l})]}),x.jsxs("div",{className:"mb-24",children:[x.jsx("label",{htmlFor:"",className:"form-label",children:a("bpr.form.publication.age")}),x.jsxs("div",{className:"d-flex gap-8",children:[x.jsx("div",{className:"col col-2",children:x.jsx(Py,{control:l,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(C,T)=>parseInt(C)<=parseInt(T.ageMax)})}),x.jsx("div",{className:"col col-2",children:x.jsx(Py,{control:l,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(C,T)=>parseInt(C)>=parseInt(T.ageMin)})})]})]}),x.jsx("div",{className:"mb-24",children:x.jsxs(ot,{id:"keywords",isOptional:!0,children:[x.jsx(Nn,{children:a("bpr.form.publication.keywords")}),x.jsx(Qs,{type:"text",...y("keyWords"),size:"md",placeholder:a("bpr.form.publication.keywords.placeholder")})]})}),x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:a("bpr.form.publication.licence.text")}),x.jsx(eU,{})]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:i,type:"button",variant:"ghost",children:a("cancel")}),x.jsx(tt,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:u,disabled:!c||u||!h||!f,children:a("bpr.form.submit")})]})]}),document.getElementById("portal")):x.jsx(Lm,{})}const aU=({isUpdating:t,selectedResource:e})=>{const[r,i]=E.useState(t&&(e==null?void 0:e.thumbnail)||"");return E.useEffect(()=>{i((e==null?void 0:e.thumbnail)||"")},[e]),{thumbnail:r,handleDeleteImage:()=>i(""),handleUploadImage:s=>i(s)}},oU=({isOpen:t,onCancel:e,onSuccess:r,children:i,...s})=>{const{appCode:n,currentApp:a}=mt(),{t:o}=Ce(),{mode:l}=s,c=bl(),h=E.useId(),f=l==="create",u=l==="update",d=Bm(n,u?s.resourceId:""),{watch:p,register:m,handleSubmit:g,setValue:y,formState:{isSubmitting:_,isValid:v}}=Ky({mode:"onChange",defaultValues:{description:u?d==null?void 0:d.description:"",enablePublic:u?d==null?void 0:d.public:!1,title:u?d==null?void 0:d.name:"",formSlug:u?d==null?void 0:d.slug:""}}),{thumbnail:b,handleDeleteImage:w,handleUploadImage:A}=aU({isUpdating:u,selectedResource:u?d:void 0}),S=async function(C){var T,M;try{const I={description:C.description||"",name:C.title,public:C.enablePublic,slug:C.enablePublic&&C.formSlug||"",thumbnail:b};if(f){const k={...I,folder:((T=s.currentFolder)==null?void 0:T.id)==="default"?void 0:parseInt(((M=s.currentFolder)==null?void 0:M.id)||""),application:n};s.createResource?await s.createResource.mutateAsync(k):await Ae.resource(n).create(k)}else{const k={...I,entId:d.assetId,trashed:d.trashed};s.updateResource?await s.updateResource.mutateAsync(k):await Ae.resource(n).update(k)}c.success(x.jsxs(x.Fragment,{children:[x.jsx("strong",{children:o(f?"explorer.resource.created":"explorer.resource.updated")}),x.jsxs("p",{children:[o("title")," : ",C.title]}),x.jsxs("p",{children:[o("description")," : ",C.description]}),n==="blog"&&x.jsxs("p",{children:["Public:",C.enablePublic?o("explorer.enable.public.yes"):o("explorer.enable.public.no")]})]})),r()}catch(I){console.error(I)}};return u&&!d?x.jsx(Lm,{}):rs.createPortal(x.jsxs(je,{id:`${l}-resource`,size:"lg",isOpen:t,onModalClose:e,children:[x.jsx(je.Header,{onModalClose:e,children:o(`explorer.resource.editModal.header.${f?"create":"edit"}`)}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:o("explorer.resource.editModal.heading.general")}),x.jsxs("form",{id:h,onSubmit:g(S),children:[x.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[x.jsx("div",{children:x.jsx(rE,{app:a,src:u&&(d==null?void 0:d.thumbnail)||"",label:o("explorer.imagepicker.label"),addButtonLabel:o("explorer.imagepicker.button.add"),deleteButtonLabel:o("explorer.imagepicker.button.delete"),onUploadImage:A,onDeleteImage:w,className:"align-self-center mt-8"})}),x.jsxs("div",{className:"col",children:[x.jsxs(ot,{id:"title",className:"mb-16",isRequired:!0,children:[x.jsx(Nn,{children:o("title")}),x.jsx(Qs,{type:"text",defaultValue:u?d==null?void 0:d.name:"",...m("title",{required:!0,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:o("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0})]}),x.jsxs(ot,{id:"description",isOptional:!0,children:[x.jsx(Nn,{children:o("description")}),x.jsx(oE,{defaultValue:u?d==null?void 0:d.description:"",...m("description"),placeholder:o("explorer.resource.editModal.description.placeholder"),size:"md"})]})]})]}),typeof i=="function"?i(d,u,p,y,m):i]})]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{color:"tertiary",onClick:e,type:"button",variant:"ghost",children:o("explorer.cancel")}),x.jsx(tt,{form:h,type:"submit",color:"primary",isLoading:_,variant:"filled",disabled:!v||_,children:o(f?"explorer.create":"save")})]})]}),document.getElementById("portal"))},m8=oU,lU=({application:t,options:e})=>yb({mutationFn:async r=>await Ae.resource(t).update(r),...e}),g8=lU,Oy=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function cU(t,e){e?e={...Oy,...e}:e=Oy;const r=lE(e);return r.dispatch(t),r.toString()}const hU=Object.freeze(["prototype","__proto__","constructor"]);function lE(t){let e="",r=new Map;const i=s=>{e+=s};return{toString(){return e},getContext(){return r},dispatch(s){return t.replacer&&(s=t.replacer(s)),this[s===null?"null":typeof s](s)},object(s){if(s&&typeof s.toJSON=="function")return this.object(s.toJSON());const n=Object.prototype.toString.call(s);let a="";const o=n.length;o<10?a="unknown:["+n+"]":a=n.slice(8,o-1),a=a.toLowerCase();let l=null;if((l=r.get(s))===void 0)r.set(s,r.size);else return this.dispatch("[CIRCULAR:"+l+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return i("buffer:"),i(s.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](s):t.ignoreUnknown||this.unkown(s,a);else{let c=Object.keys(s);t.unorderedObjects&&(c=c.sort());let h=[];t.respectType!==!1&&!ky(s)&&(h=hU),t.excludeKeys&&(c=c.filter(u=>!t.excludeKeys(u)),h=h.filter(u=>!t.excludeKeys(u))),i("object:"+(c.length+h.length)+":");const f=u=>{this.dispatch(u),i(":"),t.excludeValues||this.dispatch(s[u]),i(",")};for(const u of c)f(u);for(const u of h)f(u)}},array(s,n){if(n=n===void 0?t.unorderedArrays!==!1:n,i("array:"+s.length+":"),!n||s.length<=1){for(const l of s)this.dispatch(l);return}const a=new Map,o=s.map(l=>{const c=lE(t);c.dispatch(l);for(const[h,f]of c.getContext())a.set(h,f);return c.toString()});return r=a,o.sort(),this.array(o,!1)},date(s){return i("date:"+s.toJSON())},symbol(s){return i("symbol:"+s.toString())},unkown(s,n){if(i(n),!!s&&(i(":"),s&&typeof s.entries=="function"))return this.array(Array.from(s.entries()),!0)},error(s){return i("error:"+s.toString())},boolean(s){return i("bool:"+s)},string(s){i("string:"+s.length+":"),i(s)},function(s){i("fn:"),ky(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this.object(s)},number(s){return i("number:"+s)},xml(s){return i("xml:"+s.toString())},null(){return i("Null")},undefined(){return i("Undefined")},regexp(s){return i("regex:"+s.toString())},uint8array(s){return i("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},uint8clampedarray(s){return i("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},int8array(s){return i("int8array:"),this.dispatch(Array.prototype.slice.call(s))},uint16array(s){return i("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},int16array(s){return i("int16array:"),this.dispatch(Array.prototype.slice.call(s))},uint32array(s){return i("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},int32array(s){return i("int32array:"),this.dispatch(Array.prototype.slice.call(s))},float32array(s){return i("float32array:"),this.dispatch(Array.prototype.slice.call(s))},float64array(s){return i("float64array:"),this.dispatch(Array.prototype.slice.call(s))},arraybuffer(s){return i("arraybuffer:"),this.dispatch(new Uint8Array(s))},url(s){return i("url:"+s.toString())},map(s){i("map:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},set(s){i("set:");const n=[...s];return this.array(n,t.unorderedSets!==!1)},file(s){return i("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},blob(){if(t.ignoreUnknown)return i("[blob]");throw new Error(`Hashing Blob objects is currently not supported
1346
- Use "options.replacer" or "options.ignoreUnknown"
1347
- `)},domwindow(){return i("domwindow")},bigint(s){return i("bigint:"+s.toString())},process(){return i("process")},timer(){return i("timer")},pipe(){return i("pipe")},tcp(){return i("tcp")},udp(){return i("udp")},tty(){return i("tty")},statwatcher(){return i("statwatcher")},securecontext(){return i("securecontext")},connection(){return i("connection")},zlib(){return i("zlib")},context(){return i("context")},nodescript(){return i("nodescript")},httpparser(){return i("httpparser")},dataview(){return i("dataview")},signal(){return i("signal")},fsevent(){return i("fsevent")},tlswrap(){return i("tlswrap")}}}const cE="[native code] }",uU=cE.length;function ky(t){return typeof t!="function"?!1:Function.prototype.toString.call(t).slice(-uU)===cE}class Zi{constructor(e,r){e=this.words=e||[],this.sigBytes=r===void 0?e.length*4:r}toString(e){return(e||dU).stringify(this)}concat(e){if(this.clamp(),this.sigBytes%4)for(let r=0;r<e.sigBytes;r++){const i=e.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=i<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<e.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=e.words[r>>>2];return this.sigBytes+=e.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new Zi([...this.words])}}const dU={stringify(t){const e=[];for(let r=0;r<t.sigBytes;r++){const i=t.words[r>>>2]>>>24-r%4*8&255;e.push((i>>>4).toString(16),(i&15).toString(16))}return e.join("")}},fU={stringify(t){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[];for(let i=0;i<t.sigBytes;i+=3){const s=t.words[i>>>2]>>>24-i%4*8&255,n=t.words[i+1>>>2]>>>24-(i+1)%4*8&255,a=t.words[i+2>>>2]>>>24-(i+2)%4*8&255,o=s<<16|n<<8|a;for(let l=0;l<4&&i*8+l*6<t.sigBytes*8;l++)r.push(e.charAt(o>>>6*(3-l)&63))}return r.join("")}},pU={parse(t){const e=t.length,r=[];for(let i=0;i<e;i++)r[i>>>2]|=(t.charCodeAt(i)&255)<<24-i%4*8;return new Zi(r,e)}},mU={parse(t){return pU.parse(unescape(encodeURIComponent(t)))}};class gU{constructor(){this._data=new Zi,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new Zi,this._nDataBytes=0}_append(e){typeof e=="string"&&(e=mU.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_doProcessBlock(e,r){}_process(e){let r,i=this._data.sigBytes/(this.blockSize*4);e?i=Math.ceil(i):i=Math.max((i|0)-this._minBufferSize,0);const s=i*this.blockSize,n=Math.min(s*4,this._data.sigBytes);if(s){for(let a=0;a<s;a+=this.blockSize)this._doProcessBlock(this._data.words,a);r=this._data.words.splice(0,s),this._data.sigBytes-=n}return new Zi(r,n)}}class vU extends gU{update(e){return this._append(e),this._process(),this}finalize(e){e&&this._append(e)}}const Dy=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],yU=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],fs=[];class bU extends vU{constructor(){super(...arguments),this._hash=new Zi([...Dy])}reset(){super.reset(),this._hash=new Zi([...Dy])}_doProcessBlock(e,r){const i=this._hash.words;let s=i[0],n=i[1],a=i[2],o=i[3],l=i[4],c=i[5],h=i[6],f=i[7];for(let u=0;u<64;u++){if(u<16)fs[u]=e[r+u]|0;else{const v=fs[u-15],b=(v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3,w=fs[u-2],A=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;fs[u]=b+fs[u-7]+A+fs[u-16]}const d=l&c^~l&h,p=s&n^s&a^n&a,m=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),g=(l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25),y=f+g+d+yU[u]+fs[u],_=m+p;f=h,h=c,c=l,l=o+y|0,o=a,a=n,n=s,s=y+_|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+a|0,i[3]=i[3]+o|0,i[4]=i[4]+l|0,i[5]=i[5]+c|0,i[6]=i[6]+h|0,i[7]=i[7]+f|0}finalize(e){super.finalize(e);const r=this._nDataBytes*8,i=this._data.sigBytes*8;return this._data.words[i>>>5]|=128<<24-i%32,this._data.words[(i+64>>>9<<4)+14]=Math.floor(r/4294967296),this._data.words[(i+64>>>9<<4)+15]=r,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function xU(t){return new bU().finalize(t).toString(fU)}function Ny(t,e={}){const r=typeof t=="string"?t:cU(t,e);return xU(r).slice(0,10)}var hE={};Object.defineProperty(hE,"__esModule",{value:!0});const _U=t=>{const e="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",r="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",i=e.split("").join("|"),s=new RegExp(`(${i})`,"g");function n(a){return r[e.indexOf(a)]||""}return t.replace(s,n)},wU=t=>t.split("").map(e=>`\\${e}`).join(""),Ly=(t,e,r=!1)=>{const i=_U(t).trim().toLowerCase(),s=wU(e);return r?i.replace(/\s+/g,e):i.replace(new RegExp(`[^a-z0-9${s}]+`,"g"),e).replace(new RegExp(`${s}+`,"g"),e).replace(new RegExp(`^${s}`,"g"),"").replace(new RegExp(`${s}$`,"g"),"")},qa=(t,e={delimiter:"-",prefix:""})=>{if(e.delimiter||(e.delimiter="-"),e.prefix||(e.prefix=""),!t||typeof t=="boolean")return"";const{delimiter:r,prefix:i}=e;if(typeof t=="boolean")return"";if(typeof t=="string"||typeof t=="number"){const s=Ly(i,r,!0),n=Ly(String(t),r);return s?`${s}${r}${n}`:n}return"children"in t?qa(t.children):"type"in t?qa(t.props.children,e):Symbol.iterator in t?qa(Array.from(t).map(s=>qa(s,{delimiter:r})).join(r),e):""};var By=hE.default=qa;const EU=({watch:t,setValue:e,selectedResource:r})=>{const[i,s]=E.useState(""),[n,a]=E.useState((r==null?void 0:r.public)||!1),o=E.useId(),l=t("title"),{t:c}=Ce(),h=bl();E.useEffect(()=>{if(n){let d="";r?d=r.slug?r.slug:`${Ny({foo:`${l}${o}`})}-${By(l)}`:d=`${Ny({foo:`${l}${o}`})}-${By(l)}`,e("formSlug",d),s(d)}},[n,l]);function f(d){a(d)}function u(){navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}/pub/${i}`),h.success(c("explorer.copy.clipboard"))}return{slug:i,uniqueId:o,isPublic:n,resourceName:l,onPublicChange:f,onCopyToClipBoard:u}},SU=({appCode:t,isUpdating:e,resource:r,watch:i,register:s,setValue:n})=>{const{t:a}=Ce(),{slug:o,isPublic:l,resourceName:c,onPublicChange:h,onCopyToClipBoard:f}=EU({watch:i,setValue:n,selectedResource:e?r:void 0});return x.jsxs(x.Fragment,{children:[x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:[a("explorer.resource.editModal.heading.access"),t]}),x.jsx(zi,{type:"info",children:a("explorer.resource.editModal.access.alert")}),x.jsxs(ot,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[x.jsx(ot.Input,{type:"checkbox",role:"switch",defaultChecked:e?r.public:!1,...s("enablePublic",{disabled:!c,onChange:u=>{const d=u.target.checked;h(d)}}),className:"form-check-input mt-0",size:"md"}),x.jsx(ot.Label,{className:"form-check-label mb-0",children:a("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),l&&x.jsxs(x.Fragment,{children:[x.jsx(ot,{id:"formSlug",children:x.jsx(Qs,{type:"text",hidden:!0,defaultValue:e?o:"",...s("formSlug"),size:"sm"})},o),x.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[x.jsxs("p",{className:"text-break",children:[window.location.origin,window.location.pathname,"/pub/",o]}),x.jsx(tt,{color:"primary",disabled:!l,onClick:f,type:"button",leftIcon:x.jsx(dE,{}),variant:"ghost",className:"text-nowrap",children:a("explorer.resource.editModal.access.url.button")})]})]})]})},v8=SU,TU={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function AU(t,e){switch(e.type){case"onChange":return{...t,searchInputValue:e.payload};case"isSearching":return{...t,isSearching:e.payload};case"addResult":return{...t,searchResults:e.payload};case"addApiResult":return{...t,searchAPIResults:e.payload};case"updateSearchResult":return{...t,searchResults:e.payload};case"emptyResult":return{...t,searchResults:e.payload};default:throw new Error("Unhandled action type")}}const Cd=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],CU=({resource:t,shareRights:e,shareDispatch:r})=>{const[i,s]=E.useReducer(AU,TU),n=n5(i.searchInputValue,500),{isAdml:a}=m5(),{appCode:o}=mt(),{t:l}=Ce();E.useEffect(()=>{h(n)},[n]);const c=f=>{const u=f.target.value;s({type:"onChange",payload:u})},h=E.useCallback(async f=>{if(t){if(s({type:"isSearching",payload:!0}),!a&&f.length>=1||a&&f.length>=3){const u=t&&await Ae.share().searchShareSubjects(o,t==null?void 0:t.assetId,f);s({type:"addApiResult",payload:u});const d=u.filter(p=>!e.rights.find(m=>m.id===p.id)).filter(p=>!(p.type==="user"&&p.id===(t==null?void 0:t.creatorId))).map(p=>{let m=p.displayName;return p.type==="user"&&p.profile?m=`${m} (${l(p.profile)})`:p.type==="group"&&p.structureName&&(m=`${m} (${p.structureName})`),{value:p.id,label:m,icon:p.type==="sharebookmark"?x.jsx(Sp,{}):null}});s({type:"addResult",payload:d})}else s({type:"emptyResult",payload:[]}),Promise.resolve();s({type:"isSearching",payload:!1})}},[t]);return{state:i,showSearchAdmlHint:()=>a&&i.searchInputValue.length<3,showSearchLoading:()=>i.isSearching,showSearchNoResults:()=>!i.isSearching&&!a&&n.length>0&&i.searchResults.length===0||!i.isSearching&&a&&n.length>3&&i.searchResults.length===0,getSearchMinLength:()=>a?3:1,handleSearchInputChange:c,handleSearchResultsChange:async f=>{const u=i.searchAPIResults.find(d=>d.id===f[0]);if(u){let d=[];if(u.type==="sharebookmark"){const p=await Ae.directory().getBookMarkById(u.id);d.push({...p,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:Cd}),p==null||p.users.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"user",avatarUrl:"",directoryUrl:"",actions:Cd,isBookmarkMember:!0})}),p.groups.filter(m=>!e.rights.find(g=>g.id===m.id)).forEach(m=>{d.push({...m,type:"group",avatarUrl:"",directoryUrl:"",actions:Cd,isBookmarkMember:!0})})}else d=[{...u,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];r({type:"updateShareRights",payload:{...e,rights:[...e.rights,...d]}}),s({type:"updateSearchResult",payload:i.searchResults.filter(p=>p.value!==f[0])})}}}},IU={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function RU(t,e){switch(e.type){case"init":return{...t,...e.payload};case"deleteRow":return{...t,shareRights:e.payload};case"updateShareRights":return{...t,shareRights:e.payload};case"toggleRight":return{...t,shareRights:e.payload};case"isSharing":return{...t,isSharing:e.payload};default:throw new Error("Unhandled action type")}}function PU({onSuccess:t,resource:e,shareResource:r}){const{appCode:i}=mt(),{user:s,avatar:n}=Zw(),a=bl(),{t:o}=Ce(),[l,c]=E.useReducer(RU,IU);return E.useEffect(()=>{e&&(async()=>{const h=await Ae.share().getActionsForApp(i),f=await Ae.share().getRightsForResource(i,e==null?void 0:e.assetId);c({type:"init",payload:{shareRightActions:h,shareRights:f}})})()},[e]),{state:l,dispatch:c,currentIsAuthor:()=>!!(e&&e.creatorId===(s==null?void 0:s.userId)),myAvatar:n,handleDeleteRow:h=>{c({type:"deleteRow",payload:{...l.shareRights,rights:l.shareRights.rights.filter(f=>{var u,d;return f.id!==h.id&&!((u=h.users)!=null&&u.find(p=>p.id===f.id))&&!((d=h.groups)!=null&&d.find(p=>p.id===f.id))})}})},handleShare:async()=>{c({type:"isSharing",payload:!0});try{const h=e.rights.filter(u=>s&&u.includes(`user:${s.userId}`)).map(u=>u.split(":")[2]).filter(u=>!!u),f=[...l.shareRights.rights];if(h.length>0){const u=h.map(d=>({displayName:d,id:d}));f.push({actions:u,avatarUrl:"",directoryUrl:"",displayName:s.username,id:s.userId,type:"user"})}r?await r.mutateAsync({resourceId:e==null?void 0:e.assetId,rights:f}):await Ae.share().saveRights(i,e==null?void 0:e.assetId,f),a.success(o("explorer.shared.status.saved")),t()}catch(h){typeof h=="string"&&a.error(o("explorer.shared.status.error")),console.error("Failed to save share",h)}finally{c({type:"isSharing",payload:!1})}},toggleRight:(h,f)=>{var u,d;const{rights:p,...m}=l.shareRights,g=[...p],y=g.findIndex(v=>v.id===h.id),_=l.shareRightActions.filter(v=>v.id===f)[0];if(g[y].actions.findIndex(v=>v.id===f)>-1){let v=g[y].actions.filter(w=>w.id!==f);const b=l.shareRightActions.filter(w=>{var A;return(A=w.requires)==null?void 0:A.includes(f)});v=v.filter(w=>!b.find(A=>A.id===w.id)),g[y]={...g[y],actions:v}}else{const v=l.shareRightActions.filter(b=>{var w;return((w=_.requires)==null?void 0:w.includes(b.id))&&!g[y].actions.find(A=>A.id===b.id)});g[y]={...g[y],actions:[...g[y].actions,_,...v]}}h.type==="sharebookmark"&&((u=g[y].users)==null||u.forEach(v=>{const b=g.findIndex(w=>w.id===v.id);g[b]={...g[b],actions:g[y].actions}}),(d=g[y].groups)==null||d.forEach(v=>{const b=g.findIndex(w=>w.id===v.id);g[b]={...g[b],actions:g[y].actions}})),c({type:"toggleRight",payload:{rights:g,...m}})}}}const MU=({shareRights:t,shareDispatch:e})=>{const r=bl(),{t:i}=Ce(),s=E.useRef(null),[n,a]=E.useState({name:"",id:E.useId()}),[o,l]=d5(!1),[c,h]=E.useState(!1),f=()=>{l()},u=()=>{a(p=>{var m;return{...p,name:((m=s.current)==null?void 0:m.value)||""}})},d=async p=>{try{const m=await Ae.directory().saveBookmarks(p,{users:t.rights.filter(g=>g.type==="user").map(g=>g.id),groups:t.rights.filter(g=>g.type==="group").map(g=>g.id),bookmarks:t.rights.filter(g=>g.type==="sharebookmark").map(g=>g.id)});r.success(i("explorer.bookmarked.status.saved")),e({type:"updateShareRights",payload:{...t,visibleBookmarks:[...t.visibleBookmarks,{displayName:p,id:m.id}]}}),a(g=>({...g,bookmarkId:g.id+new Date().getTime().toString()})),h(!1)}catch(m){console.error("Failed to save bookmark",m),r.error(i("explorer.bookmarked.status.error"))}};return{refBookmark:s,showBookmark:o,showBookmarkInput:c,bookmark:n,handleBookmarkChange:u,setBookmark:a,handleOnSave:()=>{var p;const m=((p=s.current)==null?void 0:p.value)||"";d(m)},toggleBookmark:f,toggleBookmarkInput:h}},OU=({bookmark:t,refBookmark:e,onBookmarkChange:r,onSave:i})=>{const{t:s}=Ce();return x.jsx("div",{className:"mt-16",children:x.jsxs(ot,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[x.jsx("div",{className:"flex-fill",children:x.jsx(ot.Input,{ref:e,onChange:r,placeholder:s("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},t.id)}),x.jsx(tt,{type:"button",color:"primary",variant:"ghost",disabled:t.name.length===0,leftIcon:x.jsx(fE,{}),onClick:i,className:"text-nowrap",children:s("explorer.modal.share.sharebookmark.save")})]})})},kU=(t,e)=>t.actions.filter(r=>e.id===r.id).length>0,DU=(t,e)=>t.isBookmarkMember&&e||!t.isBookmarkMember,NU=({shareRights:t,showBookmark:e,toggleBookmark:r,shareRightActions:i,toggleRight:s,onDeleteRow:n})=>{const{t:a}=Ce();return t==null?void 0:t.rights.map(o=>DU(o,e)&&x.jsxs("tr",{className:o.isBookmarkMember?"bg-light":"",children:[x.jsxs("td",{children:[o.type!=="sharebookmark"&&x.jsx(da,{alt:a("explorer.modal.share.avatar.shared.alt"),size:"xs",src:o.avatarUrl,variant:"circle"}),o.type==="sharebookmark"&&x.jsx(Sp,{})]}),x.jsx("td",{children:x.jsxs("div",{className:"d-flex",children:[o.type==="sharebookmark"&&x.jsx(tt,{color:"tertiary",rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:e?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:r,children:o.displayName}),o.type!=="sharebookmark"&&o.displayName,o.type==="user"&&` (${a(o.profile||"")})`]})}),i.map(l=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:kU(o,l),onChange:()=>s(o,l.id)})},l.displayName)),x.jsx("td",{children:!o.isBookmarkMember&&x.jsx(ua,{"aria-label":"Delete",color:"tertiary",icon:x.jsx(Jy,{}),type:"button",variant:"ghost",title:"Delete",onClick:()=>n(o)})})]},o.id))};function y8({isOpen:t,resourceId:e,shareResource:r,children:i,onSuccess:s,onCancel:n}){const{appCode:a}=mt(),o=Bm(a,e),{state:{isSharing:l,shareRights:c,shareRightActions:h},dispatch:f,myAvatar:u,currentIsAuthor:d,handleShare:p,toggleRight:m,handleDeleteRow:g}=PU({resource:o,shareResource:r,onSuccess:s}),{state:{searchResults:y,searchInputValue:_},showSearchAdmlHint:v,showSearchLoading:b,showSearchNoResults:w,getSearchMinLength:A,handleSearchInputChange:S,handleSearchResultsChange:C}=CU({resource:o,shareRights:c,shareDispatch:f}),{refBookmark:T,showBookmark:M,handleBookmarkChange:I,toggleBookmark:k,bookmark:P,handleOnSave:R,showBookmarkInput:O,toggleBookmarkInput:L}=MU({shareRights:c,shareDispatch:f}),{t:N}=Ce(),B=v()?N("explorer.search.adml.hint"):N("explorer.modal.share.search.placeholder");return o?rs.createPortal(x.jsxs(je,{id:"share_modal",size:"lg",isOpen:t,onModalClose:n,children:[x.jsx(je.Header,{onModalClose:n,children:N("share.title")}),x.jsxs(je.Body,{children:[x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:N("explorer.modal.share.usersWithAccess")}),x.jsx("div",{className:"table-responsive",children:x.jsxs("table",{className:"table border align-middle mb-0",children:[x.jsx("thead",{className:"bg-secondary",children:x.jsxs("tr",{children:[x.jsx("th",{scope:"col",className:"w-32",children:x.jsx(Hi,{children:N("explorer.modal.share.avatar.shared.alt")})}),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:N("explorer.modal.share.search.placeholder")})}),h.map(U=>x.jsx("th",{scope:"col",className:"text-center text-white",children:N(U.displayName)},U.displayName)),x.jsx("th",{scope:"col",children:x.jsx(Hi,{children:N("close")})})]})}),x.jsxs("tbody",{children:[d()&&x.jsxs("tr",{children:[x.jsx("th",{scope:"row",children:x.jsx(da,{alt:N("explorer.modal.share.avatar.me.alt"),size:"xs",src:u,variant:"circle"})}),x.jsx("td",{children:N("share.me")}),h.map(U=>x.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:x.jsx(Dm,{checked:!0,disabled:!0})},U.displayName)),x.jsx("td",{})]}),x.jsx(NU,{showBookmark:M,shareRightActions:h,shareRights:c,onDeleteRow:g,toggleRight:m,toggleBookmark:k})]})]})}),x.jsxs("div",{className:"mt-16",children:[x.jsx(tt,{color:"tertiary",leftIcon:x.jsx(Sp,{}),rightIcon:x.jsx(po,{title:"Show",className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:O?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>L(!O),children:N("share.save.sharebookmark")}),O&&x.jsx(OU,{refBookmark:T,bookmark:P,onBookmarkChange:I,onSave:R})]}),x.jsx("hr",{}),x.jsxs(ur,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[x.jsx("div",{className:"me-8",children:N("explorer.modal.share.search")}),x.jsx(H5,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:x.jsx(Qy,{className:"c-pointer",height:"18"})})]}),x.jsx("div",{className:"row",children:x.jsx("div",{className:"col-10",children:x.jsx(g6,{value:_,placeholder:B,isLoading:b(),noResult:w(),options:y,searchMinLength:A(),onSearchInputChange:S,onSearchResultsChange:C})})}),i]}),x.jsxs(je.Footer,{children:[x.jsx(tt,{type:"button",color:"tertiary",variant:"ghost",onClick:n,children:N("explorer.cancel")}),x.jsx(tt,{type:"button",color:"primary",variant:"filled",isLoading:l,onClick:p,disabled:l,children:N("share")})]})]}),document.getElementById("portal")):x.jsx(Lm,{})}function b8({resource:t,updateResource:e}){const{appCode:r}=mt(),{t:i}=Ce(r),s=t&&t["publish-type"],[n,a]=E.useState(s),o=async l=>{const c=l.target.value;(async()=>{const h={description:t.description||"",entId:t.assetId,name:t.name,public:!!t.public,slug:t.slug||"",thumbnail:t.thumbnail,trashed:t.trashed,"publish-type":c};e?await e.mutateAsync(h):await Ae.resource("blog").update(h),a(c)})()};return x.jsxs(x.Fragment,{children:[x.jsx("hr",{}),x.jsx(ur,{headingStyle:"h4",level:"h3",className:"mb-16",children:i("explorer.publication.steps")}),x.jsx(Ep,{label:i("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:n,checked:n==="IMMEDIATE",onChange:o}),x.jsx(Ep,{label:i("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:n==="RESTRAINT",model:n,onChange:o})]})}const LU=({application:t,options:e})=>yb({mutationFn:async({resourceId:r,rights:i})=>await Ae.share().saveRights(t,r,i),...e}),x8=LU;function Id({children:t}){return x.jsx("span",{className:"position-absolute badge rounded-pill bg-warning",children:t})}function Rd({children:t,className:e,...r}){const i=re("navbar",e);return x.jsx("nav",{className:i,...r,children:t})}function Fy({children:t,className:e,...r}){const i=re("navbar-nav",e);return x.jsx("ul",{className:i,...r,children:t})}const Ge=E.forwardRef(({children:t,className:e,...r},i)=>{const s=re("nav-item",e);return x.jsx("li",{ref:i,className:s,...r,children:t})});function La({link:t,className:e,children:r,translate:i,...s}){const n=re("nav-link",e);return x.jsxs("a",{href:t,className:n,...s,children:[r,i&&x.jsx(Hi,{children:x.jsx("span",{className:"nav-text",children:i})})]})}const BU=()=>{const{t}=Ce();return x.jsx("div",{className:"widget-footer",children:x.jsx("div",{className:"widget-footer-action",children:x.jsx("a",{href:"/welcome",className:"link",children:t("plus")})})})},FU=({bookmarkedApps:t})=>{const{t:e}=Ce();return x.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!t.length&&x.jsx("div",{className:"text-dark",children:e("navbar.myapps.more")}),t.slice(0,6).map((r,i)=>x.jsx("a",{href:r.address,className:"bookmarked-app",children:x.jsx(Ho,{app:r,size:"32"})},i))]})};function Uy({isHelpOpen:t,setIsHelpOpen:e,parsedHeadline:r,parsedContent:i,error:s}){const{t:n}=Ce(),a=()=>{e(!1)};return t?rs.createPortal(x.jsxs(je,{id:"help-modal",isOpen:t,onModalClose:a,scrollable:!0,size:"lg",children:[x.jsx(je.Header,{onModalClose:a,children:n("navbar.help")}),x.jsx(je.Subtitle,{children:s?n("help.notfound.title"):r}),x.jsx(je.Body,{className:s?"d-flex":null,children:s?n("help.notfound.text"):i})]}),document.getElementById("portal")):null}function UU(){var t,e,r,i,s;const{appCode:n}=mt(),{theme:a}=Om(),[o,l]=E.useState(""),[c,h]=E.useState(!0),[f,u]=E.useState(!1),[d,p]=E.useState(!1),m=a!=null&&a.is1d?"/help-1d":"/help-2d";E.useEffect(()=>{(async()=>{let v="";v=m+"/application/"+n+"/",!n&&window.location.pathname!=="/adapter"?v=m+"/application/portal/":window.location.pathname==="/adapter"?v=m+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?v=m+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(v=m+"/application/userbook/");try{const b=await fetch(v),w=await b.text();if(b.status===404){p(!0);return}l(w),p(!1)}catch(b){p(!0),console.error(b)}})()},[n,m]);const g=os(o,{replace:v=>{const b=v;if(b.attribs&&b.attribs.id==="TOC")return x.jsxs("nav",{id:"TOC",children:[x.jsx(tt,{onClick:()=>{h(!c)},children:x.jsx(SE,{})}),Ol(b.children,{replace:w=>{const A=w;if(A.attribs&&A.name==="ul")return x.jsx("ul",{id:"TOC-list",style:{display:c?"block":"none"},children:Ol(A.children,{replace:S=>{const C=S;if(C.attribs&&C.name==="a")return x.jsx("a",{...Iu(C.attribs),children:x.jsx("span",{onClick:()=>{h(!1)},children:Ol(C.children)})})}})})}})]});if(b.attribs&&b.attribs.class==="section level2"){const w=Iu(v.attribs);return x.jsx("div",{...w,className:"section level2",style:{display:b.attribs.id!=="présentation"?"none":"block"},children:Ol(b.children,{replace:A=>{const S=A;if(S.attribs&&S.name==="img"){const C=A.attribs.src;return x.jsx("img",{...Iu(S.attribs),src:`${m}/${C}`,alt:""})}}})})}}}),y=(r=(e=(t=g==null?void 0:g.props)==null?void 0:t.children.find(v=>v.type==="body"))==null?void 0:e.props)==null?void 0:r.children,_=(s=(i=y==null?void 0:y.find(v=>v.type==="p"))==null?void 0:i.props)==null?void 0:s.children;return{html:o,visibility:c,isModalOpen:f,setIsModalOpen:u,parsedContent:y,parsedHeadline:_,error:d}}const jU=()=>{const[t,e]=qw(),r=E.useRef(null),i=E.useId(),{t:s}=Ce();function n(){if(r.current){const a=r.current.value;window.location.href=`/searchengine#/${a}`}}return x.jsxs(Ge,{id:i,ref:t,className:"position-relative","aria-haspopup":"true","aria-expanded":e,children:[x.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[x.jsx(j2,{className:"icon search"}),x.jsx("span",{className:"nav-text",children:s("navbar.search")})]}),x.jsx(nE,{id:i,isVisible:e,className:"d-none d-md-flex",children:x.jsxs(ot,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[x.jsx(ot.Input,{ref:r,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),x.jsx(X4,{type:"submit",size:"sm",onClick:n,"aria-label":s("navbar.search")})]})})]})},$U=jU,GU=({is1d:t=!1,src:e=""})=>{const{t:r}=Ce(),{messages:i,msgLink:s,zimbraWorkflow:n}=s5(),{user:a,avatar:o}=Zw(),{currentLanguage:l,currentApp:c}=mt(),{isModalOpen:h,setIsModalOpen:f,parsedContent:u,parsedHeadline:d,error:p}=UU(),m=re("header",{"no-2d":t,"no-1d":!t}),{title:g,bookmarkedApps:y,appsRef:_,isAppsHovered:v,popoverAppsId:b,userAvatar:w,userName:A,welcomeUser:S,communityWorkflow:C,conversationWorflow:T,searchWorkflow:M,isCollapsed:I,toggleCollapsedNav:k,handleLogout:P}=p5({user:a,avatar:o}),R=i>0;return x.jsx("header",{className:m,children:t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"container-fluid",children:x.jsxs(Rd,{children:[x.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:c?c.address:"/timeline/timeline",children:g}),x.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[x.jsx(da,{alt:A,size:"sm",src:w,variant:"circle",width:"32",height:"32"}),x.jsx("span",{className:"navbar-text",children:S})]}),x.jsxs(Fy,{className:"gap-8","aria-hidden":"false","aria-label":r("navbar.main.navigation"),children:[T&&x.jsx(Ge,{children:x.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[x.jsx(B2,{className:"icon notification"}),R&&x.jsx(Id,{children:i}),x.jsx(Hi,{children:r("navbar.messages")})]})}),x.jsx(Ge,{children:x.jsx(La,{link:"/userbook/mon-compte",className:"dropdown-item",translate:r("navbar.myaccount"),children:x.jsx(Ax,{className:"icon user"})})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link",onClick:()=>{f(!0)},children:[x.jsx(N2,{className:"icon help"}),x.jsx(Hi,{children:r("navbar.help")})]}),x.jsx(Uy,{isHelpOpen:h,setIsHelpOpen:f,parsedContent:u,parsedHeadline:d,error:p})]}):null,x.jsx(Ge,{children:x.jsxs("button",{className:"nav-link",onClick:P,children:[x.jsx(Ng,{className:"icon logout"}),x.jsx(Hi,{children:r("navbar.disconnect")})]})}),x.jsx(Ge,{className:"d-md-none",children:x.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!I,"aria-label":r("navbar.secondary.navigation"),onClick:k,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),x.jsx(Rd,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":r("navbar.secondary.navigation"),children:x.jsx("div",{className:"container-fluid",children:x.jsxs("div",{className:`collapse navbar-collapse ${I?"":"show"}`,id:"navbarCollapsed",children:[x.jsx(Ry,{is1d:!0,src:`${e}/img/illustrations/logo.png`,translate:r("navbar.home")}),x.jsxs(Fy,{className:"gap-8",children:[x.jsx(Ge,{children:x.jsxs("a",{href:"/timeline/timeline",className:"button",children:[x.jsx(k2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.whatsnew")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[x.jsx(G2,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.classMembers")})]})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/welcome",className:"button",children:[x.jsx(Lg,{color:"#fff",className:"d-md-none"}),x.jsx("span",{className:"d-inline-block",children:r("portal.header.navigation.myapps")})]})})]})]})})})]}):x.jsx(Rd,{className:"navbar-expand-md",children:x.jsxs("div",{className:"container-fluid",children:[x.jsx(Ry,{src:`${e}/img/illustrations/logo.png`}),x.jsx("a",{href:c?c.address:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:g}),x.jsxs("ul",{className:"navbar-nav",children:[x.jsx(Ge,{children:x.jsx(La,{link:"/timeline/timeline",translate:r("navbar.home"),children:x.jsx(C2,{color:"#fff"})})}),x.jsxs(Ge,{className:"position-relative",ref:_,id:b,"aria-haspopup":"true","aria-expanded":v,children:[x.jsx(La,{link:"/welcome",translate:r("navbar.applications"),children:x.jsx(Lg,{color:"#fff"})}),x.jsxs(nE,{className:"top-100 widget",id:b,isVisible:v,children:[x.jsx(k6,{children:x.jsx(FU,{bookmarkedApps:y})}),x.jsx(D6,{className:"widget-footer border-top border-ghost",children:x.jsx(BU,{})})]})]}),T&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:"/conversation/conversation",translate:r("conversation"),children:[x.jsx(Bg,{color:"#fff"}),R&&x.jsx(Id,{children:i})]})}),n&&x.jsx(Ge,{children:x.jsxs(La,{className:"position-relative",link:s,translate:r("conversation"),children:[x.jsx(Bg,{color:"#fff"}),R&&x.jsx(Id,{children:i})]})}),l==="fr"?x.jsxs(Ge,{children:[x.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{f(!0)},children:[x.jsx(P2,{color:"#fff"}),x.jsx(Hi,{children:r("support")})]}),x.jsx(Uy,{isHelpOpen:h,setIsHelpOpen:f,parsedContent:u,parsedHeadline:d,error:p})]}):null,x.jsx(Ge,{children:x.jsxs("div",{className:"dropdown",children:[x.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!I,"aria-label":r("navbar.open.menu"),onClick:k,children:x.jsx(po,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),x.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${I?"":"show"}`,id:"dropdown-navbar",children:[C&&x.jsx(Ge,{children:x.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[x.jsx(S2,{className:"icon community"}),x.jsx("span",{className:"nav-text",children:r("navbar.community")})]})}),M?x.jsx($U,{}):null,x.jsx(Ge,{children:x.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[x.jsx(da,{alt:A,size:"sm",src:w,variant:"circle",className:"bg-white",width:"32",height:"32"}),x.jsx("span",{className:"nav-text",children:r("navbar.myaccount")})]})}),x.jsx(Ge,{children:x.jsx("hr",{className:"dropdown-divider"})}),x.jsx(Ge,{children:x.jsxs("a",{href:"/auth/logout?callback=",className:"nav-link dropdown-item",children:[x.jsx(Ng,{className:"icon logout"}),x.jsx("span",{id:"logout-label",className:"nav-text",children:r("navbar.disconnect")})]})})]})]})})]})]})})})},zU=GU;function HU({children:t,className:e,...r}){const i=re("container-fluid",e);return x.jsx("main",{className:i,...r,children:t})}const VU=({children:t,...e})=>{const{theme:r}=Om();return x.jsxs(x.Fragment,{children:[x.jsx(zU,{is1d:r==null?void 0:r.is1d,src:r==null?void 0:r.basePath}),x.jsx(HU,{className:re("d-flex flex-column bg-white",{"rounded-4 border":r==null?void 0:r.is1d,"mt-24":r==null?void 0:r.is1d}),...e,children:t}),x.jsx(qS,{toastOptions:{position:"top-right"}})]})},_8=VU;K_.extend(uk);K_.extend(ck);export{Nn as $,r8 as A,tt as B,cf as C,lt as D,t8 as E,ot as F,y6 as G,y8 as H,ua as I,b8 as J,f8 as K,Lm as L,je as M,u8 as N,i8 as O,h8 as P,ZU as Q,e8 as R,X4 as S,d8 as T,Ho as U,da as V,Ax as W,H5 as X,K_ as Y,uk as Z,re as _,mt as a,m8 as a0,p8 as a1,vb as b,bl as c,fb as d,yb as e,x8 as f,g8 as g,Zw as h,JU as i,x as j,Qs as k,d5 as l,l8 as m,n8 as n,c8 as o,_8 as p,jE as q,QU as r,s8 as s,v8 as t,a8 as u,Om as v,o8 as w,nu as x,wa as y,mx as z};